diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/CHANGELOG.md b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/CHANGELOG.md index 7c9638cae4706..4cb5fa4df0bd1 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/CHANGELOG.md +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/CHANGELOG.md @@ -1,7 +1,8 @@ # Release History -## 1.0.0-beta.2 (Unreleased) +## 1.0.0-beta.1 (2022-04-12) +- 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-03. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## 1.0.0-beta.1 (2021-04-12) diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/README.md b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/README.md index 70d752936ae75..8e86da021e445 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-2020-10. 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-03. 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.1 + 1.0.0-beta.2 ``` [//]: # ({x-version-update-end}) @@ -74,6 +74,9 @@ See [API design][design] for general introduction on design and key concepts on ## Examples +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/azurestackhci/azure-resourcemanager-azurestackhci/SAMPLE.md) + + ## Troubleshooting ## Next steps diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/SAMPLE.md b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/SAMPLE.md new file mode 100644 index 0000000000000..fafb4de0cdaa2 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/SAMPLE.md @@ -0,0 +1,539 @@ +# Code snippets and samples + + +## ArcSettings + +- [Create](#arcsettings_create) +- [CreateIdentity](#arcsettings_createidentity) +- [Delete](#arcsettings_delete) +- [GeneratePassword](#arcsettings_generatepassword) +- [Get](#arcsettings_get) +- [ListByCluster](#arcsettings_listbycluster) + +## Clusters + +- [Create](#clusters_create) +- [CreateIdentity](#clusters_createidentity) +- [Delete](#clusters_delete) +- [GetByResourceGroup](#clusters_getbyresourcegroup) +- [List](#clusters_list) +- [ListByResourceGroup](#clusters_listbyresourcegroup) +- [Update](#clusters_update) +- [UploadCertificate](#clusters_uploadcertificate) + +## Extensions + +- [Create](#extensions_create) +- [Delete](#extensions_delete) +- [Get](#extensions_get) +- [ListByArcSetting](#extensions_listbyarcsetting) +- [Update](#extensions_update) + +## Operations + +- [List](#operations_list) +### ArcSettings_Create + +```java +/** Samples for ArcSettings Create. */ +public final class ArcSettingsCreateSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-03-01/examples/PutArcSetting.json + */ + /** + * Sample code: Create ArcSetting. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void createArcSetting(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.arcSettings().define("default").withExistingCluster("test-rg", "myCluster").create(); + } +} +``` + +### ArcSettings_CreateIdentity + +```java +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-03-01/examples/CreateArcIdentity.json + */ + /** + * Sample code: Create Arc Identity. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void createArcIdentity(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.arcSettings().createIdentity("test-rg", "myCluster", "default", Context.NONE); + } +} +``` + +### ArcSettings_Delete + +```java +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-03-01/examples/DeleteArcSetting.json + */ + /** + * Sample code: Delete ArcSetting. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void deleteArcSetting(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.arcSettings().delete("test-rg", "myCluster", "default", Context.NONE); + } +} +``` + +### ArcSettings_GeneratePassword + +```java +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-03-01/examples/GeneratePassword.json + */ + /** + * Sample code: Generate Password. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void generatePassword(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.arcSettings().generatePasswordWithResponse("test-rg", "myCluster", "default", Context.NONE); + } +} +``` + +### ArcSettings_Get + +```java +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-03-01/examples/GetArcSetting.json + */ + /** + * Sample code: Get ArcSetting. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getArcSetting(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.arcSettings().getWithResponse("test-rg", "myCluster", "default", Context.NONE); + } +} +``` + +### ArcSettings_ListByCluster + +```java +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-03-01/examples/ListArcSettingsByCluster.json + */ + /** + * Sample code: List ArcSetting resources by HCI Cluster. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listArcSettingResourcesByHCICluster( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.arcSettings().listByCluster("test-rg", "myCluster", Context.NONE); + } +} +``` + +### Clusters_Create + +```java +/** Samples for Clusters Create. */ +public final class ClustersCreateSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-03-01/examples/CreateCluster.json + */ + /** + * Sample code: Create cluster. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void createCluster(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .clusters() + .define("myCluster") + .withRegion("East US") + .withExistingResourceGroup("test-rg") + .withCloudManagementEndpoint("https://98294836-31be-4668-aeae-698667faf99b.waconazure.com") + .withAadClientId("24a6e53d-04e5-44d2-b7cc-1b732a847dfc") + .withAadTenantId("7e589cc1-a8b6-4dff-91bd-5ec0fa18db94") + .create(); + } +} +``` + +### Clusters_CreateIdentity + +```java +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-03-01/examples/CreateClusterIdentity.json + */ + /** + * Sample code: Create cluster Identity. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void createClusterIdentity(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.clusters().createIdentity("test-rg", "myCluster", Context.NONE); + } +} +``` + +### Clusters_Delete + +```java +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-03-01/examples/DeleteCluster.json + */ + /** + * Sample code: Delete cluster. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void deleteCluster(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.clusters().deleteWithResponse("test-rg", "myCluster", Context.NONE); + } +} +``` + +### Clusters_GetByResourceGroup + +```java +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-03-01/examples/GetCluster.json + */ + /** + * Sample code: Get cluster. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getCluster(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.clusters().getByResourceGroupWithResponse("test-rg", "myCluster", Context.NONE); + } +} +``` + +### Clusters_List + +```java +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-03-01/examples/ListClustersBySubscription.json + */ + /** + * Sample code: List clusters in a given subscription. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listClustersInAGivenSubscription( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.clusters().list(Context.NONE); + } +} +``` + +### Clusters_ListByResourceGroup + +```java +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-03-01/examples/ListClustersByResourceGroup.json + */ + /** + * Sample code: List clusters in a given resource group. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listClustersInAGivenResourceGroup( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.clusters().listByResourceGroup("test-rg", Context.NONE); + } +} +``` + +### Clusters_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.models.Cluster; +import com.azure.resourcemanager.azurestackhci.models.ClusterDesiredProperties; +import com.azure.resourcemanager.azurestackhci.models.DiagnosticLevel; +import com.azure.resourcemanager.azurestackhci.models.WindowsServerSubscription; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Clusters Update. */ +public final class ClustersUpdateSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-03-01/examples/UpdateCluster.json + */ + /** + * Sample code: Update cluster. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void updateCluster(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + Cluster resource = + manager.clusters().getByResourceGroupWithResponse("test-rg", "myCluster", Context.NONE).getValue(); + resource + .update() + .withTags(mapOf("tag1", "value1", "tag2", "value2")) + .withCloudManagementEndpoint("https://98294836-31be-4668-aeae-698667faf99b.waconazure.com") + .withDesiredProperties( + new ClusterDesiredProperties() + .withWindowsServerSubscription(WindowsServerSubscription.ENABLED) + .withDiagnosticLevel(DiagnosticLevel.BASIC)) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Clusters_UploadCertificate + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.models.RawCertificateData; +import com.azure.resourcemanager.azurestackhci.models.UploadCertificateRequest; +import java.util.Arrays; + +/** Samples for Clusters UploadCertificate. */ +public final class ClustersUploadCertificateSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-03-01/examples/UploadCertificate.json + */ + /** + * Sample code: Upload certificate. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void uploadCertificate(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .clusters() + .uploadCertificate( + "test-rg", + "myCluster", + new UploadCertificateRequest() + .withProperties( + new RawCertificateData().withCertificates(Arrays.asList("base64cert", "base64cert"))), + Context.NONE); + } +} +``` + +### Extensions_Create + +```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import java.io.IOException; + +/** Samples for Extensions Create. */ +public final class ExtensionsCreateSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-03-01/examples/PutExtension.json + */ + /** + * Sample code: Create Arc Extension. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void createArcExtension(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) + throws IOException { + manager + .extensions() + .define("MicrosoftMonitoringAgent") + .withExistingArcSetting("test-rg", "myCluster", "default") + .withPublisher("Microsoft.Compute") + .withTypePropertiesType("MicrosoftMonitoringAgent") + .withTypeHandlerVersion("1.10") + .withSettings( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{\"workspaceId\":\"xx\"}", Object.class, SerializerEncoding.JSON)) + .withProtectedSettings( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{\"workspaceKey\":\"xx\"}", Object.class, SerializerEncoding.JSON)) + .create(); + } +} +``` + +### Extensions_Delete + +```java +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-03-01/examples/DeleteExtension.json + */ + /** + * Sample code: Delete Arc Extension. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void deleteArcExtension(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.extensions().delete("test-rg", "myCluster", "default", "MicrosoftMonitoringAgent", Context.NONE); + } +} +``` + +### Extensions_Get + +```java +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-03-01/examples/GetExtension.json + */ + /** + * Sample code: Get ArcSettings Extension. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getArcSettingsExtension(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .extensions() + .getWithResponse("test-rg", "myCluster", "default", "MicrosoftMonitoringAgent", Context.NONE); + } +} +``` + +### Extensions_ListByArcSetting + +```java +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-03-01/examples/ListExtensionsByArcSetting.json + */ + /** + * Sample code: List Extensions under ArcSetting resource. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listExtensionsUnderArcSettingResource( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.extensions().listByArcSetting("test-rg", "myCluster", "default", Context.NONE); + } +} +``` + +### Extensions_Update + +```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.Context; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.azurestackhci.models.Extension; +import java.io.IOException; + +/** Samples for Extensions Update. */ +public final class ExtensionsUpdateSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-03-01/examples/PatchExtension.json + */ + /** + * Sample code: Update Arc Extension. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void updateArcExtension(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) + throws IOException { + Extension resource = + manager + .extensions() + .getWithResponse("test-rg", "myCluster", "default", "MicrosoftMonitoringAgent", Context.NONE) + .getValue(); + resource + .update() + .withPublisher("Microsoft.Compute") + .withTypePropertiesType("MicrosoftMonitoringAgent") + .withTypeHandlerVersion("1.10") + .withSettings( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{\"workspaceId\":\"xx\"}", Object.class, SerializerEncoding.JSON)) + .apply(); + } +} +``` + +### Operations_List + +```java +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-03-01/examples/ListOperations.json + */ + /** + * Sample code: Create cluster. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void createCluster(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.operations().listWithResponse(Context.NONE); + } +} +``` + diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/pom.xml b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/pom.xml index d87c80d74c0b1..5102b78b0129b 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/pom.xml +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/pom.xml @@ -1,55 +1,55 @@ - 4.0.0 - - com.azure - azure-client-sdk-parent - 1.7.0 - ../../parents/azure-client-sdk-parent - + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + - com.azure.resourcemanager - azure-resourcemanager-azurestackhci - 1.0.0-beta.2 - jar + com.azure.resourcemanager + azure-resourcemanager-azurestackhci + 1.0.0-beta.2 + 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-2020-10. - https://github.com/Azure/azure-sdk-for-java + 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-03. + https://github.com/Azure/azure-sdk-for-java - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - repo - - + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + - - https://github.com/Azure/azure-sdk-for-java - scm:git:git@github.com:Azure/azure-sdk-for-java.git - scm:git:git@github.com:Azure/azure-sdk-for-java.git - HEAD - - - - microsoft - Microsoft - - - - UTF-8 - true - - - - com.azure - azure-core - 1.27.0 - - - com.azure - azure-core-management - 1.5.4 - - + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + true + + + + com.azure + azure-core + 1.27.0 + + + com.azure + azure-core-management + 1.5.4 + + 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 3e48e353084b4..d53b1c80d53ed 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 @@ -8,36 +8,48 @@ import com.azure.core.http.HttpClient; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; import com.azure.core.http.policy.HttpPipelinePolicy; import com.azure.core.http.policy.HttpPolicyProviders; import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.azurestackhci.fluent.AzureStackHciClient; +import com.azure.resourcemanager.azurestackhci.implementation.ArcSettingsImpl; import com.azure.resourcemanager.azurestackhci.implementation.AzureStackHciClientBuilder; import com.azure.resourcemanager.azurestackhci.implementation.ClustersImpl; +import com.azure.resourcemanager.azurestackhci.implementation.ExtensionsImpl; import com.azure.resourcemanager.azurestackhci.implementation.OperationsImpl; +import com.azure.resourcemanager.azurestackhci.models.ArcSettings; import com.azure.resourcemanager.azurestackhci.models.Clusters; +import com.azure.resourcemanager.azurestackhci.models.Extensions; import com.azure.resourcemanager.azurestackhci.models.Operations; import java.time.Duration; import java.time.temporal.ChronoUnit; import java.util.ArrayList; import java.util.List; import java.util.Objects; +import java.util.stream.Collectors; /** Entry point to AzureStackHciManager. Azure Stack HCI management service. */ public final class AzureStackHciManager { - private Operations operations; + private ArcSettings arcSettings; private Clusters clusters; + private Extensions extensions; + + private Operations operations; + private final AzureStackHciClient clientObject; private AzureStackHciManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { @@ -65,6 +77,19 @@ public static AzureStackHciManager authenticate(TokenCredential credential, Azur return configure().authenticate(credential, profile); } + /** + * Creates an instance of AzureStackHci service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the AzureStackHci service API instance. + */ + public static AzureStackHciManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new AzureStackHciManager(httpPipeline, profile, null); + } + /** * Gets a Configurable instance that can be used to create AzureStackHciManager with optional configuration. * @@ -76,12 +101,14 @@ public static Configurable configure() { /** The Configurable allowing configurations to be set. */ public static final class Configurable { - private final ClientLogger logger = new ClientLogger(Configurable.class); + private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); private HttpClient httpClient; private HttpLogOptions httpLogOptions; private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); private RetryPolicy retryPolicy; + private RetryOptions retryOptions; private Duration defaultPollInterval; private Configurable() { @@ -120,6 +147,17 @@ public Configurable withPolicy(HttpPipelinePolicy policy) { return this; } + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + /** * Sets the retry policy to the HTTP pipeline. * @@ -131,6 +169,19 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) { return this; } + /** + * Sets the retry options for the HTTP pipeline retry policy. + * + *

This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + * + * @param retryOptions the retry options for the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryOptions(RetryOptions retryOptions) { + this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null."); + return this; + } + /** * Sets the default poll interval, used when service does not provide "Retry-After" header. * @@ -138,9 +189,11 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) { * @return the configurable object itself. */ public Configurable withDefaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null."); + this.defaultPollInterval = + Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); if (this.defaultPollInterval.isNegative()) { - throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative")); + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); } return this; } @@ -176,20 +229,38 @@ public AzureStackHciManager authenticate(TokenCredential credential, AzureProfil userAgentBuilder.append(" (auto-generated)"); } + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } if (retryPolicy == null) { - retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + if (retryOptions != null) { + retryPolicy = new RetryPolicy(retryOptions); + } else { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } } List policies = new ArrayList<>(); policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new AddHeadersFromContextPolicy()); policies.add(new RequestIdPolicy()); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); policies - .add( - new BearerTokenAuthenticationPolicy( - credential, profile.getEnvironment().getManagementEndpoint() + "/.default")); - policies.addAll(this.policies); + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); HttpPipeline httpPipeline = @@ -201,12 +272,12 @@ public AzureStackHciManager authenticate(TokenCredential credential, AzureProfil } } - /** @return Resource collection API of Operations. */ - public Operations operations() { - if (this.operations == null) { - this.operations = new OperationsImpl(clientObject.getOperations(), this); + /** @return Resource collection API of ArcSettings. */ + public ArcSettings arcSettings() { + if (this.arcSettings == null) { + this.arcSettings = new ArcSettingsImpl(clientObject.getArcSettings(), this); } - return operations; + return arcSettings; } /** @return Resource collection API of Clusters. */ @@ -217,6 +288,22 @@ public Clusters clusters() { return clusters; } + /** @return Resource collection API of Extensions. */ + public Extensions extensions() { + if (this.extensions == null) { + this.extensions = new ExtensionsImpl(clientObject.getExtensions(), this); + } + return extensions; + } + + /** @return Resource collection API of Operations. */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + /** * @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 new file mode 100644 index 0000000000000..b10ed359d2d75 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/ArcSettingsClient.java @@ -0,0 +1,261 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.azurestackhci.fluent.models.ArcIdentityResponseInner; +import com.azure.resourcemanager.azurestackhci.fluent.models.ArcSettingInner; +import com.azure.resourcemanager.azurestackhci.fluent.models.PasswordCredentialInner; + +/** An instance of this class provides access to all the operations defined in ArcSettingsClient. */ +public interface ArcSettingsClient { + /** + * Get ArcSetting resources of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting resources of HCI Cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByCluster(String resourceGroupName, String clusterName); + + /** + * Get ArcSetting resources of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting resources of HCI Cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByCluster(String resourceGroupName, String clusterName, Context context); + + /** + * Get ArcSetting resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting resource details of HCI Cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String clusterName, String arcSettingName, Context context); + + /** + * Create ArcSetting for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param arcSetting Parameters supplied to the Create ArcSetting resource for this HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ArcSettingInner create( + String resourceGroupName, String clusterName, String arcSettingName, ArcSettingInner arcSetting); + + /** + * Create ArcSetting for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param arcSetting Parameters supplied to the Create ArcSetting resource for this HCI cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse( + String resourceGroupName, + String clusterName, + String arcSettingName, + ArcSettingInner arcSetting, + Context context); + + /** + * Delete ArcSetting resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, String arcSettingName); + + /** + * Delete ArcSetting resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String clusterName, String arcSettingName, Context context); + + /** + * Delete ArcSetting resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String clusterName, String arcSettingName); + + /** + * Delete ArcSetting resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String clusterName, String arcSettingName, Context context); + + /** + * Generate password for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PasswordCredentialInner generatePassword(String resourceGroupName, String clusterName, String arcSettingName); + + /** + * Generate password for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response generatePasswordWithResponse( + String resourceGroupName, String clusterName, String arcSettingName, Context context); + + /** + * Create Aad identity for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of arcIdentity details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ArcIdentityResponseInner> beginCreateIdentity( + String resourceGroupName, String clusterName, String arcSettingName); + + /** + * Create Aad identity for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of arcIdentity details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ArcIdentityResponseInner> beginCreateIdentity( + String resourceGroupName, String clusterName, String arcSettingName, Context context); + + /** + * Create Aad identity for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcIdentity details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ArcIdentityResponseInner createIdentity(String resourceGroupName, String clusterName, String arcSettingName); + + /** + * Create Aad identity for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcIdentity details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ArcIdentityResponseInner createIdentity( + String resourceGroupName, String clusterName, String arcSettingName, Context context); +} 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 277e14ea65dbb..bb51fe0bea47c 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/AzureStackHciClient.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/AzureStackHciClient.java @@ -45,11 +45,11 @@ public interface AzureStackHciClient { Duration getDefaultPollInterval(); /** - * Gets the OperationsClient object to access its operations. + * Gets the ArcSettingsClient object to access its operations. * - * @return the OperationsClient object. + * @return the ArcSettingsClient object. */ - OperationsClient getOperations(); + ArcSettingsClient getArcSettings(); /** * Gets the ClustersClient object to access its operations. @@ -57,4 +57,18 @@ public interface AzureStackHciClient { * @return the ClustersClient object. */ ClustersClient getClusters(); + + /** + * Gets the ExtensionsClient object to access its operations. + * + * @return the ExtensionsClient object. + */ + ExtensionsClient getExtensions(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); } 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 b1023e2021f41..e150bf9449f82 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 @@ -8,9 +8,13 @@ import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.azurestackhci.fluent.models.ClusterIdentityResponseInner; import com.azure.resourcemanager.azurestackhci.fluent.models.ClusterInner; -import com.azure.resourcemanager.azurestackhci.models.ClusterUpdate; +import com.azure.resourcemanager.azurestackhci.models.ClusterPatch; +import com.azure.resourcemanager.azurestackhci.models.UploadCertificateRequest; /** An instance of this class provides access to all the operations defined in ClustersClient. */ public interface ClustersClient { @@ -19,7 +23,7 @@ public interface ClustersClient { * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of clusters. + * @return list of clusters as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -31,7 +35,7 @@ public interface ClustersClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of clusters. + * @return list of clusters as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); @@ -43,7 +47,7 @@ public interface ClustersClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of clusters. + * @return list of clusters as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName); @@ -56,7 +60,7 @@ public interface ClustersClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of clusters. + * @return list of clusters as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName, Context context); @@ -83,7 +87,7 @@ public interface ClustersClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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) Response getByResourceGroupWithResponse( @@ -113,7 +117,7 @@ Response getByResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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) Response createWithResponse( @@ -131,7 +135,7 @@ Response createWithResponse( * @return cluster details. */ @ServiceMethod(returns = ReturnType.SINGLE) - ClusterInner update(String resourceGroupName, String clusterName, ClusterUpdate cluster); + ClusterInner update(String resourceGroupName, String clusterName, ClusterPatch cluster); /** * Update an HCI cluster. @@ -143,11 +147,11 @@ Response createWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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) Response updateWithResponse( - String resourceGroupName, String clusterName, ClusterUpdate cluster, Context context); + String resourceGroupName, String clusterName, ClusterPatch cluster, Context context); /** * Delete an HCI cluster. @@ -170,8 +174,130 @@ Response updateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response deleteWithResponse(String resourceGroupName, String clusterName, Context context); + + /** + * Upload certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param uploadCertificateRequest Upload certificate request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginUploadCertificate( + String resourceGroupName, String clusterName, UploadCertificateRequest uploadCertificateRequest); + + /** + * Upload certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param uploadCertificateRequest Upload certificate request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginUploadCertificate( + String resourceGroupName, + String clusterName, + UploadCertificateRequest uploadCertificateRequest, + Context context); + + /** + * Upload certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param uploadCertificateRequest Upload certificate request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void uploadCertificate( + String resourceGroupName, String clusterName, UploadCertificateRequest uploadCertificateRequest); + + /** + * Upload certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param uploadCertificateRequest Upload certificate request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void uploadCertificate( + String resourceGroupName, + String clusterName, + UploadCertificateRequest uploadCertificateRequest, + Context context); + + /** + * Create cluster identity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of cluster Identity details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ClusterIdentityResponseInner> beginCreateIdentity( + String resourceGroupName, String clusterName); + + /** + * Create cluster identity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of cluster Identity details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ClusterIdentityResponseInner> beginCreateIdentity( + String resourceGroupName, String clusterName, Context context); + + /** + * Create cluster identity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster Identity details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterIdentityResponseInner createIdentity(String resourceGroupName, String clusterName); + + /** + * Create cluster identity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster Identity details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterIdentityResponseInner createIdentity(String resourceGroupName, String clusterName, Context context); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/ExtensionsClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/ExtensionsClient.java new file mode 100644 index 0000000000000..d9662370c2a31 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/ExtensionsClient.java @@ -0,0 +1,318 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.azurestackhci.fluent.models.ExtensionInner; + +/** An instance of this class provides access to all the operations defined in ExtensionsClient. */ +public interface ExtensionsClient { + /** + * List all Extensions under ArcSetting resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Extensions in HCI cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByArcSetting(String resourceGroupName, String clusterName, String arcSettingName); + + /** + * List all Extensions under ArcSetting resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Extensions in HCI cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByArcSetting( + String resourceGroupName, String clusterName, String arcSettingName, Context context); + + /** + * Get particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return particular Arc Extension of HCI Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExtensionInner get(String resourceGroupName, String clusterName, String arcSettingName, String extensionName); + + /** + * Get particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return particular Arc Extension of HCI Cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String clusterName, String arcSettingName, String extensionName, Context context); + + /** + * Create Extension for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extension Details of the Machine Extension to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of details of a particular extension in HCI Cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ExtensionInner> beginCreate( + String resourceGroupName, + String clusterName, + String arcSettingName, + String extensionName, + ExtensionInner extension); + + /** + * Create Extension for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extension Details of the Machine Extension to be created. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of details of a particular extension in HCI Cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ExtensionInner> beginCreate( + String resourceGroupName, + String clusterName, + String arcSettingName, + String extensionName, + ExtensionInner extension, + Context context); + + /** + * Create Extension for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extension Details of the Machine Extension to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of a particular extension in HCI Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExtensionInner create( + String resourceGroupName, + String clusterName, + String arcSettingName, + String extensionName, + ExtensionInner extension); + + /** + * Create Extension for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extension Details of the Machine Extension to be created. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of a particular extension in HCI Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExtensionInner create( + String resourceGroupName, + String clusterName, + String arcSettingName, + String extensionName, + ExtensionInner extension, + Context context); + + /** + * Update Extension for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extension Details of the Machine Extension to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of details of a particular extension in HCI Cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ExtensionInner> beginUpdate( + String resourceGroupName, + String clusterName, + String arcSettingName, + String extensionName, + ExtensionInner extension); + + /** + * Update Extension for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extension Details of the Machine Extension to be created. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of details of a particular extension in HCI Cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ExtensionInner> beginUpdate( + String resourceGroupName, + String clusterName, + String arcSettingName, + String extensionName, + ExtensionInner extension, + Context context); + + /** + * Update Extension for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extension Details of the Machine Extension to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of a particular extension in HCI Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExtensionInner update( + String resourceGroupName, + String clusterName, + String arcSettingName, + String extensionName, + ExtensionInner extension); + + /** + * Update Extension for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extension Details of the Machine Extension to be created. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of a particular extension in HCI Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExtensionInner update( + String resourceGroupName, + String clusterName, + String arcSettingName, + String extensionName, + ExtensionInner extension, + Context context); + + /** + * Delete particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String clusterName, String arcSettingName, String extensionName); + + /** + * Delete particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String clusterName, String arcSettingName, String extensionName, Context context); + + /** + * Delete particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String clusterName, String arcSettingName, String extensionName); + + /** + * Delete particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete( + String resourceGroupName, String clusterName, String arcSettingName, String extensionName, Context context); +} 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 6a1af013a2fbc..0b8e907abe681 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 @@ -8,7 +8,7 @@ import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -import com.azure.resourcemanager.azurestackhci.fluent.models.AvailableOperationsInner; +import com.azure.resourcemanager.azurestackhci.fluent.models.OperationListResultInner; /** An instance of this class provides access to all the operations defined in OperationsClient. */ public interface OperationsClient { @@ -17,10 +17,10 @@ public interface OperationsClient { * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return available operations of the service. + * @return a list of REST API operations supported by an Azure Resource Provider. */ @ServiceMethod(returns = ReturnType.SINGLE) - AvailableOperationsInner list(); + OperationListResultInner list(); /** * List all available Microsoft.AzureStackHCI provider operations. @@ -29,8 +29,8 @@ public interface OperationsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return available operations of the service. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse(Context context); + Response listWithResponse(Context context); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcIdentityResponseInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcIdentityResponseInner.java new file mode 100644 index 0000000000000..909acd05b51ed --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcIdentityResponseInner.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** ArcIdentity details. */ +@Immutable +public final class ArcIdentityResponseInner { + /* + * ArcIdentity properties. + */ + @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) + private ArcIdentityResponseProperties innerProperties; + + /** + * Get the innerProperties property: ArcIdentity properties. + * + * @return the innerProperties value. + */ + private ArcIdentityResponseProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the arcApplicationClientId property: The arcApplicationClientId property. + * + * @return the arcApplicationClientId value. + */ + public String arcApplicationClientId() { + return this.innerProperties() == null ? null : this.innerProperties().arcApplicationClientId(); + } + + /** + * Set the arcApplicationClientId property: The arcApplicationClientId property. + * + * @param arcApplicationClientId the arcApplicationClientId value to set. + * @return the ArcIdentityResponseInner object itself. + */ + public ArcIdentityResponseInner withArcApplicationClientId(String arcApplicationClientId) { + if (this.innerProperties() == null) { + this.innerProperties = new ArcIdentityResponseProperties(); + } + this.innerProperties().withArcApplicationClientId(arcApplicationClientId); + return this; + } + + /** + * Get the arcApplicationTenantId property: The arcApplicationTenantId property. + * + * @return the arcApplicationTenantId value. + */ + public String arcApplicationTenantId() { + return this.innerProperties() == null ? null : this.innerProperties().arcApplicationTenantId(); + } + + /** + * Set the arcApplicationTenantId property: The arcApplicationTenantId property. + * + * @param arcApplicationTenantId the arcApplicationTenantId value to set. + * @return the ArcIdentityResponseInner object itself. + */ + public ArcIdentityResponseInner withArcApplicationTenantId(String arcApplicationTenantId) { + if (this.innerProperties() == null) { + this.innerProperties = new ArcIdentityResponseProperties(); + } + this.innerProperties().withArcApplicationTenantId(arcApplicationTenantId); + return this; + } + + /** + * Get the arcServicePrincipalObjectId property: The arcServicePrincipalObjectId property. + * + * @return the arcServicePrincipalObjectId value. + */ + public String arcServicePrincipalObjectId() { + return this.innerProperties() == null ? null : this.innerProperties().arcServicePrincipalObjectId(); + } + + /** + * Set the arcServicePrincipalObjectId property: The arcServicePrincipalObjectId property. + * + * @param arcServicePrincipalObjectId the arcServicePrincipalObjectId value to set. + * @return the ArcIdentityResponseInner object itself. + */ + public ArcIdentityResponseInner withArcServicePrincipalObjectId(String arcServicePrincipalObjectId) { + if (this.innerProperties() == null) { + this.innerProperties = new ArcIdentityResponseProperties(); + } + this.innerProperties().withArcServicePrincipalObjectId(arcServicePrincipalObjectId); + return this; + } + + /** + * Get the arcApplicationObjectId property: The arcApplicationObjectId property. + * + * @return the arcApplicationObjectId value. + */ + public String arcApplicationObjectId() { + return this.innerProperties() == null ? null : this.innerProperties().arcApplicationObjectId(); + } + + /** + * Set the arcApplicationObjectId property: The arcApplicationObjectId property. + * + * @param arcApplicationObjectId the arcApplicationObjectId value to set. + * @return the ArcIdentityResponseInner object itself. + */ + public ArcIdentityResponseInner withArcApplicationObjectId(String arcApplicationObjectId) { + if (this.innerProperties() == null) { + this.innerProperties = new ArcIdentityResponseProperties(); + } + this.innerProperties().withArcApplicationObjectId(arcApplicationObjectId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcIdentityResponseProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcIdentityResponseProperties.java new file mode 100644 index 0000000000000..5b20f4848fb72 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcIdentityResponseProperties.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ArcIdentityResponseProperties model. */ +@Fluent +public final class ArcIdentityResponseProperties { + /* + * The arcApplicationClientId property. + */ + @JsonProperty(value = "arcApplicationClientId") + private String arcApplicationClientId; + + /* + * The arcApplicationTenantId property. + */ + @JsonProperty(value = "arcApplicationTenantId") + private String arcApplicationTenantId; + + /* + * The arcServicePrincipalObjectId property. + */ + @JsonProperty(value = "arcServicePrincipalObjectId") + private String arcServicePrincipalObjectId; + + /* + * The arcApplicationObjectId property. + */ + @JsonProperty(value = "arcApplicationObjectId") + private String arcApplicationObjectId; + + /** + * Get the arcApplicationClientId property: The arcApplicationClientId property. + * + * @return the arcApplicationClientId value. + */ + public String arcApplicationClientId() { + return this.arcApplicationClientId; + } + + /** + * Set the arcApplicationClientId property: The arcApplicationClientId property. + * + * @param arcApplicationClientId the arcApplicationClientId value to set. + * @return the ArcIdentityResponseProperties object itself. + */ + public ArcIdentityResponseProperties withArcApplicationClientId(String arcApplicationClientId) { + this.arcApplicationClientId = arcApplicationClientId; + return this; + } + + /** + * Get the arcApplicationTenantId property: The arcApplicationTenantId property. + * + * @return the arcApplicationTenantId value. + */ + public String arcApplicationTenantId() { + return this.arcApplicationTenantId; + } + + /** + * Set the arcApplicationTenantId property: The arcApplicationTenantId property. + * + * @param arcApplicationTenantId the arcApplicationTenantId value to set. + * @return the ArcIdentityResponseProperties object itself. + */ + public ArcIdentityResponseProperties withArcApplicationTenantId(String arcApplicationTenantId) { + this.arcApplicationTenantId = arcApplicationTenantId; + return this; + } + + /** + * Get the arcServicePrincipalObjectId property: The arcServicePrincipalObjectId property. + * + * @return the arcServicePrincipalObjectId value. + */ + public String arcServicePrincipalObjectId() { + return this.arcServicePrincipalObjectId; + } + + /** + * Set the arcServicePrincipalObjectId property: The arcServicePrincipalObjectId property. + * + * @param arcServicePrincipalObjectId the arcServicePrincipalObjectId value to set. + * @return the ArcIdentityResponseProperties object itself. + */ + public ArcIdentityResponseProperties withArcServicePrincipalObjectId(String arcServicePrincipalObjectId) { + this.arcServicePrincipalObjectId = arcServicePrincipalObjectId; + return this; + } + + /** + * Get the arcApplicationObjectId property: The arcApplicationObjectId property. + * + * @return the arcApplicationObjectId value. + */ + public String arcApplicationObjectId() { + return this.arcApplicationObjectId; + } + + /** + * Set the arcApplicationObjectId property: The arcApplicationObjectId property. + * + * @param arcApplicationObjectId the arcApplicationObjectId value to set. + * @return the ArcIdentityResponseProperties object itself. + */ + public ArcIdentityResponseProperties withArcApplicationObjectId(String arcApplicationObjectId) { + this.arcApplicationObjectId = arcApplicationObjectId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcSettingInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcSettingInner.java new file mode 100644 index 0000000000000..281a032316792 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcSettingInner.java @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.azurestackhci.models.ArcSettingAggregateState; +import com.azure.resourcemanager.azurestackhci.models.PerNodeState; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** ArcSetting details. */ +@Fluent +public final class ArcSettingInner extends ProxyResource { + /* + * System data of ArcSetting resource + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * ArcSetting properties. + */ + @JsonProperty(value = "properties") + private ArcSettingProperties innerProperties; + + /** + * Get the systemData property: System data of ArcSetting resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the innerProperties property: ArcSetting properties. + * + * @return the innerProperties value. + */ + private ArcSettingProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the provisioningState property: Provisioning state of the ArcSetting proxy resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the arcInstanceResourceGroup property: The resource group that hosts the Arc agents, ie. Hybrid Compute + * Machine resources. + * + * @return the arcInstanceResourceGroup value. + */ + public String arcInstanceResourceGroup() { + return this.innerProperties() == null ? null : this.innerProperties().arcInstanceResourceGroup(); + } + + /** + * Set the arcInstanceResourceGroup property: The resource group that hosts the Arc agents, ie. Hybrid Compute + * Machine resources. + * + * @param arcInstanceResourceGroup the arcInstanceResourceGroup value to set. + * @return the ArcSettingInner object itself. + */ + public ArcSettingInner withArcInstanceResourceGroup(String arcInstanceResourceGroup) { + if (this.innerProperties() == null) { + this.innerProperties = new ArcSettingProperties(); + } + this.innerProperties().withArcInstanceResourceGroup(arcInstanceResourceGroup); + return this; + } + + /** + * Get the arcApplicationClientId property: App id of arc AAD identity. + * + * @return the arcApplicationClientId value. + */ + public String arcApplicationClientId() { + return this.innerProperties() == null ? null : this.innerProperties().arcApplicationClientId(); + } + + /** + * Set the arcApplicationClientId property: App id of arc AAD identity. + * + * @param arcApplicationClientId the arcApplicationClientId value to set. + * @return the ArcSettingInner object itself. + */ + public ArcSettingInner withArcApplicationClientId(String arcApplicationClientId) { + if (this.innerProperties() == null) { + this.innerProperties = new ArcSettingProperties(); + } + this.innerProperties().withArcApplicationClientId(arcApplicationClientId); + return this; + } + + /** + * Get the arcApplicationTenantId property: Tenant id of arc AAD identity. + * + * @return the arcApplicationTenantId value. + */ + public String arcApplicationTenantId() { + return this.innerProperties() == null ? null : this.innerProperties().arcApplicationTenantId(); + } + + /** + * Set the arcApplicationTenantId property: Tenant id of arc AAD identity. + * + * @param arcApplicationTenantId the arcApplicationTenantId value to set. + * @return the ArcSettingInner object itself. + */ + public ArcSettingInner withArcApplicationTenantId(String arcApplicationTenantId) { + if (this.innerProperties() == null) { + this.innerProperties = new ArcSettingProperties(); + } + this.innerProperties().withArcApplicationTenantId(arcApplicationTenantId); + return this; + } + + /** + * Get the arcServicePrincipalObjectId property: Object id of arc AAD service principal. + * + * @return the arcServicePrincipalObjectId value. + */ + public String arcServicePrincipalObjectId() { + return this.innerProperties() == null ? null : this.innerProperties().arcServicePrincipalObjectId(); + } + + /** + * Set the arcServicePrincipalObjectId property: Object id of arc AAD service principal. + * + * @param arcServicePrincipalObjectId the arcServicePrincipalObjectId value to set. + * @return the ArcSettingInner object itself. + */ + public ArcSettingInner withArcServicePrincipalObjectId(String arcServicePrincipalObjectId) { + if (this.innerProperties() == null) { + this.innerProperties = new ArcSettingProperties(); + } + this.innerProperties().withArcServicePrincipalObjectId(arcServicePrincipalObjectId); + return this; + } + + /** + * Get the arcApplicationObjectId property: Object id of arc AAD identity. + * + * @return the arcApplicationObjectId value. + */ + public String arcApplicationObjectId() { + return this.innerProperties() == null ? null : this.innerProperties().arcApplicationObjectId(); + } + + /** + * Set the arcApplicationObjectId property: Object id of arc AAD identity. + * + * @param arcApplicationObjectId the arcApplicationObjectId value to set. + * @return the ArcSettingInner object itself. + */ + public ArcSettingInner withArcApplicationObjectId(String arcApplicationObjectId) { + if (this.innerProperties() == null) { + this.innerProperties = new ArcSettingProperties(); + } + this.innerProperties().withArcApplicationObjectId(arcApplicationObjectId); + return this; + } + + /** + * Get the aggregateState property: Aggregate state of Arc agent across the nodes in this HCI cluster. + * + * @return the aggregateState value. + */ + public ArcSettingAggregateState aggregateState() { + return this.innerProperties() == null ? null : this.innerProperties().aggregateState(); + } + + /** + * Get the perNodeDetails property: State of Arc agent in each of the nodes. + * + * @return the perNodeDetails value. + */ + public List perNodeDetails() { + return this.innerProperties() == null ? null : this.innerProperties().perNodeDetails(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcSettingProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcSettingProperties.java new file mode 100644 index 0000000000000..53326e8ebb520 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcSettingProperties.java @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurestackhci.models.ArcSettingAggregateState; +import com.azure.resourcemanager.azurestackhci.models.PerNodeState; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** ArcSetting properties. */ +@Fluent +public final class ArcSettingProperties { + /* + * Provisioning state of the ArcSetting proxy resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The resource group that hosts the Arc agents, ie. Hybrid Compute Machine + * resources. + */ + @JsonProperty(value = "arcInstanceResourceGroup") + private String arcInstanceResourceGroup; + + /* + * App id of arc AAD identity. + */ + @JsonProperty(value = "arcApplicationClientId") + private String arcApplicationClientId; + + /* + * Tenant id of arc AAD identity. + */ + @JsonProperty(value = "arcApplicationTenantId") + private String arcApplicationTenantId; + + /* + * Object id of arc AAD service principal. + */ + @JsonProperty(value = "arcServicePrincipalObjectId") + private String arcServicePrincipalObjectId; + + /* + * Object id of arc AAD identity. + */ + @JsonProperty(value = "arcApplicationObjectId") + private String arcApplicationObjectId; + + /* + * Aggregate state of Arc agent across the nodes in this HCI cluster. + */ + @JsonProperty(value = "aggregateState", access = JsonProperty.Access.WRITE_ONLY) + private ArcSettingAggregateState aggregateState; + + /* + * State of Arc agent in each of the nodes. + */ + @JsonProperty(value = "perNodeDetails", access = JsonProperty.Access.WRITE_ONLY) + private List perNodeDetails; + + /** + * Get the provisioningState property: Provisioning state of the ArcSetting proxy resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the arcInstanceResourceGroup property: The resource group that hosts the Arc agents, ie. Hybrid Compute + * Machine resources. + * + * @return the arcInstanceResourceGroup value. + */ + public String arcInstanceResourceGroup() { + return this.arcInstanceResourceGroup; + } + + /** + * Set the arcInstanceResourceGroup property: The resource group that hosts the Arc agents, ie. Hybrid Compute + * Machine resources. + * + * @param arcInstanceResourceGroup the arcInstanceResourceGroup value to set. + * @return the ArcSettingProperties object itself. + */ + public ArcSettingProperties withArcInstanceResourceGroup(String arcInstanceResourceGroup) { + this.arcInstanceResourceGroup = arcInstanceResourceGroup; + return this; + } + + /** + * Get the arcApplicationClientId property: App id of arc AAD identity. + * + * @return the arcApplicationClientId value. + */ + public String arcApplicationClientId() { + return this.arcApplicationClientId; + } + + /** + * Set the arcApplicationClientId property: App id of arc AAD identity. + * + * @param arcApplicationClientId the arcApplicationClientId value to set. + * @return the ArcSettingProperties object itself. + */ + public ArcSettingProperties withArcApplicationClientId(String arcApplicationClientId) { + this.arcApplicationClientId = arcApplicationClientId; + return this; + } + + /** + * Get the arcApplicationTenantId property: Tenant id of arc AAD identity. + * + * @return the arcApplicationTenantId value. + */ + public String arcApplicationTenantId() { + return this.arcApplicationTenantId; + } + + /** + * Set the arcApplicationTenantId property: Tenant id of arc AAD identity. + * + * @param arcApplicationTenantId the arcApplicationTenantId value to set. + * @return the ArcSettingProperties object itself. + */ + public ArcSettingProperties withArcApplicationTenantId(String arcApplicationTenantId) { + this.arcApplicationTenantId = arcApplicationTenantId; + return this; + } + + /** + * Get the arcServicePrincipalObjectId property: Object id of arc AAD service principal. + * + * @return the arcServicePrincipalObjectId value. + */ + public String arcServicePrincipalObjectId() { + return this.arcServicePrincipalObjectId; + } + + /** + * Set the arcServicePrincipalObjectId property: Object id of arc AAD service principal. + * + * @param arcServicePrincipalObjectId the arcServicePrincipalObjectId value to set. + * @return the ArcSettingProperties object itself. + */ + public ArcSettingProperties withArcServicePrincipalObjectId(String arcServicePrincipalObjectId) { + this.arcServicePrincipalObjectId = arcServicePrincipalObjectId; + return this; + } + + /** + * Get the arcApplicationObjectId property: Object id of arc AAD identity. + * + * @return the arcApplicationObjectId value. + */ + public String arcApplicationObjectId() { + return this.arcApplicationObjectId; + } + + /** + * Set the arcApplicationObjectId property: Object id of arc AAD identity. + * + * @param arcApplicationObjectId the arcApplicationObjectId value to set. + * @return the ArcSettingProperties object itself. + */ + public ArcSettingProperties withArcApplicationObjectId(String arcApplicationObjectId) { + this.arcApplicationObjectId = arcApplicationObjectId; + return this; + } + + /** + * Get the aggregateState property: Aggregate state of Arc agent across the nodes in this HCI cluster. + * + * @return the aggregateState value. + */ + public ArcSettingAggregateState aggregateState() { + return this.aggregateState; + } + + /** + * Get the perNodeDetails property: State of Arc agent in each of the nodes. + * + * @return the perNodeDetails value. + */ + public List perNodeDetails() { + return this.perNodeDetails; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (perNodeDetails() != null) { + perNodeDetails().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/AvailableOperationsInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/AvailableOperationsInner.java deleted file mode 100644 index f3536ea73c011..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/AvailableOperationsInner.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (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.OperationDetail; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Available operations of the service. */ -@Fluent -public final class AvailableOperationsInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableOperationsInner.class); - - /* - * Collection of available operation details - */ - @JsonProperty(value = "value") - private List value; - - /* - * URL client should use to fetch the next page (per server side paging). - * It's null for now, added for future use. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: Collection of available operation details. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Collection of available operation details. - * - * @param value the value value to set. - * @return the AvailableOperationsInner object itself. - */ - public AvailableOperationsInner withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for - * now, added for future use. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for - * now, added for future use. - * - * @param nextLink the nextLink value to set. - * @return the AvailableOperationsInner object itself. - */ - public AvailableOperationsInner withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterIdentityResponseInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterIdentityResponseInner.java new file mode 100644 index 0000000000000..be934a9d5d353 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterIdentityResponseInner.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Cluster Identity details. */ +@Immutable +public final class ClusterIdentityResponseInner { + /* + * Cluster identity properties. + */ + @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) + private ClusterIdentityResponseProperties innerProperties; + + /** + * Get the innerProperties property: Cluster identity properties. + * + * @return the innerProperties value. + */ + private ClusterIdentityResponseProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the aadClientId property: The aadClientId property. + * + * @return the aadClientId value. + */ + public String aadClientId() { + return this.innerProperties() == null ? null : this.innerProperties().aadClientId(); + } + + /** + * Set the aadClientId property: The aadClientId property. + * + * @param aadClientId the aadClientId value to set. + * @return the ClusterIdentityResponseInner object itself. + */ + public ClusterIdentityResponseInner withAadClientId(String aadClientId) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterIdentityResponseProperties(); + } + this.innerProperties().withAadClientId(aadClientId); + return this; + } + + /** + * Get the aadTenantId property: The aadTenantId property. + * + * @return the aadTenantId value. + */ + public String aadTenantId() { + return this.innerProperties() == null ? null : this.innerProperties().aadTenantId(); + } + + /** + * Set the aadTenantId property: The aadTenantId property. + * + * @param aadTenantId the aadTenantId value to set. + * @return the ClusterIdentityResponseInner object itself. + */ + public ClusterIdentityResponseInner withAadTenantId(String aadTenantId) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterIdentityResponseProperties(); + } + this.innerProperties().withAadTenantId(aadTenantId); + return this; + } + + /** + * Get the aadServicePrincipalObjectId property: The aadServicePrincipalObjectId property. + * + * @return the aadServicePrincipalObjectId value. + */ + public String aadServicePrincipalObjectId() { + return this.innerProperties() == null ? null : this.innerProperties().aadServicePrincipalObjectId(); + } + + /** + * Set the aadServicePrincipalObjectId property: The aadServicePrincipalObjectId property. + * + * @param aadServicePrincipalObjectId the aadServicePrincipalObjectId value to set. + * @return the ClusterIdentityResponseInner object itself. + */ + public ClusterIdentityResponseInner withAadServicePrincipalObjectId(String aadServicePrincipalObjectId) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterIdentityResponseProperties(); + } + this.innerProperties().withAadServicePrincipalObjectId(aadServicePrincipalObjectId); + return this; + } + + /** + * Get the aadApplicationObjectId property: The aadApplicationObjectId property. + * + * @return the aadApplicationObjectId value. + */ + public String aadApplicationObjectId() { + return this.innerProperties() == null ? null : this.innerProperties().aadApplicationObjectId(); + } + + /** + * Set the aadApplicationObjectId property: The aadApplicationObjectId property. + * + * @param aadApplicationObjectId the aadApplicationObjectId value to set. + * @return the ClusterIdentityResponseInner object itself. + */ + public ClusterIdentityResponseInner withAadApplicationObjectId(String aadApplicationObjectId) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterIdentityResponseProperties(); + } + this.innerProperties().withAadApplicationObjectId(aadApplicationObjectId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterIdentityResponseProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterIdentityResponseProperties.java new file mode 100644 index 0000000000000..745b333748ae2 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterIdentityResponseProperties.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ClusterIdentityResponseProperties model. */ +@Fluent +public final class ClusterIdentityResponseProperties { + /* + * The aadClientId property. + */ + @JsonProperty(value = "aadClientId") + private String aadClientId; + + /* + * The aadTenantId property. + */ + @JsonProperty(value = "aadTenantId") + private String aadTenantId; + + /* + * The aadServicePrincipalObjectId property. + */ + @JsonProperty(value = "aadServicePrincipalObjectId") + private String aadServicePrincipalObjectId; + + /* + * The aadApplicationObjectId property. + */ + @JsonProperty(value = "aadApplicationObjectId") + private String aadApplicationObjectId; + + /** + * Get the aadClientId property: The aadClientId property. + * + * @return the aadClientId value. + */ + public String aadClientId() { + return this.aadClientId; + } + + /** + * Set the aadClientId property: The aadClientId property. + * + * @param aadClientId the aadClientId value to set. + * @return the ClusterIdentityResponseProperties object itself. + */ + public ClusterIdentityResponseProperties withAadClientId(String aadClientId) { + this.aadClientId = aadClientId; + return this; + } + + /** + * Get the aadTenantId property: The aadTenantId property. + * + * @return the aadTenantId value. + */ + public String aadTenantId() { + return this.aadTenantId; + } + + /** + * Set the aadTenantId property: The aadTenantId property. + * + * @param aadTenantId the aadTenantId value to set. + * @return the ClusterIdentityResponseProperties object itself. + */ + public ClusterIdentityResponseProperties withAadTenantId(String aadTenantId) { + this.aadTenantId = aadTenantId; + return this; + } + + /** + * Get the aadServicePrincipalObjectId property: The aadServicePrincipalObjectId property. + * + * @return the aadServicePrincipalObjectId value. + */ + public String aadServicePrincipalObjectId() { + return this.aadServicePrincipalObjectId; + } + + /** + * Set the aadServicePrincipalObjectId property: The aadServicePrincipalObjectId property. + * + * @param aadServicePrincipalObjectId the aadServicePrincipalObjectId value to set. + * @return the ClusterIdentityResponseProperties object itself. + */ + public ClusterIdentityResponseProperties withAadServicePrincipalObjectId(String aadServicePrincipalObjectId) { + this.aadServicePrincipalObjectId = aadServicePrincipalObjectId; + return this; + } + + /** + * Get the aadApplicationObjectId property: The aadApplicationObjectId property. + * + * @return the aadApplicationObjectId value. + */ + public String aadApplicationObjectId() { + return this.aadApplicationObjectId; + } + + /** + * Set the aadApplicationObjectId property: The aadApplicationObjectId property. + * + * @param aadApplicationObjectId the aadApplicationObjectId value to set. + * @return the ClusterIdentityResponseProperties object itself. + */ + public ClusterIdentityResponseProperties withAadApplicationObjectId(String aadApplicationObjectId) { + this.aadApplicationObjectId = aadApplicationObjectId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterInner.java index 30f5fcebff66e..90830dc5dd720 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 @@ -5,125 +5,62 @@ package com.azure.resourcemanager.azurestackhci.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; +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.CreatedByType; import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; import com.azure.resourcemanager.azurestackhci.models.Status; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; import java.util.Map; /** Cluster details. */ -@JsonFlatten @Fluent -public class ClusterInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterInner.class); - - /* - * Provisioning state. - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ProvisioningState provisioningState; - +public final class ClusterInner extends Resource { /* - * Status of the cluster agent. + * System data of Cluster resource */ - @JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY) - private Status status; + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; /* - * Unique, immutable resource id. + * Cluster properties. */ - @JsonProperty(value = "properties.cloudId", access = JsonProperty.Access.WRITE_ONLY) - private String cloudId; + @JsonProperty(value = "properties") + private ClusterProperties innerProperties; - /* - * App id of cluster AAD identity. - */ - @JsonProperty(value = "properties.aadClientId") - private String aadClientId; - - /* - * Tenant id of cluster AAD identity. - */ - @JsonProperty(value = "properties.aadTenantId") - private String aadTenantId; - - /* - * Properties reported by cluster agent. - */ - @JsonProperty(value = "properties.reportedProperties") - private ClusterReportedProperties reportedProperties; - - /* - * Number of days remaining in the trial period. - */ - @JsonProperty(value = "properties.trialDaysRemaining", access = JsonProperty.Access.WRITE_ONLY) - private Float trialDaysRemaining; - - /* - * Type of billing applied to the resource. - */ - @JsonProperty(value = "properties.billingModel", access = JsonProperty.Access.WRITE_ONLY) - private String billingModel; - - /* - * First cluster sync timestamp. - */ - @JsonProperty(value = "properties.registrationTimestamp", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime registrationTimestamp; - - /* - * Most recent cluster sync timestamp. - */ - @JsonProperty(value = "properties.lastSyncTimestamp", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime lastSyncTimestamp; - - /* - * Most recent billing meter timestamp. - */ - @JsonProperty(value = "properties.lastBillingTimestamp", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime lastBillingTimestamp; - - /* - * The identity that created the resource. - */ - @JsonProperty(value = "systemData.createdBy") - private String createdBy; - - /* - * The type of identity that created the resource. - */ - @JsonProperty(value = "systemData.createdByType") - private CreatedByType createdByType; - - /* - * The timestamp of resource creation (UTC). + /** + * Get the systemData property: System data of Cluster resource. + * + * @return the systemData value. */ - @JsonProperty(value = "systemData.createdAt") - private OffsetDateTime createdAt; + public SystemData systemData() { + return this.systemData; + } - /* - * The identity that last modified the resource. + /** + * Get the innerProperties property: Cluster properties. + * + * @return the innerProperties value. */ - @JsonProperty(value = "systemData.lastModifiedBy") - private String lastModifiedBy; + private ClusterProperties innerProperties() { + return this.innerProperties; + } - /* - * The type of identity that last modified the resource. - */ - @JsonProperty(value = "systemData.lastModifiedByType") - private CreatedByType lastModifiedByType; + /** {@inheritDoc} */ + @Override + public ClusterInner withLocation(String location) { + super.withLocation(location); + return this; + } - /* - * The timestamp of resource last modification (UTC) - */ - @JsonProperty(value = "systemData.lastModifiedAt") - private OffsetDateTime lastModifiedAt; + /** {@inheritDoc} */ + @Override + public ClusterInner withTags(Map tags) { + super.withTags(tags); + return this; + } /** * Get the provisioningState property: Provisioning state. @@ -131,7 +68,7 @@ public class ClusterInner extends Resource { * @return the provisioningState value. */ public ProvisioningState provisioningState() { - return this.provisioningState; + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** @@ -140,7 +77,7 @@ public ProvisioningState provisioningState() { * @return the status value. */ public Status status() { - return this.status; + return this.innerProperties() == null ? null : this.innerProperties().status(); } /** @@ -149,7 +86,30 @@ public Status status() { * @return the cloudId value. */ public String cloudId() { - return this.cloudId; + return this.innerProperties() == null ? null : this.innerProperties().cloudId(); + } + + /** + * Get the cloudManagementEndpoint property: Endpoint configured for management from the Azure portal. + * + * @return the cloudManagementEndpoint value. + */ + public String cloudManagementEndpoint() { + return this.innerProperties() == null ? null : this.innerProperties().cloudManagementEndpoint(); + } + + /** + * Set the cloudManagementEndpoint property: Endpoint configured for management from the Azure portal. + * + * @param cloudManagementEndpoint the cloudManagementEndpoint value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withCloudManagementEndpoint(String cloudManagementEndpoint) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterProperties(); + } + this.innerProperties().withCloudManagementEndpoint(cloudManagementEndpoint); + return this; } /** @@ -158,7 +118,7 @@ public String cloudId() { * @return the aadClientId value. */ public String aadClientId() { - return this.aadClientId; + return this.innerProperties() == null ? null : this.innerProperties().aadClientId(); } /** @@ -168,7 +128,10 @@ public String aadClientId() { * @return the ClusterInner object itself. */ public ClusterInner withAadClientId(String aadClientId) { - this.aadClientId = aadClientId; + if (this.innerProperties() == null) { + this.innerProperties = new ClusterProperties(); + } + this.innerProperties().withAadClientId(aadClientId); return this; } @@ -178,7 +141,7 @@ public ClusterInner withAadClientId(String aadClientId) { * @return the aadTenantId value. */ public String aadTenantId() { - return this.aadTenantId; + return this.innerProperties() == null ? null : this.innerProperties().aadTenantId(); } /** @@ -188,207 +151,143 @@ public String aadTenantId() { * @return the ClusterInner object itself. */ public ClusterInner withAadTenantId(String aadTenantId) { - this.aadTenantId = aadTenantId; + if (this.innerProperties() == null) { + this.innerProperties = new ClusterProperties(); + } + this.innerProperties().withAadTenantId(aadTenantId); return this; } /** - * Get the reportedProperties property: Properties reported by cluster agent. + * Get the aadApplicationObjectId property: Object id of cluster AAD identity. * - * @return the reportedProperties value. + * @return the aadApplicationObjectId value. */ - public ClusterReportedProperties reportedProperties() { - return this.reportedProperties; + public String aadApplicationObjectId() { + return this.innerProperties() == null ? null : this.innerProperties().aadApplicationObjectId(); } /** - * Set the reportedProperties property: Properties reported by cluster agent. + * Set the aadApplicationObjectId property: Object id of cluster AAD identity. * - * @param reportedProperties the reportedProperties value to set. + * @param aadApplicationObjectId the aadApplicationObjectId value to set. * @return the ClusterInner object itself. */ - public ClusterInner withReportedProperties(ClusterReportedProperties reportedProperties) { - this.reportedProperties = reportedProperties; + public ClusterInner withAadApplicationObjectId(String aadApplicationObjectId) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterProperties(); + } + this.innerProperties().withAadApplicationObjectId(aadApplicationObjectId); return this; } /** - * Get the trialDaysRemaining property: Number of days remaining in the trial period. - * - * @return the trialDaysRemaining value. - */ - public Float trialDaysRemaining() { - return this.trialDaysRemaining; - } - - /** - * Get the billingModel property: Type of billing applied to the resource. + * Get the aadServicePrincipalObjectId property: Id of cluster identity service principal. * - * @return the billingModel value. + * @return the aadServicePrincipalObjectId value. */ - public String billingModel() { - return this.billingModel; + public String aadServicePrincipalObjectId() { + return this.innerProperties() == null ? null : this.innerProperties().aadServicePrincipalObjectId(); } /** - * Get the registrationTimestamp property: First cluster sync timestamp. + * Set the aadServicePrincipalObjectId property: Id of cluster identity service principal. * - * @return the registrationTimestamp value. - */ - public OffsetDateTime registrationTimestamp() { - return this.registrationTimestamp; - } - - /** - * Get the lastSyncTimestamp property: Most recent cluster sync timestamp. - * - * @return the lastSyncTimestamp value. - */ - public OffsetDateTime lastSyncTimestamp() { - return this.lastSyncTimestamp; - } - - /** - * Get the lastBillingTimestamp property: Most recent billing meter timestamp. - * - * @return the lastBillingTimestamp value. - */ - public OffsetDateTime lastBillingTimestamp() { - return this.lastBillingTimestamp; - } - - /** - * Get the createdBy property: The identity that created the resource. - * - * @return the createdBy value. - */ - public String createdBy() { - return this.createdBy; - } - - /** - * Set the createdBy property: The identity that created the resource. - * - * @param createdBy the createdBy value to set. + * @param aadServicePrincipalObjectId the aadServicePrincipalObjectId value to set. * @return the ClusterInner object itself. */ - public ClusterInner withCreatedBy(String createdBy) { - this.createdBy = createdBy; + public ClusterInner withAadServicePrincipalObjectId(String aadServicePrincipalObjectId) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterProperties(); + } + this.innerProperties().withAadServicePrincipalObjectId(aadServicePrincipalObjectId); return this; } /** - * Get the createdByType property: The type of identity that created the resource. + * Get the desiredProperties property: Desired properties of the cluster. * - * @return the createdByType value. + * @return the desiredProperties value. */ - public CreatedByType createdByType() { - return this.createdByType; + public ClusterDesiredProperties desiredProperties() { + return this.innerProperties() == null ? null : this.innerProperties().desiredProperties(); } /** - * Set the createdByType property: The type of identity that created the resource. + * Set the desiredProperties property: Desired properties of the cluster. * - * @param createdByType the createdByType value to set. + * @param desiredProperties the desiredProperties value to set. * @return the ClusterInner object itself. */ - public ClusterInner withCreatedByType(CreatedByType createdByType) { - this.createdByType = createdByType; + public ClusterInner withDesiredProperties(ClusterDesiredProperties desiredProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterProperties(); + } + this.innerProperties().withDesiredProperties(desiredProperties); return this; } /** - * Get the createdAt property: The timestamp of resource creation (UTC). - * - * @return the createdAt value. - */ - public OffsetDateTime createdAt() { - return this.createdAt; - } - - /** - * Set the createdAt property: The timestamp of resource creation (UTC). + * Get the reportedProperties property: Properties reported by cluster agent. * - * @param createdAt the createdAt value to set. - * @return the ClusterInner object itself. + * @return the reportedProperties value. */ - public ClusterInner withCreatedAt(OffsetDateTime createdAt) { - this.createdAt = createdAt; - return this; + public ClusterReportedProperties reportedProperties() { + return this.innerProperties() == null ? null : this.innerProperties().reportedProperties(); } /** - * Get the lastModifiedBy property: The identity that last modified the resource. + * Get the trialDaysRemaining property: Number of days remaining in the trial period. * - * @return the lastModifiedBy value. + * @return the trialDaysRemaining value. */ - public String lastModifiedBy() { - return this.lastModifiedBy; + public Float trialDaysRemaining() { + return this.innerProperties() == null ? null : this.innerProperties().trialDaysRemaining(); } /** - * Set the lastModifiedBy property: The identity that last modified the resource. + * Get the billingModel property: Type of billing applied to the resource. * - * @param lastModifiedBy the lastModifiedBy value to set. - * @return the ClusterInner object itself. + * @return the billingModel value. */ - public ClusterInner withLastModifiedBy(String lastModifiedBy) { - this.lastModifiedBy = lastModifiedBy; - return this; + public String billingModel() { + return this.innerProperties() == null ? null : this.innerProperties().billingModel(); } /** - * Get the lastModifiedByType property: The type of identity that last modified the resource. + * Get the registrationTimestamp property: First cluster sync timestamp. * - * @return the lastModifiedByType value. + * @return the registrationTimestamp value. */ - public CreatedByType lastModifiedByType() { - return this.lastModifiedByType; + public OffsetDateTime registrationTimestamp() { + return this.innerProperties() == null ? null : this.innerProperties().registrationTimestamp(); } /** - * Set the lastModifiedByType property: The type of identity that last modified the resource. + * Get the lastSyncTimestamp property: Most recent cluster sync timestamp. * - * @param lastModifiedByType the lastModifiedByType value to set. - * @return the ClusterInner object itself. + * @return the lastSyncTimestamp value. */ - public ClusterInner withLastModifiedByType(CreatedByType lastModifiedByType) { - this.lastModifiedByType = lastModifiedByType; - return this; + public OffsetDateTime lastSyncTimestamp() { + return this.innerProperties() == null ? null : this.innerProperties().lastSyncTimestamp(); } /** - * Get the lastModifiedAt property: The timestamp of resource last modification (UTC). + * Get the lastBillingTimestamp property: Most recent billing meter timestamp. * - * @return the lastModifiedAt value. + * @return the lastBillingTimestamp value. */ - public OffsetDateTime lastModifiedAt() { - return this.lastModifiedAt; + public OffsetDateTime lastBillingTimestamp() { + return this.innerProperties() == null ? null : this.innerProperties().lastBillingTimestamp(); } /** - * Set the lastModifiedAt property: The timestamp of resource last modification (UTC). + * Get the serviceEndpoint property: Region specific DataPath Endpoint of the cluster. * - * @param lastModifiedAt the lastModifiedAt value to set. - * @return the ClusterInner object itself. + * @return the serviceEndpoint value. */ - public ClusterInner withLastModifiedAt(OffsetDateTime lastModifiedAt) { - this.lastModifiedAt = lastModifiedAt; - return this; - } - - /** {@inheritDoc} */ - @Override - public ClusterInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public ClusterInner withTags(Map tags) { - super.withTags(tags); - return this; + public String serviceEndpoint() { + return this.innerProperties() == null ? null : this.innerProperties().serviceEndpoint(); } /** @@ -397,8 +296,8 @@ public ClusterInner withTags(Map tags) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (reportedProperties() != null) { - reportedProperties().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 new file mode 100644 index 0000000000000..170d36a4d2b3a --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterPatchProperties.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurestackhci.models.ClusterDesiredProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Cluster properties. */ +@Fluent +public final class ClusterPatchProperties { + /* + * Endpoint configured for management from the Azure portal + */ + @JsonProperty(value = "cloudManagementEndpoint") + private String cloudManagementEndpoint; + + /* + * App id of cluster AAD identity. + */ + @JsonProperty(value = "aadClientId") + private String aadClientId; + + /* + * Tenant id of cluster AAD identity. + */ + @JsonProperty(value = "aadTenantId") + private String aadTenantId; + + /* + * Desired properties of the cluster. + */ + @JsonProperty(value = "desiredProperties") + private ClusterDesiredProperties desiredProperties; + + /** + * Get the cloudManagementEndpoint property: Endpoint configured for management from the Azure portal. + * + * @return the cloudManagementEndpoint value. + */ + public String cloudManagementEndpoint() { + return this.cloudManagementEndpoint; + } + + /** + * Set the cloudManagementEndpoint property: Endpoint configured for management from the Azure portal. + * + * @param cloudManagementEndpoint the cloudManagementEndpoint value to set. + * @return the ClusterPatchProperties object itself. + */ + public ClusterPatchProperties withCloudManagementEndpoint(String cloudManagementEndpoint) { + this.cloudManagementEndpoint = cloudManagementEndpoint; + return this; + } + + /** + * Get the aadClientId property: App id of cluster AAD identity. + * + * @return the aadClientId value. + */ + public String aadClientId() { + return this.aadClientId; + } + + /** + * Set the aadClientId property: App id of cluster AAD identity. + * + * @param aadClientId the aadClientId value to set. + * @return the ClusterPatchProperties object itself. + */ + public ClusterPatchProperties withAadClientId(String aadClientId) { + this.aadClientId = aadClientId; + return this; + } + + /** + * Get the aadTenantId property: Tenant id of cluster AAD identity. + * + * @return the aadTenantId value. + */ + public String aadTenantId() { + return this.aadTenantId; + } + + /** + * Set the aadTenantId property: Tenant id of cluster AAD identity. + * + * @param aadTenantId the aadTenantId value to set. + * @return the ClusterPatchProperties object itself. + */ + public ClusterPatchProperties withAadTenantId(String aadTenantId) { + this.aadTenantId = aadTenantId; + return this; + } + + /** + * Get the desiredProperties property: Desired properties of the cluster. + * + * @return the desiredProperties value. + */ + public ClusterDesiredProperties desiredProperties() { + return this.desiredProperties; + } + + /** + * Set the desiredProperties property: Desired properties of the cluster. + * + * @param desiredProperties the desiredProperties value to set. + * @return the ClusterPatchProperties object itself. + */ + public ClusterPatchProperties withDesiredProperties(ClusterDesiredProperties desiredProperties) { + this.desiredProperties = desiredProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (desiredProperties() != null) { + desiredProperties().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterProperties.java new file mode 100644 index 0000000000000..cb7310c87094d --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterProperties.java @@ -0,0 +1,337 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurestackhci.models.ClusterDesiredProperties; +import com.azure.resourcemanager.azurestackhci.models.ClusterReportedProperties; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; +import com.azure.resourcemanager.azurestackhci.models.Status; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Cluster properties. */ +@Fluent +public final class ClusterProperties { + /* + * Provisioning state. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Status of the cluster agent. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private Status status; + + /* + * Unique, immutable resource id. + */ + @JsonProperty(value = "cloudId", access = JsonProperty.Access.WRITE_ONLY) + private String cloudId; + + /* + * Endpoint configured for management from the Azure portal. + */ + @JsonProperty(value = "cloudManagementEndpoint") + private String cloudManagementEndpoint; + + /* + * App id of cluster AAD identity. + */ + @JsonProperty(value = "aadClientId") + private String aadClientId; + + /* + * Tenant id of cluster AAD identity. + */ + @JsonProperty(value = "aadTenantId") + private String aadTenantId; + + /* + * Object id of cluster AAD identity. + */ + @JsonProperty(value = "aadApplicationObjectId") + private String aadApplicationObjectId; + + /* + * Id of cluster identity service principal. + */ + @JsonProperty(value = "aadServicePrincipalObjectId") + private String aadServicePrincipalObjectId; + + /* + * Desired properties of the cluster. + */ + @JsonProperty(value = "desiredProperties") + private ClusterDesiredProperties desiredProperties; + + /* + * Properties reported by cluster agent. + */ + @JsonProperty(value = "reportedProperties", access = JsonProperty.Access.WRITE_ONLY) + private ClusterReportedProperties reportedProperties; + + /* + * Number of days remaining in the trial period. + */ + @JsonProperty(value = "trialDaysRemaining", access = JsonProperty.Access.WRITE_ONLY) + private Float trialDaysRemaining; + + /* + * Type of billing applied to the resource. + */ + @JsonProperty(value = "billingModel", access = JsonProperty.Access.WRITE_ONLY) + private String billingModel; + + /* + * First cluster sync timestamp. + */ + @JsonProperty(value = "registrationTimestamp", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime registrationTimestamp; + + /* + * Most recent cluster sync timestamp. + */ + @JsonProperty(value = "lastSyncTimestamp", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastSyncTimestamp; + + /* + * Most recent billing meter timestamp. + */ + @JsonProperty(value = "lastBillingTimestamp", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastBillingTimestamp; + + /* + * Region specific DataPath Endpoint of the cluster. + */ + @JsonProperty(value = "serviceEndpoint", access = JsonProperty.Access.WRITE_ONLY) + private String serviceEndpoint; + + /** + * Get the provisioningState property: Provisioning state. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the status property: Status of the cluster agent. + * + * @return the status value. + */ + public Status status() { + return this.status; + } + + /** + * Get the cloudId property: Unique, immutable resource id. + * + * @return the cloudId value. + */ + public String cloudId() { + return this.cloudId; + } + + /** + * Get the cloudManagementEndpoint property: Endpoint configured for management from the Azure portal. + * + * @return the cloudManagementEndpoint value. + */ + public String cloudManagementEndpoint() { + return this.cloudManagementEndpoint; + } + + /** + * Set the cloudManagementEndpoint property: Endpoint configured for management from the Azure portal. + * + * @param cloudManagementEndpoint the cloudManagementEndpoint value to set. + * @return the ClusterProperties object itself. + */ + public ClusterProperties withCloudManagementEndpoint(String cloudManagementEndpoint) { + this.cloudManagementEndpoint = cloudManagementEndpoint; + return this; + } + + /** + * Get the aadClientId property: App id of cluster AAD identity. + * + * @return the aadClientId value. + */ + public String aadClientId() { + return this.aadClientId; + } + + /** + * Set the aadClientId property: App id of cluster AAD identity. + * + * @param aadClientId the aadClientId value to set. + * @return the ClusterProperties object itself. + */ + public ClusterProperties withAadClientId(String aadClientId) { + this.aadClientId = aadClientId; + return this; + } + + /** + * Get the aadTenantId property: Tenant id of cluster AAD identity. + * + * @return the aadTenantId value. + */ + public String aadTenantId() { + return this.aadTenantId; + } + + /** + * Set the aadTenantId property: Tenant id of cluster AAD identity. + * + * @param aadTenantId the aadTenantId value to set. + * @return the ClusterProperties object itself. + */ + public ClusterProperties withAadTenantId(String aadTenantId) { + this.aadTenantId = aadTenantId; + return this; + } + + /** + * Get the aadApplicationObjectId property: Object id of cluster AAD identity. + * + * @return the aadApplicationObjectId value. + */ + public String aadApplicationObjectId() { + return this.aadApplicationObjectId; + } + + /** + * Set the aadApplicationObjectId property: Object id of cluster AAD identity. + * + * @param aadApplicationObjectId the aadApplicationObjectId value to set. + * @return the ClusterProperties object itself. + */ + public ClusterProperties withAadApplicationObjectId(String aadApplicationObjectId) { + this.aadApplicationObjectId = aadApplicationObjectId; + return this; + } + + /** + * Get the aadServicePrincipalObjectId property: Id of cluster identity service principal. + * + * @return the aadServicePrincipalObjectId value. + */ + public String aadServicePrincipalObjectId() { + return this.aadServicePrincipalObjectId; + } + + /** + * Set the aadServicePrincipalObjectId property: Id of cluster identity service principal. + * + * @param aadServicePrincipalObjectId the aadServicePrincipalObjectId value to set. + * @return the ClusterProperties object itself. + */ + public ClusterProperties withAadServicePrincipalObjectId(String aadServicePrincipalObjectId) { + this.aadServicePrincipalObjectId = aadServicePrincipalObjectId; + return this; + } + + /** + * Get the desiredProperties property: Desired properties of the cluster. + * + * @return the desiredProperties value. + */ + public ClusterDesiredProperties desiredProperties() { + return this.desiredProperties; + } + + /** + * Set the desiredProperties property: Desired properties of the cluster. + * + * @param desiredProperties the desiredProperties value to set. + * @return the ClusterProperties object itself. + */ + public ClusterProperties withDesiredProperties(ClusterDesiredProperties desiredProperties) { + this.desiredProperties = desiredProperties; + return this; + } + + /** + * Get the reportedProperties property: Properties reported by cluster agent. + * + * @return the reportedProperties value. + */ + public ClusterReportedProperties reportedProperties() { + return this.reportedProperties; + } + + /** + * Get the trialDaysRemaining property: Number of days remaining in the trial period. + * + * @return the trialDaysRemaining value. + */ + public Float trialDaysRemaining() { + return this.trialDaysRemaining; + } + + /** + * Get the billingModel property: Type of billing applied to the resource. + * + * @return the billingModel value. + */ + public String billingModel() { + return this.billingModel; + } + + /** + * Get the registrationTimestamp property: First cluster sync timestamp. + * + * @return the registrationTimestamp value. + */ + public OffsetDateTime registrationTimestamp() { + return this.registrationTimestamp; + } + + /** + * Get the lastSyncTimestamp property: Most recent cluster sync timestamp. + * + * @return the lastSyncTimestamp value. + */ + public OffsetDateTime lastSyncTimestamp() { + return this.lastSyncTimestamp; + } + + /** + * Get the lastBillingTimestamp property: Most recent billing meter timestamp. + * + * @return the lastBillingTimestamp value. + */ + public OffsetDateTime lastBillingTimestamp() { + return this.lastBillingTimestamp; + } + + /** + * Get the serviceEndpoint property: Region specific DataPath Endpoint of the cluster. + * + * @return the serviceEndpoint value. + */ + public String serviceEndpoint() { + return this.serviceEndpoint; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (desiredProperties() != null) { + desiredProperties().validate(); + } + if (reportedProperties() != null) { + reportedProperties().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ExtensionInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ExtensionInner.java new file mode 100644 index 0000000000000..915af50280efa --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ExtensionInner.java @@ -0,0 +1,253 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.azurestackhci.models.ExtensionAggregateState; +import com.azure.resourcemanager.azurestackhci.models.PerNodeExtensionState; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Details of a particular extension in HCI Cluster. */ +@Fluent +public final class ExtensionInner extends ProxyResource { + /* + * System data of Extension resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * Describes Machine Extension Properties. + */ + @JsonProperty(value = "properties") + private ExtensionProperties innerProperties; + + /** + * Get the systemData property: System data of Extension resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the innerProperties property: Describes Machine Extension Properties. + * + * @return the innerProperties value. + */ + private ExtensionProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the provisioningState property: Provisioning state of the Extension proxy resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the aggregateState property: Aggregate state of Arc Extensions across the nodes in this HCI cluster. + * + * @return the aggregateState value. + */ + public ExtensionAggregateState aggregateState() { + return this.innerProperties() == null ? null : this.innerProperties().aggregateState(); + } + + /** + * Get the perNodeExtensionDetails property: State of Arc Extension in each of the nodes. + * + * @return the perNodeExtensionDetails value. + */ + public List perNodeExtensionDetails() { + return this.innerProperties() == null ? null : this.innerProperties().perNodeExtensionDetails(); + } + + /** + * Get the forceUpdateTag property: How the extension handler should be forced to update even if the extension + * configuration has not changed. + * + * @return the forceUpdateTag value. + */ + public String forceUpdateTag() { + return this.innerProperties() == null ? null : this.innerProperties().forceUpdateTag(); + } + + /** + * Set the forceUpdateTag property: How the extension handler should be forced to update even if the extension + * configuration has not changed. + * + * @param forceUpdateTag the forceUpdateTag value to set. + * @return the ExtensionInner object itself. + */ + public ExtensionInner withForceUpdateTag(String forceUpdateTag) { + if (this.innerProperties() == null) { + this.innerProperties = new ExtensionProperties(); + } + this.innerProperties().withForceUpdateTag(forceUpdateTag); + return this; + } + + /** + * Get the publisher property: The name of the extension handler publisher. + * + * @return the publisher value. + */ + public String publisher() { + return this.innerProperties() == null ? null : this.innerProperties().publisher(); + } + + /** + * Set the publisher property: The name of the extension handler publisher. + * + * @param publisher the publisher value to set. + * @return the ExtensionInner object itself. + */ + public ExtensionInner withPublisher(String publisher) { + if (this.innerProperties() == null) { + this.innerProperties = new ExtensionProperties(); + } + this.innerProperties().withPublisher(publisher); + return this; + } + + /** + * Get the type property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @return the type value. + */ + public String typePropertiesType() { + return this.innerProperties() == null ? null : this.innerProperties().type(); + } + + /** + * Set the type property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @param type the type value to set. + * @return the ExtensionInner object itself. + */ + public ExtensionInner withTypePropertiesType(String type) { + if (this.innerProperties() == null) { + this.innerProperties = new ExtensionProperties(); + } + this.innerProperties().withType(type); + return this; + } + + /** + * Get the typeHandlerVersion property: Specifies the version of the script handler. + * + * @return the typeHandlerVersion value. + */ + public String typeHandlerVersion() { + return this.innerProperties() == null ? null : this.innerProperties().typeHandlerVersion(); + } + + /** + * Set the typeHandlerVersion property: Specifies the version of the script handler. + * + * @param typeHandlerVersion the typeHandlerVersion value to set. + * @return the ExtensionInner object itself. + */ + public ExtensionInner withTypeHandlerVersion(String typeHandlerVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new ExtensionProperties(); + } + this.innerProperties().withTypeHandlerVersion(typeHandlerVersion); + return this; + } + + /** + * Get the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless + * redeployed, even with this property set to true. + * + * @return the autoUpgradeMinorVersion value. + */ + public Boolean autoUpgradeMinorVersion() { + return this.innerProperties() == null ? null : this.innerProperties().autoUpgradeMinorVersion(); + } + + /** + * Set the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless + * redeployed, even with this property set to true. + * + * @param autoUpgradeMinorVersion the autoUpgradeMinorVersion value to set. + * @return the ExtensionInner object itself. + */ + public ExtensionInner withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new ExtensionProperties(); + } + this.innerProperties().withAutoUpgradeMinorVersion(autoUpgradeMinorVersion); + return this; + } + + /** + * Get the settings property: Json formatted public settings for the extension. + * + * @return the settings value. + */ + public Object settings() { + return this.innerProperties() == null ? null : this.innerProperties().settings(); + } + + /** + * Set the settings property: Json formatted public settings for the extension. + * + * @param settings the settings value to set. + * @return the ExtensionInner object itself. + */ + public ExtensionInner withSettings(Object settings) { + if (this.innerProperties() == null) { + this.innerProperties = new ExtensionProperties(); + } + this.innerProperties().withSettings(settings); + return this; + } + + /** + * Get the protectedSettings property: Protected settings (may contain secrets). + * + * @return the protectedSettings value. + */ + public Object protectedSettings() { + return this.innerProperties() == null ? null : this.innerProperties().protectedSettings(); + } + + /** + * Set the protectedSettings property: Protected settings (may contain secrets). + * + * @param protectedSettings the protectedSettings value to set. + * @return the ExtensionInner object itself. + */ + public ExtensionInner withProtectedSettings(Object protectedSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new ExtensionProperties(); + } + this.innerProperties().withProtectedSettings(protectedSettings); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ExtensionParameters.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ExtensionParameters.java new file mode 100644 index 0000000000000..52eea9ddbd4ae --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ExtensionParameters.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.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the properties of a Machine Extension. This object mirrors the definition in HybridCompute. */ +@Fluent +public final class ExtensionParameters { + /* + * How the extension handler should be forced to update even if the + * extension configuration has not changed. + */ + @JsonProperty(value = "forceUpdateTag") + private String forceUpdateTag; + + /* + * The name of the extension handler publisher. + */ + @JsonProperty(value = "publisher") + private String publisher; + + /* + * Specifies the type of the extension; an example is + * "CustomScriptExtension". + */ + @JsonProperty(value = "type") + private String type; + + /* + * Specifies the version of the script handler. + */ + @JsonProperty(value = "typeHandlerVersion") + private String typeHandlerVersion; + + /* + * Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension + * will not upgrade minor versions unless redeployed, even with this + * property set to true. + */ + @JsonProperty(value = "autoUpgradeMinorVersion") + private Boolean autoUpgradeMinorVersion; + + /* + * Json formatted public settings for the extension. + */ + @JsonProperty(value = "settings") + private Object settings; + + /* + * Protected settings (may contain secrets). + */ + @JsonProperty(value = "protectedSettings") + private Object protectedSettings; + + /** + * Get the forceUpdateTag property: How the extension handler should be forced to update even if the extension + * configuration has not changed. + * + * @return the forceUpdateTag value. + */ + public String forceUpdateTag() { + return this.forceUpdateTag; + } + + /** + * Set the forceUpdateTag property: How the extension handler should be forced to update even if the extension + * configuration has not changed. + * + * @param forceUpdateTag the forceUpdateTag value to set. + * @return the ExtensionParameters object itself. + */ + public ExtensionParameters withForceUpdateTag(String forceUpdateTag) { + this.forceUpdateTag = forceUpdateTag; + return this; + } + + /** + * Get the publisher property: The name of the extension handler publisher. + * + * @return the publisher value. + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the publisher property: The name of the extension handler publisher. + * + * @param publisher the publisher value to set. + * @return the ExtensionParameters object itself. + */ + public ExtensionParameters withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get the type property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @param type the type value to set. + * @return the ExtensionParameters object itself. + */ + public ExtensionParameters withType(String type) { + this.type = type; + return this; + } + + /** + * Get the typeHandlerVersion property: Specifies the version of the script handler. + * + * @return the typeHandlerVersion value. + */ + public String typeHandlerVersion() { + return this.typeHandlerVersion; + } + + /** + * Set the typeHandlerVersion property: Specifies the version of the script handler. + * + * @param typeHandlerVersion the typeHandlerVersion value to set. + * @return the ExtensionParameters object itself. + */ + public ExtensionParameters withTypeHandlerVersion(String typeHandlerVersion) { + this.typeHandlerVersion = typeHandlerVersion; + return this; + } + + /** + * Get the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless + * redeployed, even with this property set to true. + * + * @return the autoUpgradeMinorVersion value. + */ + public Boolean autoUpgradeMinorVersion() { + return this.autoUpgradeMinorVersion; + } + + /** + * Set the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless + * redeployed, even with this property set to true. + * + * @param autoUpgradeMinorVersion the autoUpgradeMinorVersion value to set. + * @return the ExtensionParameters object itself. + */ + public ExtensionParameters withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { + this.autoUpgradeMinorVersion = autoUpgradeMinorVersion; + return this; + } + + /** + * Get the settings property: Json formatted public settings for the extension. + * + * @return the settings value. + */ + public Object settings() { + return this.settings; + } + + /** + * Set the settings property: Json formatted public settings for the extension. + * + * @param settings the settings value to set. + * @return the ExtensionParameters object itself. + */ + public ExtensionParameters withSettings(Object settings) { + this.settings = settings; + return this; + } + + /** + * Get the protectedSettings property: Protected settings (may contain secrets). + * + * @return the protectedSettings value. + */ + public Object protectedSettings() { + return this.protectedSettings; + } + + /** + * Set the protectedSettings property: Protected settings (may contain secrets). + * + * @param protectedSettings the protectedSettings value to set. + * @return the ExtensionParameters object itself. + */ + public ExtensionParameters withProtectedSettings(Object protectedSettings) { + this.protectedSettings = protectedSettings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ExtensionProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ExtensionProperties.java new file mode 100644 index 0000000000000..0a19e3a728d56 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ExtensionProperties.java @@ -0,0 +1,259 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurestackhci.models.ExtensionAggregateState; +import com.azure.resourcemanager.azurestackhci.models.PerNodeExtensionState; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Status of Arc Extension for a particular node in HCI Cluster. */ +@Fluent +public final class ExtensionProperties { + /* + * Provisioning state of the Extension proxy resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Parameters specific to this extension type. + */ + @JsonProperty(value = "extensionParameters") + private ExtensionParameters innerExtensionParameters; + + /* + * Aggregate state of Arc Extensions across the nodes in this HCI cluster. + */ + @JsonProperty(value = "aggregateState", access = JsonProperty.Access.WRITE_ONLY) + private ExtensionAggregateState aggregateState; + + /* + * State of Arc Extension in each of the nodes. + */ + @JsonProperty(value = "perNodeExtensionDetails", access = JsonProperty.Access.WRITE_ONLY) + private List perNodeExtensionDetails; + + /** + * Get the provisioningState property: Provisioning state of the Extension proxy resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the innerExtensionParameters property: Parameters specific to this extension type. + * + * @return the innerExtensionParameters value. + */ + private ExtensionParameters innerExtensionParameters() { + return this.innerExtensionParameters; + } + + /** + * Get the aggregateState property: Aggregate state of Arc Extensions across the nodes in this HCI cluster. + * + * @return the aggregateState value. + */ + public ExtensionAggregateState aggregateState() { + return this.aggregateState; + } + + /** + * Get the perNodeExtensionDetails property: State of Arc Extension in each of the nodes. + * + * @return the perNodeExtensionDetails value. + */ + public List perNodeExtensionDetails() { + return this.perNodeExtensionDetails; + } + + /** + * Get the forceUpdateTag property: How the extension handler should be forced to update even if the extension + * configuration has not changed. + * + * @return the forceUpdateTag value. + */ + public String forceUpdateTag() { + return this.innerExtensionParameters() == null ? null : this.innerExtensionParameters().forceUpdateTag(); + } + + /** + * Set the forceUpdateTag property: How the extension handler should be forced to update even if the extension + * configuration has not changed. + * + * @param forceUpdateTag the forceUpdateTag value to set. + * @return the ExtensionProperties object itself. + */ + public ExtensionProperties withForceUpdateTag(String forceUpdateTag) { + if (this.innerExtensionParameters() == null) { + this.innerExtensionParameters = new ExtensionParameters(); + } + this.innerExtensionParameters().withForceUpdateTag(forceUpdateTag); + return this; + } + + /** + * Get the publisher property: The name of the extension handler publisher. + * + * @return the publisher value. + */ + public String publisher() { + return this.innerExtensionParameters() == null ? null : this.innerExtensionParameters().publisher(); + } + + /** + * Set the publisher property: The name of the extension handler publisher. + * + * @param publisher the publisher value to set. + * @return the ExtensionProperties object itself. + */ + public ExtensionProperties withPublisher(String publisher) { + if (this.innerExtensionParameters() == null) { + this.innerExtensionParameters = new ExtensionParameters(); + } + this.innerExtensionParameters().withPublisher(publisher); + return this; + } + + /** + * Get the type property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @return the type value. + */ + public String type() { + return this.innerExtensionParameters() == null ? null : this.innerExtensionParameters().type(); + } + + /** + * Set the type property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @param type the type value to set. + * @return the ExtensionProperties object itself. + */ + public ExtensionProperties withType(String type) { + if (this.innerExtensionParameters() == null) { + this.innerExtensionParameters = new ExtensionParameters(); + } + this.innerExtensionParameters().withType(type); + return this; + } + + /** + * Get the typeHandlerVersion property: Specifies the version of the script handler. + * + * @return the typeHandlerVersion value. + */ + public String typeHandlerVersion() { + return this.innerExtensionParameters() == null ? null : this.innerExtensionParameters().typeHandlerVersion(); + } + + /** + * Set the typeHandlerVersion property: Specifies the version of the script handler. + * + * @param typeHandlerVersion the typeHandlerVersion value to set. + * @return the ExtensionProperties object itself. + */ + public ExtensionProperties withTypeHandlerVersion(String typeHandlerVersion) { + if (this.innerExtensionParameters() == null) { + this.innerExtensionParameters = new ExtensionParameters(); + } + this.innerExtensionParameters().withTypeHandlerVersion(typeHandlerVersion); + return this; + } + + /** + * Get the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless + * redeployed, even with this property set to true. + * + * @return the autoUpgradeMinorVersion value. + */ + public Boolean autoUpgradeMinorVersion() { + return this.innerExtensionParameters() == null + ? null + : this.innerExtensionParameters().autoUpgradeMinorVersion(); + } + + /** + * Set the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless + * redeployed, even with this property set to true. + * + * @param autoUpgradeMinorVersion the autoUpgradeMinorVersion value to set. + * @return the ExtensionProperties object itself. + */ + public ExtensionProperties withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { + if (this.innerExtensionParameters() == null) { + this.innerExtensionParameters = new ExtensionParameters(); + } + this.innerExtensionParameters().withAutoUpgradeMinorVersion(autoUpgradeMinorVersion); + return this; + } + + /** + * Get the settings property: Json formatted public settings for the extension. + * + * @return the settings value. + */ + public Object settings() { + return this.innerExtensionParameters() == null ? null : this.innerExtensionParameters().settings(); + } + + /** + * Set the settings property: Json formatted public settings for the extension. + * + * @param settings the settings value to set. + * @return the ExtensionProperties object itself. + */ + public ExtensionProperties withSettings(Object settings) { + if (this.innerExtensionParameters() == null) { + this.innerExtensionParameters = new ExtensionParameters(); + } + this.innerExtensionParameters().withSettings(settings); + return this; + } + + /** + * Get the protectedSettings property: Protected settings (may contain secrets). + * + * @return the protectedSettings value. + */ + public Object protectedSettings() { + return this.innerExtensionParameters() == null ? null : this.innerExtensionParameters().protectedSettings(); + } + + /** + * Set the protectedSettings property: Protected settings (may contain secrets). + * + * @param protectedSettings the protectedSettings value to set. + * @return the ExtensionProperties object itself. + */ + public ExtensionProperties withProtectedSettings(Object protectedSettings) { + if (this.innerExtensionParameters() == null) { + this.innerExtensionParameters = new ExtensionParameters(); + } + this.innerExtensionParameters().withProtectedSettings(protectedSettings); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerExtensionParameters() != null) { + innerExtensionParameters().validate(); + } + if (perNodeExtensionDetails() != null) { + perNodeExtensionDetails().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/OperationListResultInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/OperationListResultInner.java new file mode 100644 index 0000000000000..cd70af853a48e --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/OperationListResultInner.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.azurestackhci.models.Operation; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of + * results. + */ +@Immutable +public final class OperationListResultInner { + /* + * List of operations supported by the resource provider + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next set of operation list results (if there are any). + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: List of operations supported by the resource provider. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results (if there are any). + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/PasswordCredentialInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/PasswordCredentialInner.java new file mode 100644 index 0000000000000..92abc341b7391 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/PasswordCredentialInner.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The PasswordCredential model. */ +@Fluent +public final class PasswordCredentialInner { + /* + * The secretText property. + */ + @JsonProperty(value = "secretText") + private String secretText; + + /* + * The keyId property. + */ + @JsonProperty(value = "keyId") + private String keyId; + + /* + * The startDateTime property. + */ + @JsonProperty(value = "startDateTime") + private OffsetDateTime startDateTime; + + /* + * The endDateTime property. + */ + @JsonProperty(value = "endDateTime") + private OffsetDateTime endDateTime; + + /** + * Get the secretText property: The secretText property. + * + * @return the secretText value. + */ + public String secretText() { + return this.secretText; + } + + /** + * Set the secretText property: The secretText property. + * + * @param secretText the secretText value to set. + * @return the PasswordCredentialInner object itself. + */ + public PasswordCredentialInner withSecretText(String secretText) { + this.secretText = secretText; + return this; + } + + /** + * Get the keyId property: The keyId property. + * + * @return the keyId value. + */ + public String keyId() { + return this.keyId; + } + + /** + * Set the keyId property: The keyId property. + * + * @param keyId the keyId value to set. + * @return the PasswordCredentialInner object itself. + */ + public PasswordCredentialInner withKeyId(String keyId) { + this.keyId = keyId; + return this; + } + + /** + * Get the startDateTime property: The startDateTime property. + * + * @return the startDateTime value. + */ + public OffsetDateTime startDateTime() { + return this.startDateTime; + } + + /** + * Set the startDateTime property: The startDateTime property. + * + * @param startDateTime the startDateTime value to set. + * @return the PasswordCredentialInner object itself. + */ + public PasswordCredentialInner withStartDateTime(OffsetDateTime startDateTime) { + this.startDateTime = startDateTime; + return this; + } + + /** + * Get the endDateTime property: The endDateTime property. + * + * @return the endDateTime value. + */ + public OffsetDateTime endDateTime() { + return this.endDateTime; + } + + /** + * Set the endDateTime property: The endDateTime property. + * + * @param endDateTime the endDateTime value to set. + * @return the PasswordCredentialInner object itself. + */ + public PasswordCredentialInner withEndDateTime(OffsetDateTime endDateTime) { + this.endDateTime = endDateTime; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcIdentityResponseImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcIdentityResponseImpl.java new file mode 100644 index 0000000000000..d0fa03aff9ea7 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcIdentityResponseImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.resourcemanager.azurestackhci.fluent.models.ArcIdentityResponseInner; +import com.azure.resourcemanager.azurestackhci.models.ArcIdentityResponse; + +public final class ArcIdentityResponseImpl implements ArcIdentityResponse { + private ArcIdentityResponseInner innerObject; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + ArcIdentityResponseImpl( + ArcIdentityResponseInner innerObject, + com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String arcApplicationClientId() { + return this.innerModel().arcApplicationClientId(); + } + + public String arcApplicationTenantId() { + return this.innerModel().arcApplicationTenantId(); + } + + public String arcServicePrincipalObjectId() { + return this.innerModel().arcServicePrincipalObjectId(); + } + + public String arcApplicationObjectId() { + return this.innerModel().arcApplicationObjectId(); + } + + public ArcIdentityResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingImpl.java new file mode 100644 index 0000000000000..f070ad8074809 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingImpl.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.fluent.models.ArcSettingInner; +import com.azure.resourcemanager.azurestackhci.models.ArcIdentityResponse; +import com.azure.resourcemanager.azurestackhci.models.ArcSetting; +import com.azure.resourcemanager.azurestackhci.models.ArcSettingAggregateState; +import com.azure.resourcemanager.azurestackhci.models.PasswordCredential; +import com.azure.resourcemanager.azurestackhci.models.PerNodeState; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; +import java.util.Collections; +import java.util.List; + +public final class ArcSettingImpl implements ArcSetting, ArcSetting.Definition { + private ArcSettingInner innerObject; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + ArcSettingImpl( + ArcSettingInner 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 ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String arcInstanceResourceGroup() { + return this.innerModel().arcInstanceResourceGroup(); + } + + public String arcApplicationClientId() { + return this.innerModel().arcApplicationClientId(); + } + + public String arcApplicationTenantId() { + return this.innerModel().arcApplicationTenantId(); + } + + public String arcServicePrincipalObjectId() { + return this.innerModel().arcServicePrincipalObjectId(); + } + + public String arcApplicationObjectId() { + return this.innerModel().arcApplicationObjectId(); + } + + public ArcSettingAggregateState aggregateState() { + return this.innerModel().aggregateState(); + } + + public List perNodeDetails() { + List inner = this.innerModel().perNodeDetails(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ArcSettingInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String clusterName; + + private String arcSettingName; + + public ArcSettingImpl withExistingCluster(String resourceGroupName, String clusterName) { + this.resourceGroupName = resourceGroupName; + this.clusterName = clusterName; + return this; + } + + public ArcSetting create() { + this.innerObject = + serviceManager + .serviceClient() + .getArcSettings() + .createWithResponse(resourceGroupName, clusterName, arcSettingName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public ArcSetting create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getArcSettings() + .createWithResponse(resourceGroupName, clusterName, arcSettingName, this.innerModel(), context) + .getValue(); + return this; + } + + ArcSettingImpl(String name, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = new ArcSettingInner(); + this.serviceManager = serviceManager; + this.arcSettingName = name; + } + + public ArcSetting refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getArcSettings() + .getWithResponse(resourceGroupName, clusterName, arcSettingName, Context.NONE) + .getValue(); + return this; + } + + public ArcSetting refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getArcSettings() + .getWithResponse(resourceGroupName, clusterName, arcSettingName, context) + .getValue(); + return this; + } + + public PasswordCredential generatePassword() { + return serviceManager.arcSettings().generatePassword(resourceGroupName, clusterName, arcSettingName); + } + + public Response generatePasswordWithResponse(Context context) { + return serviceManager + .arcSettings() + .generatePasswordWithResponse(resourceGroupName, clusterName, arcSettingName, context); + } + + public ArcIdentityResponse createIdentity() { + return serviceManager.arcSettings().createIdentity(resourceGroupName, clusterName, arcSettingName); + } + + public ArcIdentityResponse createIdentity(Context context) { + return serviceManager.arcSettings().createIdentity(resourceGroupName, clusterName, arcSettingName, context); + } + + public ArcSettingImpl withArcInstanceResourceGroup(String arcInstanceResourceGroup) { + this.innerModel().withArcInstanceResourceGroup(arcInstanceResourceGroup); + return this; + } + + public ArcSettingImpl withArcApplicationClientId(String arcApplicationClientId) { + this.innerModel().withArcApplicationClientId(arcApplicationClientId); + return this; + } + + public ArcSettingImpl withArcApplicationTenantId(String arcApplicationTenantId) { + this.innerModel().withArcApplicationTenantId(arcApplicationTenantId); + return this; + } + + public ArcSettingImpl withArcServicePrincipalObjectId(String arcServicePrincipalObjectId) { + this.innerModel().withArcServicePrincipalObjectId(arcServicePrincipalObjectId); + return this; + } + + public ArcSettingImpl withArcApplicationObjectId(String arcApplicationObjectId) { + this.innerModel().withArcApplicationObjectId(arcApplicationObjectId); + return this; + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingsClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingsClientImpl.java new file mode 100644 index 0000000000000..e6b5daedb1aa1 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingsClientImpl.java @@ -0,0 +1,1466 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.azurestackhci.fluent.ArcSettingsClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.ArcIdentityResponseInner; +import com.azure.resourcemanager.azurestackhci.fluent.models.ArcSettingInner; +import com.azure.resourcemanager.azurestackhci.fluent.models.PasswordCredentialInner; +import com.azure.resourcemanager.azurestackhci.models.ArcSettingList; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ArcSettingsClient. */ +public final class ArcSettingsClientImpl implements ArcSettingsClient { + /** The proxy service used to perform REST calls. */ + private final ArcSettingsService service; + + /** The service client containing this operation class. */ + private final AzureStackHciClientImpl client; + + /** + * Initializes an instance of ArcSettingsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ArcSettingsClientImpl(AzureStackHciClientImpl client) { + this.service = + RestProxy.create(ArcSettingsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureStackHciClientArcSettings to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureStackHciClientA") + private interface ArcSettingsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/clusters/{clusterName}/arcSettings") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByCluster( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/clusters/{clusterName}/arcSettings/{arcSettingName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("arcSettingName") String arcSettingName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/clusters/{clusterName}/arcSettings/{arcSettingName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("arcSettingName") String arcSettingName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ArcSettingInner arcSetting, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/clusters/{clusterName}/arcSettings/{arcSettingName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("arcSettingName") String arcSettingName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/clusters/{clusterName}/arcSettings/{arcSettingName}/generatePassword") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> generatePassword( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("arcSettingName") String arcSettingName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/clusters/{clusterName}/arcSettings/{arcSettingName}/createArcIdentity") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createIdentity( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("arcSettingName") String arcSettingName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByClusterNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get ArcSetting resources of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting resources of HCI Cluster along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByClusterSinglePageAsync( + String resourceGroupName, String clusterName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByCluster( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get ArcSetting resources of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting resources of HCI Cluster along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByClusterSinglePageAsync( + String resourceGroupName, String clusterName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByCluster( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get ArcSetting resources of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting resources of HCI Cluster as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByClusterAsync(String resourceGroupName, String clusterName) { + return new PagedFlux<>( + () -> listByClusterSinglePageAsync(resourceGroupName, clusterName), + nextLink -> listByClusterNextSinglePageAsync(nextLink)); + } + + /** + * Get ArcSetting resources of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting resources of HCI Cluster as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByClusterAsync( + String resourceGroupName, String clusterName, Context context) { + return new PagedFlux<>( + () -> listByClusterSinglePageAsync(resourceGroupName, clusterName, context), + nextLink -> listByClusterNextSinglePageAsync(nextLink, context)); + } + + /** + * Get ArcSetting resources of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting resources of HCI Cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByCluster(String resourceGroupName, String clusterName) { + return new PagedIterable<>(listByClusterAsync(resourceGroupName, clusterName)); + } + + /** + * Get ArcSetting resources of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting resources of HCI Cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByCluster(String resourceGroupName, String clusterName, Context context) { + return new PagedIterable<>(listByClusterAsync(resourceGroupName, clusterName, context)); + } + + /** + * Get ArcSetting resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting resource details of HCI Cluster along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String clusterName, String arcSettingName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (arcSettingName == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + arcSettingName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get ArcSetting resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting resource details of HCI Cluster along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String clusterName, String arcSettingName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (arcSettingName == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + arcSettingName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get ArcSetting resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting resource details of HCI Cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String clusterName, String arcSettingName) { + return getWithResponseAsync(resourceGroupName, clusterName, arcSettingName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get ArcSetting resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting resource details of HCI Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ArcSettingInner get(String resourceGroupName, String clusterName, String arcSettingName) { + return getAsync(resourceGroupName, clusterName, arcSettingName).block(); + } + + /** + * Get ArcSetting resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting resource details of HCI Cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String clusterName, String arcSettingName, Context context) { + return getWithResponseAsync(resourceGroupName, clusterName, arcSettingName, context).block(); + } + + /** + * Create ArcSetting for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param arcSetting Parameters supplied to the Create ArcSetting resource for this HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, String clusterName, String arcSettingName, ArcSettingInner arcSetting) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (arcSettingName == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + } + if (arcSetting == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSetting is required and cannot be null.")); + } else { + arcSetting.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + arcSettingName, + this.client.getApiVersion(), + arcSetting, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create ArcSetting for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param arcSetting Parameters supplied to the Create ArcSetting resource for this HCI cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, + String clusterName, + String arcSettingName, + ArcSettingInner arcSetting, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (arcSettingName == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + } + if (arcSetting == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSetting is required and cannot be null.")); + } else { + arcSetting.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + arcSettingName, + this.client.getApiVersion(), + arcSetting, + accept, + context); + } + + /** + * Create ArcSetting for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param arcSetting Parameters supplied to the Create ArcSetting resource for this HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String clusterName, String arcSettingName, ArcSettingInner arcSetting) { + return createWithResponseAsync(resourceGroupName, clusterName, arcSettingName, arcSetting) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Create ArcSetting for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param arcSetting Parameters supplied to the Create ArcSetting resource for this HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ArcSettingInner create( + String resourceGroupName, String clusterName, String arcSettingName, ArcSettingInner arcSetting) { + return createAsync(resourceGroupName, clusterName, arcSettingName, arcSetting).block(); + } + + /** + * Create ArcSetting for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param arcSetting Parameters supplied to the Create ArcSetting resource for this HCI cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse( + String resourceGroupName, + String clusterName, + String arcSettingName, + ArcSettingInner arcSetting, + Context context) { + return createWithResponseAsync(resourceGroupName, clusterName, arcSettingName, arcSetting, context).block(); + } + + /** + * Delete ArcSetting resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String clusterName, String arcSettingName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (arcSettingName == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + arcSettingName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete ArcSetting resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String clusterName, String arcSettingName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (arcSettingName == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + arcSettingName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Delete ArcSetting resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String clusterName, String arcSettingName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName, arcSettingName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete ArcSetting resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String clusterName, String arcSettingName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, clusterName, arcSettingName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete ArcSetting resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String clusterName, String arcSettingName) { + return beginDeleteAsync(resourceGroupName, clusterName, arcSettingName).getSyncPoller(); + } + + /** + * Delete ArcSetting resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String clusterName, String arcSettingName, Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, arcSettingName, context).getSyncPoller(); + } + + /** + * Delete ArcSetting resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String clusterName, String arcSettingName) { + return beginDeleteAsync(resourceGroupName, clusterName, arcSettingName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete ArcSetting resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String clusterName, String arcSettingName, Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, arcSettingName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete ArcSetting resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String clusterName, String arcSettingName) { + deleteAsync(resourceGroupName, clusterName, arcSettingName).block(); + } + + /** + * Delete ArcSetting resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String clusterName, String arcSettingName, Context context) { + deleteAsync(resourceGroupName, clusterName, arcSettingName, context).block(); + } + + /** + * Generate password for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> generatePasswordWithResponseAsync( + String resourceGroupName, String clusterName, String arcSettingName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (arcSettingName == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .generatePassword( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + arcSettingName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Generate password for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> generatePasswordWithResponseAsync( + String resourceGroupName, String clusterName, String arcSettingName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (arcSettingName == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .generatePassword( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + arcSettingName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Generate password for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono generatePasswordAsync( + String resourceGroupName, String clusterName, String arcSettingName) { + return generatePasswordWithResponseAsync(resourceGroupName, clusterName, arcSettingName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Generate password for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PasswordCredentialInner generatePassword( + String resourceGroupName, String clusterName, String arcSettingName) { + return generatePasswordAsync(resourceGroupName, clusterName, arcSettingName).block(); + } + + /** + * Generate password for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response generatePasswordWithResponse( + String resourceGroupName, String clusterName, String arcSettingName, Context context) { + return generatePasswordWithResponseAsync(resourceGroupName, clusterName, arcSettingName, context).block(); + } + + /** + * Create Aad identity for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcIdentity details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createIdentityWithResponseAsync( + String resourceGroupName, String clusterName, String arcSettingName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (arcSettingName == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createIdentity( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + arcSettingName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create Aad identity for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcIdentity details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createIdentityWithResponseAsync( + String resourceGroupName, String clusterName, String arcSettingName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (arcSettingName == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createIdentity( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + arcSettingName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Create Aad identity for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of arcIdentity details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ArcIdentityResponseInner> beginCreateIdentityAsync( + String resourceGroupName, String clusterName, String arcSettingName) { + Mono>> mono = + createIdentityWithResponseAsync(resourceGroupName, clusterName, arcSettingName); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ArcIdentityResponseInner.class, + ArcIdentityResponseInner.class, + this.client.getContext()); + } + + /** + * Create Aad identity for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of arcIdentity details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ArcIdentityResponseInner> beginCreateIdentityAsync( + String resourceGroupName, String clusterName, String arcSettingName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createIdentityWithResponseAsync(resourceGroupName, clusterName, arcSettingName, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ArcIdentityResponseInner.class, + ArcIdentityResponseInner.class, + context); + } + + /** + * Create Aad identity for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of arcIdentity details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ArcIdentityResponseInner> beginCreateIdentity( + String resourceGroupName, String clusterName, String arcSettingName) { + return beginCreateIdentityAsync(resourceGroupName, clusterName, arcSettingName).getSyncPoller(); + } + + /** + * Create Aad identity for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of arcIdentity details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ArcIdentityResponseInner> beginCreateIdentity( + String resourceGroupName, String clusterName, String arcSettingName, Context context) { + return beginCreateIdentityAsync(resourceGroupName, clusterName, arcSettingName, context).getSyncPoller(); + } + + /** + * Create Aad identity for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcIdentity details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createIdentityAsync( + String resourceGroupName, String clusterName, String arcSettingName) { + return beginCreateIdentityAsync(resourceGroupName, clusterName, arcSettingName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create Aad identity for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcIdentity details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createIdentityAsync( + String resourceGroupName, String clusterName, String arcSettingName, Context context) { + return beginCreateIdentityAsync(resourceGroupName, clusterName, arcSettingName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create Aad identity for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcIdentity details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ArcIdentityResponseInner createIdentity( + String resourceGroupName, String clusterName, String arcSettingName) { + return createIdentityAsync(resourceGroupName, clusterName, arcSettingName).block(); + } + + /** + * Create Aad identity for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcIdentity details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ArcIdentityResponseInner createIdentity( + String resourceGroupName, String clusterName, String arcSettingName, Context context) { + return createIdentityAsync(resourceGroupName, clusterName, arcSettingName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ArcSetting proxy resources for the HCI cluster along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ArcSetting proxy resources for the HCI cluster along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByClusterNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByClusterNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingsImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingsImpl.java new file mode 100644 index 0000000000000..e7fc8d055b322 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingsImpl.java @@ -0,0 +1,238 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.azurestackhci.fluent.ArcSettingsClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.ArcIdentityResponseInner; +import com.azure.resourcemanager.azurestackhci.fluent.models.ArcSettingInner; +import com.azure.resourcemanager.azurestackhci.fluent.models.PasswordCredentialInner; +import com.azure.resourcemanager.azurestackhci.models.ArcIdentityResponse; +import com.azure.resourcemanager.azurestackhci.models.ArcSetting; +import com.azure.resourcemanager.azurestackhci.models.ArcSettings; +import com.azure.resourcemanager.azurestackhci.models.PasswordCredential; + +public final class ArcSettingsImpl implements ArcSettings { + private static final ClientLogger LOGGER = new ClientLogger(ArcSettingsImpl.class); + + private final ArcSettingsClient innerClient; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + public ArcSettingsImpl( + ArcSettingsClient innerClient, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByCluster(String resourceGroupName, String clusterName) { + PagedIterable inner = this.serviceClient().listByCluster(resourceGroupName, clusterName); + return Utils.mapPage(inner, inner1 -> new ArcSettingImpl(inner1, this.manager())); + } + + public PagedIterable listByCluster(String resourceGroupName, String clusterName, Context context) { + PagedIterable inner = + this.serviceClient().listByCluster(resourceGroupName, clusterName, context); + return Utils.mapPage(inner, inner1 -> new ArcSettingImpl(inner1, this.manager())); + } + + public ArcSetting get(String resourceGroupName, String clusterName, String arcSettingName) { + ArcSettingInner inner = this.serviceClient().get(resourceGroupName, clusterName, arcSettingName); + if (inner != null) { + return new ArcSettingImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String clusterName, String arcSettingName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, clusterName, arcSettingName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ArcSettingImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String clusterName, String arcSettingName) { + this.serviceClient().delete(resourceGroupName, clusterName, arcSettingName); + } + + public void delete(String resourceGroupName, String clusterName, String arcSettingName, Context context) { + this.serviceClient().delete(resourceGroupName, clusterName, arcSettingName, context); + } + + public PasswordCredential generatePassword(String resourceGroupName, String clusterName, String arcSettingName) { + PasswordCredentialInner inner = + this.serviceClient().generatePassword(resourceGroupName, clusterName, arcSettingName); + if (inner != null) { + return new PasswordCredentialImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response generatePasswordWithResponse( + String resourceGroupName, String clusterName, String arcSettingName, Context context) { + Response inner = + this.serviceClient().generatePasswordWithResponse(resourceGroupName, clusterName, arcSettingName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PasswordCredentialImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ArcIdentityResponse createIdentity(String resourceGroupName, String clusterName, String arcSettingName) { + ArcIdentityResponseInner inner = + this.serviceClient().createIdentity(resourceGroupName, clusterName, arcSettingName); + if (inner != null) { + return new ArcIdentityResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public ArcIdentityResponse createIdentity( + String resourceGroupName, String clusterName, String arcSettingName, Context context) { + ArcIdentityResponseInner inner = + this.serviceClient().createIdentity(resourceGroupName, clusterName, arcSettingName, context); + if (inner != null) { + return new ArcIdentityResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public ArcSetting getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String arcSettingName = Utils.getValueFromIdByName(id, "arcSettings"); + if (arcSettingName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'arcSettings'.", id))); + } + return this.getWithResponse(resourceGroupName, clusterName, arcSettingName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String arcSettingName = Utils.getValueFromIdByName(id, "arcSettings"); + if (arcSettingName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'arcSettings'.", id))); + } + return this.getWithResponse(resourceGroupName, clusterName, arcSettingName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String arcSettingName = Utils.getValueFromIdByName(id, "arcSettings"); + if (arcSettingName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'arcSettings'.", id))); + } + this.delete(resourceGroupName, clusterName, arcSettingName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String arcSettingName = Utils.getValueFromIdByName(id, "arcSettings"); + if (arcSettingName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'arcSettings'.", id))); + } + this.delete(resourceGroupName, clusterName, arcSettingName, context); + } + + private ArcSettingsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } + + public ArcSettingImpl define(String name) { + return new ArcSettingImpl(name, this.manager()); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/AzureStackHciClientBuilder.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/AzureStackHciClientBuilder.java index 389dc32c2e1e6..deb531de19bc9 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 @@ -7,7 +7,6 @@ import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.policy.CookiePolicy; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; import com.azure.core.management.AzureEnvironment; @@ -67,34 +66,34 @@ public AzureStackHciClientBuilder environment(AzureEnvironment environment) { } /* - * The default poll interval for long-running operation + * The HTTP pipeline to send requests through */ - private Duration defaultPollInterval; + private HttpPipeline pipeline; /** - * Sets The default poll interval for long-running operation. + * Sets The HTTP pipeline to send requests through. * - * @param defaultPollInterval the defaultPollInterval value. + * @param pipeline the pipeline value. * @return the AzureStackHciClientBuilder. */ - public AzureStackHciClientBuilder defaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = defaultPollInterval; + public AzureStackHciClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; return this; } /* - * The HTTP pipeline to send requests through + * The default poll interval for long-running operation */ - private HttpPipeline pipeline; + private Duration defaultPollInterval; /** - * Sets The HTTP pipeline to send requests through. + * Sets The default poll interval for long-running operation. * - * @param pipeline the pipeline value. + * @param defaultPollInterval the defaultPollInterval value. * @return the AzureStackHciClientBuilder. */ - public AzureStackHciClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; + public AzureStackHciClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; return this; } @@ -120,21 +119,21 @@ public AzureStackHciClientBuilder serializerAdapter(SerializerAdapter serializer * @return an instance of AzureStackHciClientImpl. */ public AzureStackHciClientImpl buildClient() { + if (pipeline == null) { + this.pipeline = new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + } 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 (pipeline == null) { - this.pipeline = - new HttpPipelineBuilder() - .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) - .build(); - } if (serializerAdapter == null) { this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); } 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 c6f8b7d73b93d..b33bf1cfea376 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 @@ -21,8 +21,10 @@ import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.azurestackhci.fluent.ArcSettingsClient; import com.azure.resourcemanager.azurestackhci.fluent.AzureStackHciClient; import com.azure.resourcemanager.azurestackhci.fluent.ClustersClient; +import com.azure.resourcemanager.azurestackhci.fluent.ExtensionsClient; import com.azure.resourcemanager.azurestackhci.fluent.OperationsClient; import java.io.IOException; import java.lang.reflect.Type; @@ -37,8 +39,6 @@ /** Initializes a new instance of the AzureStackHciClientImpl type. */ @ServiceClient(builder = AzureStackHciClientBuilder.class) public final class AzureStackHciClientImpl implements AzureStackHciClient { - private final ClientLogger logger = new ClientLogger(AzureStackHciClientImpl.class); - /** The ID of the target subscription. */ private final String subscriptionId; @@ -111,16 +111,16 @@ public Duration getDefaultPollInterval() { return this.defaultPollInterval; } - /** The OperationsClient object to access its operations. */ - private final OperationsClient operations; + /** The ArcSettingsClient object to access its operations. */ + private final ArcSettingsClient arcSettings; /** - * Gets the OperationsClient object to access its operations. + * Gets the ArcSettingsClient object to access its operations. * - * @return the OperationsClient object. + * @return the ArcSettingsClient object. */ - public OperationsClient getOperations() { - return this.operations; + public ArcSettingsClient getArcSettings() { + return this.arcSettings; } /** The ClustersClient object to access its operations. */ @@ -135,6 +135,30 @@ public ClustersClient getClusters() { return this.clusters; } + /** The ExtensionsClient object to access its operations. */ + private final ExtensionsClient extensions; + + /** + * Gets the ExtensionsClient object to access its operations. + * + * @return the ExtensionsClient object. + */ + public ExtensionsClient getExtensions() { + return this.extensions; + } + + /** The OperationsClient object to access its operations. */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + /** * Initializes an instance of AzureStackHciClient client. * @@ -157,9 +181,11 @@ public ClustersClient getClusters() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2020-10-01"; - this.operations = new OperationsClientImpl(this); + this.apiVersion = "2022-03-01"; + this.arcSettings = new ArcSettingsClientImpl(this); this.clusters = new ClustersClientImpl(this); + this.extensions = new ExtensionsClientImpl(this); + this.operations = new OperationsClientImpl(this); } /** @@ -245,7 +271,7 @@ public Mono getLroFinalResultOrError(AsyncPollResponse, managementError = null; } } catch (IOException | RuntimeException ioe) { - logger.logThrowableAsWarning(ioe); + LOGGER.logThrowableAsWarning(ioe); } } } else { @@ -304,4 +330,6 @@ public Mono getBodyAsString(Charset charset) { return Mono.just(new String(responseBody, charset)); } } + + private static final ClientLogger LOGGER = new ClientLogger(AzureStackHciClientImpl.class); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClusterIdentityResponseImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClusterIdentityResponseImpl.java new file mode 100644 index 0000000000000..bc4eb9adf8bee --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClusterIdentityResponseImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.resourcemanager.azurestackhci.fluent.models.ClusterIdentityResponseInner; +import com.azure.resourcemanager.azurestackhci.models.ClusterIdentityResponse; + +public final class ClusterIdentityResponseImpl implements ClusterIdentityResponse { + private ClusterIdentityResponseInner innerObject; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + ClusterIdentityResponseImpl( + ClusterIdentityResponseInner innerObject, + com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String aadClientId() { + return this.innerModel().aadClientId(); + } + + public String aadTenantId() { + return this.innerModel().aadTenantId(); + } + + public String aadServicePrincipalObjectId() { + return this.innerModel().aadServicePrincipalObjectId(); + } + + public String aadApplicationObjectId() { + return this.innerModel().aadApplicationObjectId(); + } + + public ClusterIdentityResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClusterImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClusterImpl.java index d42ade422ccf5..a40ba16f582c8 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 @@ -5,14 +5,17 @@ package com.azure.resourcemanager.azurestackhci.implementation; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.azurestackhci.fluent.models.ClusterInner; import com.azure.resourcemanager.azurestackhci.models.Cluster; +import com.azure.resourcemanager.azurestackhci.models.ClusterDesiredProperties; +import com.azure.resourcemanager.azurestackhci.models.ClusterIdentityResponse; +import com.azure.resourcemanager.azurestackhci.models.ClusterPatch; import com.azure.resourcemanager.azurestackhci.models.ClusterReportedProperties; -import com.azure.resourcemanager.azurestackhci.models.ClusterUpdate; -import com.azure.resourcemanager.azurestackhci.models.CreatedByType; import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; import com.azure.resourcemanager.azurestackhci.models.Status; +import com.azure.resourcemanager.azurestackhci.models.UploadCertificateRequest; import java.time.OffsetDateTime; import java.util.Collections; import java.util.Map; @@ -47,6 +50,10 @@ public Map tags() { } } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public ProvisioningState provisioningState() { return this.innerModel().provisioningState(); } @@ -59,6 +66,10 @@ public String cloudId() { return this.innerModel().cloudId(); } + public String cloudManagementEndpoint() { + return this.innerModel().cloudManagementEndpoint(); + } + public String aadClientId() { return this.innerModel().aadClientId(); } @@ -67,6 +78,18 @@ public String aadTenantId() { return this.innerModel().aadTenantId(); } + public String aadApplicationObjectId() { + return this.innerModel().aadApplicationObjectId(); + } + + public String aadServicePrincipalObjectId() { + return this.innerModel().aadServicePrincipalObjectId(); + } + + public ClusterDesiredProperties desiredProperties() { + return this.innerModel().desiredProperties(); + } + public ClusterReportedProperties reportedProperties() { return this.innerModel().reportedProperties(); } @@ -91,28 +114,8 @@ public OffsetDateTime lastBillingTimestamp() { return this.innerModel().lastBillingTimestamp(); } - public String createdBy() { - return this.innerModel().createdBy(); - } - - public CreatedByType createdByType() { - return this.innerModel().createdByType(); - } - - public OffsetDateTime createdAt() { - return this.innerModel().createdAt(); - } - - public String lastModifiedBy() { - return this.innerModel().lastModifiedBy(); - } - - public CreatedByType lastModifiedByType() { - return this.innerModel().lastModifiedByType(); - } - - public OffsetDateTime lastModifiedAt() { - return this.innerModel().lastModifiedAt(); + public String serviceEndpoint() { + return this.innerModel().serviceEndpoint(); } public Region region() { @@ -135,7 +138,7 @@ private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { private String clusterName; - private ClusterUpdate updateCluster; + private ClusterPatch updateCluster; public ClusterImpl withExistingResourceGroup(String resourceGroupName) { this.resourceGroupName = resourceGroupName; @@ -169,7 +172,7 @@ public Cluster create(Context context) { } public ClusterImpl update() { - this.updateCluster = new ClusterUpdate(); + this.updateCluster = new ClusterPatch(); return this; } @@ -220,6 +223,22 @@ public Cluster refresh(Context context) { return this; } + public void uploadCertificate(UploadCertificateRequest uploadCertificateRequest) { + serviceManager.clusters().uploadCertificate(resourceGroupName, clusterName, uploadCertificateRequest); + } + + public void uploadCertificate(UploadCertificateRequest uploadCertificateRequest, Context context) { + serviceManager.clusters().uploadCertificate(resourceGroupName, clusterName, uploadCertificateRequest, context); + } + + public ClusterIdentityResponse createIdentity() { + return serviceManager.clusters().createIdentity(resourceGroupName, clusterName); + } + + public ClusterIdentityResponse createIdentity(Context context) { + return serviceManager.clusters().createIdentity(resourceGroupName, clusterName, context); + } + public ClusterImpl withRegion(Region location) { this.innerModel().withLocation(location.toString()); return this; @@ -240,49 +259,54 @@ public ClusterImpl withTags(Map tags) { } } - public ClusterImpl withAadClientId(String aadClientId) { - this.innerModel().withAadClientId(aadClientId); - return this; - } - - public ClusterImpl withAadTenantId(String aadTenantId) { - this.innerModel().withAadTenantId(aadTenantId); - return this; - } - - public ClusterImpl withReportedProperties(ClusterReportedProperties reportedProperties) { - this.innerModel().withReportedProperties(reportedProperties); - return this; - } - - public ClusterImpl withCreatedBy(String createdBy) { - this.innerModel().withCreatedBy(createdBy); - return this; + public ClusterImpl withCloudManagementEndpoint(String cloudManagementEndpoint) { + if (isInCreateMode()) { + this.innerModel().withCloudManagementEndpoint(cloudManagementEndpoint); + return this; + } else { + this.updateCluster.withCloudManagementEndpoint(cloudManagementEndpoint); + return this; + } } - public ClusterImpl withCreatedByType(CreatedByType createdByType) { - this.innerModel().withCreatedByType(createdByType); - return this; + public ClusterImpl withAadClientId(String aadClientId) { + if (isInCreateMode()) { + this.innerModel().withAadClientId(aadClientId); + return this; + } else { + this.updateCluster.withAadClientId(aadClientId); + return this; + } } - public ClusterImpl withCreatedAt(OffsetDateTime createdAt) { - this.innerModel().withCreatedAt(createdAt); - return this; + public ClusterImpl withAadTenantId(String aadTenantId) { + if (isInCreateMode()) { + this.innerModel().withAadTenantId(aadTenantId); + return this; + } else { + this.updateCluster.withAadTenantId(aadTenantId); + return this; + } } - public ClusterImpl withLastModifiedBy(String lastModifiedBy) { - this.innerModel().withLastModifiedBy(lastModifiedBy); + public ClusterImpl withAadApplicationObjectId(String aadApplicationObjectId) { + this.innerModel().withAadApplicationObjectId(aadApplicationObjectId); return this; } - public ClusterImpl withLastModifiedByType(CreatedByType lastModifiedByType) { - this.innerModel().withLastModifiedByType(lastModifiedByType); + public ClusterImpl withAadServicePrincipalObjectId(String aadServicePrincipalObjectId) { + this.innerModel().withAadServicePrincipalObjectId(aadServicePrincipalObjectId); return this; } - public ClusterImpl withLastModifiedAt(OffsetDateTime lastModifiedAt) { - this.innerModel().withLastModifiedAt(lastModifiedAt); - return this; + public ClusterImpl withDesiredProperties(ClusterDesiredProperties desiredProperties) { + if (isInCreateMode()) { + this.innerModel().withDesiredProperties(desiredProperties); + return this; + } else { + this.updateCluster.withDesiredProperties(desiredProperties); + return this; + } } private boolean isInCreateMode() { 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 ce30daccae08a..7d68cb08073f4 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 @@ -14,6 +14,7 @@ import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Patch; import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; import com.azure.core.annotation.Put; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; @@ -27,19 +28,23 @@ 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.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.azurestackhci.fluent.ClustersClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.ClusterIdentityResponseInner; import com.azure.resourcemanager.azurestackhci.fluent.models.ClusterInner; import com.azure.resourcemanager.azurestackhci.models.ClusterList; -import com.azure.resourcemanager.azurestackhci.models.ClusterUpdate; +import com.azure.resourcemanager.azurestackhci.models.ClusterPatch; +import com.azure.resourcemanager.azurestackhci.models.UploadCertificateRequest; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in ClustersClient. */ public final class ClustersClientImpl implements ClustersClient { - private final ClientLogger logger = new ClientLogger(ClustersClientImpl.class); - /** The proxy service used to perform REST calls. */ private final ClustersService service; @@ -131,7 +136,7 @@ Mono> update( @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ClusterUpdate cluster, + @BodyParam("application/json") ClusterPatch cluster, @HeaderParam("Accept") String accept, Context context); @@ -150,6 +155,37 @@ Mono> delete( @HeaderParam("Accept") String accept, Context context); + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/clusters/{clusterName}/uploadCertificate") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> uploadCertificate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") UploadCertificateRequest uploadCertificateRequest, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/clusters/{clusterName}/createClusterIdentity") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createIdentity( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + @Headers({"Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -176,7 +212,7 @@ Mono> listByResourceGroupNext( * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of clusters. + * @return list of clusters along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -222,7 +258,7 @@ private Mono> listSinglePageAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of clusters. + * @return list of clusters along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -263,7 +299,7 @@ private Mono> listSinglePageAsync(Context context) { * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of clusters. + * @return list of clusters as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -278,7 +314,7 @@ private PagedFlux listAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of clusters. + * @return list of clusters as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { @@ -291,7 +327,7 @@ private PagedFlux listAsync(Context context) { * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of clusters. + * @return list of clusters as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -305,7 +341,7 @@ public PagedIterable list() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of clusters. + * @return list of clusters as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -319,7 +355,7 @@ public PagedIterable list(Context context) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of clusters. + * @return list of clusters along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { @@ -371,7 +407,7 @@ private Mono> listByResourceGroupSinglePageAsync(Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of clusters. + * @return list of clusters along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync( @@ -420,7 +456,7 @@ private Mono> listByResourceGroupSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of clusters. + * @return list of clusters as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName) { @@ -437,7 +473,7 @@ private PagedFlux listByResourceGroupAsync(String resourceGroupNam * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of clusters. + * @return list of clusters as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { @@ -453,7 +489,7 @@ private PagedFlux listByResourceGroupAsync(String resourceGroupNam * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of clusters. + * @return list of clusters as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName) { @@ -468,7 +504,7 @@ public PagedIterable listByResourceGroup(String resourceGroupName) * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of clusters. + * @return list of clusters as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { @@ -483,7 +519,7 @@ public PagedIterable listByResourceGroup(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -532,7 +568,7 @@ private Mono> getByResourceGroupWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -577,7 +613,7 @@ private Mono> getByResourceGroupWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getByResourceGroupAsync(String resourceGroupName, String clusterName) { @@ -616,7 +652,7 @@ public ClusterInner getByResourceGroup(String resourceGroupName, String clusterN * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Response getByResourceGroupWithResponse( @@ -633,7 +669,7 @@ public Response getByResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createWithResponseAsync( @@ -689,7 +725,7 @@ private Mono> createWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createWithResponseAsync( @@ -741,7 +777,7 @@ private Mono> createWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createAsync(String resourceGroupName, String clusterName, ClusterInner cluster) { @@ -782,7 +818,7 @@ public ClusterInner create(String resourceGroupName, String clusterName, Cluster * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster details. + * @return cluster details along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createWithResponse( @@ -799,11 +835,11 @@ public Response createWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( - String resourceGroupName, String clusterName, ClusterUpdate cluster) { + String resourceGroupName, String clusterName, ClusterPatch cluster) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -855,11 +891,11 @@ private Mono> updateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( - String resourceGroupName, String clusterName, ClusterUpdate cluster, Context context) { + String resourceGroupName, String clusterName, ClusterPatch cluster, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -907,10 +943,10 @@ private Mono> updateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String clusterName, ClusterUpdate cluster) { + private Mono updateAsync(String resourceGroupName, String clusterName, ClusterPatch cluster) { return updateWithResponseAsync(resourceGroupName, clusterName, cluster) .flatMap( (Response res) -> { @@ -934,7 +970,7 @@ private Mono updateAsync(String resourceGroupName, String clusterN * @return cluster details. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ClusterInner update(String resourceGroupName, String clusterName, ClusterUpdate cluster) { + public ClusterInner update(String resourceGroupName, String clusterName, ClusterPatch cluster) { return updateAsync(resourceGroupName, clusterName, cluster).block(); } @@ -948,11 +984,11 @@ public ClusterInner update(String resourceGroupName, String clusterName, Cluster * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster details. + * @return cluster details along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response updateWithResponse( - String resourceGroupName, String clusterName, ClusterUpdate cluster, Context context) { + String resourceGroupName, String clusterName, ClusterPatch cluster, Context context) { return updateWithResponseAsync(resourceGroupName, clusterName, cluster, context).block(); } @@ -964,7 +1000,7 @@ public Response updateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync(String resourceGroupName, String clusterName) { @@ -1012,7 +1048,7 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync( @@ -1057,7 +1093,7 @@ private Mono> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String clusterName) { @@ -1087,13 +1123,538 @@ public void delete(String resourceGroupName, String clusterName) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(String resourceGroupName, String clusterName, Context context) { return deleteWithResponseAsync(resourceGroupName, clusterName, context).block(); } + /** + * Upload certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param uploadCertificateRequest Upload certificate request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> uploadCertificateWithResponseAsync( + String resourceGroupName, String clusterName, UploadCertificateRequest uploadCertificateRequest) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (uploadCertificateRequest == null) { + return Mono + .error( + new IllegalArgumentException("Parameter uploadCertificateRequest is required and cannot be null.")); + } else { + uploadCertificateRequest.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .uploadCertificate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + uploadCertificateRequest, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Upload certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param uploadCertificateRequest Upload certificate request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> uploadCertificateWithResponseAsync( + String resourceGroupName, + String clusterName, + UploadCertificateRequest uploadCertificateRequest, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (uploadCertificateRequest == null) { + return Mono + .error( + new IllegalArgumentException("Parameter uploadCertificateRequest is required and cannot be null.")); + } else { + uploadCertificateRequest.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .uploadCertificate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + uploadCertificateRequest, + accept, + context); + } + + /** + * Upload certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param uploadCertificateRequest Upload certificate request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginUploadCertificateAsync( + String resourceGroupName, String clusterName, UploadCertificateRequest uploadCertificateRequest) { + Mono>> mono = + uploadCertificateWithResponseAsync(resourceGroupName, clusterName, uploadCertificateRequest); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Upload certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param uploadCertificateRequest Upload certificate request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginUploadCertificateAsync( + String resourceGroupName, + String clusterName, + UploadCertificateRequest uploadCertificateRequest, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + uploadCertificateWithResponseAsync(resourceGroupName, clusterName, uploadCertificateRequest, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Upload certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param uploadCertificateRequest Upload certificate request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginUploadCertificate( + String resourceGroupName, String clusterName, UploadCertificateRequest uploadCertificateRequest) { + return beginUploadCertificateAsync(resourceGroupName, clusterName, uploadCertificateRequest).getSyncPoller(); + } + + /** + * Upload certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param uploadCertificateRequest Upload certificate request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginUploadCertificate( + String resourceGroupName, + String clusterName, + UploadCertificateRequest uploadCertificateRequest, + Context context) { + return beginUploadCertificateAsync(resourceGroupName, clusterName, uploadCertificateRequest, context) + .getSyncPoller(); + } + + /** + * Upload certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param uploadCertificateRequest Upload certificate request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono uploadCertificateAsync( + String resourceGroupName, String clusterName, UploadCertificateRequest uploadCertificateRequest) { + return beginUploadCertificateAsync(resourceGroupName, clusterName, uploadCertificateRequest) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Upload certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param uploadCertificateRequest Upload certificate request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono uploadCertificateAsync( + String resourceGroupName, + String clusterName, + UploadCertificateRequest uploadCertificateRequest, + Context context) { + return beginUploadCertificateAsync(resourceGroupName, clusterName, uploadCertificateRequest, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Upload certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param uploadCertificateRequest Upload certificate request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void uploadCertificate( + String resourceGroupName, String clusterName, UploadCertificateRequest uploadCertificateRequest) { + uploadCertificateAsync(resourceGroupName, clusterName, uploadCertificateRequest).block(); + } + + /** + * Upload certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param uploadCertificateRequest Upload certificate request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void uploadCertificate( + String resourceGroupName, + String clusterName, + UploadCertificateRequest uploadCertificateRequest, + Context context) { + uploadCertificateAsync(resourceGroupName, clusterName, uploadCertificateRequest, context).block(); + } + + /** + * Create cluster identity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster Identity details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createIdentityWithResponseAsync( + String resourceGroupName, String clusterName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createIdentity( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create cluster identity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster Identity details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createIdentityWithResponseAsync( + String resourceGroupName, String clusterName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createIdentity( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Create cluster identity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of cluster Identity details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ClusterIdentityResponseInner> beginCreateIdentityAsync( + String resourceGroupName, String clusterName) { + Mono>> mono = createIdentityWithResponseAsync(resourceGroupName, clusterName); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ClusterIdentityResponseInner.class, + ClusterIdentityResponseInner.class, + this.client.getContext()); + } + + /** + * Create cluster identity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of cluster Identity details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ClusterIdentityResponseInner> beginCreateIdentityAsync( + String resourceGroupName, String clusterName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createIdentityWithResponseAsync(resourceGroupName, clusterName, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ClusterIdentityResponseInner.class, + ClusterIdentityResponseInner.class, + context); + } + + /** + * Create cluster identity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of cluster Identity details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ClusterIdentityResponseInner> beginCreateIdentity( + String resourceGroupName, String clusterName) { + return beginCreateIdentityAsync(resourceGroupName, clusterName).getSyncPoller(); + } + + /** + * Create cluster identity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of cluster Identity details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ClusterIdentityResponseInner> beginCreateIdentity( + String resourceGroupName, String clusterName, Context context) { + return beginCreateIdentityAsync(resourceGroupName, clusterName, context).getSyncPoller(); + } + + /** + * Create cluster identity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster Identity details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createIdentityAsync(String resourceGroupName, String clusterName) { + return beginCreateIdentityAsync(resourceGroupName, clusterName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create cluster identity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster Identity details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createIdentityAsync( + String resourceGroupName, String clusterName, Context context) { + return beginCreateIdentityAsync(resourceGroupName, clusterName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create cluster identity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster Identity details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterIdentityResponseInner createIdentity(String resourceGroupName, String clusterName) { + return createIdentityAsync(resourceGroupName, clusterName).block(); + } + + /** + * Create cluster identity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster Identity details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterIdentityResponseInner createIdentity(String resourceGroupName, String clusterName, Context context) { + return createIdentityAsync(resourceGroupName, clusterName, context).block(); + } + /** * Get the next page of items. * @@ -1101,7 +1662,7 @@ public Response deleteWithResponse(String resourceGroupName, String cluste * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of clusters. + * @return list of clusters along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { @@ -1138,7 +1699,7 @@ private Mono> listBySubscriptionNextSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of clusters. + * @return list of clusters along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { @@ -1173,7 +1734,7 @@ private Mono> listBySubscriptionNextSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of clusters. + * @return list of clusters along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { @@ -1210,7 +1771,7 @@ private Mono> listByResourceGroupNextSinglePageAsync * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of clusters. + * @return list of clusters along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { 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 ffdedeed7baa8..6d5ac9ecfd5b7 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 @@ -10,13 +10,15 @@ import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.azurestackhci.fluent.ClustersClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.ClusterIdentityResponseInner; import com.azure.resourcemanager.azurestackhci.fluent.models.ClusterInner; import com.azure.resourcemanager.azurestackhci.models.Cluster; +import com.azure.resourcemanager.azurestackhci.models.ClusterIdentityResponse; import com.azure.resourcemanager.azurestackhci.models.Clusters; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.resourcemanager.azurestackhci.models.UploadCertificateRequest; public final class ClustersImpl implements Clusters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ClustersImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(ClustersImpl.class); private final ClustersClient innerClient; @@ -80,10 +82,42 @@ public Response deleteWithResponse(String resourceGroupName, String cluste return this.serviceClient().deleteWithResponse(resourceGroupName, clusterName, context); } + public void uploadCertificate( + String resourceGroupName, String clusterName, UploadCertificateRequest uploadCertificateRequest) { + this.serviceClient().uploadCertificate(resourceGroupName, clusterName, uploadCertificateRequest); + } + + public void uploadCertificate( + String resourceGroupName, + String clusterName, + UploadCertificateRequest uploadCertificateRequest, + Context context) { + this.serviceClient().uploadCertificate(resourceGroupName, clusterName, uploadCertificateRequest, context); + } + + public ClusterIdentityResponse createIdentity(String resourceGroupName, String clusterName) { + ClusterIdentityResponseInner inner = this.serviceClient().createIdentity(resourceGroupName, clusterName); + if (inner != null) { + return new ClusterIdentityResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public ClusterIdentityResponse createIdentity(String resourceGroupName, String clusterName, Context context) { + ClusterIdentityResponseInner inner = + this.serviceClient().createIdentity(resourceGroupName, clusterName, context); + if (inner != null) { + return new ClusterIdentityResponseImpl(inner, this.manager()); + } else { + return null; + } + } + public Cluster getById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -91,7 +125,7 @@ public Cluster getById(String id) { } String clusterName = Utils.getValueFromIdByName(id, "clusters"); if (clusterName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); @@ -102,7 +136,7 @@ public Cluster getById(String id) { public Response getByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -110,7 +144,7 @@ public Response getByIdWithResponse(String id, Context context) { } String clusterName = Utils.getValueFromIdByName(id, "clusters"); if (clusterName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); @@ -121,7 +155,7 @@ public Response getByIdWithResponse(String id, Context context) { public void deleteById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -129,18 +163,18 @@ public void deleteById(String id) { } String clusterName = Utils.getValueFromIdByName(id, "clusters"); if (clusterName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); } - this.deleteWithResponse(resourceGroupName, clusterName, Context.NONE).getValue(); + this.deleteWithResponse(resourceGroupName, clusterName, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -148,7 +182,7 @@ public Response deleteByIdWithResponse(String id, Context context) { } String clusterName = Utils.getValueFromIdByName(id, "clusters"); if (clusterName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ExtensionImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ExtensionImpl.java new file mode 100644 index 0000000000000..18106fd385162 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ExtensionImpl.java @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.fluent.models.ExtensionInner; +import com.azure.resourcemanager.azurestackhci.models.Extension; +import com.azure.resourcemanager.azurestackhci.models.ExtensionAggregateState; +import com.azure.resourcemanager.azurestackhci.models.PerNodeExtensionState; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; +import java.util.Collections; +import java.util.List; + +public final class ExtensionImpl implements Extension, Extension.Definition, Extension.Update { + private ExtensionInner innerObject; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public ExtensionAggregateState aggregateState() { + return this.innerModel().aggregateState(); + } + + public List perNodeExtensionDetails() { + List inner = this.innerModel().perNodeExtensionDetails(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String forceUpdateTag() { + return this.innerModel().forceUpdateTag(); + } + + public String publisher() { + return this.innerModel().publisher(); + } + + public String typePropertiesType() { + return this.innerModel().typePropertiesType(); + } + + public String typeHandlerVersion() { + return this.innerModel().typeHandlerVersion(); + } + + public Boolean autoUpgradeMinorVersion() { + return this.innerModel().autoUpgradeMinorVersion(); + } + + public Object settings() { + return this.innerModel().settings(); + } + + public Object protectedSettings() { + return this.innerModel().protectedSettings(); + } + + public ExtensionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String clusterName; + + private String arcSettingName; + + private String extensionName; + + public ExtensionImpl withExistingArcSetting(String resourceGroupName, String clusterName, String arcSettingName) { + this.resourceGroupName = resourceGroupName; + this.clusterName = clusterName; + this.arcSettingName = arcSettingName; + return this; + } + + public Extension create() { + this.innerObject = + serviceManager + .serviceClient() + .getExtensions() + .create(resourceGroupName, clusterName, arcSettingName, extensionName, this.innerModel(), Context.NONE); + return this; + } + + public Extension create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getExtensions() + .create(resourceGroupName, clusterName, arcSettingName, extensionName, this.innerModel(), context); + return this; + } + + ExtensionImpl(String name, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = new ExtensionInner(); + this.serviceManager = serviceManager; + this.extensionName = name; + } + + public ExtensionImpl update() { + return this; + } + + public Extension apply() { + this.innerObject = + serviceManager + .serviceClient() + .getExtensions() + .update(resourceGroupName, clusterName, arcSettingName, extensionName, this.innerModel(), Context.NONE); + return this; + } + + public Extension apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getExtensions() + .update(resourceGroupName, clusterName, arcSettingName, extensionName, this.innerModel(), context); + return this; + } + + ExtensionImpl( + ExtensionInner innerObject, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.clusterName = Utils.getValueFromIdByName(innerObject.id(), "clusters"); + this.arcSettingName = Utils.getValueFromIdByName(innerObject.id(), "arcSettings"); + this.extensionName = Utils.getValueFromIdByName(innerObject.id(), "extensions"); + } + + public Extension refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getExtensions() + .getWithResponse(resourceGroupName, clusterName, arcSettingName, extensionName, Context.NONE) + .getValue(); + return this; + } + + public Extension refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getExtensions() + .getWithResponse(resourceGroupName, clusterName, arcSettingName, extensionName, context) + .getValue(); + return this; + } + + public ExtensionImpl withForceUpdateTag(String forceUpdateTag) { + this.innerModel().withForceUpdateTag(forceUpdateTag); + return this; + } + + public ExtensionImpl withPublisher(String publisher) { + this.innerModel().withPublisher(publisher); + return this; + } + + public ExtensionImpl withTypePropertiesType(String typePropertiesType) { + this.innerModel().withTypePropertiesType(typePropertiesType); + return this; + } + + public ExtensionImpl withTypeHandlerVersion(String typeHandlerVersion) { + this.innerModel().withTypeHandlerVersion(typeHandlerVersion); + return this; + } + + public ExtensionImpl withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { + this.innerModel().withAutoUpgradeMinorVersion(autoUpgradeMinorVersion); + return this; + } + + public ExtensionImpl withSettings(Object settings) { + this.innerModel().withSettings(settings); + return this; + } + + public ExtensionImpl withProtectedSettings(Object protectedSettings) { + this.innerModel().withProtectedSettings(protectedSettings); + return this; + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ExtensionsClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ExtensionsClientImpl.java new file mode 100644 index 0000000000000..6728c51a24287 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ExtensionsClientImpl.java @@ -0,0 +1,1591 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.azurestackhci.fluent.ExtensionsClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.ExtensionInner; +import com.azure.resourcemanager.azurestackhci.models.ExtensionList; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ExtensionsClient. */ +public final class ExtensionsClientImpl implements ExtensionsClient { + /** The proxy service used to perform REST calls. */ + private final ExtensionsService service; + + /** The service client containing this operation class. */ + private final AzureStackHciClientImpl client; + + /** + * Initializes an instance of ExtensionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ExtensionsClientImpl(AzureStackHciClientImpl client) { + this.service = + RestProxy.create(ExtensionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureStackHciClientExtensions to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureStackHciClientE") + private interface ExtensionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByArcSetting( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("arcSettingName") String arcSettingName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("arcSettingName") String arcSettingName, + @PathParam("extensionName") String extensionName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("arcSettingName") String arcSettingName, + @PathParam("extensionName") String extensionName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ExtensionInner extension, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}") + @ExpectedResponses({201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("arcSettingName") String arcSettingName, + @PathParam("extensionName") String extensionName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ExtensionInner extension, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("arcSettingName") String arcSettingName, + @PathParam("extensionName") String extensionName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByArcSettingNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List all Extensions under ArcSetting resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Extensions in HCI cluster along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByArcSettingSinglePageAsync( + String resourceGroupName, String clusterName, String arcSettingName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (arcSettingName == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByArcSetting( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + arcSettingName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all Extensions under ArcSetting resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Extensions in HCI cluster along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByArcSettingSinglePageAsync( + String resourceGroupName, String clusterName, String arcSettingName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (arcSettingName == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByArcSetting( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + arcSettingName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List all Extensions under ArcSetting resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Extensions in HCI cluster as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByArcSettingAsync( + String resourceGroupName, String clusterName, String arcSettingName) { + return new PagedFlux<>( + () -> listByArcSettingSinglePageAsync(resourceGroupName, clusterName, arcSettingName), + nextLink -> listByArcSettingNextSinglePageAsync(nextLink)); + } + + /** + * List all Extensions under ArcSetting resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Extensions in HCI cluster as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByArcSettingAsync( + String resourceGroupName, String clusterName, String arcSettingName, Context context) { + return new PagedFlux<>( + () -> listByArcSettingSinglePageAsync(resourceGroupName, clusterName, arcSettingName, context), + nextLink -> listByArcSettingNextSinglePageAsync(nextLink, context)); + } + + /** + * List all Extensions under ArcSetting resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Extensions in HCI cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByArcSetting( + String resourceGroupName, String clusterName, String arcSettingName) { + return new PagedIterable<>(listByArcSettingAsync(resourceGroupName, clusterName, arcSettingName)); + } + + /** + * List all Extensions under ArcSetting resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Extensions in HCI cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByArcSetting( + String resourceGroupName, String clusterName, String arcSettingName, Context context) { + return new PagedIterable<>(listByArcSettingAsync(resourceGroupName, clusterName, arcSettingName, context)); + } + + /** + * Get particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return particular Arc Extension of HCI Cluster along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String clusterName, String arcSettingName, String extensionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (arcSettingName == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + } + if (extensionName == null) { + return Mono.error(new IllegalArgumentException("Parameter extensionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + arcSettingName, + extensionName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return particular Arc Extension of HCI Cluster along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String clusterName, String arcSettingName, String extensionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (arcSettingName == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + } + if (extensionName == null) { + return Mono.error(new IllegalArgumentException("Parameter extensionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + arcSettingName, + extensionName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return particular Arc Extension of HCI Cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String clusterName, String arcSettingName, String extensionName) { + return getWithResponseAsync(resourceGroupName, clusterName, arcSettingName, extensionName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return particular Arc Extension of HCI Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExtensionInner get( + String resourceGroupName, String clusterName, String arcSettingName, String extensionName) { + return getAsync(resourceGroupName, clusterName, arcSettingName, extensionName).block(); + } + + /** + * Get particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return particular Arc Extension of HCI Cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String clusterName, String arcSettingName, String extensionName, Context context) { + return getWithResponseAsync(resourceGroupName, clusterName, arcSettingName, extensionName, context).block(); + } + + /** + * Create Extension for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extension Details of the Machine Extension to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of a particular extension in HCI Cluster along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String clusterName, + String arcSettingName, + String extensionName, + ExtensionInner extension) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (arcSettingName == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + } + if (extensionName == null) { + return Mono.error(new IllegalArgumentException("Parameter extensionName is required and cannot be null.")); + } + if (extension == null) { + return Mono.error(new IllegalArgumentException("Parameter extension is required and cannot be null.")); + } else { + extension.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + arcSettingName, + extensionName, + this.client.getApiVersion(), + extension, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create Extension for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extension Details of the Machine Extension to be created. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of a particular extension in HCI Cluster along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String clusterName, + String arcSettingName, + String extensionName, + ExtensionInner extension, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (arcSettingName == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + } + if (extensionName == null) { + return Mono.error(new IllegalArgumentException("Parameter extensionName is required and cannot be null.")); + } + if (extension == null) { + return Mono.error(new IllegalArgumentException("Parameter extension is required and cannot be null.")); + } else { + extension.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + arcSettingName, + extensionName, + this.client.getApiVersion(), + extension, + accept, + context); + } + + /** + * Create Extension for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extension Details of the Machine Extension to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of details of a particular extension in HCI Cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ExtensionInner> beginCreateAsync( + String resourceGroupName, + String clusterName, + String arcSettingName, + String extensionName, + ExtensionInner extension) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, clusterName, arcSettingName, extensionName, extension); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ExtensionInner.class, + ExtensionInner.class, + this.client.getContext()); + } + + /** + * Create Extension for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extension Details of the Machine Extension to be created. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of details of a particular extension in HCI Cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ExtensionInner> beginCreateAsync( + String resourceGroupName, + String clusterName, + String arcSettingName, + String extensionName, + ExtensionInner extension, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, clusterName, arcSettingName, extensionName, extension, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ExtensionInner.class, ExtensionInner.class, context); + } + + /** + * Create Extension for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extension Details of the Machine Extension to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of details of a particular extension in HCI Cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExtensionInner> beginCreate( + String resourceGroupName, + String clusterName, + String arcSettingName, + String extensionName, + ExtensionInner extension) { + return beginCreateAsync(resourceGroupName, clusterName, arcSettingName, extensionName, extension) + .getSyncPoller(); + } + + /** + * Create Extension for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extension Details of the Machine Extension to be created. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of details of a particular extension in HCI Cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExtensionInner> beginCreate( + String resourceGroupName, + String clusterName, + String arcSettingName, + String extensionName, + ExtensionInner extension, + Context context) { + return beginCreateAsync(resourceGroupName, clusterName, arcSettingName, extensionName, extension, context) + .getSyncPoller(); + } + + /** + * Create Extension for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extension Details of the Machine Extension to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of a particular extension in HCI Cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String clusterName, + String arcSettingName, + String extensionName, + ExtensionInner extension) { + return beginCreateAsync(resourceGroupName, clusterName, arcSettingName, extensionName, extension) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create Extension for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extension Details of the Machine Extension to be created. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of a particular extension in HCI Cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String clusterName, + String arcSettingName, + String extensionName, + ExtensionInner extension, + Context context) { + return beginCreateAsync(resourceGroupName, clusterName, arcSettingName, extensionName, extension, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create Extension for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extension Details of the Machine Extension to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of a particular extension in HCI Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExtensionInner create( + String resourceGroupName, + String clusterName, + String arcSettingName, + String extensionName, + ExtensionInner extension) { + return createAsync(resourceGroupName, clusterName, arcSettingName, extensionName, extension).block(); + } + + /** + * Create Extension for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extension Details of the Machine Extension to be created. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of a particular extension in HCI Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExtensionInner create( + String resourceGroupName, + String clusterName, + String arcSettingName, + String extensionName, + ExtensionInner extension, + Context context) { + return createAsync(resourceGroupName, clusterName, arcSettingName, extensionName, extension, context).block(); + } + + /** + * Update Extension for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extension Details of the Machine Extension to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of a particular extension in HCI Cluster along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String clusterName, + String arcSettingName, + String extensionName, + ExtensionInner extension) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (arcSettingName == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + } + if (extensionName == null) { + return Mono.error(new IllegalArgumentException("Parameter extensionName is required and cannot be null.")); + } + if (extension == null) { + return Mono.error(new IllegalArgumentException("Parameter extension is required and cannot be null.")); + } else { + extension.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + arcSettingName, + extensionName, + this.client.getApiVersion(), + extension, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update Extension for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extension Details of the Machine Extension to be created. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of a particular extension in HCI Cluster along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String clusterName, + String arcSettingName, + String extensionName, + ExtensionInner extension, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (arcSettingName == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + } + if (extensionName == null) { + return Mono.error(new IllegalArgumentException("Parameter extensionName is required and cannot be null.")); + } + if (extension == null) { + return Mono.error(new IllegalArgumentException("Parameter extension is required and cannot be null.")); + } else { + extension.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + arcSettingName, + extensionName, + this.client.getApiVersion(), + extension, + accept, + context); + } + + /** + * Update Extension for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extension Details of the Machine Extension to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of details of a particular extension in HCI Cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ExtensionInner> beginUpdateAsync( + String resourceGroupName, + String clusterName, + String arcSettingName, + String extensionName, + ExtensionInner extension) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, clusterName, arcSettingName, extensionName, extension); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ExtensionInner.class, + ExtensionInner.class, + this.client.getContext()); + } + + /** + * Update Extension for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extension Details of the Machine Extension to be created. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of details of a particular extension in HCI Cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ExtensionInner> beginUpdateAsync( + String resourceGroupName, + String clusterName, + String arcSettingName, + String extensionName, + ExtensionInner extension, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, clusterName, arcSettingName, extensionName, extension, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ExtensionInner.class, ExtensionInner.class, context); + } + + /** + * Update Extension for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extension Details of the Machine Extension to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of details of a particular extension in HCI Cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExtensionInner> beginUpdate( + String resourceGroupName, + String clusterName, + String arcSettingName, + String extensionName, + ExtensionInner extension) { + return beginUpdateAsync(resourceGroupName, clusterName, arcSettingName, extensionName, extension) + .getSyncPoller(); + } + + /** + * Update Extension for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extension Details of the Machine Extension to be created. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of details of a particular extension in HCI Cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExtensionInner> beginUpdate( + String resourceGroupName, + String clusterName, + String arcSettingName, + String extensionName, + ExtensionInner extension, + Context context) { + return beginUpdateAsync(resourceGroupName, clusterName, arcSettingName, extensionName, extension, context) + .getSyncPoller(); + } + + /** + * Update Extension for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extension Details of the Machine Extension to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of a particular extension in HCI Cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String clusterName, + String arcSettingName, + String extensionName, + ExtensionInner extension) { + return beginUpdateAsync(resourceGroupName, clusterName, arcSettingName, extensionName, extension) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update Extension for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extension Details of the Machine Extension to be created. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of a particular extension in HCI Cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String clusterName, + String arcSettingName, + String extensionName, + ExtensionInner extension, + Context context) { + return beginUpdateAsync(resourceGroupName, clusterName, arcSettingName, extensionName, extension, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update Extension for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extension Details of the Machine Extension to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of a particular extension in HCI Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExtensionInner update( + String resourceGroupName, + String clusterName, + String arcSettingName, + String extensionName, + ExtensionInner extension) { + return updateAsync(resourceGroupName, clusterName, arcSettingName, extensionName, extension).block(); + } + + /** + * Update Extension for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extension Details of the Machine Extension to be created. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of a particular extension in HCI Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExtensionInner update( + String resourceGroupName, + String clusterName, + String arcSettingName, + String extensionName, + ExtensionInner extension, + Context context) { + return updateAsync(resourceGroupName, clusterName, arcSettingName, extensionName, extension, context).block(); + } + + /** + * Delete particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String clusterName, String arcSettingName, String extensionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (arcSettingName == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + } + if (extensionName == null) { + return Mono.error(new IllegalArgumentException("Parameter extensionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + arcSettingName, + extensionName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String clusterName, String arcSettingName, String extensionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (arcSettingName == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + } + if (extensionName == null) { + return Mono.error(new IllegalArgumentException("Parameter extensionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + arcSettingName, + extensionName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Delete particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String clusterName, String arcSettingName, String extensionName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, clusterName, arcSettingName, extensionName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String clusterName, String arcSettingName, String extensionName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, clusterName, arcSettingName, extensionName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String clusterName, String arcSettingName, String extensionName) { + return beginDeleteAsync(resourceGroupName, clusterName, arcSettingName, extensionName).getSyncPoller(); + } + + /** + * Delete particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String clusterName, String arcSettingName, String extensionName, Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, arcSettingName, extensionName, context).getSyncPoller(); + } + + /** + * Delete particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String clusterName, String arcSettingName, String extensionName) { + return beginDeleteAsync(resourceGroupName, clusterName, arcSettingName, extensionName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String clusterName, String arcSettingName, String extensionName, Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, arcSettingName, extensionName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String clusterName, String arcSettingName, String extensionName) { + deleteAsync(resourceGroupName, clusterName, arcSettingName, extensionName).block(); + } + + /** + * Delete particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, String clusterName, String arcSettingName, String extensionName, Context context) { + deleteAsync(resourceGroupName, clusterName, arcSettingName, extensionName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Extensions in HCI cluster along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByArcSettingNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByArcSettingNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Extensions in HCI cluster along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByArcSettingNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByArcSettingNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ExtensionsImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ExtensionsImpl.java new file mode 100644 index 0000000000000..a2ed71822024c --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ExtensionsImpl.java @@ -0,0 +1,224 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.azurestackhci.fluent.ExtensionsClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.ExtensionInner; +import com.azure.resourcemanager.azurestackhci.models.Extension; +import com.azure.resourcemanager.azurestackhci.models.Extensions; + +public final class ExtensionsImpl implements Extensions { + private static final ClientLogger LOGGER = new ClientLogger(ExtensionsImpl.class); + + private final ExtensionsClient innerClient; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + public ExtensionsImpl( + ExtensionsClient innerClient, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByArcSetting( + String resourceGroupName, String clusterName, String arcSettingName) { + PagedIterable inner = + this.serviceClient().listByArcSetting(resourceGroupName, clusterName, arcSettingName); + return Utils.mapPage(inner, inner1 -> new ExtensionImpl(inner1, this.manager())); + } + + public PagedIterable listByArcSetting( + String resourceGroupName, String clusterName, String arcSettingName, Context context) { + PagedIterable inner = + this.serviceClient().listByArcSetting(resourceGroupName, clusterName, arcSettingName, context); + return Utils.mapPage(inner, inner1 -> new ExtensionImpl(inner1, this.manager())); + } + + public Extension get(String resourceGroupName, String clusterName, String arcSettingName, String extensionName) { + ExtensionInner inner = this.serviceClient().get(resourceGroupName, clusterName, arcSettingName, extensionName); + if (inner != null) { + return new ExtensionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String clusterName, String arcSettingName, String extensionName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, clusterName, arcSettingName, extensionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ExtensionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String clusterName, String arcSettingName, String extensionName) { + this.serviceClient().delete(resourceGroupName, clusterName, arcSettingName, extensionName); + } + + public void delete( + String resourceGroupName, String clusterName, String arcSettingName, String extensionName, Context context) { + this.serviceClient().delete(resourceGroupName, clusterName, arcSettingName, extensionName, context); + } + + public Extension getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String arcSettingName = Utils.getValueFromIdByName(id, "arcSettings"); + if (arcSettingName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'arcSettings'.", id))); + } + String extensionName = Utils.getValueFromIdByName(id, "extensions"); + if (extensionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'extensions'.", id))); + } + return this + .getWithResponse(resourceGroupName, clusterName, arcSettingName, extensionName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String arcSettingName = Utils.getValueFromIdByName(id, "arcSettings"); + if (arcSettingName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'arcSettings'.", id))); + } + String extensionName = Utils.getValueFromIdByName(id, "extensions"); + if (extensionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'extensions'.", id))); + } + return this.getWithResponse(resourceGroupName, clusterName, arcSettingName, extensionName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String arcSettingName = Utils.getValueFromIdByName(id, "arcSettings"); + if (arcSettingName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'arcSettings'.", id))); + } + String extensionName = Utils.getValueFromIdByName(id, "extensions"); + if (extensionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'extensions'.", id))); + } + this.delete(resourceGroupName, clusterName, arcSettingName, extensionName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String arcSettingName = Utils.getValueFromIdByName(id, "arcSettings"); + if (arcSettingName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'arcSettings'.", id))); + } + String extensionName = Utils.getValueFromIdByName(id, "extensions"); + if (extensionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'extensions'.", id))); + } + this.delete(resourceGroupName, clusterName, arcSettingName, extensionName, context); + } + + private ExtensionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } + + public ExtensionImpl define(String name) { + return new ExtensionImpl(name, this.manager()); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/AvailableOperationsImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OperationListResultImpl.java similarity index 62% rename from sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/AvailableOperationsImpl.java rename to sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OperationListResultImpl.java index 5b15c5c41e449..5d406ea17f054 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/AvailableOperationsImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OperationListResultImpl.java @@ -4,26 +4,26 @@ package com.azure.resourcemanager.azurestackhci.implementation; -import com.azure.resourcemanager.azurestackhci.fluent.models.AvailableOperationsInner; -import com.azure.resourcemanager.azurestackhci.models.AvailableOperations; -import com.azure.resourcemanager.azurestackhci.models.OperationDetail; +import com.azure.resourcemanager.azurestackhci.fluent.models.OperationListResultInner; +import com.azure.resourcemanager.azurestackhci.models.Operation; +import com.azure.resourcemanager.azurestackhci.models.OperationListResult; import java.util.Collections; import java.util.List; -public final class AvailableOperationsImpl implements AvailableOperations { - private AvailableOperationsInner innerObject; +public final class OperationListResultImpl implements OperationListResult { + private OperationListResultInner innerObject; private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; - AvailableOperationsImpl( - AvailableOperationsInner innerObject, + OperationListResultImpl( + OperationListResultInner innerObject, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } - public List value() { - List inner = this.innerModel().value(); + public List value() { + List inner = this.innerModel().value(); if (inner != null) { return Collections.unmodifiableList(inner); } else { @@ -35,7 +35,7 @@ public String nextLink() { return this.innerModel().nextLink(); } - public AvailableOperationsInner innerModel() { + public OperationListResultInner innerModel() { return this.innerObject; } 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 96b74acc66565..9bdf4c5016496 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 @@ -20,15 +20,12 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.azurestackhci.fluent.OperationsClient; -import com.azure.resourcemanager.azurestackhci.fluent.models.AvailableOperationsInner; +import com.azure.resourcemanager.azurestackhci.fluent.models.OperationListResultInner; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in OperationsClient. */ public final class OperationsClientImpl implements OperationsClient { - private final ClientLogger logger = new ClientLogger(OperationsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final OperationsService service; @@ -57,7 +54,7 @@ private interface OperationsService { @Get("/providers/Microsoft.AzureStackHCI/operations") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( + Mono> list( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, @@ -69,10 +66,11 @@ Mono> list( * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return available operations of the service. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync() { + private Mono> listWithResponseAsync() { if (this.client.getEndpoint() == null) { return Mono .error( @@ -93,10 +91,11 @@ private Mono> listWithResponseAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return available operations of the service. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync(Context context) { + private Mono> listWithResponseAsync(Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -113,13 +112,14 @@ private Mono> listWithResponseAsync(Context c * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return available operations of the service. + * @return a list of REST API operations supported by an Azure Resource Provider on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listAsync() { + private Mono listAsync() { return listWithResponseAsync() .flatMap( - (Response res) -> { + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -133,10 +133,10 @@ private Mono listAsync() { * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return available operations of the service. + * @return a list of REST API operations supported by an Azure Resource Provider. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AvailableOperationsInner list() { + public OperationListResultInner list() { return listAsync().block(); } @@ -147,10 +147,10 @@ public AvailableOperationsInner list() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return available operations of the service. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse(Context context) { + public Response listWithResponse(Context context) { return listWithResponseAsync(context).block(); } } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OperationsImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OperationsImpl.java index 25b04346c2d58..9a5400b784a4d 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 @@ -9,13 +9,12 @@ import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.azurestackhci.fluent.OperationsClient; -import com.azure.resourcemanager.azurestackhci.fluent.models.AvailableOperationsInner; -import com.azure.resourcemanager.azurestackhci.models.AvailableOperations; +import com.azure.resourcemanager.azurestackhci.fluent.models.OperationListResultInner; +import com.azure.resourcemanager.azurestackhci.models.OperationListResult; import com.azure.resourcemanager.azurestackhci.models.Operations; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class OperationsImpl implements Operations { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class); private final OperationsClient innerClient; @@ -27,23 +26,23 @@ public OperationsImpl( this.serviceManager = serviceManager; } - public AvailableOperations list() { - AvailableOperationsInner inner = this.serviceClient().list(); + public OperationListResult list() { + OperationListResultInner inner = this.serviceClient().list(); if (inner != null) { - return new AvailableOperationsImpl(inner, this.manager()); + return new OperationListResultImpl(inner, this.manager()); } else { return null; } } - public Response listWithResponse(Context context) { - Response inner = this.serviceClient().listWithResponse(context); + public Response listWithResponse(Context context) { + Response inner = this.serviceClient().listWithResponse(context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AvailableOperationsImpl(inner.getValue(), this.manager())); + new OperationListResultImpl(inner.getValue(), this.manager())); } else { return null; } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/PasswordCredentialImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/PasswordCredentialImpl.java new file mode 100644 index 0000000000000..281ace205dd39 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/PasswordCredentialImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.resourcemanager.azurestackhci.fluent.models.PasswordCredentialInner; +import com.azure.resourcemanager.azurestackhci.models.PasswordCredential; +import java.time.OffsetDateTime; + +public final class PasswordCredentialImpl implements PasswordCredential { + private PasswordCredentialInner innerObject; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + PasswordCredentialImpl( + PasswordCredentialInner innerObject, + com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String secretText() { + return this.innerModel().secretText(); + } + + public String keyId() { + return this.innerModel().keyId(); + } + + public OffsetDateTime startDateTime() { + return this.innerModel().startDateTime(); + } + + public OffsetDateTime endDateTime() { + return this.innerModel().endDateTime(); + } + + public PasswordCredentialInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ActionType.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ActionType.java new file mode 100644 index 0000000000000..5affedfda7875 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ActionType.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ActionType. */ +public final class ActionType extends ExpandableStringEnum { + /** Static value Internal for ActionType. */ + public static final ActionType INTERNAL = fromString("Internal"); + + /** + * Creates or finds a ActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ActionType. + */ + @JsonCreator + public static ActionType fromString(String name) { + return fromString(name, ActionType.class); + } + + /** @return known ActionType values. */ + public static Collection values() { + return values(ActionType.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcIdentityResponse.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcIdentityResponse.java new file mode 100644 index 0000000000000..970adcaa4bf88 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcIdentityResponse.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.resourcemanager.azurestackhci.fluent.models.ArcIdentityResponseInner; + +/** An immutable client-side representation of ArcIdentityResponse. */ +public interface ArcIdentityResponse { + /** + * Gets the arcApplicationClientId property: The arcApplicationClientId property. + * + * @return the arcApplicationClientId value. + */ + String arcApplicationClientId(); + + /** + * Gets the arcApplicationTenantId property: The arcApplicationTenantId property. + * + * @return the arcApplicationTenantId value. + */ + String arcApplicationTenantId(); + + /** + * Gets the arcServicePrincipalObjectId property: The arcServicePrincipalObjectId property. + * + * @return the arcServicePrincipalObjectId value. + */ + String arcServicePrincipalObjectId(); + + /** + * Gets the arcApplicationObjectId property: The arcApplicationObjectId property. + * + * @return the arcApplicationObjectId value. + */ + String arcApplicationObjectId(); + + /** + * Gets the inner com.azure.resourcemanager.azurestackhci.fluent.models.ArcIdentityResponseInner object. + * + * @return the inner object. + */ + ArcIdentityResponseInner innerModel(); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSetting.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSetting.java new file mode 100644 index 0000000000000..5212cf56c5803 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSetting.java @@ -0,0 +1,259 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.fluent.models.ArcSettingInner; +import java.util.List; + +/** An immutable client-side representation of ArcSetting. */ +public interface ArcSetting { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: System data of ArcSetting resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: Provisioning state of the ArcSetting proxy resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the arcInstanceResourceGroup property: The resource group that hosts the Arc agents, ie. Hybrid Compute + * Machine resources. + * + * @return the arcInstanceResourceGroup value. + */ + String arcInstanceResourceGroup(); + + /** + * Gets the arcApplicationClientId property: App id of arc AAD identity. + * + * @return the arcApplicationClientId value. + */ + String arcApplicationClientId(); + + /** + * Gets the arcApplicationTenantId property: Tenant id of arc AAD identity. + * + * @return the arcApplicationTenantId value. + */ + String arcApplicationTenantId(); + + /** + * Gets the arcServicePrincipalObjectId property: Object id of arc AAD service principal. + * + * @return the arcServicePrincipalObjectId value. + */ + String arcServicePrincipalObjectId(); + + /** + * Gets the arcApplicationObjectId property: Object id of arc AAD identity. + * + * @return the arcApplicationObjectId value. + */ + String arcApplicationObjectId(); + + /** + * Gets the aggregateState property: Aggregate state of Arc agent across the nodes in this HCI cluster. + * + * @return the aggregateState value. + */ + ArcSettingAggregateState aggregateState(); + + /** + * Gets the perNodeDetails property: State of Arc agent in each of the nodes. + * + * @return the perNodeDetails value. + */ + List perNodeDetails(); + + /** + * Gets the inner com.azure.resourcemanager.azurestackhci.fluent.models.ArcSettingInner object. + * + * @return the inner object. + */ + ArcSettingInner innerModel(); + + /** The entirety of the ArcSetting definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The ArcSetting definition stages. */ + interface DefinitionStages { + /** The first stage of the ArcSetting definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the ArcSetting definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, clusterName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @return the next definition stage. + */ + WithCreate withExistingCluster(String resourceGroupName, String clusterName); + } + /** + * The stage of the ArcSetting definition which contains all the minimum required properties for the resource to + * be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithArcInstanceResourceGroup, + DefinitionStages.WithArcApplicationClientId, + DefinitionStages.WithArcApplicationTenantId, + DefinitionStages.WithArcServicePrincipalObjectId, + DefinitionStages.WithArcApplicationObjectId { + /** + * Executes the create request. + * + * @return the created resource. + */ + ArcSetting create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ArcSetting create(Context context); + } + /** The stage of the ArcSetting definition allowing to specify arcInstanceResourceGroup. */ + interface WithArcInstanceResourceGroup { + /** + * Specifies the arcInstanceResourceGroup property: The resource group that hosts the Arc agents, ie. Hybrid + * Compute Machine resources.. + * + * @param arcInstanceResourceGroup The resource group that hosts the Arc agents, ie. Hybrid Compute Machine + * resources. + * @return the next definition stage. + */ + WithCreate withArcInstanceResourceGroup(String arcInstanceResourceGroup); + } + /** The stage of the ArcSetting definition allowing to specify arcApplicationClientId. */ + interface WithArcApplicationClientId { + /** + * Specifies the arcApplicationClientId property: App id of arc AAD identity.. + * + * @param arcApplicationClientId App id of arc AAD identity. + * @return the next definition stage. + */ + WithCreate withArcApplicationClientId(String arcApplicationClientId); + } + /** The stage of the ArcSetting definition allowing to specify arcApplicationTenantId. */ + interface WithArcApplicationTenantId { + /** + * Specifies the arcApplicationTenantId property: Tenant id of arc AAD identity.. + * + * @param arcApplicationTenantId Tenant id of arc AAD identity. + * @return the next definition stage. + */ + WithCreate withArcApplicationTenantId(String arcApplicationTenantId); + } + /** The stage of the ArcSetting definition allowing to specify arcServicePrincipalObjectId. */ + interface WithArcServicePrincipalObjectId { + /** + * Specifies the arcServicePrincipalObjectId property: Object id of arc AAD service principal.. + * + * @param arcServicePrincipalObjectId Object id of arc AAD service principal. + * @return the next definition stage. + */ + WithCreate withArcServicePrincipalObjectId(String arcServicePrincipalObjectId); + } + /** The stage of the ArcSetting definition allowing to specify arcApplicationObjectId. */ + interface WithArcApplicationObjectId { + /** + * Specifies the arcApplicationObjectId property: Object id of arc AAD identity.. + * + * @param arcApplicationObjectId Object id of arc AAD identity. + * @return the next definition stage. + */ + WithCreate withArcApplicationObjectId(String arcApplicationObjectId); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ArcSetting refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ArcSetting refresh(Context context); + + /** + * Generate password for arc settings. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + PasswordCredential generatePassword(); + + /** + * Generate password for arc settings. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + Response generatePasswordWithResponse(Context context); + + /** + * Create Aad identity for arc settings. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcIdentity details. + */ + ArcIdentityResponse createIdentity(); + + /** + * Create Aad identity for arc settings. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcIdentity details. + */ + ArcIdentityResponse createIdentity(Context context); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSettingAggregateState.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSettingAggregateState.java new file mode 100644 index 0000000000000..938735eabf8af --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSettingAggregateState.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ArcSettingAggregateState. */ +public final class ArcSettingAggregateState extends ExpandableStringEnum { + /** Static value NotSpecified for ArcSettingAggregateState. */ + public static final ArcSettingAggregateState NOT_SPECIFIED = fromString("NotSpecified"); + + /** Static value Error for ArcSettingAggregateState. */ + public static final ArcSettingAggregateState ERROR = fromString("Error"); + + /** Static value Succeeded for ArcSettingAggregateState. */ + public static final ArcSettingAggregateState SUCCEEDED = fromString("Succeeded"); + + /** Static value Canceled for ArcSettingAggregateState. */ + public static final ArcSettingAggregateState CANCELED = fromString("Canceled"); + + /** Static value Failed for ArcSettingAggregateState. */ + public static final ArcSettingAggregateState FAILED = fromString("Failed"); + + /** Static value Connected for ArcSettingAggregateState. */ + public static final ArcSettingAggregateState CONNECTED = fromString("Connected"); + + /** Static value Disconnected for ArcSettingAggregateState. */ + public static final ArcSettingAggregateState DISCONNECTED = fromString("Disconnected"); + + /** Static value Deleted for ArcSettingAggregateState. */ + public static final ArcSettingAggregateState DELETED = fromString("Deleted"); + + /** Static value Creating for ArcSettingAggregateState. */ + public static final ArcSettingAggregateState CREATING = fromString("Creating"); + + /** Static value Updating for ArcSettingAggregateState. */ + public static final ArcSettingAggregateState UPDATING = fromString("Updating"); + + /** Static value Deleting for ArcSettingAggregateState. */ + public static final ArcSettingAggregateState DELETING = fromString("Deleting"); + + /** Static value Moving for ArcSettingAggregateState. */ + public static final ArcSettingAggregateState MOVING = fromString("Moving"); + + /** Static value PartiallySucceeded for ArcSettingAggregateState. */ + public static final ArcSettingAggregateState PARTIALLY_SUCCEEDED = fromString("PartiallySucceeded"); + + /** Static value PartiallyConnected for ArcSettingAggregateState. */ + public static final ArcSettingAggregateState PARTIALLY_CONNECTED = fromString("PartiallyConnected"); + + /** Static value InProgress for ArcSettingAggregateState. */ + public static final ArcSettingAggregateState IN_PROGRESS = fromString("InProgress"); + + /** + * Creates or finds a ArcSettingAggregateState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ArcSettingAggregateState. + */ + @JsonCreator + public static ArcSettingAggregateState fromString(String name) { + return fromString(name, ArcSettingAggregateState.class); + } + + /** @return known ArcSettingAggregateState values. */ + public static Collection values() { + return values(ArcSettingAggregateState.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSettingList.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSettingList.java new file mode 100644 index 0000000000000..877c5efa98071 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSettingList.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.azure.resourcemanager.azurestackhci.fluent.models.ArcSettingInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of ArcSetting proxy resources for the HCI cluster. */ +@Immutable +public final class ArcSettingList { + /* + * List of ArcSetting proxy resources. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Link to the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: List of ArcSetting proxy resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Link to the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSettings.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSettings.java new file mode 100644 index 0000000000000..d58145da942f6 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSettings.java @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ArcSettings. */ +public interface ArcSettings { + /** + * Get ArcSetting resources of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting resources of HCI Cluster as paginated response with {@link PagedIterable}. + */ + PagedIterable listByCluster(String resourceGroupName, String clusterName); + + /** + * Get ArcSetting resources of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting resources of HCI Cluster as paginated response with {@link PagedIterable}. + */ + PagedIterable listByCluster(String resourceGroupName, String clusterName, Context context); + + /** + * Get ArcSetting resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting resource details of HCI Cluster. + */ + ArcSetting get(String resourceGroupName, String clusterName, String arcSettingName); + + /** + * Get ArcSetting resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting resource details of HCI Cluster along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String clusterName, String arcSettingName, Context context); + + /** + * Delete ArcSetting resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String clusterName, String arcSettingName); + + /** + * Delete ArcSetting resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String clusterName, String arcSettingName, Context context); + + /** + * Generate password for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + PasswordCredential generatePassword(String resourceGroupName, String clusterName, String arcSettingName); + + /** + * Generate password for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + Response generatePasswordWithResponse( + String resourceGroupName, String clusterName, String arcSettingName, Context context); + + /** + * Create Aad identity for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcIdentity details. + */ + ArcIdentityResponse createIdentity(String resourceGroupName, String clusterName, String arcSettingName); + + /** + * Create Aad identity for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcIdentity details. + */ + ArcIdentityResponse createIdentity( + String resourceGroupName, String clusterName, String arcSettingName, Context context); + + /** + * Get ArcSetting resource details of HCI Cluster. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting resource details of HCI Cluster along with {@link Response}. + */ + ArcSetting getById(String id); + + /** + * Get ArcSetting resource details of HCI Cluster. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting resource details of HCI Cluster along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete ArcSetting resource details of HCI Cluster. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete ArcSetting resource details of HCI Cluster. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ArcSetting resource. + * + * @param name resource name. + * @return the first stage of the new ArcSetting definition. + */ + ArcSetting.DefinitionStages.Blank define(String name); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/AvailableOperations.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/AvailableOperations.java deleted file mode 100644 index f34dac121ea0f..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/AvailableOperations.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.models; - -import com.azure.resourcemanager.azurestackhci.fluent.models.AvailableOperationsInner; -import java.util.List; - -/** An immutable client-side representation of AvailableOperations. */ -public interface AvailableOperations { - /** - * Gets the value property: Collection of available operation details. - * - * @return the value value. - */ - List value(); - - /** - * Gets the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for - * now, added for future use. - * - * @return the nextLink value. - */ - String nextLink(); - - /** - * Gets the inner com.azure.resourcemanager.azurestackhci.fluent.models.AvailableOperationsInner object. - * - * @return the inner object. - */ - AvailableOperationsInner innerModel(); -} 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 9465d92f22429..bc07bef31968d 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 @@ -5,6 +5,7 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.azurestackhci.fluent.models.ClusterInner; import java.time.OffsetDateTime; @@ -47,6 +48,13 @@ public interface Cluster { */ Map tags(); + /** + * Gets the systemData property: System data of Cluster resource. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the provisioningState property: Provisioning state. * @@ -68,6 +76,13 @@ public interface Cluster { */ String cloudId(); + /** + * Gets the cloudManagementEndpoint property: Endpoint configured for management from the Azure portal. + * + * @return the cloudManagementEndpoint value. + */ + String cloudManagementEndpoint(); + /** * Gets the aadClientId property: App id of cluster AAD identity. * @@ -82,6 +97,27 @@ public interface Cluster { */ String aadTenantId(); + /** + * Gets the aadApplicationObjectId property: Object id of cluster AAD identity. + * + * @return the aadApplicationObjectId value. + */ + String aadApplicationObjectId(); + + /** + * Gets the aadServicePrincipalObjectId property: Id of cluster identity service principal. + * + * @return the aadServicePrincipalObjectId value. + */ + String aadServicePrincipalObjectId(); + + /** + * Gets the desiredProperties property: Desired properties of the cluster. + * + * @return the desiredProperties value. + */ + ClusterDesiredProperties desiredProperties(); + /** * Gets the reportedProperties property: Properties reported by cluster agent. * @@ -125,46 +161,11 @@ public interface Cluster { OffsetDateTime lastBillingTimestamp(); /** - * Gets the createdBy property: The identity that created the resource. - * - * @return the createdBy value. - */ - String createdBy(); - - /** - * Gets the createdByType property: The type of identity that created the resource. - * - * @return the createdByType value. - */ - CreatedByType createdByType(); - - /** - * Gets the createdAt property: The timestamp of resource creation (UTC). + * Gets the serviceEndpoint property: Region specific DataPath Endpoint of the cluster. * - * @return the createdAt value. + * @return the serviceEndpoint value. */ - OffsetDateTime createdAt(); - - /** - * Gets the lastModifiedBy property: The identity that last modified the resource. - * - * @return the lastModifiedBy value. - */ - String lastModifiedBy(); - - /** - * Gets the lastModifiedByType property: The type of identity that last modified the resource. - * - * @return the lastModifiedByType value. - */ - CreatedByType lastModifiedByType(); - - /** - * Gets the lastModifiedAt property: The timestamp of resource last modification (UTC). - * - * @return the lastModifiedAt value. - */ - OffsetDateTime lastModifiedAt(); + String serviceEndpoint(); /** * Gets the region of the resource. @@ -233,15 +234,12 @@ interface WithResourceGroup { */ interface WithCreate extends DefinitionStages.WithTags, + DefinitionStages.WithCloudManagementEndpoint, DefinitionStages.WithAadClientId, DefinitionStages.WithAadTenantId, - DefinitionStages.WithReportedProperties, - DefinitionStages.WithCreatedBy, - DefinitionStages.WithCreatedByType, - DefinitionStages.WithCreatedAt, - DefinitionStages.WithLastModifiedBy, - DefinitionStages.WithLastModifiedByType, - DefinitionStages.WithLastModifiedAt { + DefinitionStages.WithAadApplicationObjectId, + DefinitionStages.WithAadServicePrincipalObjectId, + DefinitionStages.WithDesiredProperties { /** * Executes the create request. * @@ -267,6 +265,17 @@ interface WithTags { */ WithCreate withTags(Map tags); } + /** The stage of the Cluster definition allowing to specify cloudManagementEndpoint. */ + interface WithCloudManagementEndpoint { + /** + * Specifies the cloudManagementEndpoint property: Endpoint configured for management from the Azure + * portal.. + * + * @param cloudManagementEndpoint Endpoint configured for management from the Azure portal. + * @return the next definition stage. + */ + WithCreate withCloudManagementEndpoint(String cloudManagementEndpoint); + } /** The stage of the Cluster definition allowing to specify aadClientId. */ interface WithAadClientId { /** @@ -287,75 +296,35 @@ interface WithAadTenantId { */ WithCreate withAadTenantId(String aadTenantId); } - /** The stage of the Cluster definition allowing to specify reportedProperties. */ - interface WithReportedProperties { - /** - * Specifies the reportedProperties property: Properties reported by cluster agent.. - * - * @param reportedProperties Properties reported by cluster agent. - * @return the next definition stage. - */ - WithCreate withReportedProperties(ClusterReportedProperties reportedProperties); - } - /** The stage of the Cluster definition allowing to specify createdBy. */ - interface WithCreatedBy { - /** - * Specifies the createdBy property: The identity that created the resource.. - * - * @param createdBy The identity that created the resource. - * @return the next definition stage. - */ - WithCreate withCreatedBy(String createdBy); - } - /** The stage of the Cluster definition allowing to specify createdByType. */ - interface WithCreatedByType { + /** The stage of the Cluster definition allowing to specify aadApplicationObjectId. */ + interface WithAadApplicationObjectId { /** - * Specifies the createdByType property: The type of identity that created the resource.. + * Specifies the aadApplicationObjectId property: Object id of cluster AAD identity.. * - * @param createdByType The type of identity that created the resource. + * @param aadApplicationObjectId Object id of cluster AAD identity. * @return the next definition stage. */ - WithCreate withCreatedByType(CreatedByType createdByType); + WithCreate withAadApplicationObjectId(String aadApplicationObjectId); } - /** The stage of the Cluster definition allowing to specify createdAt. */ - interface WithCreatedAt { + /** The stage of the Cluster definition allowing to specify aadServicePrincipalObjectId. */ + interface WithAadServicePrincipalObjectId { /** - * Specifies the createdAt property: The timestamp of resource creation (UTC).. + * Specifies the aadServicePrincipalObjectId property: Id of cluster identity service principal.. * - * @param createdAt The timestamp of resource creation (UTC). + * @param aadServicePrincipalObjectId Id of cluster identity service principal. * @return the next definition stage. */ - WithCreate withCreatedAt(OffsetDateTime createdAt); + WithCreate withAadServicePrincipalObjectId(String aadServicePrincipalObjectId); } - /** The stage of the Cluster definition allowing to specify lastModifiedBy. */ - interface WithLastModifiedBy { + /** The stage of the Cluster definition allowing to specify desiredProperties. */ + interface WithDesiredProperties { /** - * Specifies the lastModifiedBy property: The identity that last modified the resource.. + * Specifies the desiredProperties property: Desired properties of the cluster.. * - * @param lastModifiedBy The identity that last modified the resource. + * @param desiredProperties Desired properties of the cluster. * @return the next definition stage. */ - WithCreate withLastModifiedBy(String lastModifiedBy); - } - /** The stage of the Cluster definition allowing to specify lastModifiedByType. */ - interface WithLastModifiedByType { - /** - * Specifies the lastModifiedByType property: The type of identity that last modified the resource.. - * - * @param lastModifiedByType The type of identity that last modified the resource. - * @return the next definition stage. - */ - WithCreate withLastModifiedByType(CreatedByType lastModifiedByType); - } - /** The stage of the Cluster definition allowing to specify lastModifiedAt. */ - interface WithLastModifiedAt { - /** - * Specifies the lastModifiedAt property: The timestamp of resource last modification (UTC). - * - * @param lastModifiedAt The timestamp of resource last modification (UTC). - * @return the next definition stage. - */ - WithCreate withLastModifiedAt(OffsetDateTime lastModifiedAt); + WithCreate withDesiredProperties(ClusterDesiredProperties desiredProperties); } } /** @@ -366,7 +335,12 @@ interface WithLastModifiedAt { Cluster.Update update(); /** The template for Cluster update. */ - interface Update extends UpdateStages.WithTags { + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithCloudManagementEndpoint, + UpdateStages.WithAadClientId, + UpdateStages.WithAadTenantId, + UpdateStages.WithDesiredProperties { /** * Executes the update request. * @@ -394,6 +368,46 @@ interface WithTags { */ Update withTags(Map tags); } + /** The stage of the Cluster update allowing to specify cloudManagementEndpoint. */ + interface WithCloudManagementEndpoint { + /** + * Specifies the cloudManagementEndpoint property: Endpoint configured for management from the Azure portal. + * + * @param cloudManagementEndpoint Endpoint configured for management from the Azure portal. + * @return the next definition stage. + */ + Update withCloudManagementEndpoint(String cloudManagementEndpoint); + } + /** The stage of the Cluster update allowing to specify aadClientId. */ + interface WithAadClientId { + /** + * Specifies the aadClientId property: App id of cluster AAD identity.. + * + * @param aadClientId App id of cluster AAD identity. + * @return the next definition stage. + */ + Update withAadClientId(String aadClientId); + } + /** The stage of the Cluster update allowing to specify aadTenantId. */ + interface WithAadTenantId { + /** + * Specifies the aadTenantId property: Tenant id of cluster AAD identity.. + * + * @param aadTenantId Tenant id of cluster AAD identity. + * @return the next definition stage. + */ + Update withAadTenantId(String aadTenantId); + } + /** The stage of the Cluster update allowing to specify desiredProperties. */ + interface WithDesiredProperties { + /** + * Specifies the desiredProperties property: Desired properties of the cluster.. + * + * @param desiredProperties Desired properties of the cluster. + * @return the next definition stage. + */ + Update withDesiredProperties(ClusterDesiredProperties desiredProperties); + } } /** * Refreshes the resource to sync with Azure. @@ -409,4 +423,45 @@ interface WithTags { * @return the refreshed resource. */ Cluster refresh(Context context); + + /** + * Upload certificate. + * + * @param uploadCertificateRequest Upload certificate request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void uploadCertificate(UploadCertificateRequest uploadCertificateRequest); + + /** + * Upload certificate. + * + * @param uploadCertificateRequest Upload certificate request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void uploadCertificate(UploadCertificateRequest uploadCertificateRequest, Context context); + + /** + * Create cluster identity. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster Identity details. + */ + ClusterIdentityResponse createIdentity(); + + /** + * Create cluster identity. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster Identity details. + */ + ClusterIdentityResponse createIdentity(Context context); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterDesiredProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterDesiredProperties.java new file mode 100644 index 0000000000000..6047cd6aac00a --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterDesiredProperties.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Desired properties of the cluster. */ +@Fluent +public final class ClusterDesiredProperties { + /* + * Desired state of Windows Server Subscription. + */ + @JsonProperty(value = "windowsServerSubscription") + private WindowsServerSubscription windowsServerSubscription; + + /* + * Desired level of diagnostic data emitted by the cluster. + */ + @JsonProperty(value = "diagnosticLevel") + private DiagnosticLevel diagnosticLevel; + + /** + * Get the windowsServerSubscription property: Desired state of Windows Server Subscription. + * + * @return the windowsServerSubscription value. + */ + public WindowsServerSubscription windowsServerSubscription() { + return this.windowsServerSubscription; + } + + /** + * Set the windowsServerSubscription property: Desired state of Windows Server Subscription. + * + * @param windowsServerSubscription the windowsServerSubscription value to set. + * @return the ClusterDesiredProperties object itself. + */ + public ClusterDesiredProperties withWindowsServerSubscription(WindowsServerSubscription windowsServerSubscription) { + this.windowsServerSubscription = windowsServerSubscription; + return this; + } + + /** + * Get the diagnosticLevel property: Desired level of diagnostic data emitted by the cluster. + * + * @return the diagnosticLevel value. + */ + public DiagnosticLevel diagnosticLevel() { + return this.diagnosticLevel; + } + + /** + * Set the diagnosticLevel property: Desired level of diagnostic data emitted by the cluster. + * + * @param diagnosticLevel the diagnosticLevel value to set. + * @return the ClusterDesiredProperties object itself. + */ + public ClusterDesiredProperties withDiagnosticLevel(DiagnosticLevel diagnosticLevel) { + this.diagnosticLevel = diagnosticLevel; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterIdentityResponse.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterIdentityResponse.java new file mode 100644 index 0000000000000..296b523f8462d --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterIdentityResponse.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.resourcemanager.azurestackhci.fluent.models.ClusterIdentityResponseInner; + +/** An immutable client-side representation of ClusterIdentityResponse. */ +public interface ClusterIdentityResponse { + /** + * Gets the aadClientId property: The aadClientId property. + * + * @return the aadClientId value. + */ + String aadClientId(); + + /** + * Gets the aadTenantId property: The aadTenantId property. + * + * @return the aadTenantId value. + */ + String aadTenantId(); + + /** + * Gets the aadServicePrincipalObjectId property: The aadServicePrincipalObjectId property. + * + * @return the aadServicePrincipalObjectId value. + */ + String aadServicePrincipalObjectId(); + + /** + * Gets the aadApplicationObjectId property: The aadApplicationObjectId property. + * + * @return the aadApplicationObjectId value. + */ + String aadApplicationObjectId(); + + /** + * Gets the inner com.azure.resourcemanager.azurestackhci.fluent.models.ClusterIdentityResponseInner object. + * + * @return the inner object. + */ + ClusterIdentityResponseInner innerModel(); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterList.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterList.java index afc2f0fd03dae..0a18e044fdbff 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 @@ -5,17 +5,13 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.azurestackhci.fluent.models.ClusterInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** List of clusters. */ @Fluent public final class ClusterList { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterList.class); - /* * 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 c755566c5e9fa..1d7a5a571ed42 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 @@ -5,15 +5,11 @@ package com.azure.resourcemanager.azurestackhci.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Cluster node details. */ @Immutable public final class ClusterNode { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterNode.class); - /* * Name of the cluster node. */ @@ -26,6 +22,12 @@ public final class ClusterNode { @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) private Float id; + /* + * State of Windows Server Subscription. + */ + @JsonProperty(value = "windowsServerSubscription", access = JsonProperty.Access.WRITE_ONLY) + private WindowsServerSubscription windowsServerSubscription; + /* * Manufacturer of the cluster node hardware. */ @@ -86,6 +88,15 @@ public Float id() { return this.id; } + /** + * Get the windowsServerSubscription property: State of Windows Server Subscription. + * + * @return the windowsServerSubscription value. + */ + public WindowsServerSubscription windowsServerSubscription() { + return this.windowsServerSubscription; + } + /** * Get the manufacturer property: Manufacturer of the cluster node hardware. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterPatch.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterPatch.java new file mode 100644 index 0000000000000..2004f6129e9fe --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterPatch.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurestackhci.fluent.models.ClusterPatchProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Cluster details to update. */ +@Fluent +public final class ClusterPatch { + /* + * Resource tags. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /* + * Cluster properties. + */ + @JsonProperty(value = "properties") + private ClusterPatchProperties innerProperties; + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the ClusterPatch object itself. + */ + public ClusterPatch withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the innerProperties property: Cluster properties. + * + * @return the innerProperties value. + */ + private ClusterPatchProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the cloudManagementEndpoint property: Endpoint configured for management from the Azure portal. + * + * @return the cloudManagementEndpoint value. + */ + public String cloudManagementEndpoint() { + return this.innerProperties() == null ? null : this.innerProperties().cloudManagementEndpoint(); + } + + /** + * Set the cloudManagementEndpoint property: Endpoint configured for management from the Azure portal. + * + * @param cloudManagementEndpoint the cloudManagementEndpoint value to set. + * @return the ClusterPatch object itself. + */ + public ClusterPatch withCloudManagementEndpoint(String cloudManagementEndpoint) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterPatchProperties(); + } + this.innerProperties().withCloudManagementEndpoint(cloudManagementEndpoint); + return this; + } + + /** + * Get the aadClientId property: App id of cluster AAD identity. + * + * @return the aadClientId value. + */ + public String aadClientId() { + return this.innerProperties() == null ? null : this.innerProperties().aadClientId(); + } + + /** + * Set the aadClientId property: App id of cluster AAD identity. + * + * @param aadClientId the aadClientId value to set. + * @return the ClusterPatch object itself. + */ + public ClusterPatch withAadClientId(String aadClientId) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterPatchProperties(); + } + this.innerProperties().withAadClientId(aadClientId); + return this; + } + + /** + * Get the aadTenantId property: Tenant id of cluster AAD identity. + * + * @return the aadTenantId value. + */ + public String aadTenantId() { + return this.innerProperties() == null ? null : this.innerProperties().aadTenantId(); + } + + /** + * Set the aadTenantId property: Tenant id of cluster AAD identity. + * + * @param aadTenantId the aadTenantId value to set. + * @return the ClusterPatch object itself. + */ + public ClusterPatch withAadTenantId(String aadTenantId) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterPatchProperties(); + } + this.innerProperties().withAadTenantId(aadTenantId); + return this; + } + + /** + * Get the desiredProperties property: Desired properties of the cluster. + * + * @return the desiredProperties value. + */ + public ClusterDesiredProperties desiredProperties() { + return this.innerProperties() == null ? null : this.innerProperties().desiredProperties(); + } + + /** + * Set the desiredProperties property: Desired properties of the cluster. + * + * @param desiredProperties the desiredProperties value to set. + * @return the ClusterPatch object itself. + */ + public ClusterPatch withDesiredProperties(ClusterDesiredProperties desiredProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterPatchProperties(); + } + this.innerProperties().withDesiredProperties(desiredProperties); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterReportedProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterReportedProperties.java index 57e55b370e17e..4a2d2b7c7895d 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 @@ -4,18 +4,14 @@ package com.azure.resourcemanager.azurestackhci.models; -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; import java.util.List; /** Properties reported by cluster agent. */ -@Immutable +@Fluent public final class ClusterReportedProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterReportedProperties.class); - /* * Name of the on-prem cluster connected to this resource. */ @@ -46,6 +42,18 @@ public final class ClusterReportedProperties { @JsonProperty(value = "lastUpdated", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime lastUpdated; + /* + * IMDS attestation status of the cluster. + */ + @JsonProperty(value = "imdsAttestation", access = JsonProperty.Access.WRITE_ONLY) + private ImdsAttestation imdsAttestation; + + /* + * Level of diagnostic data emitted by the cluster. + */ + @JsonProperty(value = "diagnosticLevel") + private DiagnosticLevel diagnosticLevel; + /** * Get the clusterName property: Name of the on-prem cluster connected to this resource. * @@ -91,6 +99,35 @@ public OffsetDateTime lastUpdated() { return this.lastUpdated; } + /** + * Get the imdsAttestation property: IMDS attestation status of the cluster. + * + * @return the imdsAttestation value. + */ + public ImdsAttestation imdsAttestation() { + return this.imdsAttestation; + } + + /** + * Get the diagnosticLevel property: Level of diagnostic data emitted by the cluster. + * + * @return the diagnosticLevel value. + */ + public DiagnosticLevel diagnosticLevel() { + return this.diagnosticLevel; + } + + /** + * Set the diagnosticLevel property: Level of diagnostic data emitted by the cluster. + * + * @param diagnosticLevel the diagnosticLevel value to set. + * @return the ClusterReportedProperties object itself. + */ + public ClusterReportedProperties withDiagnosticLevel(DiagnosticLevel diagnosticLevel) { + this.diagnosticLevel = diagnosticLevel; + return this; + } + /** * Validates the instance. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterUpdate.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterUpdate.java deleted file mode 100644 index 9f56919c75a24..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterUpdate.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Cluster details to update. */ -@Fluent -public final class ClusterUpdate { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterUpdate.class); - - /* - * Resource tags. - */ - @JsonProperty(value = "tags") - private Map tags; - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the ClusterUpdate object itself. - */ - public ClusterUpdate withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Clusters.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Clusters.java index 38c7dcf8342fc..f31f5e17c6d02 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 @@ -15,7 +15,7 @@ public interface Clusters { * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of clusters. + * @return list of clusters as paginated response with {@link PagedIterable}. */ PagedIterable list(); @@ -26,7 +26,7 @@ public interface Clusters { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of clusters. + * @return list of clusters as paginated response with {@link PagedIterable}. */ PagedIterable list(Context context); @@ -37,7 +37,7 @@ public interface Clusters { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of clusters. + * @return list of clusters as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName); @@ -49,7 +49,7 @@ public interface Clusters { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of clusters. + * @return list of clusters as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName, Context context); @@ -74,7 +74,7 @@ public interface Clusters { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. */ Response getByResourceGroupWithResponse(String resourceGroupName, String clusterName, Context context); @@ -98,10 +98,65 @@ public interface Clusters { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 {@link Response}. */ Response deleteWithResponse(String resourceGroupName, String clusterName, Context context); + /** + * Upload certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param uploadCertificateRequest Upload certificate request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void uploadCertificate( + String resourceGroupName, String clusterName, UploadCertificateRequest uploadCertificateRequest); + + /** + * Upload certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param uploadCertificateRequest Upload certificate request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void uploadCertificate( + String resourceGroupName, + String clusterName, + UploadCertificateRequest uploadCertificateRequest, + Context context); + + /** + * Create cluster identity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster Identity details. + */ + ClusterIdentityResponse createIdentity(String resourceGroupName, String clusterName); + + /** + * Create cluster identity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster Identity details. + */ + ClusterIdentityResponse createIdentity(String resourceGroupName, String clusterName, Context context); + /** * Get HCI cluster. * @@ -109,7 +164,7 @@ public interface Clusters { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 getById(String id); @@ -121,7 +176,7 @@ public interface Clusters { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. */ Response getByIdWithResponse(String id, Context context); @@ -143,7 +198,7 @@ public interface Clusters { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 {@link Response}. */ Response deleteByIdWithResponse(String id, Context context); diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/CreatedByType.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/CreatedByType.java deleted file mode 100644 index 71527757128d5..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/CreatedByType.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for CreatedByType. */ -public final class CreatedByType extends ExpandableStringEnum { - /** Static value User for CreatedByType. */ - public static final CreatedByType USER = fromString("User"); - - /** Static value Application for CreatedByType. */ - public static final CreatedByType APPLICATION = fromString("Application"); - - /** Static value ManagedIdentity for CreatedByType. */ - public static final CreatedByType MANAGED_IDENTITY = fromString("ManagedIdentity"); - - /** Static value Key for CreatedByType. */ - public static final CreatedByType KEY = fromString("Key"); - - /** - * Creates or finds a CreatedByType from its string representation. - * - * @param name a name to look for. - * @return the corresponding CreatedByType. - */ - @JsonCreator - public static CreatedByType fromString(String name) { - return fromString(name, CreatedByType.class); - } - - /** @return known CreatedByType values. */ - public static Collection values() { - return values(CreatedByType.class); - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DiagnosticLevel.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DiagnosticLevel.java new file mode 100644 index 0000000000000..c7fe777fde3c7 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DiagnosticLevel.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DiagnosticLevel. */ +public final class DiagnosticLevel extends ExpandableStringEnum { + /** Static value Off for DiagnosticLevel. */ + public static final DiagnosticLevel OFF = fromString("Off"); + + /** Static value Basic for DiagnosticLevel. */ + public static final DiagnosticLevel BASIC = fromString("Basic"); + + /** Static value Enhanced for DiagnosticLevel. */ + public static final DiagnosticLevel ENHANCED = fromString("Enhanced"); + + /** + * Creates or finds a DiagnosticLevel from its string representation. + * + * @param name a name to look for. + * @return the corresponding DiagnosticLevel. + */ + @JsonCreator + public static DiagnosticLevel fromString(String name) { + return fromString(name, DiagnosticLevel.class); + } + + /** @return known DiagnosticLevel values. */ + public static Collection values() { + return values(DiagnosticLevel.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Extension.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Extension.java new file mode 100644 index 0000000000000..c611a9f5fbe85 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Extension.java @@ -0,0 +1,373 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.fluent.models.ExtensionInner; +import java.util.List; + +/** An immutable client-side representation of Extension. */ +public interface Extension { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: System data of Extension resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: Provisioning state of the Extension proxy resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the aggregateState property: Aggregate state of Arc Extensions across the nodes in this HCI cluster. + * + * @return the aggregateState value. + */ + ExtensionAggregateState aggregateState(); + + /** + * Gets the perNodeExtensionDetails property: State of Arc Extension in each of the nodes. + * + * @return the perNodeExtensionDetails value. + */ + List perNodeExtensionDetails(); + + /** + * Gets the forceUpdateTag property: How the extension handler should be forced to update even if the extension + * configuration has not changed. + * + * @return the forceUpdateTag value. + */ + String forceUpdateTag(); + + /** + * Gets the publisher property: The name of the extension handler publisher. + * + * @return the publisher value. + */ + String publisher(); + + /** + * Gets the typePropertiesType property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @return the typePropertiesType value. + */ + String typePropertiesType(); + + /** + * Gets the typeHandlerVersion property: Specifies the version of the script handler. + * + * @return the typeHandlerVersion value. + */ + String typeHandlerVersion(); + + /** + * Gets the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if + * one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless + * redeployed, even with this property set to true. + * + * @return the autoUpgradeMinorVersion value. + */ + Boolean autoUpgradeMinorVersion(); + + /** + * Gets the settings property: Json formatted public settings for the extension. + * + * @return the settings value. + */ + Object settings(); + + /** + * Gets the protectedSettings property: Protected settings (may contain secrets). + * + * @return the protectedSettings value. + */ + Object protectedSettings(); + + /** + * Gets the inner com.azure.resourcemanager.azurestackhci.fluent.models.ExtensionInner object. + * + * @return the inner object. + */ + ExtensionInner innerModel(); + + /** The entirety of the Extension definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The Extension definition stages. */ + interface DefinitionStages { + /** The first stage of the Extension definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the Extension definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, clusterName, arcSettingName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @return the next definition stage. + */ + WithCreate withExistingArcSetting(String resourceGroupName, String clusterName, String arcSettingName); + } + /** + * The stage of the Extension definition which contains all the minimum required properties for the resource to + * be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithForceUpdateTag, + DefinitionStages.WithPublisher, + DefinitionStages.WithTypePropertiesType, + DefinitionStages.WithTypeHandlerVersion, + DefinitionStages.WithAutoUpgradeMinorVersion, + DefinitionStages.WithSettings, + DefinitionStages.WithProtectedSettings { + /** + * Executes the create request. + * + * @return the created resource. + */ + Extension create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Extension create(Context context); + } + /** The stage of the Extension definition allowing to specify forceUpdateTag. */ + interface WithForceUpdateTag { + /** + * Specifies the forceUpdateTag property: How the extension handler should be forced to update even if the + * extension configuration has not changed.. + * + * @param forceUpdateTag How the extension handler should be forced to update even if the extension + * configuration has not changed. + * @return the next definition stage. + */ + WithCreate withForceUpdateTag(String forceUpdateTag); + } + /** The stage of the Extension definition allowing to specify publisher. */ + interface WithPublisher { + /** + * Specifies the publisher property: The name of the extension handler publisher.. + * + * @param publisher The name of the extension handler publisher. + * @return the next definition stage. + */ + WithCreate withPublisher(String publisher); + } + /** The stage of the Extension definition allowing to specify typePropertiesType. */ + interface WithTypePropertiesType { + /** + * Specifies the typePropertiesType property: Specifies the type of the extension; an example is + * "CustomScriptExtension".. + * + * @param typePropertiesType Specifies the type of the extension; an example is "CustomScriptExtension". + * @return the next definition stage. + */ + WithCreate withTypePropertiesType(String typePropertiesType); + } + /** The stage of the Extension definition allowing to specify typeHandlerVersion. */ + interface WithTypeHandlerVersion { + /** + * Specifies the typeHandlerVersion property: Specifies the version of the script handler.. + * + * @param typeHandlerVersion Specifies the version of the script handler. + * @return the next definition stage. + */ + WithCreate withTypeHandlerVersion(String typeHandlerVersion); + } + /** The stage of the Extension definition allowing to specify autoUpgradeMinorVersion. */ + interface WithAutoUpgradeMinorVersion { + /** + * Specifies the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor + * version if one is available at deployment time. Once deployed, however, the extension will not upgrade + * minor versions unless redeployed, even with this property set to true.. + * + * @param autoUpgradeMinorVersion Indicates whether the extension should use a newer minor version if one is + * available at deployment time. Once deployed, however, the extension will not upgrade minor versions + * unless redeployed, even with this property set to true. + * @return the next definition stage. + */ + WithCreate withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion); + } + /** The stage of the Extension definition allowing to specify settings. */ + interface WithSettings { + /** + * Specifies the settings property: Json formatted public settings for the extension.. + * + * @param settings Json formatted public settings for the extension. + * @return the next definition stage. + */ + WithCreate withSettings(Object settings); + } + /** The stage of the Extension definition allowing to specify protectedSettings. */ + interface WithProtectedSettings { + /** + * Specifies the protectedSettings property: Protected settings (may contain secrets).. + * + * @param protectedSettings Protected settings (may contain secrets). + * @return the next definition stage. + */ + WithCreate withProtectedSettings(Object protectedSettings); + } + } + /** + * Begins update for the Extension resource. + * + * @return the stage of resource update. + */ + Extension.Update update(); + + /** The template for Extension update. */ + interface Update + extends UpdateStages.WithForceUpdateTag, + UpdateStages.WithPublisher, + UpdateStages.WithTypePropertiesType, + UpdateStages.WithTypeHandlerVersion, + UpdateStages.WithAutoUpgradeMinorVersion, + UpdateStages.WithSettings, + UpdateStages.WithProtectedSettings { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Extension apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Extension apply(Context context); + } + /** The Extension update stages. */ + interface UpdateStages { + /** The stage of the Extension update allowing to specify forceUpdateTag. */ + interface WithForceUpdateTag { + /** + * Specifies the forceUpdateTag property: How the extension handler should be forced to update even if the + * extension configuration has not changed.. + * + * @param forceUpdateTag How the extension handler should be forced to update even if the extension + * configuration has not changed. + * @return the next definition stage. + */ + Update withForceUpdateTag(String forceUpdateTag); + } + /** The stage of the Extension update allowing to specify publisher. */ + interface WithPublisher { + /** + * Specifies the publisher property: The name of the extension handler publisher.. + * + * @param publisher The name of the extension handler publisher. + * @return the next definition stage. + */ + Update withPublisher(String publisher); + } + /** The stage of the Extension update allowing to specify typePropertiesType. */ + interface WithTypePropertiesType { + /** + * Specifies the typePropertiesType property: Specifies the type of the extension; an example is + * "CustomScriptExtension".. + * + * @param typePropertiesType Specifies the type of the extension; an example is "CustomScriptExtension". + * @return the next definition stage. + */ + Update withTypePropertiesType(String typePropertiesType); + } + /** The stage of the Extension update allowing to specify typeHandlerVersion. */ + interface WithTypeHandlerVersion { + /** + * Specifies the typeHandlerVersion property: Specifies the version of the script handler.. + * + * @param typeHandlerVersion Specifies the version of the script handler. + * @return the next definition stage. + */ + Update withTypeHandlerVersion(String typeHandlerVersion); + } + /** The stage of the Extension update allowing to specify autoUpgradeMinorVersion. */ + interface WithAutoUpgradeMinorVersion { + /** + * Specifies the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor + * version if one is available at deployment time. Once deployed, however, the extension will not upgrade + * minor versions unless redeployed, even with this property set to true.. + * + * @param autoUpgradeMinorVersion Indicates whether the extension should use a newer minor version if one is + * available at deployment time. Once deployed, however, the extension will not upgrade minor versions + * unless redeployed, even with this property set to true. + * @return the next definition stage. + */ + Update withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion); + } + /** The stage of the Extension update allowing to specify settings. */ + interface WithSettings { + /** + * Specifies the settings property: Json formatted public settings for the extension.. + * + * @param settings Json formatted public settings for the extension. + * @return the next definition stage. + */ + Update withSettings(Object settings); + } + /** The stage of the Extension update allowing to specify protectedSettings. */ + interface WithProtectedSettings { + /** + * Specifies the protectedSettings property: Protected settings (may contain secrets).. + * + * @param protectedSettings Protected settings (may contain secrets). + * @return the next definition stage. + */ + Update withProtectedSettings(Object protectedSettings); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Extension refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Extension refresh(Context context); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionAggregateState.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionAggregateState.java new file mode 100644 index 0000000000000..ee6bd61725ef4 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionAggregateState.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ExtensionAggregateState. */ +public final class ExtensionAggregateState extends ExpandableStringEnum { + /** Static value NotSpecified for ExtensionAggregateState. */ + public static final ExtensionAggregateState NOT_SPECIFIED = fromString("NotSpecified"); + + /** Static value Error for ExtensionAggregateState. */ + public static final ExtensionAggregateState ERROR = fromString("Error"); + + /** Static value Succeeded for ExtensionAggregateState. */ + public static final ExtensionAggregateState SUCCEEDED = fromString("Succeeded"); + + /** Static value Canceled for ExtensionAggregateState. */ + public static final ExtensionAggregateState CANCELED = fromString("Canceled"); + + /** Static value Failed for ExtensionAggregateState. */ + public static final ExtensionAggregateState FAILED = fromString("Failed"); + + /** Static value Connected for ExtensionAggregateState. */ + public static final ExtensionAggregateState CONNECTED = fromString("Connected"); + + /** Static value Disconnected for ExtensionAggregateState. */ + public static final ExtensionAggregateState DISCONNECTED = fromString("Disconnected"); + + /** Static value Deleted for ExtensionAggregateState. */ + public static final ExtensionAggregateState DELETED = fromString("Deleted"); + + /** Static value Creating for ExtensionAggregateState. */ + public static final ExtensionAggregateState CREATING = fromString("Creating"); + + /** Static value Updating for ExtensionAggregateState. */ + public static final ExtensionAggregateState UPDATING = fromString("Updating"); + + /** Static value Deleting for ExtensionAggregateState. */ + public static final ExtensionAggregateState DELETING = fromString("Deleting"); + + /** Static value Moving for ExtensionAggregateState. */ + public static final ExtensionAggregateState MOVING = fromString("Moving"); + + /** Static value PartiallySucceeded for ExtensionAggregateState. */ + public static final ExtensionAggregateState PARTIALLY_SUCCEEDED = fromString("PartiallySucceeded"); + + /** Static value PartiallyConnected for ExtensionAggregateState. */ + public static final ExtensionAggregateState PARTIALLY_CONNECTED = fromString("PartiallyConnected"); + + /** Static value InProgress for ExtensionAggregateState. */ + public static final ExtensionAggregateState IN_PROGRESS = fromString("InProgress"); + + /** + * Creates or finds a ExtensionAggregateState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExtensionAggregateState. + */ + @JsonCreator + public static ExtensionAggregateState fromString(String name) { + return fromString(name, ExtensionAggregateState.class); + } + + /** @return known ExtensionAggregateState values. */ + public static Collection values() { + return values(ExtensionAggregateState.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionList.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionList.java new file mode 100644 index 0000000000000..85c724fb57bb2 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionList.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.azure.resourcemanager.azurestackhci.fluent.models.ExtensionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of Extensions in HCI cluster. */ +@Immutable +public final class ExtensionList { + /* + * List of Extensions in HCI cluster. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Link to the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: List of Extensions in HCI cluster. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Link to the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Extensions.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Extensions.java new file mode 100644 index 0000000000000..bc901c68316ac --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Extensions.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Extensions. */ +public interface Extensions { + /** + * List all Extensions under ArcSetting resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Extensions in HCI cluster as paginated response with {@link PagedIterable}. + */ + PagedIterable listByArcSetting(String resourceGroupName, String clusterName, String arcSettingName); + + /** + * List all Extensions under ArcSetting resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Extensions in HCI cluster as paginated response with {@link PagedIterable}. + */ + PagedIterable listByArcSetting( + String resourceGroupName, String clusterName, String arcSettingName, Context context); + + /** + * Get particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return particular Arc Extension of HCI Cluster. + */ + Extension get(String resourceGroupName, String clusterName, String arcSettingName, String extensionName); + + /** + * Get particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return particular Arc Extension of HCI Cluster along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String clusterName, String arcSettingName, String extensionName, Context context); + + /** + * Delete particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String clusterName, String arcSettingName, String extensionName); + + /** + * Delete particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete( + String resourceGroupName, String clusterName, String arcSettingName, String extensionName, Context context); + + /** + * Get particular Arc Extension of HCI Cluster. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return particular Arc Extension of HCI Cluster along with {@link Response}. + */ + Extension getById(String id); + + /** + * Get particular Arc Extension of HCI Cluster. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return particular Arc Extension of HCI Cluster along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete particular Arc Extension of HCI Cluster. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete particular Arc Extension of HCI Cluster. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Extension resource. + * + * @param name resource name. + * @return the first stage of the new Extension definition. + */ + Extension.DefinitionStages.Blank define(String name); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ImdsAttestation.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ImdsAttestation.java new file mode 100644 index 0000000000000..cdc208bc6e7e9 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ImdsAttestation.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ImdsAttestation. */ +public final class ImdsAttestation extends ExpandableStringEnum { + /** Static value Disabled for ImdsAttestation. */ + public static final ImdsAttestation DISABLED = fromString("Disabled"); + + /** Static value Enabled for ImdsAttestation. */ + public static final ImdsAttestation ENABLED = fromString("Enabled"); + + /** + * Creates or finds a ImdsAttestation from its string representation. + * + * @param name a name to look for. + * @return the corresponding ImdsAttestation. + */ + @JsonCreator + public static ImdsAttestation fromString(String name) { + return fromString(name, ImdsAttestation.class); + } + + /** @return known ImdsAttestation values. */ + public static Collection values() { + return values(ImdsAttestation.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NodeArcState.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NodeArcState.java new file mode 100644 index 0000000000000..3548460199641 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NodeArcState.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for NodeArcState. */ +public final class NodeArcState extends ExpandableStringEnum { + /** Static value NotSpecified for NodeArcState. */ + public static final NodeArcState NOT_SPECIFIED = fromString("NotSpecified"); + + /** Static value Error for NodeArcState. */ + public static final NodeArcState ERROR = fromString("Error"); + + /** Static value Succeeded for NodeArcState. */ + public static final NodeArcState SUCCEEDED = fromString("Succeeded"); + + /** Static value Canceled for NodeArcState. */ + public static final NodeArcState CANCELED = fromString("Canceled"); + + /** Static value Failed for NodeArcState. */ + public static final NodeArcState FAILED = fromString("Failed"); + + /** Static value Connected for NodeArcState. */ + public static final NodeArcState CONNECTED = fromString("Connected"); + + /** Static value Disconnected for NodeArcState. */ + public static final NodeArcState DISCONNECTED = fromString("Disconnected"); + + /** Static value Deleted for NodeArcState. */ + public static final NodeArcState DELETED = fromString("Deleted"); + + /** Static value Creating for NodeArcState. */ + public static final NodeArcState CREATING = fromString("Creating"); + + /** Static value Updating for NodeArcState. */ + public static final NodeArcState UPDATING = fromString("Updating"); + + /** Static value Deleting for NodeArcState. */ + public static final NodeArcState DELETING = fromString("Deleting"); + + /** Static value Moving for NodeArcState. */ + public static final NodeArcState MOVING = fromString("Moving"); + + /** + * Creates or finds a NodeArcState from its string representation. + * + * @param name a name to look for. + * @return the corresponding NodeArcState. + */ + @JsonCreator + public static NodeArcState fromString(String name) { + return fromString(name, NodeArcState.class); + } + + /** @return known NodeArcState values. */ + public static Collection values() { + return values(NodeArcState.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NodeExtensionState.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NodeExtensionState.java new file mode 100644 index 0000000000000..ae9b97b6c5472 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NodeExtensionState.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for NodeExtensionState. */ +public final class NodeExtensionState extends ExpandableStringEnum { + /** Static value NotSpecified for NodeExtensionState. */ + public static final NodeExtensionState NOT_SPECIFIED = fromString("NotSpecified"); + + /** Static value Error for NodeExtensionState. */ + public static final NodeExtensionState ERROR = fromString("Error"); + + /** Static value Succeeded for NodeExtensionState. */ + public static final NodeExtensionState SUCCEEDED = fromString("Succeeded"); + + /** Static value Canceled for NodeExtensionState. */ + public static final NodeExtensionState CANCELED = fromString("Canceled"); + + /** Static value Failed for NodeExtensionState. */ + public static final NodeExtensionState FAILED = fromString("Failed"); + + /** Static value Connected for NodeExtensionState. */ + public static final NodeExtensionState CONNECTED = fromString("Connected"); + + /** Static value Disconnected for NodeExtensionState. */ + public static final NodeExtensionState DISCONNECTED = fromString("Disconnected"); + + /** Static value Deleted for NodeExtensionState. */ + public static final NodeExtensionState DELETED = fromString("Deleted"); + + /** Static value Creating for NodeExtensionState. */ + public static final NodeExtensionState CREATING = fromString("Creating"); + + /** Static value Updating for NodeExtensionState. */ + public static final NodeExtensionState UPDATING = fromString("Updating"); + + /** Static value Deleting for NodeExtensionState. */ + public static final NodeExtensionState DELETING = fromString("Deleting"); + + /** Static value Moving for NodeExtensionState. */ + public static final NodeExtensionState MOVING = fromString("Moving"); + + /** + * Creates or finds a NodeExtensionState from its string representation. + * + * @param name a name to look for. + * @return the corresponding NodeExtensionState. + */ + @JsonCreator + public static NodeExtensionState fromString(String name) { + return fromString(name, NodeExtensionState.class); + } + + /** @return known NodeExtensionState values. */ + public static Collection values() { + return values(NodeExtensionState.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Operation.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Operation.java new file mode 100644 index 0000000000000..8a8c66e2aafe5 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Operation.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** REST API Operation Details of a REST API operation, returned from the Resource Provider Operations API. */ +@Fluent +public final class Operation { + /* + * The name of the operation, as per Resource-Based Access Control (RBAC). + * Examples: "Microsoft.Compute/virtualMachines/write", + * "Microsoft.Compute/virtualMachines/capture/action" + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Whether the operation applies to data-plane. This is "true" for + * data-plane operations and "false" for ARM/control-plane operations. + */ + @JsonProperty(value = "isDataAction", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isDataAction; + + /* + * Localized display information for this particular operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /* + * The intended executor of the operation; as in Resource Based Access + * Control (RBAC) and audit logs UX. Default value is "user,system" + */ + @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) + private Origin origin; + + /* + * Enum. Indicates the action type. "Internal" refers to actions that are + * for internal only APIs. + */ + @JsonProperty(value = "actionType", access = JsonProperty.Access.WRITE_ONLY) + private ActionType actionType; + + /** + * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for ARM/control-plane operations. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Get the display property: Localized display information for this particular operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display property: Localized display information for this particular operation. + * + * @param display the display value to set. + * @return the Operation object itself. + */ + public Operation withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". + * + * @return the origin value. + */ + public Origin origin() { + return this.origin; + } + + /** + * Get the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal + * only APIs. + * + * @return the actionType value. + */ + public ActionType actionType() { + return this.actionType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OperationDetail.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OperationDetail.java deleted file mode 100644 index 78efe34382152..0000000000000 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OperationDetail.java +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.azurestackhci.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Operation detail payload. */ -@Fluent -public final class OperationDetail { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDetail.class); - - /* - * Name of the operation - */ - @JsonProperty(value = "name") - private String name; - - /* - * Indicates whether the operation is a data action - */ - @JsonProperty(value = "isDataAction") - private Boolean isDataAction; - - /* - * Display of the operation - */ - @JsonProperty(value = "display") - private OperationDisplay display; - - /* - * Origin of the operation - */ - @JsonProperty(value = "origin") - private String origin; - - /* - * Properties of the operation - */ - @JsonProperty(value = "properties") - private Object properties; - - /** - * Get the name property: Name of the operation. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of the operation. - * - * @param name the name value to set. - * @return the OperationDetail object itself. - */ - public OperationDetail withName(String name) { - this.name = name; - return this; - } - - /** - * Get the isDataAction property: Indicates whether the operation is a data action. - * - * @return the isDataAction value. - */ - public Boolean isDataAction() { - return this.isDataAction; - } - - /** - * Set the isDataAction property: Indicates whether the operation is a data action. - * - * @param isDataAction the isDataAction value to set. - * @return the OperationDetail object itself. - */ - public OperationDetail withIsDataAction(Boolean isDataAction) { - this.isDataAction = isDataAction; - return this; - } - - /** - * Get the display property: Display of the operation. - * - * @return the display value. - */ - public OperationDisplay display() { - return this.display; - } - - /** - * Set the display property: Display of the operation. - * - * @param display the display value to set. - * @return the OperationDetail object itself. - */ - public OperationDetail withDisplay(OperationDisplay display) { - this.display = display; - return this; - } - - /** - * Get the origin property: Origin of the operation. - * - * @return the origin value. - */ - public String origin() { - return this.origin; - } - - /** - * Set the origin property: Origin of the operation. - * - * @param origin the origin value to set. - * @return the OperationDetail object itself. - */ - public OperationDetail withOrigin(String origin) { - this.origin = origin; - return this; - } - - /** - * Get the properties property: Properties of the operation. - * - * @return the properties value. - */ - public Object properties() { - return this.properties; - } - - /** - * Set the properties property: Properties of the operation. - * - * @param properties the properties value to set. - * @return the OperationDetail object itself. - */ - public OperationDetail withProperties(Object properties) { - this.properties = properties; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (display() != null) { - display().validate(); - } - } -} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OperationDisplay.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OperationDisplay.java index b8580f63bfbbd..75a95b413ce47 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 @@ -4,42 +4,44 @@ package com.azure.resourcemanager.azurestackhci.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonProperty; -/** Operation display payload. */ -@Fluent +/** Localized display information for this particular operation. */ +@Immutable public final class OperationDisplay { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDisplay.class); - /* - * Resource provider of the operation + * The localized friendly form of the resource provider name, e.g. + * "Microsoft Monitoring Insights" or "Microsoft Compute". */ - @JsonProperty(value = "provider") + @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) private String provider; /* - * Resource of the operation + * The localized friendly name of the resource type related to this + * operation. E.g. "Virtual Machines" or "Job Schedule Collections". */ - @JsonProperty(value = "resource") + @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) private String resource; /* - * Localized friendly name for the operation + * The concise, localized friendly name for the operation; suitable for + * dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual + * Machine". */ - @JsonProperty(value = "operation") + @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) private String operation; /* - * Localized friendly description for the operation + * The short, localized friendly description of the operation; suitable for + * tool tips and detailed views. */ - @JsonProperty(value = "description") + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) private String description; /** - * Get the provider property: Resource provider of the operation. + * Get the provider property: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring + * Insights" or "Microsoft Compute". * * @return the provider value. */ @@ -48,18 +50,8 @@ public String provider() { } /** - * Set the provider property: Resource provider of the operation. - * - * @param provider the provider value to set. - * @return the OperationDisplay object itself. - */ - public OperationDisplay withProvider(String provider) { - this.provider = provider; - return this; - } - - /** - * Get the resource property: Resource of the operation. + * Get the resource property: The localized friendly name of the resource type related to this operation. E.g. + * "Virtual Machines" or "Job Schedule Collections". * * @return the resource value. */ @@ -68,18 +60,8 @@ public String resource() { } /** - * Set the resource property: Resource of the operation. - * - * @param resource the resource value to set. - * @return the OperationDisplay object itself. - */ - public OperationDisplay withResource(String resource) { - this.resource = resource; - return this; - } - - /** - * Get the operation property: Localized friendly name for the operation. + * Get the operation property: The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". * * @return the operation value. */ @@ -88,18 +70,8 @@ public String operation() { } /** - * Set the operation property: Localized friendly name for the operation. - * - * @param operation the operation value to set. - * @return the OperationDisplay object itself. - */ - public OperationDisplay withOperation(String operation) { - this.operation = operation; - return this; - } - - /** - * Get the description property: Localized friendly description for the operation. + * Get the description property: The short, localized friendly description of the operation; suitable for tool tips + * and detailed views. * * @return the description value. */ @@ -107,17 +79,6 @@ public String description() { return this.description; } - /** - * Set the description property: Localized friendly description for the operation. - * - * @param description the description value to set. - * @return the OperationDisplay object itself. - */ - public OperationDisplay withDescription(String description) { - this.description = description; - return this; - } - /** * Validates the instance. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OperationListResult.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OperationListResult.java new file mode 100644 index 0000000000000..6f6f0475efc84 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OperationListResult.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.resourcemanager.azurestackhci.fluent.models.OperationListResultInner; +import java.util.List; + +/** An immutable client-side representation of OperationListResult. */ +public interface OperationListResult { + /** + * Gets the value property: List of operations supported by the resource provider. + * + * @return the value value. + */ + List value(); + + /** + * Gets the nextLink property: URL to get the next set of operation list results (if there are any). + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the inner com.azure.resourcemanager.azurestackhci.fluent.models.OperationListResultInner object. + * + * @return the inner object. + */ + OperationListResultInner innerModel(); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Operations.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Operations.java index 9f0e894f6cdf9..570a7f0abbd4b 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 @@ -14,9 +14,9 @@ public interface Operations { * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return available operations of the service. + * @return a list of REST API operations supported by an Azure Resource Provider. */ - AvailableOperations list(); + OperationListResult list(); /** * List all available Microsoft.AzureStackHCI provider operations. @@ -25,7 +25,7 @@ public interface Operations { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return available operations of the service. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link Response}. */ - Response listWithResponse(Context context); + Response listWithResponse(Context context); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Origin.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Origin.java new file mode 100644 index 0000000000000..9762cce2c3792 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Origin.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Origin. */ +public final class Origin extends ExpandableStringEnum { + /** Static value user for Origin. */ + public static final Origin USER = fromString("user"); + + /** Static value system for Origin. */ + public static final Origin SYSTEM = fromString("system"); + + /** Static value user,system for Origin. */ + public static final Origin USER_SYSTEM = fromString("user,system"); + + /** + * Creates or finds a Origin from its string representation. + * + * @param name a name to look for. + * @return the corresponding Origin. + */ + @JsonCreator + public static Origin fromString(String name) { + return fromString(name, Origin.class); + } + + /** @return known Origin values. */ + public static Collection values() { + return values(Origin.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PasswordCredential.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PasswordCredential.java new file mode 100644 index 0000000000000..ed82f484e14ff --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PasswordCredential.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.resourcemanager.azurestackhci.fluent.models.PasswordCredentialInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of PasswordCredential. */ +public interface PasswordCredential { + /** + * Gets the secretText property: The secretText property. + * + * @return the secretText value. + */ + String secretText(); + + /** + * Gets the keyId property: The keyId property. + * + * @return the keyId value. + */ + String keyId(); + + /** + * Gets the startDateTime property: The startDateTime property. + * + * @return the startDateTime value. + */ + OffsetDateTime startDateTime(); + + /** + * Gets the endDateTime property: The endDateTime property. + * + * @return the endDateTime value. + */ + OffsetDateTime endDateTime(); + + /** + * Gets the inner com.azure.resourcemanager.azurestackhci.fluent.models.PasswordCredentialInner object. + * + * @return the inner object. + */ + PasswordCredentialInner innerModel(); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PerNodeExtensionState.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PerNodeExtensionState.java new file mode 100644 index 0000000000000..54a16e384b67d --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PerNodeExtensionState.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Status of Arc Extension for a particular node in HCI Cluster. */ +@Immutable +public final class PerNodeExtensionState { + /* + * Name of the node in HCI Cluster. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Fully qualified resource ID for the particular Arc Extension on this + * node. + */ + @JsonProperty(value = "extension", access = JsonProperty.Access.WRITE_ONLY) + private String extension; + + /* + * State of Arc Extension in this node. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private NodeExtensionState state; + + /** + * Get the name property: Name of the node in HCI Cluster. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the extension property: Fully qualified resource ID for the particular Arc Extension on this node. + * + * @return the extension value. + */ + public String extension() { + return this.extension; + } + + /** + * Get the state property: State of Arc Extension in this node. + * + * @return the state value. + */ + public NodeExtensionState state() { + return this.state; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PerNodeState.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PerNodeState.java new file mode 100644 index 0000000000000..9dad6d8d94a08 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PerNodeState.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.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Status of Arc agent for a particular node in HCI Cluster. */ +@Immutable +public final class PerNodeState { + /* + * Name of the Node in HCI Cluster + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Fully qualified resource ID for the Arc agent of this node. + */ + @JsonProperty(value = "arcInstance", access = JsonProperty.Access.WRITE_ONLY) + private String arcInstance; + + /* + * State of Arc agent in this node. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private NodeArcState state; + + /** + * Get the name property: Name of the Node in HCI Cluster. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the arcInstance property: Fully qualified resource ID for the Arc agent of this node. + * + * @return the arcInstance value. + */ + public String arcInstance() { + return this.arcInstance; + } + + /** + * Get the state property: State of Arc agent in this node. + * + * @return the state value. + */ + public NodeArcState state() { + return this.state; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/RawCertificateData.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/RawCertificateData.java new file mode 100644 index 0000000000000..5cb214a9d881a --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/RawCertificateData.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The RawCertificateData model. */ +@Fluent +public final class RawCertificateData { + /* + * The certificates property. + */ + @JsonProperty(value = "certificates") + private List certificates; + + /** + * Get the certificates property: The certificates property. + * + * @return the certificates value. + */ + public List certificates() { + return this.certificates; + } + + /** + * Set the certificates property: The certificates property. + * + * @param certificates the certificates value to set. + * @return the RawCertificateData object itself. + */ + public RawCertificateData withCertificates(List certificates) { + this.certificates = certificates; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UploadCertificateRequest.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UploadCertificateRequest.java new file mode 100644 index 0000000000000..8fabb105a6622 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UploadCertificateRequest.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.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The UploadCertificateRequest model. */ +@Fluent +public final class UploadCertificateRequest { + /* + * The properties property. + */ + @JsonProperty(value = "properties") + private RawCertificateData properties; + + /** + * Get the properties property: The properties property. + * + * @return the properties value. + */ + public RawCertificateData properties() { + return this.properties; + } + + /** + * Set the properties property: The properties property. + * + * @param properties the properties value to set. + * @return the UploadCertificateRequest object itself. + */ + public UploadCertificateRequest withProperties(RawCertificateData properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/WindowsServerSubscription.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/WindowsServerSubscription.java new file mode 100644 index 0000000000000..28701e4307f77 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/WindowsServerSubscription.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for WindowsServerSubscription. */ +public final class WindowsServerSubscription extends ExpandableStringEnum { + /** Static value Disabled for WindowsServerSubscription. */ + public static final WindowsServerSubscription DISABLED = fromString("Disabled"); + + /** Static value Enabled for WindowsServerSubscription. */ + public static final WindowsServerSubscription ENABLED = fromString("Enabled"); + + /** + * Creates or finds a WindowsServerSubscription from its string representation. + * + * @param name a name to look for. + * @return the corresponding WindowsServerSubscription. + */ + @JsonCreator + public static WindowsServerSubscription fromString(String name) { + return fromString(name, WindowsServerSubscription.class); + } + + /** @return known WindowsServerSubscription values. */ + public static Collection values() { + return values(WindowsServerSubscription.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsCreateIdentitySamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsCreateIdentitySamples.java new file mode 100644 index 0000000000000..9cf2b7d8a72bc --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsCreateIdentitySamples.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 ArcSettings CreateIdentity. */ +public final class ArcSettingsCreateIdentitySamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-03-01/examples/CreateArcIdentity.json + */ + /** + * Sample code: Create Arc Identity. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void createArcIdentity(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.arcSettings().createIdentity("test-rg", "myCluster", "default", Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsCreateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsCreateSamples.java new file mode 100644 index 0000000000000..de09bec081aa4 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsCreateSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +/** Samples for ArcSettings Create. */ +public final class ArcSettingsCreateSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-03-01/examples/PutArcSetting.json + */ + /** + * Sample code: Create ArcSetting. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void createArcSetting(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.arcSettings().define("default").withExistingCluster("test-rg", "myCluster").create(); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsDeleteSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsDeleteSamples.java new file mode 100644 index 0000000000000..11cf0c78155aa --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsDeleteSamples.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 ArcSettings Delete. */ +public final class ArcSettingsDeleteSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-03-01/examples/DeleteArcSetting.json + */ + /** + * Sample code: Delete ArcSetting. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void deleteArcSetting(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.arcSettings().delete("test-rg", "myCluster", "default", Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsGeneratePasswordSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsGeneratePasswordSamples.java new file mode 100644 index 0000000000000..5283ce921d3e1 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsGeneratePasswordSamples.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 ArcSettings GeneratePassword. */ +public final class ArcSettingsGeneratePasswordSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-03-01/examples/GeneratePassword.json + */ + /** + * Sample code: Generate Password. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void generatePassword(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.arcSettings().generatePasswordWithResponse("test-rg", "myCluster", "default", Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsGetSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsGetSamples.java new file mode 100644 index 0000000000000..760476da2f5dc --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsGetSamples.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 ArcSettings Get. */ +public final class ArcSettingsGetSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-03-01/examples/GetArcSetting.json + */ + /** + * Sample code: Get ArcSetting. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getArcSetting(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.arcSettings().getWithResponse("test-rg", "myCluster", "default", Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsListByClusterSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsListByClusterSamples.java new file mode 100644 index 0000000000000..941adf73988b6 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsListByClusterSamples.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 ArcSettings ListByCluster. */ +public final class ArcSettingsListByClusterSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-03-01/examples/ListArcSettingsByCluster.json + */ + /** + * Sample code: List ArcSetting resources by HCI Cluster. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listArcSettingResourcesByHCICluster( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.arcSettings().listByCluster("test-rg", "myCluster", Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersCreateIdentitySamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersCreateIdentitySamples.java new file mode 100644 index 0000000000000..030f35388b055 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersCreateIdentitySamples.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 Clusters CreateIdentity. */ +public final class ClustersCreateIdentitySamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-03-01/examples/CreateClusterIdentity.json + */ + /** + * Sample code: Create cluster Identity. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void createClusterIdentity(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.clusters().createIdentity("test-rg", "myCluster", Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersCreateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersCreateSamples.java new file mode 100644 index 0000000000000..f0999eb991e1c --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersCreateSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +/** Samples for Clusters Create. */ +public final class ClustersCreateSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-03-01/examples/CreateCluster.json + */ + /** + * Sample code: Create cluster. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void createCluster(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .clusters() + .define("myCluster") + .withRegion("East US") + .withExistingResourceGroup("test-rg") + .withCloudManagementEndpoint("https://98294836-31be-4668-aeae-698667faf99b.waconazure.com") + .withAadClientId("24a6e53d-04e5-44d2-b7cc-1b732a847dfc") + .withAadTenantId("7e589cc1-a8b6-4dff-91bd-5ec0fa18db94") + .create(); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersDeleteSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersDeleteSamples.java new file mode 100644 index 0000000000000..6656cf8724c40 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersDeleteSamples.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 Clusters Delete. */ +public final class ClustersDeleteSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-03-01/examples/DeleteCluster.json + */ + /** + * Sample code: Delete cluster. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void deleteCluster(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.clusters().deleteWithResponse("test-rg", "myCluster", Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersGetByResourceGroupSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..441e71b19f741 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersGetByResourceGroupSamples.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 Clusters GetByResourceGroup. */ +public final class ClustersGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-03-01/examples/GetCluster.json + */ + /** + * Sample code: Get cluster. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getCluster(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.clusters().getByResourceGroupWithResponse("test-rg", "myCluster", Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersListByResourceGroupSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersListByResourceGroupSamples.java new file mode 100644 index 0000000000000..ad3d6a8d940a3 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersListByResourceGroupSamples.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 Clusters ListByResourceGroup. */ +public final class ClustersListByResourceGroupSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-03-01/examples/ListClustersByResourceGroup.json + */ + /** + * Sample code: List clusters in a given resource group. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listClustersInAGivenResourceGroup( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.clusters().listByResourceGroup("test-rg", Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersListSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersListSamples.java new file mode 100644 index 0000000000000..19ee4b6948b15 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersListSamples.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 Clusters List. */ +public final class ClustersListSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-03-01/examples/ListClustersBySubscription.json + */ + /** + * Sample code: List clusters in a given subscription. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listClustersInAGivenSubscription( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.clusters().list(Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersUpdateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersUpdateSamples.java new file mode 100644 index 0000000000000..222d7138f0c6f --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersUpdateSamples.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.models.Cluster; +import com.azure.resourcemanager.azurestackhci.models.ClusterDesiredProperties; +import com.azure.resourcemanager.azurestackhci.models.DiagnosticLevel; +import com.azure.resourcemanager.azurestackhci.models.WindowsServerSubscription; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Clusters Update. */ +public final class ClustersUpdateSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-03-01/examples/UpdateCluster.json + */ + /** + * Sample code: Update cluster. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void updateCluster(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + Cluster resource = + manager.clusters().getByResourceGroupWithResponse("test-rg", "myCluster", Context.NONE).getValue(); + resource + .update() + .withTags(mapOf("tag1", "value1", "tag2", "value2")) + .withCloudManagementEndpoint("https://98294836-31be-4668-aeae-698667faf99b.waconazure.com") + .withDesiredProperties( + new ClusterDesiredProperties() + .withWindowsServerSubscription(WindowsServerSubscription.ENABLED) + .withDiagnosticLevel(DiagnosticLevel.BASIC)) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersUploadCertificateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersUploadCertificateSamples.java new file mode 100644 index 0000000000000..c3d33e880bf8f --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersUploadCertificateSamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.models.RawCertificateData; +import com.azure.resourcemanager.azurestackhci.models.UploadCertificateRequest; +import java.util.Arrays; + +/** Samples for Clusters UploadCertificate. */ +public final class ClustersUploadCertificateSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-03-01/examples/UploadCertificate.json + */ + /** + * Sample code: Upload certificate. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void uploadCertificate(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .clusters() + .uploadCertificate( + "test-rg", + "myCluster", + new UploadCertificateRequest() + .withProperties( + new RawCertificateData().withCertificates(Arrays.asList("base64cert", "base64cert"))), + Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsCreateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsCreateSamples.java new file mode 100644 index 0000000000000..ad2ace0520f1d --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsCreateSamples.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import java.io.IOException; + +/** Samples for Extensions Create. */ +public final class ExtensionsCreateSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-03-01/examples/PutExtension.json + */ + /** + * Sample code: Create Arc Extension. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void createArcExtension(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) + throws IOException { + manager + .extensions() + .define("MicrosoftMonitoringAgent") + .withExistingArcSetting("test-rg", "myCluster", "default") + .withPublisher("Microsoft.Compute") + .withTypePropertiesType("MicrosoftMonitoringAgent") + .withTypeHandlerVersion("1.10") + .withSettings( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{\"workspaceId\":\"xx\"}", Object.class, SerializerEncoding.JSON)) + .withProtectedSettings( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{\"workspaceKey\":\"xx\"}", Object.class, SerializerEncoding.JSON)) + .create(); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsDeleteSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsDeleteSamples.java new file mode 100644 index 0000000000000..dc62bbcca21d7 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsDeleteSamples.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 Extensions Delete. */ +public final class ExtensionsDeleteSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-03-01/examples/DeleteExtension.json + */ + /** + * Sample code: Delete Arc Extension. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void deleteArcExtension(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.extensions().delete("test-rg", "myCluster", "default", "MicrosoftMonitoringAgent", Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsGetSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsGetSamples.java new file mode 100644 index 0000000000000..86476271089e3 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +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-03-01/examples/GetExtension.json + */ + /** + * Sample code: Get ArcSettings Extension. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getArcSettingsExtension(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .extensions() + .getWithResponse("test-rg", "myCluster", "default", "MicrosoftMonitoringAgent", Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsListByArcSettingSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsListByArcSettingSamples.java new file mode 100644 index 0000000000000..0f1fb72c501f0 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsListByArcSettingSamples.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 Extensions ListByArcSetting. */ +public final class ExtensionsListByArcSettingSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-03-01/examples/ListExtensionsByArcSetting.json + */ + /** + * Sample code: List Extensions under ArcSetting resource. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listExtensionsUnderArcSettingResource( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.extensions().listByArcSetting("test-rg", "myCluster", "default", Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsUpdateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsUpdateSamples.java new file mode 100644 index 0000000000000..9103f3995255b --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsUpdateSamples.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.Context; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.azurestackhci.models.Extension; +import java.io.IOException; + +/** Samples for Extensions Update. */ +public final class ExtensionsUpdateSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-03-01/examples/PatchExtension.json + */ + /** + * Sample code: Update Arc Extension. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void updateArcExtension(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) + throws IOException { + Extension resource = + manager + .extensions() + .getWithResponse("test-rg", "myCluster", "default", "MicrosoftMonitoringAgent", Context.NONE) + .getValue(); + resource + .update() + .withPublisher("Microsoft.Compute") + .withTypePropertiesType("MicrosoftMonitoringAgent") + .withTypeHandlerVersion("1.10") + .withSettings( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{\"workspaceId\":\"xx\"}", Object.class, SerializerEncoding.JSON)) + .apply(); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/OperationsListSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/OperationsListSamples.java new file mode 100644 index 0000000000000..32c78982e4f07 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/OperationsListSamples.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 Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-03-01/examples/ListOperations.json + */ + /** + * Sample code: Create cluster. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void createCluster(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.operations().listWithResponse(Context.NONE); + } +}