diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/CHANGELOG.md b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/CHANGELOG.md index 3ccd02fadd6f..c6da8505e32d 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/CHANGELOG.md +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.0.0-beta.4 (Unreleased) +## 1.0.0-beta.1 (2022-10-01) + +- Azure Resource Manager AzureStackHci client library for Java. This package contains Microsoft Azure SDK for AzureStackHci Management SDK. Azure Stack HCI management service. Package tag package-2022-10. 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 49c5a0968a06..db0f6900288a 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/README.md +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/README.md @@ -2,7 +2,7 @@ Azure Resource Manager AzureStackHci client library for Java. -This package contains Microsoft Azure SDK for AzureStackHci Management SDK. Azure Stack HCI management service. Package tag package-2022-05. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for AzureStackHci Management SDK. Azure Stack HCI management service. Package tag package-2022-10. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-azurestackhci - 1.0.0-beta.3 + 1.0.0-beta.4 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/SAMPLE.md b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/SAMPLE.md index 949f72862f79..ddfdd9afaba6 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/SAMPLE.md +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/SAMPLE.md @@ -16,6 +16,7 @@ - [Create](#clusters_create) - [CreateIdentity](#clusters_createidentity) - [Delete](#clusters_delete) +- [ExtendSoftwareAssuranceBenefit](#clusters_extendsoftwareassurancebenefit) - [GetByResourceGroup](#clusters_getbyresourcegroup) - [List](#clusters_list) - [ListByResourceGroup](#clusters_listbyresourcegroup) @@ -30,16 +31,48 @@ - [ListByArcSetting](#extensions_listbyarcsetting) - [Update](#extensions_update) +## Offers + +- [Get](#offers_get) +- [ListByCluster](#offers_listbycluster) +- [ListByPublisher](#offers_listbypublisher) + ## Operations - [List](#operations_list) + +## Publishers + +- [Get](#publishers_get) +- [ListByCluster](#publishers_listbycluster) + +## Skus + +- [Get](#skus_get) +- [ListByOffer](#skus_listbyoffer) + +## UpdateRuns + +- [Get](#updateruns_get) +- [List](#updateruns_list) + +## UpdateSummariesOperation + +- [Get](#updatesummariesoperation_get) +- [List](#updatesummariesoperation_list) + +## Updates + +- [Get](#updates_get) +- [List](#updates_list) +- [Post](#updates_post) ### ArcSettings_Create ```java /** Samples for ArcSettings Create. */ public final class ArcSettingsCreateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/PutArcSetting.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/PutArcSetting.json */ /** * Sample code: Create ArcSetting. @@ -60,7 +93,7 @@ import com.azure.core.util.Context; /** Samples for ArcSettings CreateIdentity. */ public final class ArcSettingsCreateIdentitySamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/CreateArcIdentity.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/CreateArcIdentity.json */ /** * Sample code: Create Arc Identity. @@ -81,7 +114,7 @@ import com.azure.core.util.Context; /** Samples for ArcSettings Delete. */ public final class ArcSettingsDeleteSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/DeleteArcSetting.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/DeleteArcSetting.json */ /** * Sample code: Delete ArcSetting. @@ -102,7 +135,7 @@ import com.azure.core.util.Context; /** Samples for ArcSettings GeneratePassword. */ public final class ArcSettingsGeneratePasswordSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/GeneratePassword.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/GeneratePassword.json */ /** * Sample code: Generate Password. @@ -123,7 +156,7 @@ import com.azure.core.util.Context; /** Samples for ArcSettings Get. */ public final class ArcSettingsGetSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/GetArcSetting.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/GetArcSetting.json */ /** * Sample code: Get ArcSetting. @@ -144,7 +177,7 @@ import com.azure.core.util.Context; /** Samples for ArcSettings ListByCluster. */ public final class ArcSettingsListByClusterSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/ListArcSettingsByCluster.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/ListArcSettingsByCluster.json */ /** * Sample code: List ArcSetting resources by HCI Cluster. @@ -170,7 +203,7 @@ import java.io.IOException; /** Samples for ArcSettings Update. */ public final class ArcSettingsUpdateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/PatchArcSetting.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/PatchArcSetting.json */ /** * Sample code: Patch ArcSetting. @@ -195,10 +228,12 @@ public final class ArcSettingsUpdateSamples { ### 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/2022-05-01/examples/CreateCluster.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/CreateCluster.json */ /** * Sample code: Create cluster. @@ -211,6 +246,7 @@ public final class ClustersCreateSamples { .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") @@ -227,7 +263,7 @@ import com.azure.core.util.Context; /** Samples for Clusters CreateIdentity. */ public final class ClustersCreateIdentitySamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/CreateClusterIdentity.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/CreateClusterIdentity.json */ /** * Sample code: Create cluster Identity. @@ -248,7 +284,7 @@ import com.azure.core.util.Context; /** Samples for Clusters Delete. */ public final class ClustersDeleteSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/DeleteCluster.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/DeleteCluster.json */ /** * Sample code: Delete cluster. @@ -261,6 +297,39 @@ public final class ClustersDeleteSamples { } ``` +### Clusters_ExtendSoftwareAssuranceBenefit + +```java +import com.azure.core.util.Context; +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/2022-10-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)), + Context.NONE); + } +} +``` + ### Clusters_GetByResourceGroup ```java @@ -269,7 +338,7 @@ import com.azure.core.util.Context; /** Samples for Clusters GetByResourceGroup. */ public final class ClustersGetByResourceGroupSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/GetCluster.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/GetCluster.json */ /** * Sample code: Get cluster. @@ -290,7 +359,7 @@ import com.azure.core.util.Context; /** Samples for Clusters List. */ public final class ClustersListSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/ListClustersBySubscription.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/ListClustersBySubscription.json */ /** * Sample code: List clusters in a given subscription. @@ -312,7 +381,7 @@ import com.azure.core.util.Context; /** Samples for Clusters ListByResourceGroup. */ public final class ClustersListByResourceGroupSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/ListClustersByResourceGroup.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/ListClustersByResourceGroup.json */ /** * Sample code: List clusters in a given resource group. @@ -333,6 +402,7 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.azurestackhci.models.Cluster; import com.azure.resourcemanager.azurestackhci.models.ClusterDesiredProperties; import com.azure.resourcemanager.azurestackhci.models.DiagnosticLevel; +import com.azure.resourcemanager.azurestackhci.models.ManagedServiceIdentityType; import com.azure.resourcemanager.azurestackhci.models.WindowsServerSubscription; import java.util.HashMap; import java.util.Map; @@ -340,7 +410,7 @@ import java.util.Map; /** Samples for Clusters Update. */ public final class ClustersUpdateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/UpdateCluster.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/UpdateCluster.json */ /** * Sample code: Update cluster. @@ -353,6 +423,7 @@ public final class ClustersUpdateSamples { resource .update() .withTags(mapOf("tag1", "value1", "tag2", "value2")) + .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) .withCloudManagementEndpoint("https://98294836-31be-4668-aeae-698667faf99b.waconazure.com") .withDesiredProperties( new ClusterDesiredProperties() @@ -385,7 +456,7 @@ import java.util.Arrays; /** Samples for Clusters UploadCertificate. */ public final class ClustersUploadCertificateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/UploadCertificate.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/UploadCertificate.json */ /** * Sample code: Upload certificate. @@ -416,7 +487,7 @@ import java.io.IOException; /** Samples for Extensions Create. */ public final class ExtensionsCreateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/PutExtension.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/PutExtension.json */ /** * Sample code: Create Arc Extension. @@ -453,7 +524,7 @@ import com.azure.core.util.Context; /** Samples for Extensions Delete. */ public final class ExtensionsDeleteSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/DeleteExtension.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/DeleteExtension.json */ /** * Sample code: Delete Arc Extension. @@ -474,7 +545,7 @@ import com.azure.core.util.Context; /** Samples for Extensions Get. */ public final class ExtensionsGetSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/GetExtension.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/GetExtension.json */ /** * Sample code: Get ArcSettings Extension. @@ -497,7 +568,7 @@ import com.azure.core.util.Context; /** Samples for Extensions ListByArcSetting. */ public final class ExtensionsListByArcSettingSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/ListExtensionsByArcSetting.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/ListExtensionsByArcSetting.json */ /** * Sample code: List Extensions under ArcSetting resource. @@ -523,7 +594,7 @@ import java.io.IOException; /** Samples for Extensions Update. */ public final class ExtensionsUpdateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/PatchExtension.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/PatchExtension.json */ /** * Sample code: Update Arc Extension. @@ -551,6 +622,71 @@ public final class ExtensionsUpdateSamples { } ``` +### Offers_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Offers Get. */ +public final class OffersGetSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-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, Context.NONE); + } +} +``` + +### Offers_ListByCluster + +```java +import com.azure.core.util.Context; + +/** Samples for Offers ListByCluster. */ +public final class OffersListByClusterSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-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, Context.NONE); + } +} +``` + +### Offers_ListByPublisher + +```java +import com.azure.core.util.Context; + +/** Samples for Offers ListByPublisher. */ +public final class OffersListByPublisherSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-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, Context.NONE); + } +} +``` + ### Operations_List ```java @@ -559,7 +695,7 @@ import com.azure.core.util.Context; /** Samples for Operations List. */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/ListOperations.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/ListOperations.json */ /** * Sample code: Create cluster. @@ -572,3 +708,243 @@ public final class OperationsListSamples { } ``` +### Publishers_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Publishers Get. */ +public final class PublishersGetSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-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", Context.NONE); + } +} +``` + +### Publishers_ListByCluster + +```java +import com.azure.core.util.Context; + +/** Samples for Publishers ListByCluster. */ +public final class PublishersListByClusterSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-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", Context.NONE); + } +} +``` + +### Skus_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Skus Get. */ +public final class SkusGetSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-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, Context.NONE); + } +} +``` + +### Skus_ListByOffer + +```java +import com.azure.core.util.Context; + +/** Samples for Skus ListByOffer. */ +public final class SkusListByOfferSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-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, Context.NONE); + } +} +``` + +### UpdateRuns_Get + +```java +import com.azure.core.util.Context; + +/** Samples for UpdateRuns Get. */ +public final class UpdateRunsGetSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-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", Context.NONE); + } +} +``` + +### UpdateRuns_List + +```java +import com.azure.core.util.Context; + +/** Samples for UpdateRuns List. */ +public final class UpdateRunsListSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-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", Context.NONE); + } +} +``` + +### UpdateSummariesOperation_Get + +```java +import com.azure.core.util.Context; + +/** Samples for UpdateSummariesOperation Get. */ +public final class UpdateSummariesOperationGetSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-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", Context.NONE); + } +} +``` + +### UpdateSummariesOperation_List + +```java +import com.azure.core.util.Context; + +/** Samples for UpdateSummariesOperation List. */ +public final class UpdateSummariesOperationListSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-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", Context.NONE); + } +} +``` + +### Updates_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Updates Get. */ +public final class UpdatesGetSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-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", Context.NONE); + } +} +``` + +### Updates_List + +```java +import com.azure.core.util.Context; + +/** Samples for Updates List. */ +public final class UpdatesListSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-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", Context.NONE); + } +} +``` + +### Updates_Post + +```java +import com.azure.core.util.Context; + +/** Samples for Updates Post. */ +public final class UpdatesPostSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-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", Context.NONE); + } +} +``` + diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/pom.xml b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/pom.xml index b0570927e37a..9be5190c4e52 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/pom.xml +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/pom.xml @@ -13,7 +13,7 @@ jar Microsoft Azure SDK for AzureStackHci Management - This package contains Microsoft Azure SDK for AzureStackHci Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Stack HCI management service. Package tag package-2022-05. + This package contains Microsoft Azure SDK for AzureStackHci Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Stack HCI management service. Package tag package-2022-10. https://github.com/Azure/azure-sdk-for-java 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 7fa8e3fcf096..e02d549425d6 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 @@ -28,11 +28,23 @@ import com.azure.resourcemanager.azurestackhci.implementation.AzureStackHciClientBuilder; import com.azure.resourcemanager.azurestackhci.implementation.ClustersImpl; import com.azure.resourcemanager.azurestackhci.implementation.ExtensionsImpl; +import com.azure.resourcemanager.azurestackhci.implementation.OffersImpl; import com.azure.resourcemanager.azurestackhci.implementation.OperationsImpl; +import com.azure.resourcemanager.azurestackhci.implementation.PublishersImpl; +import com.azure.resourcemanager.azurestackhci.implementation.SkusImpl; +import com.azure.resourcemanager.azurestackhci.implementation.UpdateRunsImpl; +import com.azure.resourcemanager.azurestackhci.implementation.UpdateSummariesOperationsImpl; +import com.azure.resourcemanager.azurestackhci.implementation.UpdatesImpl; import com.azure.resourcemanager.azurestackhci.models.ArcSettings; import com.azure.resourcemanager.azurestackhci.models.Clusters; import com.azure.resourcemanager.azurestackhci.models.Extensions; +import com.azure.resourcemanager.azurestackhci.models.Offers; import com.azure.resourcemanager.azurestackhci.models.Operations; +import com.azure.resourcemanager.azurestackhci.models.Publishers; +import com.azure.resourcemanager.azurestackhci.models.Skus; +import com.azure.resourcemanager.azurestackhci.models.UpdateRuns; +import com.azure.resourcemanager.azurestackhci.models.UpdateSummariesOperations; +import com.azure.resourcemanager.azurestackhci.models.Updates; import java.time.Duration; import java.time.temporal.ChronoUnit; import java.util.ArrayList; @@ -50,6 +62,18 @@ public final class AzureStackHciManager { private Operations operations; + private Offers offers; + + private Publishers publishers; + + private Skus skus; + + private UpdateRuns updateRuns; + + private UpdateSummariesOperations updateSummariesOperations; + + private Updates updates; + private final AzureStackHciClient clientObject; private AzureStackHciManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { @@ -215,7 +239,7 @@ public AzureStackHciManager authenticate(TokenCredential credential, AzureProfil .append("-") .append("com.azure.resourcemanager.azurestackhci") .append("/") - .append("1.0.0-beta.3"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -320,6 +344,79 @@ public Operations operations() { return operations; } + /** + * 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 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 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 UpdateRuns. + * + * @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. + * + * @return Resource collection API of Updates. + */ + public Updates updates() { + if (this.updates == null) { + this.updates = new UpdatesImpl(clientObject.getUpdates(), this); + } + return updates; + } + /** * @return Wrapped service client AzureStackHciClient providing direct access to the underlying auto-generated API * implementation, based on Azure REST API. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/ArcSettingsClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/ArcSettingsClient.java index e7dd0a66b848..3031ce182d54 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/ArcSettingsClient.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/ArcSettingsClient.java @@ -45,20 +45,6 @@ public interface ArcSettingsClient { @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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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); - /** * Get ArcSetting resource details of HCI Cluster. * @@ -76,20 +62,18 @@ Response getWithResponse( String resourceGroupName, String clusterName, String arcSettingName, Context context); /** - * Create ArcSetting for HCI cluster. + * 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 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. + * @return arcSetting resource details of HCI Cluster. */ @ServiceMethod(returns = ReturnType.SINGLE) - ArcSettingInner create( - String resourceGroupName, String clusterName, String arcSettingName, ArcSettingInner arcSetting); + ArcSettingInner get(String resourceGroupName, String clusterName, String arcSettingName); /** * Create ArcSetting for HCI cluster. @@ -113,20 +97,20 @@ Response createWithResponse( Context context); /** - * Update ArcSettings for HCI cluster. + * 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 ArcSettings parameters that needs to be updated. + * @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 update( - String resourceGroupName, String clusterName, String arcSettingName, ArcSettingsPatch arcSetting); + ArcSettingInner create( + String resourceGroupName, String clusterName, String arcSettingName, ArcSettingInner arcSetting); /** * Update ArcSettings for HCI cluster. @@ -149,6 +133,22 @@ Response updateWithResponse( 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. * @@ -212,13 +212,15 @@ SyncPoller, Void> beginDelete( * @param resourceGroupName The name of the resource group. The name 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. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - PasswordCredentialInner generatePassword(String resourceGroupName, String clusterName, String arcSettingName); + Response generatePasswordWithResponse( + String resourceGroupName, String clusterName, String arcSettingName, Context context); /** * Generate password for arc settings. @@ -226,15 +228,13 @@ SyncPoller, Void> beginDelete( * @param resourceGroupName The name of the resource group. The name 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}. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response generatePasswordWithResponse( - String resourceGroupName, String clusterName, String arcSettingName, Context context); + PasswordCredentialInner generatePassword(String resourceGroupName, String clusterName, String arcSettingName); /** * Create Aad identity for arc settings. 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 bb51fe0bea47..14b314862594 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 @@ -71,4 +71,46 @@ public interface AzureStackHciClient { * @return the OperationsClient object. */ OperationsClient getOperations(); + + /** + * Gets the OffersClient object to access its operations. + * + * @return the OffersClient object. + */ + OffersClient getOffers(); + + /** + * Gets the PublishersClient object to access its operations. + * + * @return the PublishersClient object. + */ + PublishersClient getPublishers(); + + /** + * Gets the SkusClient object to access its operations. + * + * @return the SkusClient object. + */ + SkusClient getSkus(); + + /** + * 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(); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/ClustersClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/ClustersClient.java index 625ccd127e93..506c21053cc4 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/ClustersClient.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/ClustersClient.java @@ -14,6 +14,7 @@ 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. */ @@ -70,28 +71,28 @@ public interface ClustersClient { * * @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. + * @return hCI cluster along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - ClusterInner getByResourceGroup(String resourceGroupName, String clusterName); + 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. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hCI cluster along with {@link Response}. + * @return hCI cluster. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String clusterName, Context context); + ClusterInner getByResourceGroup(String resourceGroupName, String clusterName); /** * Create an HCI cluster. @@ -99,13 +100,15 @@ Response getByResourceGroupWithResponse( * @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. + * @return cluster details along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - ClusterInner create(String resourceGroupName, String clusterName, ClusterInner cluster); + Response createWithResponse( + String resourceGroupName, String clusterName, ClusterInner cluster, Context context); /** * Create an HCI cluster. @@ -113,15 +116,13 @@ Response getByResourceGroupWithResponse( * @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}. + * @return cluster details. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse( - String resourceGroupName, String clusterName, ClusterInner cluster, Context context); + ClusterInner create(String resourceGroupName, String clusterName, ClusterInner cluster); /** * Update an HCI cluster. @@ -129,13 +130,15 @@ Response createWithResponse( * @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. + * @return cluster details along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - ClusterInner update(String resourceGroupName, String clusterName, ClusterPatch cluster); + Response updateWithResponse( + String resourceGroupName, String clusterName, ClusterPatch cluster, Context context); /** * Update an HCI cluster. @@ -143,15 +146,13 @@ Response createWithResponse( * @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}. + * @return cluster details. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, String clusterName, ClusterPatch cluster, Context context); + ClusterInner update(String resourceGroupName, String clusterName, ClusterPatch cluster); /** * Delete an HCI cluster. @@ -326,4 +327,72 @@ SyncPoller, ClusterIdentityResponseInne */ @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/ExtensionsClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/ExtensionsClient.java index d9662370c2a3..7b1b2221720d 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/ExtensionsClient.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/ExtensionsClient.java @@ -52,13 +52,15 @@ PagedIterable listByArcSetting( * @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. + * @return particular Arc Extension of HCI Cluster along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - ExtensionInner get(String resourceGroupName, String clusterName, String arcSettingName, String extensionName); + Response getWithResponse( + String resourceGroupName, String clusterName, String arcSettingName, String extensionName, Context context); /** * Get particular Arc Extension of HCI Cluster. @@ -67,15 +69,13 @@ PagedIterable listByArcSetting( * @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}. + * @return particular Arc Extension of HCI Cluster. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String clusterName, String arcSettingName, String extensionName, Context context); + ExtensionInner get(String resourceGroupName, String clusterName, String arcSettingName, String extensionName); /** * Create Extension for HCI cluster. 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..de2d0e4575c7 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/OffersClient.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent; + +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 0b8e907abe68..f0b6560317b0 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 @@ -15,22 +15,22 @@ public interface OperationsClient { /** * 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. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - OperationListResultInner list(); + Response listWithResponse(Context context); /** * List all available Microsoft.AzureStackHCI provider operations. * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider along with {@link Response}. + * @return a list of REST API operations supported by an Azure Resource Provider. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse(Context context); + 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..4848319e64a2 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/PublishersClient.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.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/SkusClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/SkusClient.java new file mode 100644 index 000000000000..1966f641671b --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/SkusClient.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.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/UpdateRunsClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/UpdateRunsClient.java new file mode 100644 index 000000000000..63756a17f58d --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/UpdateRunsClient.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.fluent.models.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); + + /** + * 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 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 details of an Update run along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String clusterName, String updateName, String updateRunName, 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. + * @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 details of an Update run. + */ + @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..c2ab46a803dc --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/UpdateSummariesOperationsClient.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.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.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); + + /** + * 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..370c7ba5ade6 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/UpdatesClient.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.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.UpdateInner; + +/** 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); + + /** + * 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) + UpdateInner get(String resourceGroupName, String clusterName, String updateName); +} 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 index 909acd05b51e..b78ef3f98986 100644 --- 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 @@ -16,6 +16,10 @@ public final class ArcIdentityResponseInner { @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) private ArcIdentityResponseProperties innerProperties; + /** Creates an instance of ArcIdentityResponseInner class. */ + public ArcIdentityResponseInner() { + } + /** * Get the innerProperties property: ArcIdentity properties. * 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 index 5b20f4848fb7..5ab585ca46e1 100644 --- 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 @@ -34,6 +34,10 @@ public final class ArcIdentityResponseProperties { @JsonProperty(value = "arcApplicationObjectId") private String arcApplicationObjectId; + /** Creates an instance of ArcIdentityResponseProperties class. */ + public ArcIdentityResponseProperties() { + } + /** * Get the arcApplicationClientId property: The arcApplicationClientId property. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcSettingInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcSettingInner.java index cfdbb16c5d22..74b89bc342f4 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcSettingInner.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcSettingInner.java @@ -16,25 +16,20 @@ /** ArcSetting details. */ @Fluent public final class ArcSettingInner extends ProxyResource { - /* - * System data of ArcSetting resource - */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) - private SystemData systemData; - /* * ArcSetting properties. */ @JsonProperty(value = "properties") private ArcSettingProperties innerProperties; - /** - * Get the systemData property: System data of ArcSetting resource. - * - * @return the systemData value. + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - public SystemData systemData() { - return this.systemData; + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of ArcSettingInner class. */ + public ArcSettingInner() { } /** @@ -46,6 +41,15 @@ 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 provisioningState property: Provisioning state of the ArcSetting proxy resource. * 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 index e628ec8d6f03..5b7a98227889 100644 --- 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 @@ -21,8 +21,7 @@ public final class ArcSettingProperties { private ProvisioningState provisioningState; /* - * The resource group that hosts the Arc agents, ie. Hybrid Compute Machine - * resources. + * The resource group that hosts the Arc agents, ie. Hybrid Compute Machine resources. */ @JsonProperty(value = "arcInstanceResourceGroup") private String arcInstanceResourceGroup; @@ -69,6 +68,10 @@ public final class ArcSettingProperties { @JsonProperty(value = "connectivityProperties") private Object connectivityProperties; + /** Creates an instance of ArcSettingProperties class. */ + public ArcSettingProperties() { + } + /** * Get the provisioningState property: Provisioning state of the ArcSetting proxy resource. * 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 index ea8247835231..bbd2f95830e2 100644 --- 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 @@ -16,6 +16,10 @@ public final class ArcSettingsPatchProperties { @JsonProperty(value = "connectivityProperties") private Object connectivityProperties; + /** Creates an instance of ArcSettingsPatchProperties class. */ + public ArcSettingsPatchProperties() { + } + /** * Get the connectivityProperties property: contains connectivity related configuration for ARC resources. * 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 index be934a9d5d35..0e602f5ca269 100644 --- 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 @@ -16,6 +16,10 @@ public final class ClusterIdentityResponseInner { @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) private ClusterIdentityResponseProperties innerProperties; + /** Creates an instance of ClusterIdentityResponseInner class. */ + public ClusterIdentityResponseInner() { + } + /** * Get the innerProperties property: Cluster identity properties. * 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 index 745b333748ae..56a135b5b73d 100644 --- 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 @@ -34,6 +34,10 @@ public final class ClusterIdentityResponseProperties { @JsonProperty(value = "aadApplicationObjectId") private String aadApplicationObjectId; + /** Creates an instance of ClusterIdentityResponseProperties class. */ + public ClusterIdentityResponseProperties() { + } + /** * Get the aadClientId property: The aadClientId property. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterInner.java index 90830dc5dd72..c4355f56da6a 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterInner.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterInner.java @@ -9,20 +9,24 @@ import com.azure.core.management.SystemData; import com.azure.resourcemanager.azurestackhci.models.ClusterDesiredProperties; import com.azure.resourcemanager.azurestackhci.models.ClusterReportedProperties; +import com.azure.resourcemanager.azurestackhci.models.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 com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; import java.util.Map; +import java.util.UUID; /** Cluster details. */ @Fluent public final class ClusterInner extends Resource { /* - * System data of Cluster resource + * Identity of Cluster resource */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) - private SystemData systemData; + @JsonProperty(value = "identity") + private ManagedServiceIdentity innerIdentity; /* * Cluster properties. @@ -30,13 +34,23 @@ public final class ClusterInner extends Resource { @JsonProperty(value = "properties") private ClusterProperties innerProperties; + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of ClusterInner class. */ + public ClusterInner() { + } + /** - * Get the systemData property: System data of Cluster resource. + * Get the innerIdentity property: Identity of Cluster resource. * - * @return the systemData value. + * @return the innerIdentity value. */ - public SystemData systemData() { - return this.systemData; + private ManagedServiceIdentity innerIdentity() { + return this.innerIdentity; } /** @@ -48,6 +62,15 @@ 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; + } + /** {@inheritDoc} */ @Override public ClusterInner withLocation(String location) { @@ -62,6 +85,80 @@ public ClusterInner withTags(Map 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. * @@ -204,6 +301,29 @@ public ClusterInner withAadServicePrincipalObjectId(String aadServicePrincipalOb 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. * @@ -296,6 +416,9 @@ public String serviceEndpoint() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (innerIdentity() != null) { + innerIdentity().validate(); + } if (innerProperties() != null) { innerProperties().validate(); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterPatchProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterPatchProperties.java index 170d36a4d2b3..32e69e11ce96 100644 --- 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 @@ -35,6 +35,10 @@ public final class ClusterPatchProperties { @JsonProperty(value = "desiredProperties") private ClusterDesiredProperties desiredProperties; + /** Creates an instance of ClusterPatchProperties class. */ + public ClusterPatchProperties() { + } + /** * Get the cloudManagementEndpoint property: Endpoint configured for management from the Azure portal. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterProperties.java index cb7310c87094..aa47d1968962 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterProperties.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterProperties.java @@ -8,6 +8,7 @@ import com.azure.resourcemanager.azurestackhci.models.ClusterDesiredProperties; import com.azure.resourcemanager.azurestackhci.models.ClusterReportedProperties; import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; +import com.azure.resourcemanager.azurestackhci.models.SoftwareAssuranceProperties; import com.azure.resourcemanager.azurestackhci.models.Status; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; @@ -63,6 +64,12 @@ public final class ClusterProperties { @JsonProperty(value = "aadServicePrincipalObjectId") private String aadServicePrincipalObjectId; + /* + * Software Assurance properties of the cluster. + */ + @JsonProperty(value = "softwareAssuranceProperties") + private SoftwareAssuranceProperties softwareAssuranceProperties; + /* * Desired properties of the cluster. */ @@ -111,6 +118,10 @@ public final class ClusterProperties { @JsonProperty(value = "serviceEndpoint", access = JsonProperty.Access.WRITE_ONLY) private String serviceEndpoint; + /** Creates an instance of ClusterProperties class. */ + public ClusterProperties() { + } + /** * Get the provisioningState property: Provisioning state. * @@ -238,6 +249,26 @@ public ClusterProperties withAadServicePrincipalObjectId(String aadServicePrinci 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. * @@ -327,6 +358,9 @@ public String serviceEndpoint() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (softwareAssuranceProperties() != null) { + softwareAssuranceProperties().validate(); + } if (desiredProperties() != null) { desiredProperties().validate(); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ExtensionInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ExtensionInner.java index 915af50280ef..00e658d6da6f 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ExtensionInner.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ExtensionInner.java @@ -16,25 +16,20 @@ /** Details of a particular extension in HCI Cluster. */ @Fluent public final class ExtensionInner extends ProxyResource { - /* - * System data of Extension resource. - */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) - private SystemData systemData; - /* * Describes Machine Extension Properties. */ @JsonProperty(value = "properties") private ExtensionProperties innerProperties; - /** - * Get the systemData property: System data of Extension resource. - * - * @return the systemData value. + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - public SystemData systemData() { - return this.systemData; + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of ExtensionInner class. */ + public ExtensionInner() { } /** @@ -46,6 +41,15 @@ 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 provisioningState property: Provisioning state of the Extension proxy resource. * 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 index 52eea9ddbd4a..3e003cc96e93 100644 --- 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 @@ -11,8 +11,7 @@ @Fluent public final class ExtensionParameters { /* - * How the extension handler should be forced to update even if the - * extension configuration has not changed. + * How the extension handler should be forced to update even if the extension configuration has not changed. */ @JsonProperty(value = "forceUpdateTag") private String forceUpdateTag; @@ -24,8 +23,7 @@ public final class ExtensionParameters { private String publisher; /* - * Specifies the type of the extension; an example is - * "CustomScriptExtension". + * Specifies the type of the extension; an example is "CustomScriptExtension". */ @JsonProperty(value = "type") private String type; @@ -37,10 +35,9 @@ public final class ExtensionParameters { 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. + * Indicates whether the extension should use a newer minor version if one is available at deployment time. Once + * deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set + * to true. */ @JsonProperty(value = "autoUpgradeMinorVersion") private Boolean autoUpgradeMinorVersion; @@ -57,6 +54,10 @@ public final class ExtensionParameters { @JsonProperty(value = "protectedSettings") private Object protectedSettings; + /** 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. 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 index 0a19e3a728d5..a2fa0af70134 100644 --- 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 @@ -38,6 +38,10 @@ public final class ExtensionProperties { @JsonProperty(value = "perNodeExtensionDetails", access = JsonProperty.Access.WRITE_ONLY) private List perNodeExtensionDetails; + /** Creates an instance of ExtensionProperties class. */ + public ExtensionProperties() { + } + /** * Get the provisioningState property: Provisioning state of the Extension proxy resource. * 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..9ef26edc5be5 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ManagedServiceIdentity.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.azurestackhci.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.azurestackhci.models.UserAssignedIdentity; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; +import java.util.UUID; + +/** Managed service identity (system assigned and/or user assigned identities). */ +@Fluent +public class ManagedServiceIdentity { + /* + * The service principal ID of the system assigned identity. This property will only be provided for a system + * assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private UUID principalId; + + /* + * The tenant ID of the system assigned identity. This property will only be provided for a system assigned + * identity. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private UUID tenantId; + + /* + * Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + */ + @JsonProperty(value = "type", required = true) + 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. + */ + @JsonProperty(value = "userAssignedIdentities") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + 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 + .logExceptionAsError( + 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); +} 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..650252e8d9f4 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/OfferInner.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.azurestackhci.models.SkuMappings; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Offer details. */ +@Fluent +public final class OfferInner extends ProxyResource { + /* + * Offer properties. + */ + @JsonProperty(value = "properties") + private OfferProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of 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 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(); + } + } +} 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..77872ea85b61 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/OfferProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurestackhci.models.SkuMappings; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Publisher properties. */ +@Fluent +public final class OfferProperties { + /* + * Provisioning State + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * Identifier of the Publisher for the offer + */ + @JsonProperty(value = "publisherId") + private String publisherId; + + /* + * JSON serialized catalog content of the offer + */ + @JsonProperty(value = "content") + private String content; + + /* + * The API version of the catalog service used to serve the catalog content + */ + @JsonProperty(value = "contentVersion") + private String contentVersion; + + /* + * Array of SKU mappings + */ + @JsonProperty(value = "skuMappings") + 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()); + } + } +} 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 index cd70af853a48..4c05d5ac2ed3 100644 --- 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 @@ -27,6 +27,10 @@ public final class OperationListResultInner { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; + /** Creates an instance of OperationListResultInner class. */ + public OperationListResultInner() { + } + /** * Get the value property: List of operations supported by the resource provider. * 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 index 92abc341b739..dffbc7e9a7de 100644 --- 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 @@ -35,6 +35,10 @@ public final class PasswordCredentialInner { @JsonProperty(value = "endDateTime") private OffsetDateTime endDateTime; + /** Creates an instance of PasswordCredentialInner class. */ + public PasswordCredentialInner() { + } + /** * Get the secretText property: The secretText property. * 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..a1715a0f49a2 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/PublisherInner.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Publisher details. */ +@Immutable +public final class PublisherInner extends ProxyResource { + /* + * Publisher properties. + */ + @JsonProperty(value = "properties") + private PublisherProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of 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 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(); + } + } +} 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..8536c871c29e --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/PublisherProperties.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.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Publisher properties. */ +@Immutable +public final class PublisherProperties { + /* + * Provisioning State + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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() { + } +} 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..7aa0fb06a66f --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/SkuInner.java @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.azurestackhci.models.SkuMappings; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Sku details. */ +@Fluent +public final class SkuInner extends ProxyResource { + /* + * SKU properties. + */ + @JsonProperty(value = "properties") + private SkuProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of 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 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(); + } + } +} 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..faee73884437 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/SkuProperties.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurestackhci.models.SkuMappings; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** SKU properties. */ +@Fluent +public final class SkuProperties { + /* + * Provisioning State + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * Identifier of the Publisher for the offer + */ + @JsonProperty(value = "publisherId") + private String publisherId; + + /* + * Identifier of the Offer for the sku + */ + @JsonProperty(value = "offerId") + private String offerId; + + /* + * JSON serialized catalog content of the sku offer + */ + @JsonProperty(value = "content") + private String content; + + /* + * The API version of the catalog service used to serve the catalog content + */ + @JsonProperty(value = "contentVersion") + private String contentVersion; + + /* + * Array of SKU mappings + */ + @JsonProperty(value = "skuMappings") + 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()); + } + } +} 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..25c2bcdb4c1e --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/Step.java @@ -0,0 +1,240 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Progress representation of the update run steps. */ +@Fluent +public final class Step { + /* + * Name of the step. + */ + @JsonProperty(value = "name") + private String name; + + /* + * More detailed description of the step. + */ + @JsonProperty(value = "description") + private String description; + + /* + * Error message, specified if the step is in a failed state. + */ + @JsonProperty(value = "errorMessage") + 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' + */ + @JsonProperty(value = "status") + private String status; + + /* + * When the step started, or empty if it has not started executing. + */ + @JsonProperty(value = "startTimeUtc") + private OffsetDateTime startTimeUtc; + + /* + * When the step reached a terminal state. + */ + @JsonProperty(value = "endTimeUtc") + private OffsetDateTime endTimeUtc; + + /* + * Completion time of this step or the last completed sub-step. + */ + @JsonProperty(value = "lastUpdatedTimeUtc") + private OffsetDateTime lastUpdatedTimeUtc; + + /* + * Recursive model for child steps of this step. + */ + @JsonProperty(value = "steps") + 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()); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateInner.java new file mode 100644 index 000000000000..6d760eec6a91 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateInner.java @@ -0,0 +1,457 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.azurestackhci.models.AvailabilityType; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; +import com.azure.resourcemanager.azurestackhci.models.State; +import com.azure.resourcemanager.azurestackhci.models.UpdatePrerequisite; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Update details. */ +@Fluent +public final class UpdateInner extends ProxyResource { + /* + * The geo-location where the resource lives + */ + @JsonProperty(value = "location") + private String location; + + /* + * Update properties + */ + @JsonProperty(value = "properties") + private UpdateProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of UpdateInner class. */ + public UpdateInner() { + } + + /** + * 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 UpdateInner object itself. + */ + public UpdateInner 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 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 UpdateInner object itself. + */ + public UpdateInner 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 UpdateInner object itself. + */ + public UpdateInner 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 UpdateInner object itself. + */ + public UpdateInner 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 UpdateInner object itself. + */ + public UpdateInner withPrerequisites(List prerequisites) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateProperties(); + } + this.innerProperties().withPrerequisites(prerequisites); + 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 UpdateInner object itself. + */ + public UpdateInner 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 UpdateInner object itself. + */ + public UpdateInner 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 UpdateInner object itself. + */ + public UpdateInner 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 UpdateInner object itself. + */ + public UpdateInner 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 UpdateInner object itself. + */ + public UpdateInner 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 UpdateInner object itself. + */ + public UpdateInner 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 UpdateInner object itself. + */ + public UpdateInner 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 UpdateInner object itself. + */ + public UpdateInner 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 UpdateInner object itself. + */ + public UpdateInner 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 UpdateInner object itself. + */ + public UpdateInner 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 UpdateInner object itself. + */ + public UpdateInner 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(); + } + } +} 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..6050b4e6eeb5 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateProperties.java @@ -0,0 +1,469 @@ +// Copyright (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.AvailabilityType; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; +import com.azure.resourcemanager.azurestackhci.models.State; +import com.azure.resourcemanager.azurestackhci.models.UpdatePrerequisite; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Details of a singular Update in HCI Cluster. */ +@Fluent +public final class UpdateProperties { + /* + * Provisioning state of the Updates proxy resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Date that the update was installed. + */ + @JsonProperty(value = "installedDate") + private OffsetDateTime installedDate; + + /* + * Description of the update. + */ + @JsonProperty(value = "description") + private String description; + + /* + * State of the update as it relates to this stamp. + */ + @JsonProperty(value = "state") + 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. + */ + @JsonProperty(value = "prerequisites") + private List prerequisites; + + /* + * Path where the update package is available. + */ + @JsonProperty(value = "packagePath") + 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. + */ + @JsonProperty(value = "packageSizeInMb") + private Float packageSizeInMb; + + /* + * Display name of the Update + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * Version of the update. + */ + @JsonProperty(value = "version") + private String version; + + /* + * Publisher of the update package. + */ + @JsonProperty(value = "publisher") + private String publisher; + + /* + * Link to release notes for the update. + */ + @JsonProperty(value = "releaseLink") + private String releaseLink; + + /* + * Indicates the way the update content can be downloaded. + */ + @JsonProperty(value = "availabilityType") + private AvailabilityType availabilityType; + + /* + * Customer-visible type of the update. + */ + @JsonProperty(value = "packageType") + 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. + */ + @JsonProperty(value = "additionalProperties") + private String additionalProperties; + + /* + * Additional information regarding the state of the update. See definition of UpdateStateProperties type below for + * more details on this property. + */ + @JsonProperty(value = "updateStateProperties") + 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 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 (innerUpdateStateProperties() != null) { + innerUpdateStateProperties().validate(); + } + } +} 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..18775d21cad9 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateRunInner.java @@ -0,0 +1,330 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; +import com.azure.resourcemanager.azurestackhci.models.UpdateRunPropertiesState; +import com.fasterxml.jackson.annotation.JsonProperty; +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 + */ + @JsonProperty(value = "location") + private String location; + + /* + * Describes Update Run Properties. + */ + @JsonProperty(value = "properties") + private UpdateRunProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of 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 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 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(); + } + } +} 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..d7c18552a57e --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateRunProperties.java @@ -0,0 +1,299 @@ +// Copyright (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.ProvisioningState; +import com.azure.resourcemanager.azurestackhci.models.UpdateRunPropertiesState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Properties of an Update run. */ +@Fluent +public final class UpdateRunProperties { + /* + * Provisioning state of the UpdateRuns proxy resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Duration of the update run. + */ + @JsonProperty(value = "duration") + private String duration; + + /* + * State of the update run. + */ + @JsonProperty(value = "state") + private UpdateRunPropertiesState state; + + /* + * Progress representation of the update run steps. + */ + @JsonProperty(value = "progress") + 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 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(); + } + } +} 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..f60984021df1 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateStateProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * 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 { + /* + * 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. + */ + @JsonProperty(value = "progressPercentage") + private Float progressPercentage; + + /* + * Brief message with instructions for updates of AvailabilityType Notify. + */ + @JsonProperty(value = "notifyMessage") + 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() { + } +} 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..d1bfc7a87316 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateSummariesInner.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.resourcemanager.azurestackhci.models.PackageVersionInfo; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; +import com.azure.resourcemanager.azurestackhci.models.UpdateSummariesPropertiesState; +import com.fasterxml.jackson.annotation.JsonProperty; +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 + */ + @JsonProperty(value = "location") + private String location; + + /* + * Update summaries properties + */ + @JsonProperty(value = "properties") + private UpdateSummariesProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of 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 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 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(); + } + } +} 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..75846b273dc2 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateSummariesProperties.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurestackhci.models.PackageVersionInfo; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; +import com.azure.resourcemanager.azurestackhci.models.UpdateSummariesPropertiesState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of Update summaries. */ +@Fluent +public final class UpdateSummariesProperties { + /* + * Provisioning state of the UpdateSummaries proxy resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * OEM family name. + */ + @JsonProperty(value = "oemFamily") + private String oemFamily; + + /* + * Name of the hardware model. + */ + @JsonProperty(value = "hardwareModel") + private String hardwareModel; + + /* + * Current version of each updatable component. + */ + @JsonProperty(value = "packageVersions") + private List packageVersions; + + /* + * Current Solution Bundle version of the stamp. + */ + @JsonProperty(value = "currentVersion") + private String currentVersion; + + /* + * Overall update state of the stamp. + */ + @JsonProperty(value = "state") + 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 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()); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingImpl.java index e7c22ee4ecd1..bfba4014688b 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingImpl.java @@ -187,16 +187,16 @@ public ArcSetting refresh(Context context) { return this; } - public PasswordCredential generatePassword() { - return serviceManager.arcSettings().generatePassword(resourceGroupName, clusterName, arcSettingName); - } - public Response generatePasswordWithResponse(Context context) { return serviceManager .arcSettings() .generatePasswordWithResponse(resourceGroupName, clusterName, arcSettingName, context); } + public PasswordCredential generatePassword() { + return serviceManager.arcSettings().generatePassword(resourceGroupName, clusterName, arcSettingName); + } + public ArcIdentityResponse createIdentity() { return serviceManager.arcSettings().createIdentity(resourceGroupName, clusterName, arcSettingName); } 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 index 0da1463d4857..7561909b90d7 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingsClientImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingsClientImpl.java @@ -503,14 +503,16 @@ private Mono getAsync(String resourceGroupName, String clusterN * @param resourceGroupName The name of the resource group. The name 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. + * @return arcSetting resource details of HCI Cluster along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ArcSettingInner get(String resourceGroupName, String clusterName, String arcSettingName) { - return getAsync(resourceGroupName, clusterName, arcSettingName).block(); + public Response getWithResponse( + String resourceGroupName, String clusterName, String arcSettingName, Context context) { + return getWithResponseAsync(resourceGroupName, clusterName, arcSettingName, context).block(); } /** @@ -519,16 +521,14 @@ public ArcSettingInner get(String resourceGroupName, String clusterName, String * @param resourceGroupName The name of the resource group. The name 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}. + * @return arcSetting resource details of HCI Cluster. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String clusterName, String arcSettingName, Context context) { - return getWithResponseAsync(resourceGroupName, clusterName, arcSettingName, context).block(); + public ArcSettingInner get(String resourceGroupName, String clusterName, String arcSettingName) { + return getWithResponse(resourceGroupName, clusterName, arcSettingName, Context.NONE).getValue(); } /** @@ -679,15 +679,20 @@ private Mono createAsync( * @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. + * @return arcSetting details along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ArcSettingInner create( - String resourceGroupName, String clusterName, String arcSettingName, ArcSettingInner arcSetting) { - return createAsync(resourceGroupName, clusterName, arcSettingName, arcSetting).block(); + public Response createWithResponse( + String resourceGroupName, + String clusterName, + String arcSettingName, + ArcSettingInner arcSetting, + Context context) { + return createWithResponseAsync(resourceGroupName, clusterName, arcSettingName, arcSetting, context).block(); } /** @@ -697,20 +702,15 @@ public ArcSettingInner create( * @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}. + * @return arcSetting details. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse( - String resourceGroupName, - String clusterName, - String arcSettingName, - ArcSettingInner arcSetting, - Context context) { - return createWithResponseAsync(resourceGroupName, clusterName, arcSettingName, arcSetting, context).block(); + public ArcSettingInner create( + String resourceGroupName, String clusterName, String arcSettingName, ArcSettingInner arcSetting) { + return createWithResponse(resourceGroupName, clusterName, arcSettingName, arcSetting, Context.NONE).getValue(); } /** @@ -861,15 +861,20 @@ private Mono updateAsync( * @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. + * @return arcSetting details along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ArcSettingInner update( - String resourceGroupName, String clusterName, String arcSettingName, ArcSettingsPatch arcSetting) { - return updateAsync(resourceGroupName, clusterName, arcSettingName, arcSetting).block(); + public Response updateWithResponse( + String resourceGroupName, + String clusterName, + String arcSettingName, + ArcSettingsPatch arcSetting, + Context context) { + return updateWithResponseAsync(resourceGroupName, clusterName, arcSettingName, arcSetting, context).block(); } /** @@ -879,20 +884,15 @@ public ArcSettingInner update( * @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}. + * @return arcSetting details. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, - String clusterName, - String arcSettingName, - ArcSettingsPatch arcSetting, - Context context) { - return updateWithResponseAsync(resourceGroupName, clusterName, arcSettingName, arcSetting, context).block(); + public ArcSettingInner update( + String resourceGroupName, String clusterName, String arcSettingName, ArcSettingsPatch arcSetting) { + return updateWithResponse(resourceGroupName, clusterName, arcSettingName, arcSetting, Context.NONE).getValue(); } /** @@ -1275,15 +1275,16 @@ private Mono generatePasswordAsync( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PasswordCredentialInner generatePassword( - String resourceGroupName, String clusterName, String arcSettingName) { - return generatePasswordAsync(resourceGroupName, clusterName, arcSettingName).block(); + public Response generatePasswordWithResponse( + String resourceGroupName, String clusterName, String arcSettingName, Context context) { + return generatePasswordWithResponseAsync(resourceGroupName, clusterName, arcSettingName, context).block(); } /** @@ -1292,16 +1293,15 @@ public PasswordCredentialInner generatePassword( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response generatePasswordWithResponse( - String resourceGroupName, String clusterName, String arcSettingName, Context context) { - return generatePasswordWithResponseAsync(resourceGroupName, clusterName, arcSettingName, context).block(); + public PasswordCredentialInner generatePassword( + String resourceGroupName, String clusterName, String arcSettingName) { + return generatePasswordWithResponse(resourceGroupName, clusterName, arcSettingName, Context.NONE).getValue(); } /** @@ -1574,7 +1574,8 @@ public ArcIdentityResponseInner createIdentity( /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1610,7 +1611,8 @@ private Mono> listByClusterNextSinglePageAsync(St /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingsImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingsImpl.java index e7fc8d055b32..82252170e9c4 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingsImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingsImpl.java @@ -42,15 +42,6 @@ public PagedIterable listByCluster(String resourceGroupName, String return Utils.mapPage(inner, inner1 -> new ArcSettingImpl(inner1, this.manager())); } - public ArcSetting get(String resourceGroupName, String clusterName, String arcSettingName) { - ArcSettingInner inner = this.serviceClient().get(resourceGroupName, clusterName, arcSettingName); - if (inner != null) { - return new ArcSettingImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getWithResponse( String resourceGroupName, String clusterName, String arcSettingName, Context context) { Response inner = @@ -66,6 +57,15 @@ public Response getWithResponse( } } + 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); } @@ -74,16 +74,6 @@ public void delete(String resourceGroupName, String clusterName, String arcSetti this.serviceClient().delete(resourceGroupName, clusterName, arcSettingName, context); } - public PasswordCredential generatePassword(String resourceGroupName, String clusterName, String arcSettingName) { - PasswordCredentialInner inner = - this.serviceClient().generatePassword(resourceGroupName, clusterName, arcSettingName); - if (inner != null) { - return new PasswordCredentialImpl(inner, this.manager()); - } else { - return null; - } - } - public Response generatePasswordWithResponse( String resourceGroupName, String clusterName, String arcSettingName, Context context) { Response inner = @@ -99,6 +89,16 @@ public Response generatePasswordWithResponse( } } + 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); 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 31e4c5141f02..a68487f0b8c2 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/AzureStackHciClientBuilder.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/AzureStackHciClientBuilder.java @@ -119,24 +119,26 @@ public AzureStackHciClientBuilder serializerAdapter(SerializerAdapter serializer * @return an instance of AzureStackHciClientImpl. */ public AzureStackHciClientImpl buildClient() { - if (endpoint == null) { - this.endpoint = "https://management.azure.com"; - } - if (environment == null) { - this.environment = AzureEnvironment.AZURE; - } - if (pipeline == null) { - this.pipeline = new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); - } - if (defaultPollInterval == null) { - this.defaultPollInterval = Duration.ofSeconds(30); - } - if (serializerAdapter == null) { - this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); - } + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; + AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; + HttpPipeline localPipeline = + (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval = + (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = + (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); AzureStackHciClientImpl client = new AzureStackHciClientImpl( - pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + localPipeline, + localSerializerAdapter, + localDefaultPollInterval, + localEnvironment, + subscriptionId, + localEndpoint); return client; } } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/AzureStackHciClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/AzureStackHciClientImpl.java index 773a2426d48d..01a92367b6e0 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 @@ -26,7 +26,13 @@ import com.azure.resourcemanager.azurestackhci.fluent.AzureStackHciClient; import com.azure.resourcemanager.azurestackhci.fluent.ClustersClient; import com.azure.resourcemanager.azurestackhci.fluent.ExtensionsClient; +import com.azure.resourcemanager.azurestackhci.fluent.OffersClient; import com.azure.resourcemanager.azurestackhci.fluent.OperationsClient; +import com.azure.resourcemanager.azurestackhci.fluent.PublishersClient; +import com.azure.resourcemanager.azurestackhci.fluent.SkusClient; +import com.azure.resourcemanager.azurestackhci.fluent.UpdateRunsClient; +import com.azure.resourcemanager.azurestackhci.fluent.UpdateSummariesOperationsClient; +import com.azure.resourcemanager.azurestackhci.fluent.UpdatesClient; import java.io.IOException; import java.lang.reflect.Type; import java.nio.ByteBuffer; @@ -159,6 +165,78 @@ public OperationsClient getOperations() { return this.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 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 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 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; + } + /** * Initializes an instance of AzureStackHciClient client. * @@ -181,11 +259,17 @@ public OperationsClient getOperations() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2022-05-01"; + this.apiVersion = "2022-10-01"; this.arcSettings = new ArcSettingsClientImpl(this); this.clusters = new ClustersClientImpl(this); this.extensions = new ExtensionsClientImpl(this); this.operations = new OperationsClientImpl(this); + this.offers = new OffersClientImpl(this); + this.publishers = new PublishersClientImpl(this); + this.skus = new SkusClientImpl(this); + this.updateRuns = new UpdateRunsClientImpl(this); + this.updateSummariesOperations = new UpdateSummariesOperationsClientImpl(this); + this.updates = new UpdatesClientImpl(this); } /** diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClusterImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClusterImpl.java index 3bb9fccdd06c..a31c3c831326 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClusterImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClusterImpl.java @@ -13,12 +13,17 @@ 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.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; @@ -54,6 +59,27 @@ 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(); } @@ -86,6 +112,10 @@ public String aadServicePrincipalObjectId() { return this.innerModel().aadServicePrincipalObjectId(); } + public SoftwareAssuranceProperties softwareAssuranceProperties() { + return this.innerModel().softwareAssuranceProperties(); + } + public ClusterDesiredProperties desiredProperties() { return this.innerModel().desiredProperties(); } @@ -243,6 +273,19 @@ 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; @@ -263,6 +306,21 @@ public ClusterImpl withTags(Map tags) { } } + 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); @@ -303,6 +361,11 @@ public ClusterImpl withAadServicePrincipalObjectId(String aadServicePrincipalObj return this; } + public ClusterImpl withSoftwareAssuranceProperties(SoftwareAssuranceProperties softwareAssuranceProperties) { + this.innerModel().withSoftwareAssuranceProperties(softwareAssuranceProperties); + return this; + } + public ClusterImpl withDesiredProperties(ClusterDesiredProperties desiredProperties) { if (isInCreateMode()) { this.innerModel().withDesiredProperties(desiredProperties); @@ -313,6 +376,11 @@ public ClusterImpl withDesiredProperties(ClusterDesiredProperties desiredPropert } } + 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 index d04da2f86403..eef8a6fb6421 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClustersClientImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClustersClientImpl.java @@ -38,6 +38,7 @@ 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; @@ -186,6 +187,22 @@ Mono>> createIdentity( @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}) @@ -626,14 +643,16 @@ private Mono getByResourceGroupAsync(String resourceGroupName, Str * * @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. + * @return hCI cluster along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ClusterInner getByResourceGroup(String resourceGroupName, String clusterName) { - return getByResourceGroupAsync(resourceGroupName, clusterName).block(); + public Response getByResourceGroupWithResponse( + String resourceGroupName, String clusterName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, clusterName, context).block(); } /** @@ -641,16 +660,14 @@ public ClusterInner getByResourceGroup(String resourceGroupName, String clusterN * * @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}. + * @return hCI cluster. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String clusterName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, clusterName, context).block(); + public ClusterInner getByResourceGroup(String resourceGroupName, String clusterName) { + return getByResourceGroupWithResponse(resourceGroupName, clusterName, Context.NONE).getValue(); } /** @@ -784,14 +801,16 @@ private Mono createAsync(String resourceGroupName, String clusterN * @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. + * @return cluster details along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ClusterInner create(String resourceGroupName, String clusterName, ClusterInner cluster) { - return createAsync(resourceGroupName, clusterName, cluster).block(); + public Response createWithResponse( + String resourceGroupName, String clusterName, ClusterInner cluster, Context context) { + return createWithResponseAsync(resourceGroupName, clusterName, cluster, context).block(); } /** @@ -800,16 +819,14 @@ public ClusterInner create(String resourceGroupName, String clusterName, 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}. + * @return cluster details. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse( - String resourceGroupName, String clusterName, ClusterInner cluster, Context context) { - return createWithResponseAsync(resourceGroupName, clusterName, cluster, context).block(); + public ClusterInner create(String resourceGroupName, String clusterName, ClusterInner cluster) { + return createWithResponse(resourceGroupName, clusterName, cluster, Context.NONE).getValue(); } /** @@ -943,14 +960,16 @@ private Mono updateAsync(String resourceGroupName, String clusterN * @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. + * @return cluster details along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ClusterInner update(String resourceGroupName, String clusterName, ClusterPatch cluster) { - return updateAsync(resourceGroupName, clusterName, cluster).block(); + public Response updateWithResponse( + String resourceGroupName, String clusterName, ClusterPatch cluster, Context context) { + return updateWithResponseAsync(resourceGroupName, clusterName, cluster, context).block(); } /** @@ -959,16 +978,14 @@ public ClusterInner update(String resourceGroupName, String clusterName, 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}. + * @return cluster details. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, String clusterName, ClusterPatch cluster, Context context) { - return updateWithResponseAsync(resourceGroupName, clusterName, cluster, context).block(); + public ClusterInner update(String resourceGroupName, String clusterName, ClusterPatch cluster) { + return updateWithResponse(resourceGroupName, clusterName, cluster, Context.NONE).getValue(); } /** @@ -1723,10 +1740,304 @@ public ClusterIdentityResponseInner createIdentity(String resourceGroupName, Str 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 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 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 nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1762,7 +2073,8 @@ private Mono> listBySubscriptionNextSinglePageAsync( /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1798,7 +2110,8 @@ private Mono> listBySubscriptionNextSinglePageAsync( /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1834,7 +2147,8 @@ private Mono> listByResourceGroupNextSinglePageAsync /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClustersImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClustersImpl.java index 980c49de2240..e7b6926116dd 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClustersImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClustersImpl.java @@ -15,6 +15,7 @@ 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 { @@ -50,15 +51,6 @@ public PagedIterable listByResourceGroup(String resourceGroupName, Cont return Utils.mapPage(inner, inner1 -> new ClusterImpl(inner1, this.manager())); } - public Cluster getByResourceGroup(String resourceGroupName, String clusterName) { - ClusterInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, clusterName); - if (inner != null) { - return new ClusterImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getByResourceGroupWithResponse( String resourceGroupName, String clusterName, Context context) { Response inner = @@ -74,6 +66,15 @@ public Response getByResourceGroupWithResponse( } } + 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); } @@ -114,6 +115,36 @@ public ClusterIdentityResponse createIdentity(String resourceGroupName, String c } } + 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 = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ExtensionsClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ExtensionsClientImpl.java index ea047f5486e1..d040286f3d5c 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ExtensionsClientImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ExtensionsClientImpl.java @@ -502,15 +502,16 @@ private Mono getAsync( * @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. + * @return particular Arc Extension of HCI Cluster along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ExtensionInner get( - String resourceGroupName, String clusterName, String arcSettingName, String extensionName) { - return getAsync(resourceGroupName, clusterName, arcSettingName, extensionName).block(); + public Response getWithResponse( + String resourceGroupName, String clusterName, String arcSettingName, String extensionName, Context context) { + return getWithResponseAsync(resourceGroupName, clusterName, arcSettingName, extensionName, context).block(); } /** @@ -520,16 +521,15 @@ public ExtensionInner get( * @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}. + * @return particular Arc Extension of HCI Cluster. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String clusterName, String arcSettingName, String extensionName, Context context) { - return getWithResponseAsync(resourceGroupName, clusterName, arcSettingName, extensionName, context).block(); + public ExtensionInner get( + String resourceGroupName, String clusterName, String arcSettingName, String extensionName) { + return getWithResponse(resourceGroupName, clusterName, arcSettingName, extensionName, Context.NONE).getValue(); } /** @@ -1512,7 +1512,8 @@ public void delete( /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1548,7 +1549,8 @@ private Mono> listByArcSettingNextSinglePageAsync( /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ExtensionsImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ExtensionsImpl.java index a2ed71822024..040aa8b494d3 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ExtensionsImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ExtensionsImpl.java @@ -41,15 +41,6 @@ public PagedIterable listByArcSetting( return Utils.mapPage(inner, inner1 -> new ExtensionImpl(inner1, this.manager())); } - public Extension get(String resourceGroupName, String clusterName, String arcSettingName, String extensionName) { - ExtensionInner inner = this.serviceClient().get(resourceGroupName, clusterName, arcSettingName, extensionName); - if (inner != null) { - return new ExtensionImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getWithResponse( String resourceGroupName, String clusterName, String arcSettingName, String extensionName, Context context) { Response inner = @@ -67,6 +58,15 @@ public Response getWithResponse( } } + 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); } 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..ca21f80e99fd --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OffersClientImpl.java @@ -0,0 +1,916 @@ +// Copyright (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") + private 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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of 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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of 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..fdb94afa2aad --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OffersImpl.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.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 Utils.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 Utils.mapPage(inner, inner1 -> new OfferImpl(inner1, this.manager())); + } + + public PagedIterable listByCluster(String resourceGroupName, String clusterName) { + PagedIterable inner = this.serviceClient().listByCluster(resourceGroupName, clusterName); + return Utils.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 Utils.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/OperationsClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OperationsClientImpl.java index 1e22db58c596..74c3b0276652 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 @@ -123,26 +123,26 @@ private Mono listAsync() { /** * 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. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public OperationListResultInner list() { - return listAsync().block(); + public Response listWithResponse(Context context) { + return listWithResponseAsync(context).block(); } /** * List all available Microsoft.AzureStackHCI provider operations. * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider along with {@link Response}. + * @return a list of REST API operations supported by an Azure Resource Provider. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse(Context context) { - return listWithResponseAsync(context).block(); + 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 9a5400b784a4..6ffcd8432998 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 @@ -26,15 +26,6 @@ public OperationsImpl( this.serviceManager = serviceManager; } - public OperationListResult list() { - OperationListResultInner inner = this.serviceClient().list(); - if (inner != null) { - return new OperationListResultImpl(inner, this.manager()); - } else { - return null; - } - } - public Response listWithResponse(Context context) { Response inner = this.serviceClient().listWithResponse(context); if (inner != null) { @@ -48,6 +39,15 @@ public Response listWithResponse(Context context) { } } + public OperationListResult list() { + OperationListResultInner inner = this.serviceClient().list(); + if (inner != null) { + return new OperationListResultImpl(inner, this.manager()); + } else { + return null; + } + } + private OperationsClient serviceClient() { return this.innerClient; } 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..7267b2bfb735 --- /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..7434e84e8ca8 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/PublishersClientImpl.java @@ -0,0 +1,513 @@ +// Copyright (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") + private 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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of 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..0c57da8ee804 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/PublishersImpl.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.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 Utils.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 Utils.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/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..8efb4180079c --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/SkusClientImpl.java @@ -0,0 +1,656 @@ +// Copyright (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") + private 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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of 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..af1432e04303 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/SkusImpl.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.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 Utils.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 Utils.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/UpdateImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateImpl.java new file mode 100644 index 000000000000..489fe4727b5a --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateImpl.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.azurestackhci.fluent.models.UpdateInner; +import com.azure.resourcemanager.azurestackhci.models.AvailabilityType; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; +import com.azure.resourcemanager.azurestackhci.models.State; +import com.azure.resourcemanager.azurestackhci.models.Update; +import com.azure.resourcemanager.azurestackhci.models.UpdatePrerequisite; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class UpdateImpl implements Update { + private UpdateInner innerObject; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + UpdateImpl(UpdateInner 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 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 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 UpdateInner 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/UpdateRunImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateRunImpl.java new file mode 100644 index 000000000000..5f2201a29ae3 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateRunImpl.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.implementation; + +import com.azure.core.management.SystemData; +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 { + private UpdateRunInner innerObject; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + UpdateRunImpl( + UpdateRunInner 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 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 UpdateRunInner 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/UpdateRunsClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateRunsClientImpl.java new file mode 100644 index 000000000000..8b4eec792236 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateRunsClientImpl.java @@ -0,0 +1,538 @@ +// Copyright (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.UpdateRunsClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.UpdateRunInner; +import com.azure.resourcemanager.azurestackhci.models.UpdateRunList; +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") + private 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"}) + @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)); + } + + /** + * 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 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 details of an Update run 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())); + } + + /** + * 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 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 details of an Update run 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); + } + + /** + * 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 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 details of an Update run 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())); + } + + /** + * 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 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 details of an Update run 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(); + } + + /** + * 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 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 details of an Update run. + */ + @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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of 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..39f8727bdff3 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateRunsImpl.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.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 Utils.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 Utils.mapPage(inner, inner1 -> new UpdateRunImpl(inner1, this.manager())); + } + + 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; + } + } + + private UpdateRunsClient 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/UpdateSummariesImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateSummariesImpl.java new file mode 100644 index 000000000000..344d48a2c897 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateSummariesImpl.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.management.SystemData; +import com.azure.resourcemanager.azurestackhci.fluent.models.UpdateSummariesInner; +import com.azure.resourcemanager.azurestackhci.models.PackageVersionInfo; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; +import com.azure.resourcemanager.azurestackhci.models.UpdateSummaries; +import com.azure.resourcemanager.azurestackhci.models.UpdateSummariesPropertiesState; +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 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..840865612e72 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateSummariesOperationsClientImpl.java @@ -0,0 +1,493 @@ +// Copyright (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.UpdateSummariesOperationsClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.UpdateSummariesInner; +import com.azure.resourcemanager.azurestackhci.models.UpdateSummariesList; +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") + private 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"}) + @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)); + } + + /** + * 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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of 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..41e87c6f0610 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateSummariesOperationsImpl.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.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 Utils.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 Utils.mapPage(inner, inner1 -> new UpdateSummariesImpl(inner1, this.manager())); + } + + 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..a16bd8047890 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdatesClientImpl.java @@ -0,0 +1,776 @@ +// Copyright (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.Post; +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.UpdateInner; +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") + private 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"}) + @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 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 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)); + } + + /** + * 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 UpdateInner 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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of 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..39f1dff60254 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdatesImpl.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.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.UpdateInner; +import com.azure.resourcemanager.azurestackhci.models.Update; +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 Utils.mapPage(inner, inner1 -> new UpdateImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String clusterName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, clusterName, context); + return Utils.mapPage(inner, inner1 -> new UpdateImpl(inner1, this.manager())); + } + + 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 UpdateImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Update get(String resourceGroupName, String clusterName, String updateName) { + UpdateInner inner = this.serviceClient().get(resourceGroupName, clusterName, updateName); + if (inner != null) { + return new UpdateImpl(inner, this.manager()); + } else { + return null; + } + } + + private UpdatesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ActionType.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ActionType.java index 2b1410993e7d..9a8ca4ae60a8 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 @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for ActionType. */ +/** Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ public final class ActionType extends ExpandableStringEnum { /** Static value Internal for ActionType. */ public static final ActionType INTERNAL = fromString("Internal"); 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 index db757dbf992a..337f513ded2d 100644 --- 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 @@ -35,7 +35,7 @@ public interface ArcSetting { String type(); /** - * Gets the systemData property: System data of ArcSetting resource. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ @@ -295,22 +295,22 @@ interface WithConnectivityProperties { /** * 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. + * @return the response body along with {@link Response}. */ - PasswordCredential generatePassword(); + Response generatePasswordWithResponse(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}. + * @return the response. */ - Response generatePasswordWithResponse(Context context); + PasswordCredential generatePassword(); /** * Create Aad identity for arc settings. 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 index b784d7a58be9..5000846a04b0 100644 --- 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 @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for ArcSettingAggregateState. */ +/** 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"); 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 index 877c5efa9807..f29134b1d068 100644 --- 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 @@ -24,6 +24,10 @@ public final class ArcSettingList { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; + /** Creates an instance of ArcSettingList class. */ + public ArcSettingList() { + } + /** * Get the value property: List of ArcSetting proxy resources. * 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 index d58145da942f..12ae1a975b2f 100644 --- 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 @@ -41,12 +41,14 @@ public interface ArcSettings { * @param resourceGroupName The name of the resource group. The name 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. + * @return arcSetting resource details of HCI Cluster along with {@link Response}. */ - ArcSetting get(String resourceGroupName, String clusterName, String arcSettingName); + Response getWithResponse( + String resourceGroupName, String clusterName, String arcSettingName, Context context); /** * Get ArcSetting resource details of HCI Cluster. @@ -54,14 +56,12 @@ public interface ArcSettings { * @param resourceGroupName The name of the resource group. The name 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}. + * @return arcSetting resource details of HCI Cluster. */ - Response getWithResponse( - String resourceGroupName, String clusterName, String arcSettingName, Context context); + ArcSetting get(String resourceGroupName, String clusterName, String arcSettingName); /** * Delete ArcSetting resource details of HCI Cluster. @@ -94,12 +94,14 @@ Response getWithResponse( * @param resourceGroupName The name of the resource group. The name 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. + * @return the response body along with {@link Response}. */ - PasswordCredential generatePassword(String resourceGroupName, String clusterName, String arcSettingName); + Response generatePasswordWithResponse( + String resourceGroupName, String clusterName, String arcSettingName, Context context); /** * Generate password for arc settings. @@ -107,14 +109,12 @@ Response getWithResponse( * @param resourceGroupName The name of the resource group. The name 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}. + * @return the response. */ - Response generatePasswordWithResponse( - String resourceGroupName, String clusterName, String arcSettingName, Context context); + PasswordCredential generatePassword(String resourceGroupName, String clusterName, String arcSettingName); /** * Create Aad identity for arc settings. 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 index b9187894e0c5..0d30b01baa88 100644 --- 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 @@ -26,6 +26,10 @@ public final class ArcSettingsPatch { @JsonProperty(value = "properties") private ArcSettingsPatchProperties innerProperties; + /** Creates an instance of ArcSettingsPatch class. */ + public ArcSettingsPatch() { + } + /** * Get the tags property: Resource tags. * 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..efcc87c95719 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/AvailabilityType.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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 or finds a AvailabilityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AvailabilityType. + */ + @JsonCreator + 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/Cluster.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Cluster.java index 1bc5810040be..9247512c7b8b 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Cluster.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Cluster.java @@ -10,6 +10,7 @@ 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 { @@ -49,12 +50,46 @@ public interface Cluster { Map tags(); /** - * Gets the systemData property: System data of Cluster resource. + * 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. * @@ -111,6 +146,13 @@ public interface Cluster { */ 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. * @@ -241,11 +283,14 @@ interface WithResourceGroup { */ 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. @@ -272,6 +317,34 @@ interface WithTags { */ 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 { /** @@ -323,6 +396,16 @@ interface WithAadServicePrincipalObjectId { */ 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 { /** @@ -344,6 +427,8 @@ interface WithDesiredProperties { /** The template for Cluster update. */ interface Update extends UpdateStages.WithTags, + UpdateStages.WithType, + UpdateStages.WithUserAssignedIdentities, UpdateStages.WithCloudManagementEndpoint, UpdateStages.WithAadClientId, UpdateStages.WithAadTenantId, @@ -375,6 +460,34 @@ interface WithTags { */ 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 { /** @@ -471,4 +584,28 @@ interface WithDesiredProperties { * @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 index 6047cd6aac00..5a11f22a5853 100644 --- 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 @@ -22,6 +22,10 @@ public final class ClusterDesiredProperties { @JsonProperty(value = "diagnosticLevel") private DiagnosticLevel diagnosticLevel; + /** Creates an instance of ClusterDesiredProperties class. */ + public ClusterDesiredProperties() { + } + /** * Get the windowsServerSubscription property: Desired state of Windows Server Subscription. * 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 index 0a18e044fdbf..1763a1bb995c 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterList.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterList.java @@ -24,6 +24,10 @@ public final class ClusterList { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; + /** Creates an instance of ClusterList class. */ + public ClusterList() { + } + /** * Get the value property: List of clusters. * 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 index 1d7a5a571ed4..7a55d8dfb099 100644 --- 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 @@ -28,6 +28,12 @@ public final class ClusterNode { @JsonProperty(value = "windowsServerSubscription", access = JsonProperty.Access.WRITE_ONLY) private WindowsServerSubscription windowsServerSubscription; + /* + * Type of the cluster node hardware. + */ + @JsonProperty(value = "nodeType", access = JsonProperty.Access.WRITE_ONLY) + private ClusterNodeType nodeType; + /* * Manufacturer of the cluster node hardware. */ @@ -52,6 +58,12 @@ public final class ClusterNode { @JsonProperty(value = "osVersion", access = JsonProperty.Access.WRITE_ONLY) private String osVersion; + /* + * Display version of the operating system running on the cluster node. + */ + @JsonProperty(value = "osDisplayVersion", access = JsonProperty.Access.WRITE_ONLY) + private String osDisplayVersion; + /* * Immutable id of the cluster node. */ @@ -70,6 +82,10 @@ public final class ClusterNode { @JsonProperty(value = "memoryInGiB", access = JsonProperty.Access.WRITE_ONLY) private Float memoryInGiB; + /** Creates an instance of ClusterNode class. */ + public ClusterNode() { + } + /** * Get the name property: Name of the cluster node. * @@ -97,6 +113,15 @@ 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 manufacturer property: Manufacturer of the cluster node hardware. * @@ -133,6 +158,15 @@ 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. * 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..07554047c4ee --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterNodeType.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Type of the cluster node hardware. */ +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 or finds a ClusterNodeType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ClusterNodeType. + */ + @JsonCreator + 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 index 2004f6129e9f..88ca22d755e0 100644 --- 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 @@ -6,9 +6,11 @@ import com.azure.core.annotation.Fluent; import com.azure.resourcemanager.azurestackhci.fluent.models.ClusterPatchProperties; +import com.azure.resourcemanager.azurestackhci.fluent.models.ManagedServiceIdentity; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; +import java.util.UUID; /** Cluster details to update. */ @Fluent @@ -20,12 +22,22 @@ public final class ClusterPatch { @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; + /* + * Identity of Cluster resource + */ + @JsonProperty(value = "identity") + private ManagedServiceIdentity innerIdentity; + /* * Cluster properties. */ @JsonProperty(value = "properties") private ClusterPatchProperties innerProperties; + /** Creates an instance of ClusterPatch class. */ + public ClusterPatch() { + } + /** * Get the tags property: Resource tags. * @@ -46,6 +58,15 @@ public ClusterPatch withTags(Map 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. * @@ -55,6 +76,80 @@ 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. * @@ -153,6 +248,9 @@ public ClusterPatch withDesiredProperties(ClusterDesiredProperties desiredProper * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (innerIdentity() != null) { + innerIdentity().validate(); + } if (innerProperties() != null) { innerProperties().validate(); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterReportedProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterReportedProperties.java index 4a2d2b7c7895..41843506650d 100644 --- 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 @@ -54,6 +54,10 @@ public final class ClusterReportedProperties { @JsonProperty(value = "diagnosticLevel") private DiagnosticLevel diagnosticLevel; + /** Creates an instance of ClusterReportedProperties class. */ + public ClusterReportedProperties() { + } + /** * Get the clusterName property: Name of the on-prem cluster connected to this resource. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Clusters.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Clusters.java index 989e69c94dfc..2e7865951e97 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Clusters.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Clusters.java @@ -58,25 +58,25 @@ public interface 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 hCI cluster. + * @return hCI cluster along with {@link Response}. */ - Cluster getByResourceGroup(String resourceGroupName, String clusterName); + 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. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hCI cluster along with {@link Response}. + * @return hCI cluster. */ - Response getByResourceGroupWithResponse(String resourceGroupName, String clusterName, Context context); + Cluster getByResourceGroup(String resourceGroupName, String clusterName); /** * Delete an HCI cluster. @@ -156,6 +156,38 @@ void uploadCertificate( */ 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. * 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 index 055016a21b28..6744b640b7b4 100644 --- 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 @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for DiagnosticLevel. */ +/** 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"); 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 index 6ca8c95e770f..13d89967d4a6 100644 --- 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 @@ -33,7 +33,7 @@ public interface Extension { String type(); /** - * Gets the systemData property: System data of Extension resource. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ 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 index 23c5dfbc409d..0f005c670321 100644 --- 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 @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for ExtensionAggregateState. */ +/** 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"); 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 index 85c724fb57bb..d3784bf78e98 100644 --- 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 @@ -24,6 +24,10 @@ public final class ExtensionList { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; + /** Creates an instance of ExtensionList class. */ + public ExtensionList() { + } + /** * Get the value property: List of Extensions in HCI cluster. * 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 index bc901c68316a..482cf05d81db 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Extensions.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Extensions.java @@ -45,12 +45,14 @@ PagedIterable listByArcSetting( * @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. + * @return particular Arc Extension of HCI Cluster along with {@link Response}. */ - Extension get(String resourceGroupName, String clusterName, String arcSettingName, String extensionName); + Response getWithResponse( + String resourceGroupName, String clusterName, String arcSettingName, String extensionName, Context context); /** * Get particular Arc Extension of HCI Cluster. @@ -59,14 +61,12 @@ PagedIterable listByArcSetting( * @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}. + * @return particular Arc Extension of HCI Cluster. */ - Response getWithResponse( - String resourceGroupName, String clusterName, String arcSettingName, String extensionName, Context context); + Extension get(String resourceGroupName, String clusterName, String arcSettingName, String extensionName); /** * Delete particular Arc Extension of HCI Cluster. 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 index c3ca4a6a0bcf..ed88c23b9381 100644 --- 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 @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for ImdsAttestation. */ +/** IMDS attestation status of the cluster. */ public final class ImdsAttestation extends ExpandableStringEnum { /** Static value Disabled for ImdsAttestation. */ public static final ImdsAttestation DISABLED = fromString("Disabled"); 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..01424001798a --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ManagedServiceIdentityType.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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 or finds a ManagedServiceIdentityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedServiceIdentityType. + */ + @JsonCreator + 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/NodeArcState.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NodeArcState.java index c4f967773edf..6a23b63cbd08 100644 --- 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 @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for NodeArcState. */ +/** 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"); 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 index c3394d36855f..e5991925f763 100644 --- 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 @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for NodeExtensionState. */ +/** 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"); 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..7377f5027237 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Offer.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.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..df7f18b491a8 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OfferList.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.azurestackhci.fluent.models.OfferInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of Offer proxy resources for the HCI cluster. */ +@Immutable +public final class OfferList { + /* + * List of Offer proxy resources. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Link to the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** 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()); + } + } +} 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..05a0069a5c84 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Offers.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.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/Operation.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Operation.java index 8a8c66e2aafe..2edd1d043c05 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 @@ -7,20 +7,23 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** REST API Operation Details of a REST API operation, returned from the Resource Provider Operations API. */ +/** + * REST API Operation + * + *

Details of a REST API operation, returned from the Resource Provider Operations API. + */ @Fluent public final class Operation { /* - * The name of the operation, as per Resource-Based Access Control (RBAC). - * Examples: "Microsoft.Compute/virtualMachines/write", - * "Microsoft.Compute/virtualMachines/capture/action" + * 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. + * 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; @@ -32,19 +35,22 @@ public final class 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" + * 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. + * 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 Operation class. */ + public Operation() { + } + /** * 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". 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 75a95b413ce4..2d240728b7e4 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 @@ -11,34 +11,36 @@ @Immutable public final class OperationDisplay { /* - * 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. + * 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. */ + public OperationDisplay() { + } + /** * Get the provider property: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring * Insights" or "Microsoft Compute". 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 570a7f0abbd4..a2b004c68e7d 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 @@ -12,20 +12,20 @@ public interface 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. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link Response}. */ - OperationListResult list(); + Response listWithResponse(Context context); /** * List all available Microsoft.AzureStackHCI provider operations. * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider along with {@link Response}. + * @return a list of REST API operations supported by an Azure Resource Provider. */ - Response listWithResponse(Context context); + OperationListResult list(); } 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 5eb928fb9ec9..5fba491c43c0 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 @@ -8,7 +8,10 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for Origin. */ +/** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value + * is "user,system". + */ public final class Origin extends ExpandableStringEnum { /** Static value user for Origin. */ public static final Origin USER = fromString("user"); 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..e110cff3201a --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PackageVersionInfo.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.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Current version of each updatable component. */ +@Fluent +public final class PackageVersionInfo { + /* + * Package type + */ + @JsonProperty(value = "packageType") + private String packageType; + + /* + * Package version + */ + @JsonProperty(value = "version") + private String version; + + /* + * Last time this component was updated. + */ + @JsonProperty(value = "lastUpdated") + 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() { + } +} 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 index 54a16e384b67..77d9ab7e7b13 100644 --- 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 @@ -17,8 +17,7 @@ public final class PerNodeExtensionState { private String name; /* - * Fully qualified resource ID for the particular Arc Extension on this - * node. + * Fully qualified resource ID for the particular Arc Extension on this node. */ @JsonProperty(value = "extension", access = JsonProperty.Access.WRITE_ONLY) private String extension; @@ -29,6 +28,10 @@ public final class PerNodeExtensionState { @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) private NodeExtensionState state; + /** Creates an instance of PerNodeExtensionState class. */ + public PerNodeExtensionState() { + } + /** * Get the name property: Name of the node in HCI Cluster. * 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 index 9dad6d8d94a0..e13cca3e814f 100644 --- 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 @@ -28,6 +28,10 @@ public final class PerNodeState { @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) private NodeArcState state; + /** Creates an instance of PerNodeState class. */ + public PerNodeState() { + } + /** * Get the name property: Name of the Node in HCI Cluster. * 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 index 117f3584ed15..d62c0d36a79b 100644 --- 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 @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for ProvisioningState. */ +/** Provisioning state of the ArcSetting proxy resource. */ public final class ProvisioningState extends ExpandableStringEnum { /** Static value Succeeded for ProvisioningState. */ public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); 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..430636a66fcb --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Publisher.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.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..b3f4855f5e32 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PublisherList.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.azurestackhci.fluent.models.PublisherInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of Publisher proxy resources for the HCI cluster. */ +@Immutable +public final class PublisherList { + /* + * List of Publisher proxy resources. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Link to the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** 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()); + } + } +} 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..65eddd19fb09 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Publishers.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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/RawCertificateData.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/RawCertificateData.java index 5cb214a9d881..53bf8ca189b0 100644 --- 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 @@ -17,6 +17,10 @@ public final class RawCertificateData { @JsonProperty(value = "certificates") private List certificates; + /** Creates an instance of RawCertificateData class. */ + public RawCertificateData() { + } + /** * Get the certificates property: The certificates property. * 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..7e2ee240de5f --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Sku.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.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..f1bcc39b5467 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SkuList.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.azurestackhci.fluent.models.SkuInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of SKU proxy resources for the HCI cluster. */ +@Immutable +public final class SkuList { + /* + * List of SKU proxy resources. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Link to the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** 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()); + } + } +} 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..cc5f7f6ab613 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SkuMappings.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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** SKU Mapping details. */ +@Fluent +public final class SkuMappings { + /* + * Identifier of the CatalogPlan for the sku + */ + @JsonProperty(value = "catalogPlanId") + private String catalogPlanId; + + /* + * Identifier for the sku + */ + @JsonProperty(value = "marketplaceSkuId") + private String marketplaceSkuId; + + /* + * Array of SKU versions available + */ + @JsonProperty(value = "marketplaceSkuVersions") + 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() { + } +} 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..35f403e506b3 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Skus.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights 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..023ac5e109bd --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SoftwareAssuranceChangeRequest.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SoftwareAssuranceChangeRequest model. */ +@Fluent +public final class SoftwareAssuranceChangeRequest { + /* + * The properties property. + */ + @JsonProperty(value = "properties") + 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(); + } + } +} 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..b3a97aa0b74b --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SoftwareAssuranceChangeRequestProperties.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SoftwareAssuranceChangeRequestProperties model. */ +@Fluent +public final class SoftwareAssuranceChangeRequestProperties { + /* + * Customer Intent for Software Assurance Benefit. + */ + @JsonProperty(value = "softwareAssuranceIntent") + 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() { + } +} 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..1a0a08e94146 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SoftwareAssuranceIntent.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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 or finds a SoftwareAssuranceIntent from its string representation. + * + * @param name a name to look for. + * @return the corresponding SoftwareAssuranceIntent. + */ + @JsonCreator + 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..f54dcebae145 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SoftwareAssuranceProperties.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Software Assurance properties of the cluster. */ +@Fluent +public final class SoftwareAssuranceProperties { + /* + * Status of the Software Assurance for the cluster. + */ + @JsonProperty(value = "softwareAssuranceStatus") + private SoftwareAssuranceStatus softwareAssuranceStatus; + + /* + * Customer Intent for Software Assurance Benefit. + */ + @JsonProperty(value = "softwareAssuranceIntent") + private SoftwareAssuranceIntent softwareAssuranceIntent; + + /* + * TimeStamp denoting the latest SA benefit applicability is validated. + */ + @JsonProperty(value = "lastUpdated", access = JsonProperty.Access.WRITE_ONLY) + 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; + } + + /** + * Set the softwareAssuranceStatus property: Status of the Software Assurance for the cluster. + * + * @param softwareAssuranceStatus the softwareAssuranceStatus value to set. + * @return the SoftwareAssuranceProperties object itself. + */ + public SoftwareAssuranceProperties withSoftwareAssuranceStatus(SoftwareAssuranceStatus softwareAssuranceStatus) { + this.softwareAssuranceStatus = softwareAssuranceStatus; + return this; + } + + /** + * 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() { + } +} 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..b7e0e8bc7fb0 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SoftwareAssuranceStatus.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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 or finds a SoftwareAssuranceStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding SoftwareAssuranceStatus. + */ + @JsonCreator + 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/State.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/State.java new file mode 100644 index 000000000000..61835855e277 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/State.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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"); + + /** + * Creates or finds a State from its string representation. + * + * @param name a name to look for. + * @return the corresponding State. + */ + @JsonCreator + 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 91733d95bf45..ff832a6d8a09 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Status.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Status.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for Status. */ +/** Status of the cluster agent. */ public final class Status extends ExpandableStringEnum { /** Static value NotYetRegistered for Status. */ public static final Status NOT_YET_REGISTERED = fromString("NotYetRegistered"); diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Update.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Update.java new file mode 100644 index 000000000000..1f365c351982 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Update.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights 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.UpdateInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** An immutable client-side representation of Update. */ +public interface Update { + /** + * 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 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 inner com.azure.resourcemanager.azurestackhci.fluent.models.UpdateInner object. + * + * @return the inner object. + */ + UpdateInner innerModel(); +} 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..331c4aec3501 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateList.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurestackhci.fluent.models.UpdateInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of Updates. */ +@Fluent +public final class UpdateList { + /* + * List of Updates + */ + @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 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()); + } + } +} 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..23bfc58f35ad --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdatePrerequisite.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * 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 { + /* + * Updatable component type. + */ + @JsonProperty(value = "updateType") + private String updateType; + + /* + * Version of the prerequisite. + */ + @JsonProperty(value = "version") + private String version; + + /* + * Friendly name of the prerequisite. + */ + @JsonProperty(value = "packageName") + 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() { + } +} 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..20ae2596378b --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateRun.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.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 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 inner com.azure.resourcemanager.azurestackhci.fluent.models.UpdateRunInner object. + * + * @return the inner object. + */ + UpdateRunInner innerModel(); +} 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..381cfba50999 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateRunList.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurestackhci.fluent.models.UpdateRunInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of Update runs. */ +@Fluent +public final class UpdateRunList { + /* + * List of Update runs + */ + @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 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()); + } + } +} 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..51604cdacad8 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateRunPropertiesState.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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 or finds a UpdateRunPropertiesState from its string representation. + * + * @param name a name to look for. + * @return the corresponding UpdateRunPropertiesState. + */ + @JsonCreator + 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..968a6b428236 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateRuns.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.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); + + /** + * 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 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 details of an Update run along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String clusterName, String updateName, String updateRunName, 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. + * @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 details of an Update run. + */ + UpdateRun get(String resourceGroupName, String clusterName, String updateName, String updateRunName); +} 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..8661edb7a865 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateSummaries.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.management.SystemData; +import com.azure.resourcemanager.azurestackhci.fluent.models.UpdateSummariesInner; +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 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..e3daf3ded1ce --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateSummariesList.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurestackhci.fluent.models.UpdateSummariesInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of Update Summaries. */ +@Fluent +public final class UpdateSummariesList { + /* + * List of Update Summaries + */ + @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 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()); + } + } +} 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..3ca06407e508 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateSummariesOperations.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.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** 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); + + /** + * 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..28cf1d8e8470 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateSummariesPropertiesState.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 com.fasterxml.jackson.annotation.JsonCreator; +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 or finds a UpdateSummariesPropertiesState from its string representation. + * + * @param name a name to look for. + * @return the corresponding UpdateSummariesPropertiesState. + */ + @JsonCreator + 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..5701b0b0299c --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Updates.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.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); + + /** + * 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. + */ + Update get(String resourceGroupName, String clusterName, String updateName); +} 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 index 8fabb105a662..341a6910ed1c 100644 --- 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 @@ -16,6 +16,10 @@ public final class UploadCertificateRequest { @JsonProperty(value = "properties") private RawCertificateData properties; + /** Creates an instance of UploadCertificateRequest class. */ + public UploadCertificateRequest() { + } + /** * Get the properties property: The properties property. * 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..ded203d93243 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UserAssignedIdentity.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.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.UUID; + +/** User assigned identity properties. */ +@Immutable +public class UserAssignedIdentity { + /* + * The principal ID of the assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private UUID principalId; + + /* + * The client ID of the assigned identity. + */ + @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) + 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() { + } +} 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 index 6d9da4e53ba7..176ee7fc1b2b 100644 --- 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 @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for WindowsServerSubscription. */ +/** Desired state of Windows Server Subscription. */ public final class WindowsServerSubscription extends ExpandableStringEnum { /** Static value Disabled for WindowsServerSubscription. */ public static final WindowsServerSubscription DISABLED = fromString("Disabled"); diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsCreateIdentitySamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsCreateIdentitySamples.java index 47e9f75aa33b..a043539ccab6 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsCreateIdentitySamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsCreateIdentitySamples.java @@ -9,7 +9,7 @@ /** Samples for ArcSettings CreateIdentity. */ public final class ArcSettingsCreateIdentitySamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/CreateArcIdentity.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/CreateArcIdentity.json */ /** * Sample code: Create Arc Identity. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsCreateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsCreateSamples.java index b0da37f7e07e..4b862856689d 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsCreateSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsCreateSamples.java @@ -7,7 +7,7 @@ /** Samples for ArcSettings Create. */ public final class ArcSettingsCreateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/PutArcSetting.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/PutArcSetting.json */ /** * Sample code: Create ArcSetting. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsDeleteSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsDeleteSamples.java index dd70b8317555..f02ac3e468be 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsDeleteSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsDeleteSamples.java @@ -9,7 +9,7 @@ /** Samples for ArcSettings Delete. */ public final class ArcSettingsDeleteSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/DeleteArcSetting.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/DeleteArcSetting.json */ /** * Sample code: Delete ArcSetting. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsGeneratePasswordSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsGeneratePasswordSamples.java index 066deffefc05..7d3c17b1ff43 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsGeneratePasswordSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsGeneratePasswordSamples.java @@ -9,7 +9,7 @@ /** Samples for ArcSettings GeneratePassword. */ public final class ArcSettingsGeneratePasswordSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/GeneratePassword.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/GeneratePassword.json */ /** * Sample code: Generate Password. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsGetSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsGetSamples.java index 9b49a686cf00..7821bb49e2b6 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsGetSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsGetSamples.java @@ -9,7 +9,7 @@ /** Samples for ArcSettings Get. */ public final class ArcSettingsGetSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/GetArcSetting.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/GetArcSetting.json */ /** * Sample code: Get ArcSetting. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsListByClusterSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsListByClusterSamples.java index 840759606cea..72d59f84c4ee 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsListByClusterSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsListByClusterSamples.java @@ -9,7 +9,7 @@ /** Samples for ArcSettings ListByCluster. */ public final class ArcSettingsListByClusterSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/ListArcSettingsByCluster.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/ListArcSettingsByCluster.json */ /** * Sample code: List ArcSetting resources by HCI Cluster. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsUpdateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsUpdateSamples.java index bfc08f7891a4..0b9114541228 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsUpdateSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsUpdateSamples.java @@ -13,7 +13,7 @@ /** Samples for ArcSettings Update. */ public final class ArcSettingsUpdateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/PatchArcSetting.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/PatchArcSetting.json */ /** * Sample code: Patch ArcSetting. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersCreateIdentitySamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersCreateIdentitySamples.java index 076cc9c75fbc..e9397474a7df 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersCreateIdentitySamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersCreateIdentitySamples.java @@ -9,7 +9,7 @@ /** Samples for Clusters CreateIdentity. */ public final class ClustersCreateIdentitySamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/CreateClusterIdentity.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/CreateClusterIdentity.json */ /** * Sample code: Create cluster Identity. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersCreateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersCreateSamples.java index 2e5a4bc4c68c..b77e0de3164a 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersCreateSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersCreateSamples.java @@ -4,10 +4,12 @@ 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/2022-05-01/examples/CreateCluster.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/CreateCluster.json */ /** * Sample code: Create cluster. @@ -20,6 +22,7 @@ public static void createCluster(com.azure.resourcemanager.azurestackhci.AzureSt .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") diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersDeleteSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersDeleteSamples.java index 087f8a22c28b..f19210fa0f98 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersDeleteSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersDeleteSamples.java @@ -9,7 +9,7 @@ /** Samples for Clusters Delete. */ public final class ClustersDeleteSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/DeleteCluster.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/DeleteCluster.json */ /** * Sample code: Delete cluster. 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..85803cfb5ad9 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersExtendSoftwareAssuranceBenefitSamples.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.core.util.Context; +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/2022-10-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)), + 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 index fb08e4f84c92..22410723e503 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersGetByResourceGroupSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersGetByResourceGroupSamples.java @@ -9,7 +9,7 @@ /** Samples for Clusters GetByResourceGroup. */ public final class ClustersGetByResourceGroupSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/GetCluster.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/GetCluster.json */ /** * Sample code: Get cluster. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersListByResourceGroupSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersListByResourceGroupSamples.java index 3bdd3e760971..86bb7e84f549 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersListByResourceGroupSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersListByResourceGroupSamples.java @@ -9,7 +9,7 @@ /** Samples for Clusters ListByResourceGroup. */ public final class ClustersListByResourceGroupSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/ListClustersByResourceGroup.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/ListClustersByResourceGroup.json */ /** * Sample code: List clusters in a given resource group. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersListSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersListSamples.java index 2d619de3c166..83635de45abd 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersListSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersListSamples.java @@ -9,7 +9,7 @@ /** Samples for Clusters List. */ public final class ClustersListSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/ListClustersBySubscription.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/ListClustersBySubscription.json */ /** * Sample code: List clusters in a given subscription. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersUpdateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersUpdateSamples.java index 0604ed772ffc..b2df21ab6fa5 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersUpdateSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersUpdateSamples.java @@ -8,6 +8,7 @@ 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; @@ -15,7 +16,7 @@ /** Samples for Clusters Update. */ public final class ClustersUpdateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/UpdateCluster.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/UpdateCluster.json */ /** * Sample code: Update cluster. @@ -28,6 +29,7 @@ public static void updateCluster(com.azure.resourcemanager.azurestackhci.AzureSt resource .update() .withTags(mapOf("tag1", "value1", "tag2", "value2")) + .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) .withCloudManagementEndpoint("https://98294836-31be-4668-aeae-698667faf99b.waconazure.com") .withDesiredProperties( new ClusterDesiredProperties() diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersUploadCertificateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersUploadCertificateSamples.java index e0b951ddce12..bfd1767e1e4a 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersUploadCertificateSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersUploadCertificateSamples.java @@ -12,7 +12,7 @@ /** Samples for Clusters UploadCertificate. */ public final class ClustersUploadCertificateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/UploadCertificate.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/UploadCertificate.json */ /** * Sample code: Upload certificate. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsCreateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsCreateSamples.java index b25518c9e877..4c81cb5c84af 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsCreateSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsCreateSamples.java @@ -11,7 +11,7 @@ /** Samples for Extensions Create. */ public final class ExtensionsCreateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/PutExtension.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/PutExtension.json */ /** * Sample code: Create Arc Extension. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsDeleteSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsDeleteSamples.java index e89be94c7633..9f6c5f92960a 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsDeleteSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsDeleteSamples.java @@ -9,7 +9,7 @@ /** Samples for Extensions Delete. */ public final class ExtensionsDeleteSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/DeleteExtension.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/DeleteExtension.json */ /** * Sample code: Delete Arc Extension. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsGetSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsGetSamples.java index 6cf05532d264..74cf84cadf92 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsGetSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsGetSamples.java @@ -9,7 +9,7 @@ /** Samples for Extensions Get. */ public final class ExtensionsGetSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/GetExtension.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/GetExtension.json */ /** * Sample code: Get ArcSettings Extension. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsListByArcSettingSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsListByArcSettingSamples.java index 8206a6b61cd7..65e3d8612612 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsListByArcSettingSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsListByArcSettingSamples.java @@ -9,7 +9,7 @@ /** Samples for Extensions ListByArcSetting. */ public final class ExtensionsListByArcSettingSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/ListExtensionsByArcSetting.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/ListExtensionsByArcSetting.json */ /** * Sample code: List Extensions under ArcSetting resource. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsUpdateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsUpdateSamples.java index 382bea80ca75..6f905518861f 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsUpdateSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsUpdateSamples.java @@ -13,7 +13,7 @@ /** Samples for Extensions Update. */ public final class ExtensionsUpdateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/PatchExtension.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/PatchExtension.json */ /** * Sample code: Update Arc Extension. 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..ec7cb10c1f86 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/OffersGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +import com.azure.core.util.Context; + +/** Samples for Offers Get. */ +public final class OffersGetSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-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, 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..faccfa230ae9 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/OffersListByClusterSamples.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; + +import com.azure.core.util.Context; + +/** Samples for Offers ListByCluster. */ +public final class OffersListByClusterSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-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, 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..c9b86379a055 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/OffersListByPublisherSamples.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; + +import com.azure.core.util.Context; + +/** Samples for Offers ListByPublisher. */ +public final class OffersListByPublisherSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-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, 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 7dc158cda4c3..8461e462d3ad 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 @@ -9,7 +9,7 @@ /** Samples for Operations List. */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/ListOperations.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-01/examples/ListOperations.json */ /** * Sample code: Create cluster. 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..e103fb5b4495 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/PublishersGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +import com.azure.core.util.Context; + +/** Samples for Publishers Get. */ +public final class PublishersGetSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-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", 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..b36ee0ac0da8 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/PublishersListByClusterSamples.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; + +import com.azure.core.util.Context; + +/** Samples for Publishers ListByCluster. */ +public final class PublishersListByClusterSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-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", 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..8d78a01bb962 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/SkusGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +import com.azure.core.util.Context; + +/** Samples for Skus Get. */ +public final class SkusGetSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-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, 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..fc45d7868dd2 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/SkusListByOfferSamples.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; + +import com.azure.core.util.Context; + +/** Samples for Skus ListByOffer. */ +public final class SkusListByOfferSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-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, 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..735c7fc11f45 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunsGetSamples.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; + +import com.azure.core.util.Context; + +/** Samples for UpdateRuns Get. */ +public final class UpdateRunsGetSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-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", 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..8bd8db18ea4b --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunsListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for UpdateRuns List. */ +public final class UpdateRunsListSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-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", 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..4b497cc97d3e --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateSummariesOperationGetSamples.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; + +import com.azure.core.util.Context; + +/** Samples for UpdateSummariesOperation Get. */ +public final class UpdateSummariesOperationGetSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-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", 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..368ce4917649 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateSummariesOperationListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for UpdateSummariesOperation List. */ +public final class UpdateSummariesOperationListSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-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", 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..41fb65b92047 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +import com.azure.core.util.Context; + +/** Samples for Updates Get. */ +public final class UpdatesGetSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-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", 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..9b52f33eb16d --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +import com.azure.core.util.Context; + +/** Samples for Updates List. */ +public final class UpdatesListSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-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", 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..0a62c26dc246 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesPostSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +import com.azure.core.util.Context; + +/** Samples for Updates Post. */ +public final class UpdatesPostSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-10-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", Context.NONE); + } +}