From 647b764d2624e6f69ad6c755c3399bf0368ae367 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 19 Sep 2023 14:15:17 +0000 Subject: [PATCH] CodeGen from PR 25859 in Azure/azure-rest-api-specs Merge f336fffb1a451965ccd6d60c29fa101a9a812b5e into 88df06144633273e2bb5d8e48a790e3c460887be --- .../CHANGELOG.md | 4 +- .../README.md | 29 +- .../SAMPLE.md | 801 +++++++++-- .../pom.xml | 11 +- .../azurestackhci/AzureStackHciManager.java | 105 +- .../fluent/ArcSettingsClient.java | 147 +- .../fluent/AzureStackHciClient.java | 42 + .../azurestackhci/fluent/ClustersClient.java | 105 +- .../fluent/ExtensionsClient.java | 108 +- .../azurestackhci/fluent/OffersClient.java | 116 ++ .../fluent/OperationsClient.java | 12 +- .../fluent/PublishersClient.java | 72 + .../azurestackhci/fluent/SkusClient.java | 97 ++ .../fluent/UpdateRunsClient.java | 185 +++ .../UpdateSummariesOperationsClient.java | 154 ++ .../azurestackhci/fluent/UpdatesClient.java | 225 +++ .../models/ArcIdentityResponseInner.java | 4 + .../models/ArcIdentityResponseProperties.java | 4 + .../fluent/models/ArcSettingInner.java | 38 +- .../fluent/models/ArcSettingProperties.java | 26 +- .../models/ArcSettingsPatchProperties.java | 4 + .../models/ClusterIdentityResponseInner.java | 4 + .../ClusterIdentityResponseProperties.java | 4 + .../fluent/models/ClusterInner.java | 167 ++- .../fluent/models/ClusterPatchProperties.java | 4 + .../fluent/models/ClusterProperties.java | 85 ++ .../fluent/models/ExtensionInner.java | 69 +- .../fluent/models/ExtensionParameters.java | 54 +- .../models/ExtensionPatchProperties.java | 54 + .../fluent/models/ExtensionProperties.java | 53 +- .../fluent/models/HciUpdateInner.java | 578 ++++++++ .../fluent/models/ManagedServiceIdentity.java | 145 ++ .../fluent/models/OfferInner.java | 162 +++ .../fluent/models/OfferProperties.java | 148 ++ .../models/OperationListResultInner.java | 4 + .../models/PasswordCredentialInner.java | 4 + .../fluent/models/PublisherInner.java | 68 + .../fluent/models/PublisherProperties.java | 39 + .../azurestackhci/fluent/models/SkuInner.java | 185 +++ .../fluent/models/SkuProperties.java | 174 +++ .../azurestackhci/fluent/models/Step.java | 240 ++++ .../fluent/models/UpdateProperties.java | 611 ++++++++ .../fluent/models/UpdateRunInner.java | 376 +++++ .../fluent/models/UpdateRunProperties.java | 351 +++++ .../fluent/models/UpdateStateProperties.java | 84 ++ .../fluent/models/UpdateSummariesInner.java | 331 +++++ .../models/UpdateSummariesProperties.java | 312 +++++ .../implementation/ArcSettingImpl.java | 38 +- .../implementation/ArcSettingsClientImpl.java | 571 +++++++- .../implementation/ArcSettingsImpl.java | 76 +- .../AzureStackHciClientBuilder.java | 34 +- .../AzureStackHciClientImpl.java | 86 +- .../implementation/ClusterImpl.java | 82 ++ .../implementation/ClustersClientImpl.java | 409 +++++- .../implementation/ClustersImpl.java | 49 +- .../implementation/ExtensionImpl.java | 42 +- .../implementation/ExtensionsClientImpl.java | 459 +++++- .../implementation/ExtensionsImpl.java | 43 +- .../implementation/HciUpdateImpl.java | 376 +++++ .../implementation/OfferImpl.java | 72 + .../implementation/OffersClientImpl.java | 913 ++++++++++++ .../implementation/OffersImpl.java | 93 ++ .../implementation/OperationsClientImpl.java | 18 +- .../implementation/OperationsImpl.java | 18 +- .../implementation/PublisherImpl.java | 49 + .../implementation/PublishersClientImpl.java | 511 +++++++ .../implementation/PublishersImpl.java | 72 + .../azurestackhci/implementation/SkuImpl.java | 76 + .../implementation/SkusClientImpl.java | 654 +++++++++ .../implementation/SkusImpl.java | 89 ++ .../implementation/UpdateRunImpl.java | 287 ++++ .../implementation/UpdateRunsClientImpl.java | 1069 ++++++++++++++ .../implementation/UpdateRunsImpl.java | 218 +++ .../implementation/UpdateSummariesImpl.java | 111 ++ .../UpdateSummariesOperationsClientImpl.java | 922 ++++++++++++ .../UpdateSummariesOperationsImpl.java | 104 ++ .../implementation/UpdatesClientImpl.java | 1242 +++++++++++++++++ .../implementation/UpdatesImpl.java | 195 +++ .../azurestackhci/models/ActionType.java | 11 +- .../azurestackhci/models/ArcSetting.java | 72 +- .../models/ArcSettingAggregateState.java | 20 +- .../azurestackhci/models/ArcSettingList.java | 4 + .../azurestackhci/models/ArcSettings.java | 77 +- .../models/ArcSettingsPatch.java | 4 + .../models/AvailabilityType.java | 50 + .../azurestackhci/models/Cluster.java | 184 ++- .../models/ClusterDesiredProperties.java | 4 + .../azurestackhci/models/ClusterList.java | 4 + .../azurestackhci/models/ClusterNode.java | 80 ++ .../azurestackhci/models/ClusterNodeType.java | 47 + .../azurestackhci/models/ClusterPatch.java | 98 ++ .../models/ClusterReportedProperties.java | 64 + .../azurestackhci/models/Clusters.java | 42 +- .../models/ConnectivityStatus.java | 59 + .../models/DefaultExtensionDetails.java | 55 + .../azurestackhci/models/DiagnosticLevel.java | 11 +- .../azurestackhci/models/Extension.java | 163 ++- .../models/ExtensionAggregateState.java | 21 +- .../models/ExtensionInstanceView.java | 131 ++ .../models/ExtensionInstanceViewStatus.java | 155 ++ .../azurestackhci/models/ExtensionList.java | 4 + .../models/ExtensionManagedBy.java | 47 + .../azurestackhci/models/ExtensionPatch.java | 66 + .../models/ExtensionPatchParameters.java | 133 ++ .../models/ExtensionUpgradeParameters.java | 50 + .../azurestackhci/models/Extensions.java | 52 +- .../azurestackhci/models/HciUpdate.java | 868 ++++++++++++ .../azurestackhci/models/HealthState.java | 59 + .../azurestackhci/models/ImdsAttestation.java | 11 +- .../IsolatedVmAttestationConfiguration.java | 71 + .../models/ManagedServiceIdentityType.java | 54 + .../azurestackhci/models/NodeArcState.java | 29 +- .../models/NodeExtensionState.java | 26 +- .../azurestackhci/models/OemActivation.java | 47 + .../azurestackhci/models/Offer.java | 82 ++ .../azurestackhci/models/OfferList.java | 59 + .../azurestackhci/models/Offers.java | 106 ++ .../azurestackhci/models/Operation.java | 26 +- .../models/OperationDisplay.java | 20 +- .../azurestackhci/models/Operations.java | 12 +- .../azurestackhci/models/Origin.java | 14 +- .../models/PackageVersionInfo.java | 103 ++ .../models/PerNodeExtensionState.java | 40 +- .../azurestackhci/models/PerNodeState.java | 4 + .../azurestackhci/models/PrecheckResult.java | 350 +++++ .../models/PrecheckResultTags.java | 76 + .../models/ProvisioningState.java | 50 +- .../azurestackhci/models/Publisher.java | 53 + .../azurestackhci/models/PublisherList.java | 59 + .../azurestackhci/models/Publishers.java | 65 + .../models/RawCertificateData.java | 4 + .../models/RebootRequirement.java | 50 + .../azurestackhci/models/Severity.java | 56 + .../azurestackhci/models/Sku.java | 89 ++ .../azurestackhci/models/SkuList.java | 59 + .../azurestackhci/models/SkuMappings.java | 103 ++ .../azurestackhci/models/Skus.java | 90 ++ .../SoftwareAssuranceChangeRequest.java | 53 + ...twareAssuranceChangeRequestProperties.java | 51 + .../models/SoftwareAssuranceIntent.java | 47 + .../models/SoftwareAssuranceProperties.java | 81 ++ .../models/SoftwareAssuranceStatus.java | 47 + .../azurestackhci/models/State.java | 96 ++ .../azurestackhci/models/Status.java | 23 +- .../models/StatusLevelTypes.java | 50 + .../azurestackhci/models/UpdateList.java | 70 + .../models/UpdatePrerequisite.java | 105 ++ .../azurestackhci/models/UpdateRun.java | 572 ++++++++ .../azurestackhci/models/UpdateRunList.java | 70 + .../models/UpdateRunPropertiesState.java | 53 + .../azurestackhci/models/UpdateRuns.java | 148 ++ .../azurestackhci/models/UpdateSummaries.java | 132 ++ .../models/UpdateSummariesList.java | 70 + .../models/UpdateSummariesOperations.java | 114 ++ .../UpdateSummariesPropertiesState.java | 65 + .../azurestackhci/models/Updates.java | 167 +++ .../models/UploadCertificateRequest.java | 4 + .../models/UserAssignedIdentity.java | 55 + .../models/WindowsServerSubscription.java | 11 +- ...entAndInstallDefaultExtensionsSamples.java | 24 + .../ArcSettingsCreateIdentitySamples.java | 6 +- .../generated/ArcSettingsCreateSamples.java | 2 +- .../generated/ArcSettingsDeleteSamples.java | 6 +- .../ArcSettingsGeneratePasswordSamples.java | 8 +- .../generated/ArcSettingsGetSamples.java | 6 +- ...ttingsInitializeDisableProcessSamples.java | 22 + .../ArcSettingsListByClusterSamples.java | 6 +- .../generated/ArcSettingsUpdateSamples.java | 13 +- .../ClustersCreateIdentitySamples.java | 6 +- .../generated/ClustersCreateSamples.java | 5 +- .../generated/ClustersDeleteSamples.java | 6 +- ...ExtendSoftwareAssuranceBenefitSamples.java | 33 + .../ClustersGetByResourceGroupSamples.java | 6 +- .../ClustersListByResourceGroupSamples.java | 6 +- .../generated/ClustersListSamples.java | 6 +- .../generated/ClustersUpdateSamples.java | 11 +- .../ClustersUploadCertificateSamples.java | 5 +- .../generated/ExtensionsCreateSamples.java | 3 +- .../generated/ExtensionsDeleteSamples.java | 8 +- .../generated/ExtensionsGetSamples.java | 7 +- .../ExtensionsListByArcSettingSamples.java | 6 +- .../generated/ExtensionsUpdateSamples.java | 26 +- .../generated/ExtensionsUpgradeSamples.java | 30 + .../generated/OffersGetSamples.java | 22 + .../generated/OffersListByClusterSamples.java | 21 + .../OffersListByPublisherSamples.java | 21 + .../generated/OperationsListSamples.java | 6 +- .../generated/PublishersGetSamples.java | 20 + .../PublishersListByClusterSamples.java | 21 + .../generated/SkusGetSamples.java | 23 + .../generated/SkusListByOfferSamples.java | 23 + .../generated/UpdateRunsDeleteSamples.java | 27 + .../generated/UpdateRunsGetSamples.java | 28 + .../generated/UpdateRunsListSamples.java | 21 + .../generated/UpdateRunsPutSamples.java | 57 + ...UpdateSummariesOperationDeleteSamples.java | 20 + .../UpdateSummariesOperationGetSamples.java | 21 + .../UpdateSummariesOperationListSamples.java | 21 + .../UpdateSummariesOperationPutSamples.java | 37 + .../generated/UpdatesDeleteSamples.java | 20 + .../generated/UpdatesGetSamples.java | 22 + .../generated/UpdatesListSamples.java | 20 + .../generated/UpdatesPostSamples.java | 20 + .../generated/UpdatesPutSamples.java | 55 + 204 files changed, 22212 insertions(+), 671 deletions(-) create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/OffersClient.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/PublishersClient.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/SkusClient.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/UpdateRunsClient.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/UpdateSummariesOperationsClient.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/UpdatesClient.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ExtensionPatchProperties.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/HciUpdateInner.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ManagedServiceIdentity.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/OfferInner.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/OfferProperties.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/PublisherInner.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/PublisherProperties.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/SkuInner.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/SkuProperties.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/Step.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateProperties.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateRunInner.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateRunProperties.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateStateProperties.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateSummariesInner.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateSummariesProperties.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/HciUpdateImpl.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OfferImpl.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OffersClientImpl.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OffersImpl.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/PublisherImpl.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/PublishersClientImpl.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/PublishersImpl.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/SkuImpl.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/SkusClientImpl.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/SkusImpl.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateRunImpl.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateRunsClientImpl.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateRunsImpl.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateSummariesImpl.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateSummariesOperationsClientImpl.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateSummariesOperationsImpl.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdatesClientImpl.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdatesImpl.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/AvailabilityType.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterNodeType.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ConnectivityStatus.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DefaultExtensionDetails.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionInstanceView.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionInstanceViewStatus.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionManagedBy.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionPatch.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionPatchParameters.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionUpgradeParameters.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HciUpdate.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HealthState.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/IsolatedVmAttestationConfiguration.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ManagedServiceIdentityType.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OemActivation.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Offer.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OfferList.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Offers.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PackageVersionInfo.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PrecheckResult.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PrecheckResultTags.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Publisher.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PublisherList.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Publishers.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/RebootRequirement.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Severity.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Sku.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SkuList.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SkuMappings.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Skus.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SoftwareAssuranceChangeRequest.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SoftwareAssuranceChangeRequestProperties.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SoftwareAssuranceIntent.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SoftwareAssuranceProperties.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SoftwareAssuranceStatus.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/State.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StatusLevelTypes.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateList.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdatePrerequisite.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateRun.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateRunList.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateRunPropertiesState.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateRuns.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateSummaries.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateSummariesList.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateSummariesOperations.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateSummariesPropertiesState.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Updates.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UserAssignedIdentity.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsConsentAndInstallDefaultExtensionsSamples.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsInitializeDisableProcessSamples.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersExtendSoftwareAssuranceBenefitSamples.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsUpgradeSamples.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/OffersGetSamples.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/OffersListByClusterSamples.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/OffersListByPublisherSamples.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/PublishersGetSamples.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/PublishersListByClusterSamples.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/SkusGetSamples.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/SkusListByOfferSamples.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunsDeleteSamples.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunsGetSamples.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunsListSamples.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunsPutSamples.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateSummariesOperationDeleteSamples.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateSummariesOperationGetSamples.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateSummariesOperationListSamples.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateSummariesOperationPutSamples.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesDeleteSamples.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesGetSamples.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesListSamples.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesPostSamples.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesPutSamples.java diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/CHANGELOG.md b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/CHANGELOG.md index 3ccd02fadd6f5..7aceece97f8ef 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/CHANGELOG.md +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.0.0-beta.4 (Unreleased) +## 1.0.0-beta.1 (2023-09-19) + +- 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-2023-08. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/README.md b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/README.md index 49c5a0968a067..786e58659817f 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/README.md +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/README.md @@ -2,7 +2,7 @@ Azure Resource Manager AzureStackHci client library for Java. -This package contains Microsoft Azure SDK for AzureStackHci Management SDK. Azure Stack HCI management service. Package tag package-2022-05. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for AzureStackHci Management SDK. Azure Stack HCI management service. Package tag package-2023-08. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-azurestackhci - 1.0.0-beta.3 + 1.0.0-beta.4 ``` [//]: # ({x-version-update-end}) @@ -41,19 +41,19 @@ Various documentation is available to help you get started Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. -[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. +[Azure Identity][azure_identity] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation. ### Authentication -By default, Azure Active Directory token authentication depends on correct configure of following environment variables. +By default, Azure Active Directory token authentication depends on correct configuration of the following environment variables. - `AZURE_CLIENT_ID` for Azure client ID. - `AZURE_TENANT_ID` for Azure tenant ID. - `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. -In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. +In addition, Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. -With above configuration, `azure` client can be authenticated by following code: +With above configuration, `azure` client can be authenticated using the following code: ```java AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); @@ -83,13 +83,13 @@ See [API design][design] for general introduction on design and key concepts on ## Contributing -For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). +For details on contributing to this repository, see the [contributing guide][cg]. -1. Fork it -1. Create your feature branch (`git checkout -b my-new-feature`) -1. Commit your changes (`git commit -am 'Add some feature'`) -1. Push to the branch (`git push origin my-new-feature`) -1. Create new Pull Request +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact with any additional questions or comments. [survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS @@ -100,3 +100,8 @@ For details on contributing to this repository, see the [contributing guide](htt [azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty [authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md [design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md +[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Fazurestackhci%2Fazure-resourcemanager-azurestackhci%2FREADME.png) diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/SAMPLE.md b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/SAMPLE.md index 949f72862f798..71249d34f4395 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/SAMPLE.md +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/SAMPLE.md @@ -3,11 +3,13 @@ ## ArcSettings +- [ConsentAndInstallDefaultExtensions](#arcsettings_consentandinstalldefaultextensions) - [Create](#arcsettings_create) - [CreateIdentity](#arcsettings_createidentity) - [Delete](#arcsettings_delete) - [GeneratePassword](#arcsettings_generatepassword) - [Get](#arcsettings_get) +- [InitializeDisableProcess](#arcsettings_initializedisableprocess) - [ListByCluster](#arcsettings_listbycluster) - [Update](#arcsettings_update) @@ -16,6 +18,7 @@ - [Create](#clusters_create) - [CreateIdentity](#clusters_createidentity) - [Delete](#clusters_delete) +- [ExtendSoftwareAssuranceBenefit](#clusters_extendsoftwareassurancebenefit) - [GetByResourceGroup](#clusters_getbyresourcegroup) - [List](#clusters_list) - [ListByResourceGroup](#clusters_listbyresourcegroup) @@ -29,17 +32,79 @@ - [Get](#extensions_get) - [ListByArcSetting](#extensions_listbyarcsetting) - [Update](#extensions_update) +- [Upgrade](#extensions_upgrade) + +## Offers + +- [Get](#offers_get) +- [ListByCluster](#offers_listbycluster) +- [ListByPublisher](#offers_listbypublisher) ## Operations - [List](#operations_list) + +## Publishers + +- [Get](#publishers_get) +- [ListByCluster](#publishers_listbycluster) + +## Skus + +- [Get](#skus_get) +- [ListByOffer](#skus_listbyoffer) + +## UpdateRuns + +- [Delete](#updateruns_delete) +- [Get](#updateruns_get) +- [List](#updateruns_list) +- [Put](#updateruns_put) + +## UpdateSummariesOperation + +- [Delete](#updatesummariesoperation_delete) +- [Get](#updatesummariesoperation_get) +- [List](#updatesummariesoperation_list) +- [Put](#updatesummariesoperation_put) + +## Updates + +- [Delete](#updates_delete) +- [Get](#updates_get) +- [List](#updates_list) +- [Post](#updates_post) +- [Put](#updates_put) +### ArcSettings_ConsentAndInstallDefaultExtensions + +```java +/** Samples for ArcSettings ConsentAndInstallDefaultExtensions. */ +public final class ArcSettingsConsentAndInstallDefaultExtensionsSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/ConsentAndInstallDefaultExtensions.json + */ + /** + * Sample code: Consent And Install Default Extensions. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void consentAndInstallDefaultExtensions( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .arcSettings() + .consentAndInstallDefaultExtensionsWithResponse( + "test-rg", "myCluster", "default", com.azure.core.util.Context.NONE); + } +} +``` + ### ArcSettings_Create ```java /** Samples for ArcSettings Create. */ public final class ArcSettingsCreateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/PutArcSetting.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/PutArcSetting.json */ /** * Sample code: Create ArcSetting. @@ -55,12 +120,10 @@ public final class ArcSettingsCreateSamples { ### 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-05-01/examples/CreateArcIdentity.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/CreateArcIdentity.json */ /** * Sample code: Create Arc Identity. @@ -68,7 +131,7 @@ public final class ArcSettingsCreateIdentitySamples { * @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); + manager.arcSettings().createIdentity("test-rg", "myCluster", "default", com.azure.core.util.Context.NONE); } } ``` @@ -76,12 +139,10 @@ public final class ArcSettingsCreateIdentitySamples { ### 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-05-01/examples/DeleteArcSetting.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/DeleteArcSetting.json */ /** * Sample code: Delete ArcSetting. @@ -89,7 +150,7 @@ public final class ArcSettingsDeleteSamples { * @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); + manager.arcSettings().delete("test-rg", "myCluster", "default", com.azure.core.util.Context.NONE); } } ``` @@ -97,12 +158,10 @@ public final class ArcSettingsDeleteSamples { ### 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-05-01/examples/GeneratePassword.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/GeneratePassword.json */ /** * Sample code: Generate Password. @@ -110,7 +169,9 @@ public final class ArcSettingsGeneratePasswordSamples { * @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); + manager + .arcSettings() + .generatePasswordWithResponse("test-rg", "myCluster", "default", com.azure.core.util.Context.NONE); } } ``` @@ -118,12 +179,10 @@ public final class ArcSettingsGeneratePasswordSamples { ### 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-05-01/examples/GetArcSetting.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/GetArcSetting.json */ /** * Sample code: Get ArcSetting. @@ -131,20 +190,39 @@ public final class ArcSettingsGetSamples { * @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); + manager.arcSettings().getWithResponse("test-rg", "myCluster", "default", com.azure.core.util.Context.NONE); } } ``` -### ArcSettings_ListByCluster +### ArcSettings_InitializeDisableProcess ```java -import com.azure.core.util.Context; +/** Samples for ArcSettings InitializeDisableProcess. */ +public final class ArcSettingsInitializeDisableProcessSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/InitializeDisableProcess.json + */ + /** + * Sample code: Trigger ARC Disable. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void triggerARCDisable(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .arcSettings() + .initializeDisableProcess("test-rg", "myCluster", "default", com.azure.core.util.Context.NONE); + } +} +``` +### ArcSettings_ListByCluster + +```java /** Samples for ArcSettings ListByCluster. */ public final class ArcSettingsListByClusterSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/ListArcSettingsByCluster.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/ListArcSettingsByCluster.json */ /** * Sample code: List ArcSetting resources by HCI Cluster. @@ -153,7 +231,7 @@ public final class ArcSettingsListByClusterSamples { */ public static void listArcSettingResourcesByHCICluster( com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.arcSettings().listByCluster("test-rg", "myCluster", Context.NONE); + manager.arcSettings().listByCluster("test-rg", "myCluster", com.azure.core.util.Context.NONE); } } ``` @@ -162,7 +240,6 @@ public final class ArcSettingsListByClusterSamples { ```java import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.Context; import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.azurestackhci.models.ArcSetting; import java.io.IOException; @@ -170,7 +247,7 @@ import java.io.IOException; /** Samples for ArcSettings Update. */ public final class ArcSettingsUpdateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/PatchArcSetting.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/PatchArcSetting.json */ /** * Sample code: Patch ArcSetting. @@ -180,13 +257,19 @@ public final class ArcSettingsUpdateSamples { public static void patchArcSetting(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) throws IOException { ArcSetting resource = - manager.arcSettings().getWithResponse("test-rg", "myCluster", "default", Context.NONE).getValue(); + manager + .arcSettings() + .getWithResponse("test-rg", "myCluster", "default", com.azure.core.util.Context.NONE) + .getValue(); resource .update() .withConnectivityProperties( SerializerFactory .createDefaultManagementSerializerAdapter() - .deserialize("{\"enabled\":true}", Object.class, SerializerEncoding.JSON)) + .deserialize( + "{\"enabled\":true,\"serviceConfigurations\":[{\"port\":6516,\"serviceName\":\"WAC\"}]}", + Object.class, + SerializerEncoding.JSON)) .apply(); } } @@ -195,10 +278,12 @@ public final class ArcSettingsUpdateSamples { ### Clusters_Create ```java +import com.azure.resourcemanager.azurestackhci.models.ManagedServiceIdentityType; + /** Samples for Clusters Create. */ public final class ClustersCreateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/CreateCluster.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/CreateCluster.json */ /** * Sample code: Create cluster. @@ -211,6 +296,7 @@ public final class ClustersCreateSamples { .define("myCluster") .withRegion("East US") .withExistingResourceGroup("test-rg") + .withTypeIdentityType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) .withCloudManagementEndpoint("https://98294836-31be-4668-aeae-698667faf99b.waconazure.com") .withAadClientId("24a6e53d-04e5-44d2-b7cc-1b732a847dfc") .withAadTenantId("7e589cc1-a8b6-4dff-91bd-5ec0fa18db94") @@ -222,12 +308,10 @@ public final class ClustersCreateSamples { ### 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-05-01/examples/CreateClusterIdentity.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/CreateClusterIdentity.json */ /** * Sample code: Create cluster Identity. @@ -235,7 +319,7 @@ public final class ClustersCreateIdentitySamples { * @param manager Entry point to AzureStackHciManager. */ public static void createClusterIdentity(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.clusters().createIdentity("test-rg", "myCluster", Context.NONE); + manager.clusters().createIdentity("test-rg", "myCluster", com.azure.core.util.Context.NONE); } } ``` @@ -243,12 +327,10 @@ public final class ClustersCreateIdentitySamples { ### 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-05-01/examples/DeleteCluster.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/DeleteCluster.json */ /** * Sample code: Delete cluster. @@ -256,20 +338,50 @@ public final class ClustersDeleteSamples { * @param manager Entry point to AzureStackHciManager. */ public static void deleteCluster(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.clusters().delete("test-rg", "myCluster", Context.NONE); + manager.clusters().delete("test-rg", "myCluster", com.azure.core.util.Context.NONE); } } ``` -### Clusters_GetByResourceGroup +### Clusters_ExtendSoftwareAssuranceBenefit ```java -import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.models.SoftwareAssuranceChangeRequest; +import com.azure.resourcemanager.azurestackhci.models.SoftwareAssuranceChangeRequestProperties; +import com.azure.resourcemanager.azurestackhci.models.SoftwareAssuranceIntent; + +/** Samples for Clusters ExtendSoftwareAssuranceBenefit. */ +public final class ClustersExtendSoftwareAssuranceBenefitSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/ExtendSoftwareAssuranceBenefit.json + */ + /** + * Sample code: Create cluster Identity. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void createClusterIdentity(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .clusters() + .extendSoftwareAssuranceBenefit( + "test-rg", + "myCluster", + new SoftwareAssuranceChangeRequest() + .withProperties( + new SoftwareAssuranceChangeRequestProperties() + .withSoftwareAssuranceIntent(SoftwareAssuranceIntent.ENABLE)), + com.azure.core.util.Context.NONE); + } +} +``` + +### Clusters_GetByResourceGroup +```java /** Samples for Clusters GetByResourceGroup. */ public final class ClustersGetByResourceGroupSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/GetCluster.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/GetCluster.json */ /** * Sample code: Get cluster. @@ -277,7 +389,7 @@ public final class ClustersGetByResourceGroupSamples { * @param manager Entry point to AzureStackHciManager. */ public static void getCluster(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.clusters().getByResourceGroupWithResponse("test-rg", "myCluster", Context.NONE); + manager.clusters().getByResourceGroupWithResponse("test-rg", "myCluster", com.azure.core.util.Context.NONE); } } ``` @@ -285,12 +397,10 @@ public final class ClustersGetByResourceGroupSamples { ### 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-05-01/examples/ListClustersBySubscription.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/ListClustersBySubscription.json */ /** * Sample code: List clusters in a given subscription. @@ -299,7 +409,7 @@ public final class ClustersListSamples { */ public static void listClustersInAGivenSubscription( com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.clusters().list(Context.NONE); + manager.clusters().list(com.azure.core.util.Context.NONE); } } ``` @@ -307,12 +417,10 @@ public final class ClustersListSamples { ### 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-05-01/examples/ListClustersByResourceGroup.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/ListClustersByResourceGroup.json */ /** * Sample code: List clusters in a given resource group. @@ -321,7 +429,7 @@ public final class ClustersListByResourceGroupSamples { */ public static void listClustersInAGivenResourceGroup( com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.clusters().listByResourceGroup("test-rg", Context.NONE); + manager.clusters().listByResourceGroup("test-rg", com.azure.core.util.Context.NONE); } } ``` @@ -329,10 +437,10 @@ public final class ClustersListByResourceGroupSamples { ### 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.ManagedServiceIdentityType; import com.azure.resourcemanager.azurestackhci.models.WindowsServerSubscription; import java.util.HashMap; import java.util.Map; @@ -340,7 +448,7 @@ import java.util.Map; /** Samples for Clusters Update. */ public final class ClustersUpdateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/UpdateCluster.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/UpdateCluster.json */ /** * Sample code: Update cluster. @@ -349,10 +457,14 @@ public final class ClustersUpdateSamples { */ public static void updateCluster(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { Cluster resource = - manager.clusters().getByResourceGroupWithResponse("test-rg", "myCluster", Context.NONE).getValue(); + manager + .clusters() + .getByResourceGroupWithResponse("test-rg", "myCluster", com.azure.core.util.Context.NONE) + .getValue(); resource .update() .withTags(mapOf("tag1", "value1", "tag2", "value2")) + .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) .withCloudManagementEndpoint("https://98294836-31be-4668-aeae-698667faf99b.waconazure.com") .withDesiredProperties( new ClusterDesiredProperties() @@ -361,6 +473,7 @@ public final class ClustersUpdateSamples { .apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -377,7 +490,6 @@ public final class ClustersUpdateSamples { ### 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; @@ -385,7 +497,7 @@ import java.util.Arrays; /** Samples for Clusters UploadCertificate. */ public final class ClustersUploadCertificateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/UploadCertificate.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/UploadCertificate.json */ /** * Sample code: Upload certificate. @@ -401,7 +513,7 @@ public final class ClustersUploadCertificateSamples { new UploadCertificateRequest() .withProperties( new RawCertificateData().withCertificates(Arrays.asList("base64cert", "base64cert"))), - Context.NONE); + com.azure.core.util.Context.NONE); } } ``` @@ -416,7 +528,7 @@ import java.io.IOException; /** Samples for Extensions Create. */ public final class ExtensionsCreateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/PutExtension.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/PutExtension.json */ /** * Sample code: Create Arc Extension. @@ -440,6 +552,7 @@ public final class ExtensionsCreateSamples { SerializerFactory .createDefaultManagementSerializerAdapter() .deserialize("{\"workspaceKey\":\"xx\"}", Object.class, SerializerEncoding.JSON)) + .withEnableAutomaticUpgrade(false) .create(); } } @@ -448,12 +561,10 @@ public final class ExtensionsCreateSamples { ### 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-05-01/examples/DeleteExtension.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/DeleteExtension.json */ /** * Sample code: Delete Arc Extension. @@ -461,7 +572,9 @@ public final class ExtensionsDeleteSamples { * @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); + manager + .extensions() + .delete("test-rg", "myCluster", "default", "MicrosoftMonitoringAgent", com.azure.core.util.Context.NONE); } } ``` @@ -469,12 +582,10 @@ public final class ExtensionsDeleteSamples { ### 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-05-01/examples/GetExtension.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/GetExtension.json */ /** * Sample code: Get ArcSettings Extension. @@ -484,7 +595,8 @@ public final class ExtensionsGetSamples { public static void getArcSettingsExtension(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { manager .extensions() - .getWithResponse("test-rg", "myCluster", "default", "MicrosoftMonitoringAgent", Context.NONE); + .getWithResponse( + "test-rg", "myCluster", "default", "MicrosoftMonitoringAgent", com.azure.core.util.Context.NONE); } } ``` @@ -492,12 +604,10 @@ public final class ExtensionsGetSamples { ### 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-05-01/examples/ListExtensionsByArcSetting.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/ListExtensionsByArcSetting.json */ /** * Sample code: List Extensions under ArcSetting resource. @@ -506,7 +616,7 @@ public final class ExtensionsListByArcSettingSamples { */ public static void listExtensionsUnderArcSettingResource( com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.extensions().listByArcSetting("test-rg", "myCluster", "default", Context.NONE); + manager.extensions().listByArcSetting("test-rg", "myCluster", "default", com.azure.core.util.Context.NONE); } } ``` @@ -515,15 +625,15 @@ public final class ExtensionsListByArcSettingSamples { ```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 com.azure.resourcemanager.azurestackhci.models.ExtensionPatchParameters; import java.io.IOException; /** Samples for Extensions Update. */ public final class ExtensionsUpdateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/PatchExtension.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/PatchExtension.json */ /** * Sample code: Update Arc Extension. @@ -535,31 +645,125 @@ public final class ExtensionsUpdateSamples { Extension resource = manager .extensions() - .getWithResponse("test-rg", "myCluster", "default", "MicrosoftMonitoringAgent", Context.NONE) + .getWithResponse( + "test-rg", "myCluster", "default", "MicrosoftMonitoringAgent", com.azure.core.util.Context.NONE) .getValue(); resource .update() - .withPublisher("Microsoft.Compute") - .withTypePropertiesType("MicrosoftMonitoringAgent") - .withTypeHandlerVersion("1.10") - .withSettings( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize("{\"workspaceId\":\"xx\"}", Object.class, SerializerEncoding.JSON)) + .withExtensionParameters( + new ExtensionPatchParameters() + .withTypeHandlerVersion("1.10") + .withEnableAutomaticUpgrade(false) + .withSettings( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{\"workspaceId\":\"xx\"}", Object.class, SerializerEncoding.JSON)) + .withProtectedSettings( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{\"workspaceKey\":\"xx\"}", Object.class, SerializerEncoding.JSON))) .apply(); } } ``` -### Operations_List +### Extensions_Upgrade ```java -import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.models.ExtensionUpgradeParameters; +/** Samples for Extensions Upgrade. */ +public final class ExtensionsUpgradeSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/Extensions_Upgrade.json + */ + /** + * Sample code: Upgrade Machine Extensions. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void upgradeMachineExtensions(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .extensions() + .upgrade( + "test-rg", + "myCluster", + "default", + "MicrosoftMonitoringAgent", + new ExtensionUpgradeParameters().withTargetVersion("1.0.18062.0"), + com.azure.core.util.Context.NONE); + } +} +``` + +### Offers_Get + +```java +/** Samples for Offers Get. */ +public final class OffersGetSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/GetOffer.json + */ + /** + * Sample code: Get Offer. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getOffer(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .offers() + .getWithResponse("test-rg", "myCluster", "publisher1", "offer1", null, com.azure.core.util.Context.NONE); + } +} +``` + +### Offers_ListByCluster + +```java +/** Samples for Offers ListByCluster. */ +public final class OffersListByClusterSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/ListOffersByCluster.json + */ + /** + * Sample code: List Offer resources by HCI Cluster. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listOfferResourcesByHCICluster( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.offers().listByCluster("test-rg", "myCluster", null, com.azure.core.util.Context.NONE); + } +} +``` + +### Offers_ListByPublisher + +```java +/** Samples for Offers ListByPublisher. */ +public final class OffersListByPublisherSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/ListOffersByPublisher.json + */ + /** + * Sample code: List Offer resources by publisher for the HCI Cluster. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listOfferResourcesByPublisherForTheHCICluster( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.offers().listByPublisher("test-rg", "myCluster", "publisher1", null, com.azure.core.util.Context.NONE); + } +} +``` + +### Operations_List + +```java /** Samples for Operations List. */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/ListOperations.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/ListOperations.json */ /** * Sample code: Create cluster. @@ -567,7 +771,446 @@ public final class OperationsListSamples { * @param manager Entry point to AzureStackHciManager. */ public static void createCluster(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.operations().listWithResponse(Context.NONE); + manager.operations().listWithResponse(com.azure.core.util.Context.NONE); + } +} +``` + +### Publishers_Get + +```java +/** Samples for Publishers Get. */ +public final class PublishersGetSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/GetPublisher.json + */ + /** + * Sample code: Get Publisher. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getPublisher(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.publishers().getWithResponse("test-rg", "myCluster", "publisher1", com.azure.core.util.Context.NONE); + } +} +``` + +### Publishers_ListByCluster + +```java +/** Samples for Publishers ListByCluster. */ +public final class PublishersListByClusterSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/ListPublishersByCluster.json + */ + /** + * Sample code: List Publisher resources by HCI Cluster. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listPublisherResourcesByHCICluster( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.publishers().listByCluster("test-rg", "myCluster", com.azure.core.util.Context.NONE); + } +} +``` + +### Skus_Get + +```java +/** Samples for Skus Get. */ +public final class SkusGetSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/GetSku.json + */ + /** + * Sample code: Get Sku. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getSku(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .skus() + .getWithResponse( + "test-rg", "myCluster", "publisher1", "offer1", "sku1", null, com.azure.core.util.Context.NONE); + } +} +``` + +### Skus_ListByOffer + +```java +/** Samples for Skus ListByOffer. */ +public final class SkusListByOfferSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/ListSkusByOffer.json + */ + /** + * Sample code: List SKU resources by offer for the HCI Cluster. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listSKUResourcesByOfferForTheHCICluster( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .skus() + .listByOffer("test-rg", "myCluster", "publisher1", "offer1", null, com.azure.core.util.Context.NONE); + } +} +``` + +### UpdateRuns_Delete + +```java +/** Samples for UpdateRuns Delete. */ +public final class UpdateRunsDeleteSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/DeleteUpdateRuns.json + */ + /** + * Sample code: Delete an Update. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void deleteAnUpdate(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .updateRuns() + .delete( + "testrg", + "testcluster", + "Microsoft4.2203.2.32", + "23b779ba-0d52-4a80-8571-45ca74664ec3", + com.azure.core.util.Context.NONE); + } +} +``` + +### UpdateRuns_Get + +```java +/** Samples for UpdateRuns Get. */ +public final class UpdateRunsGetSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/GetUpdateRuns.json + */ + /** + * Sample code: Get Update runs under cluster resource. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getUpdateRunsUnderClusterResource( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .updateRuns() + .getWithResponse( + "testrg", + "testcluster", + "Microsoft4.2203.2.32", + "23b779ba-0d52-4a80-8571-45ca74664ec3", + com.azure.core.util.Context.NONE); + } +} +``` + +### UpdateRuns_List + +```java +/** Samples for UpdateRuns List. */ +public final class UpdateRunsListSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/ListUpdateRuns.json + */ + /** + * Sample code: List Update runs under cluster resource. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listUpdateRunsUnderClusterResource( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.updateRuns().list("testrg", "testcluster", "Microsoft4.2203.2.32", com.azure.core.util.Context.NONE); + } +} +``` + +### UpdateRuns_Put + +```java +import com.azure.resourcemanager.azurestackhci.fluent.models.Step; +import com.azure.resourcemanager.azurestackhci.models.UpdateRun; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** Samples for UpdateRuns Put. */ +public final class UpdateRunsPutSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/PutUpdateRuns.json + */ + /** + * Sample code: Get Update runs under cluster resource. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getUpdateRunsUnderClusterResource( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + UpdateRun resource = + manager + .updateRuns() + .getWithResponse( + "testrg", + "testcluster", + "Microsoft4.2203.2.32", + "23b779ba-0d52-4a80-8571-45ca74664ec3", + com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withNamePropertiesName("Unnamed step") + .withDescription("Update Azure Stack.") + .withErrorMessage("") + .withStatus("Success") + .withStartTimeUtc(OffsetDateTime.parse("2022-04-06T01:36:33.3876751+00:00")) + .withEndTimeUtc(OffsetDateTime.parse("2022-04-06T13:58:42.969006+00:00")) + .withLastUpdatedTimeUtc(OffsetDateTime.parse("2022-04-06T13:58:42.969006+00:00")) + .withSteps( + Arrays + .asList( + new Step() + .withName("PreUpdate Cloud") + .withDescription("Prepare for SSU update") + .withErrorMessage("") + .withStatus("Success") + .withStartTimeUtc(OffsetDateTime.parse("2022-04-06T01:36:33.3876751+00:00")) + .withEndTimeUtc(OffsetDateTime.parse("2022-04-06T01:37:16.8728314+00:00")) + .withLastUpdatedTimeUtc(OffsetDateTime.parse("2022-04-06T01:37:16.8728314+00:00")) + .withSteps(Arrays.asList()))) + .apply(); + } +} +``` + +### UpdateSummariesOperation_Delete + +```java +/** Samples for UpdateSummariesOperation Delete. */ +public final class UpdateSummariesOperationDeleteSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/DeleteUpdateSummaries.json + */ + /** + * Sample code: Delete an Update. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void deleteAnUpdate(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.updateSummariesOperations().delete("testrg", "testcluster", com.azure.core.util.Context.NONE); + } +} +``` + +### UpdateSummariesOperation_Get + +```java +/** Samples for UpdateSummariesOperation Get. */ +public final class UpdateSummariesOperationGetSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/GetUpdateSummaries.json + */ + /** + * Sample code: Get Update summaries under cluster resource. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getUpdateSummariesUnderClusterResource( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.updateSummariesOperations().getWithResponse("testrg", "testcluster", com.azure.core.util.Context.NONE); + } +} +``` + +### UpdateSummariesOperation_List + +```java +/** Samples for UpdateSummariesOperation List. */ +public final class UpdateSummariesOperationListSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/ListUpdateSummaries.json + */ + /** + * Sample code: Get Update summaries under cluster resource. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getUpdateSummariesUnderClusterResource( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.updateSummariesOperations().list("testrg", "testcluster", com.azure.core.util.Context.NONE); + } +} +``` + +### UpdateSummariesOperation_Put + +```java +import com.azure.resourcemanager.azurestackhci.fluent.models.UpdateSummariesInner; +import com.azure.resourcemanager.azurestackhci.models.UpdateSummariesPropertiesState; +import java.time.OffsetDateTime; + +/** Samples for UpdateSummariesOperation Put. */ +public final class UpdateSummariesOperationPutSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/PutUpdateSummaries.json + */ + /** + * Sample code: Put Update summaries under cluster resource. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void putUpdateSummariesUnderClusterResource( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .updateSummariesOperations() + .putWithResponse( + "testrg", + "testcluster", + new UpdateSummariesInner() + .withOemFamily("DellEMC") + .withHardwareModel("PowerEdge R730xd") + .withCurrentVersion("4.2203.2.32") + .withLastUpdated(OffsetDateTime.parse("2022-04-06T14:08:18.254Z")) + .withLastChecked(OffsetDateTime.parse("2022-04-07T18:04:07Z")) + .withState(UpdateSummariesPropertiesState.APPLIED_SUCCESSFULLY), + com.azure.core.util.Context.NONE); + } +} +``` + +### Updates_Delete + +```java +/** Samples for Updates Delete. */ +public final class UpdatesDeleteSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/DeleteUpdates.json + */ + /** + * Sample code: Delete an Update. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void deleteAnUpdate(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.updates().delete("testrg", "testcluster", "Microsoft4.2203.2.32", com.azure.core.util.Context.NONE); + } +} +``` + +### Updates_Get + +```java +/** Samples for Updates Get. */ +public final class UpdatesGetSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/GetUpdates.json + */ + /** + * Sample code: Get a specific update. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getASpecificUpdate(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .updates() + .getWithResponse("testrg", "testcluster", "Microsoft4.2203.2.32", com.azure.core.util.Context.NONE); + } +} +``` + +### Updates_List + +```java +/** Samples for Updates List. */ +public final class UpdatesListSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/ListUpdates.json + */ + /** + * Sample code: List available updates. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listAvailableUpdates(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.updates().list("testrg", "testcluster", com.azure.core.util.Context.NONE); + } +} +``` + +### Updates_Post + +```java +/** Samples for Updates Post. */ +public final class UpdatesPostSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/PostUpdates.json + */ + /** + * Sample code: List available updates. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listAvailableUpdates(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.updates().post("testrg", "testcluster", "Microsoft4.2203.2.32", com.azure.core.util.Context.NONE); + } +} +``` + +### Updates_Put + +```java +import com.azure.resourcemanager.azurestackhci.models.AvailabilityType; +import com.azure.resourcemanager.azurestackhci.models.HciUpdate; +import com.azure.resourcemanager.azurestackhci.models.State; +import com.azure.resourcemanager.azurestackhci.models.UpdatePrerequisite; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** Samples for Updates Put. */ +public final class UpdatesPutSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/PutUpdates.json + */ + /** + * Sample code: Put a specific update. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void putASpecificUpdate(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + HciUpdate resource = + manager + .updates() + .getWithResponse("testrg", "testcluster", "Microsoft4.2203.2.32", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withInstalledDate(OffsetDateTime.parse("2022-04-06T14:08:18.254Z")) + .withDescription("AzS Update 4.2203.2.32") + .withState(State.INSTALLED) + .withPrerequisites( + Arrays + .asList( + new UpdatePrerequisite() + .withUpdateType("update type") + .withVersion("prerequisite version") + .withPackageName("update package name"))) + .withPackagePath("\\\\SU1FileServer\\SU1_Infrastructure_2\\Updates\\Packages\\Microsoft4.2203.2.32") + .withPackageSizeInMb(18858.0F) + .withDisplayName("AzS Update - 4.2203.2.32") + .withVersion("4.2203.2.32") + .withPublisher("Microsoft") + .withReleaseLink("https://docs.microsoft.com/azure-stack/operator/release-notes?view=azs-2203") + .withAvailabilityType(AvailabilityType.LOCAL) + .withPackageType("Infrastructure") + .withAdditionalProperties("additional properties") + .withProgressPercentage(0.0F) + .withNotifyMessage("Brief message with instructions for updates of AvailabilityType Notify") + .apply(); } } ``` diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/pom.xml b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/pom.xml index e06d6c4b8766a..8d8f11a6a8e4d 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/pom.xml +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/pom.xml @@ -1,3 +1,8 @@ + 4.0.0 @@ -13,7 +18,7 @@ jar Microsoft Azure SDK for AzureStackHci Management - This package contains Microsoft Azure SDK for AzureStackHci Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Stack HCI management service. Package tag package-2022-05. + This package contains Microsoft Azure SDK for AzureStackHci Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Stack HCI management service. Package tag package-2023-08. https://github.com/Azure/azure-sdk-for-java @@ -38,7 +43,9 @@ UTF-8 - true + 0 + 0 + true diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/AzureStackHciManager.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/AzureStackHciManager.java index 7fa8e3fcf096e..80244e8957bad 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/AzureStackHciManager.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/AzureStackHciManager.java @@ -28,11 +28,23 @@ import com.azure.resourcemanager.azurestackhci.implementation.AzureStackHciClientBuilder; import com.azure.resourcemanager.azurestackhci.implementation.ClustersImpl; import com.azure.resourcemanager.azurestackhci.implementation.ExtensionsImpl; +import com.azure.resourcemanager.azurestackhci.implementation.OffersImpl; import com.azure.resourcemanager.azurestackhci.implementation.OperationsImpl; +import com.azure.resourcemanager.azurestackhci.implementation.PublishersImpl; +import com.azure.resourcemanager.azurestackhci.implementation.SkusImpl; +import com.azure.resourcemanager.azurestackhci.implementation.UpdateRunsImpl; +import com.azure.resourcemanager.azurestackhci.implementation.UpdateSummariesOperationsImpl; +import com.azure.resourcemanager.azurestackhci.implementation.UpdatesImpl; import com.azure.resourcemanager.azurestackhci.models.ArcSettings; import com.azure.resourcemanager.azurestackhci.models.Clusters; import com.azure.resourcemanager.azurestackhci.models.Extensions; +import com.azure.resourcemanager.azurestackhci.models.Offers; import com.azure.resourcemanager.azurestackhci.models.Operations; +import com.azure.resourcemanager.azurestackhci.models.Publishers; +import com.azure.resourcemanager.azurestackhci.models.Skus; +import com.azure.resourcemanager.azurestackhci.models.UpdateRuns; +import com.azure.resourcemanager.azurestackhci.models.UpdateSummariesOperations; +import com.azure.resourcemanager.azurestackhci.models.Updates; import java.time.Duration; import java.time.temporal.ChronoUnit; import java.util.ArrayList; @@ -48,8 +60,20 @@ public final class AzureStackHciManager { private Extensions extensions; + private Offers offers; + private Operations operations; + private Publishers publishers; + + private Skus skus; + + private UpdateRuns updateRuns; + + private UpdateSummariesOperations updateSummariesOperations; + + private Updates updates; + private final AzureStackHciClient clientObject; private AzureStackHciManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { @@ -215,7 +239,7 @@ public AzureStackHciManager authenticate(TokenCredential credential, AzureProfil .append("-") .append("com.azure.resourcemanager.azurestackhci") .append("/") - .append("1.0.0-beta.3"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -308,6 +332,18 @@ public Extensions extensions() { return extensions; } + /** + * Gets the resource collection API of Offers. + * + * @return Resource collection API of Offers. + */ + public Offers offers() { + if (this.offers == null) { + this.offers = new OffersImpl(clientObject.getOffers(), this); + } + return offers; + } + /** * Gets the resource collection API of Operations. * @@ -321,8 +357,71 @@ public Operations operations() { } /** - * @return Wrapped service client AzureStackHciClient providing direct access to the underlying auto-generated API - * implementation, based on Azure REST API. + * Gets the resource collection API of Publishers. + * + * @return Resource collection API of Publishers. + */ + public Publishers publishers() { + if (this.publishers == null) { + this.publishers = new PublishersImpl(clientObject.getPublishers(), this); + } + return publishers; + } + + /** + * Gets the resource collection API of Skus. + * + * @return Resource collection API of Skus. + */ + public Skus skus() { + if (this.skus == null) { + this.skus = new SkusImpl(clientObject.getSkus(), this); + } + return skus; + } + + /** + * Gets the resource collection API of UpdateRuns. It manages UpdateRun. + * + * @return Resource collection API of UpdateRuns. + */ + public UpdateRuns updateRuns() { + if (this.updateRuns == null) { + this.updateRuns = new UpdateRunsImpl(clientObject.getUpdateRuns(), this); + } + return updateRuns; + } + + /** + * Gets the resource collection API of UpdateSummariesOperations. + * + * @return Resource collection API of UpdateSummariesOperations. + */ + public UpdateSummariesOperations updateSummariesOperations() { + if (this.updateSummariesOperations == null) { + this.updateSummariesOperations = + new UpdateSummariesOperationsImpl(clientObject.getUpdateSummariesOperations(), this); + } + return updateSummariesOperations; + } + + /** + * Gets the resource collection API of Updates. It manages HciUpdate. + * + * @return Resource collection API of Updates. + */ + public Updates updates() { + if (this.updates == null) { + this.updates = new UpdatesImpl(clientObject.getUpdates(), this); + } + return updates; + } + + /** + * Gets wrapped service client AzureStackHciClient providing direct access to the underlying auto-generated API + * implementation, based on Azure REST API. + * + * @return Wrapped service client AzureStackHciClient. */ public AzureStackHciClient serviceClient() { return this.clientObject; diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/ArcSettingsClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/ArcSettingsClient.java index e7dd0a66b8486..487583ecbee20 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/ArcSettingsClient.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/ArcSettingsClient.java @@ -45,20 +45,6 @@ public interface ArcSettingsClient { @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByCluster(String resourceGroupName, String clusterName, Context context); - /** - * Get ArcSetting resource details of HCI Cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the cluster. - * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return arcSetting resource details of HCI Cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ArcSettingInner get(String resourceGroupName, String clusterName, String arcSettingName); - /** * Get ArcSetting resource details of HCI Cluster. * @@ -76,20 +62,18 @@ Response getWithResponse( String resourceGroupName, String clusterName, String arcSettingName, Context context); /** - * Create ArcSetting for HCI cluster. + * Get ArcSetting resource details of HCI Cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param arcSetting Parameters supplied to the Create ArcSetting resource for this HCI cluster. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return arcSetting details. + * @return arcSetting resource details of HCI Cluster. */ @ServiceMethod(returns = ReturnType.SINGLE) - ArcSettingInner create( - String resourceGroupName, String clusterName, String arcSettingName, ArcSettingInner arcSetting); + ArcSettingInner get(String resourceGroupName, String clusterName, String arcSettingName); /** * Create ArcSetting for HCI cluster. @@ -113,20 +97,20 @@ Response createWithResponse( Context context); /** - * Update ArcSettings for HCI cluster. + * Create ArcSetting for HCI cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param arcSetting ArcSettings parameters that needs to be updated. + * @param arcSetting Parameters supplied to the Create ArcSetting resource for this HCI cluster. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return arcSetting details. */ @ServiceMethod(returns = ReturnType.SINGLE) - ArcSettingInner update( - String resourceGroupName, String clusterName, String arcSettingName, ArcSettingsPatch arcSetting); + ArcSettingInner create( + String resourceGroupName, String clusterName, String arcSettingName, ArcSettingInner arcSetting); /** * Update ArcSettings for HCI cluster. @@ -149,6 +133,22 @@ Response updateWithResponse( ArcSettingsPatch arcSetting, Context context); + /** + * Update ArcSettings for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param arcSetting ArcSettings parameters that needs to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ArcSettingInner update( + String resourceGroupName, String clusterName, String arcSettingName, ArcSettingsPatch arcSetting); + /** * Delete ArcSetting resource details of HCI Cluster. * @@ -212,13 +212,15 @@ SyncPoller, Void> beginDelete( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - PasswordCredentialInner generatePassword(String resourceGroupName, String clusterName, String arcSettingName); + Response generatePasswordWithResponse( + String resourceGroupName, String clusterName, String arcSettingName, Context context); /** * Generate password for arc settings. @@ -226,15 +228,13 @@ SyncPoller, Void> beginDelete( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response generatePasswordWithResponse( - String resourceGroupName, String clusterName, String arcSettingName, Context context); + PasswordCredentialInner generatePassword(String resourceGroupName, String clusterName, String arcSettingName); /** * Create Aad identity for arc settings. @@ -296,4 +296,93 @@ SyncPoller, ArcIdentityResponseInner> begin @ServiceMethod(returns = ReturnType.SINGLE) ArcIdentityResponseInner createIdentity( String resourceGroupName, String clusterName, String arcSettingName, Context context); + + /** + * Add consent time for default extensions and initiate extensions installation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response consentAndInstallDefaultExtensionsWithResponse( + String resourceGroupName, String clusterName, String arcSettingName, Context context); + + /** + * Add consent time for default extensions and initiate extensions installation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ArcSettingInner consentAndInstallDefaultExtensions( + String resourceGroupName, String clusterName, String arcSettingName); + + /** + * Initializes ARC Disable process on the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginInitializeDisableProcess( + String resourceGroupName, String clusterName, String arcSettingName); + + /** + * Initializes ARC Disable process on the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginInitializeDisableProcess( + String resourceGroupName, String clusterName, String arcSettingName, Context context); + + /** + * Initializes ARC Disable process on the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void initializeDisableProcess(String resourceGroupName, String clusterName, String arcSettingName); + + /** + * Initializes ARC Disable process on the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void initializeDisableProcess(String resourceGroupName, String clusterName, String arcSettingName, Context context); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/AzureStackHciClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/AzureStackHciClient.java index bb51fe0bea47c..a66992173354c 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 @@ -65,10 +65,52 @@ public interface AzureStackHciClient { */ ExtensionsClient getExtensions(); + /** + * Gets the OffersClient object to access its operations. + * + * @return the OffersClient object. + */ + OffersClient getOffers(); + /** * Gets the OperationsClient object to access its operations. * * @return the OperationsClient object. */ OperationsClient getOperations(); + + /** + * Gets the PublishersClient object to access its operations. + * + * @return the PublishersClient object. + */ + PublishersClient getPublishers(); + + /** + * Gets the SkusClient object to access its operations. + * + * @return the SkusClient object. + */ + SkusClient getSkus(); + + /** + * Gets the UpdateRunsClient object to access its operations. + * + * @return the UpdateRunsClient object. + */ + UpdateRunsClient getUpdateRuns(); + + /** + * Gets the UpdateSummariesOperationsClient object to access its operations. + * + * @return the UpdateSummariesOperationsClient object. + */ + UpdateSummariesOperationsClient getUpdateSummariesOperations(); + + /** + * Gets the UpdatesClient object to access its operations. + * + * @return the UpdatesClient object. + */ + UpdatesClient getUpdates(); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/ClustersClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/ClustersClient.java index 625ccd127e93b..506c21053cc40 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/ClustersClient.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/ClustersClient.java @@ -14,6 +14,7 @@ import com.azure.resourcemanager.azurestackhci.fluent.models.ClusterIdentityResponseInner; import com.azure.resourcemanager.azurestackhci.fluent.models.ClusterInner; import com.azure.resourcemanager.azurestackhci.models.ClusterPatch; +import com.azure.resourcemanager.azurestackhci.models.SoftwareAssuranceChangeRequest; import com.azure.resourcemanager.azurestackhci.models.UploadCertificateRequest; /** An instance of this class provides access to all the operations defined in ClustersClient. */ @@ -70,28 +71,28 @@ public interface ClustersClient { * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hCI cluster. + * @return hCI cluster along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - ClusterInner getByResourceGroup(String resourceGroupName, String clusterName); + Response getByResourceGroupWithResponse( + String resourceGroupName, String clusterName, Context context); /** * Get HCI cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hCI cluster along with {@link Response}. + * @return hCI cluster. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String clusterName, Context context); + ClusterInner getByResourceGroup(String resourceGroupName, String clusterName); /** * Create an HCI cluster. @@ -99,13 +100,15 @@ Response getByResourceGroupWithResponse( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param cluster Details of the HCI cluster. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster details. + * @return cluster details along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - ClusterInner create(String resourceGroupName, String clusterName, ClusterInner cluster); + Response createWithResponse( + String resourceGroupName, String clusterName, ClusterInner cluster, Context context); /** * Create an HCI cluster. @@ -113,15 +116,13 @@ Response getByResourceGroupWithResponse( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param cluster Details of the HCI cluster. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster details along with {@link Response}. + * @return cluster details. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse( - String resourceGroupName, String clusterName, ClusterInner cluster, Context context); + ClusterInner create(String resourceGroupName, String clusterName, ClusterInner cluster); /** * Update an HCI cluster. @@ -129,13 +130,15 @@ Response createWithResponse( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param cluster Details of the HCI cluster. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster details. + * @return cluster details along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - ClusterInner update(String resourceGroupName, String clusterName, ClusterPatch cluster); + Response updateWithResponse( + String resourceGroupName, String clusterName, ClusterPatch cluster, Context context); /** * Update an HCI cluster. @@ -143,15 +146,13 @@ Response createWithResponse( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param cluster Details of the HCI cluster. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster details along with {@link Response}. + * @return cluster details. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, String clusterName, ClusterPatch cluster, Context context); + ClusterInner update(String resourceGroupName, String clusterName, ClusterPatch cluster); /** * Delete an HCI cluster. @@ -326,4 +327,72 @@ SyncPoller, ClusterIdentityResponseInne */ @ServiceMethod(returns = ReturnType.SINGLE) ClusterIdentityResponseInner createIdentity(String resourceGroupName, String clusterName, Context context); + + /** + * Extends Software Assurance Benefit to a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param softwareAssuranceChangeRequest Software Assurance Change Request Payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of cluster details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ClusterInner> beginExtendSoftwareAssuranceBenefit( + String resourceGroupName, String clusterName, SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest); + + /** + * Extends Software Assurance Benefit to a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param softwareAssuranceChangeRequest Software Assurance Change Request Payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of cluster details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ClusterInner> beginExtendSoftwareAssuranceBenefit( + String resourceGroupName, + String clusterName, + SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest, + Context context); + + /** + * Extends Software Assurance Benefit to a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param softwareAssuranceChangeRequest Software Assurance Change Request Payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterInner extendSoftwareAssuranceBenefit( + String resourceGroupName, String clusterName, SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest); + + /** + * Extends Software Assurance Benefit to a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param softwareAssuranceChangeRequest Software Assurance Change Request Payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterInner extendSoftwareAssuranceBenefit( + String resourceGroupName, + String clusterName, + SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest, + Context context); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/ExtensionsClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/ExtensionsClient.java index d9662370c2a31..8bac06d086f45 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/ExtensionsClient.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/ExtensionsClient.java @@ -12,6 +12,8 @@ import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.azurestackhci.fluent.models.ExtensionInner; +import com.azure.resourcemanager.azurestackhci.models.ExtensionPatch; +import com.azure.resourcemanager.azurestackhci.models.ExtensionUpgradeParameters; /** An instance of this class provides access to all the operations defined in ExtensionsClient. */ public interface ExtensionsClient { @@ -52,13 +54,15 @@ PagedIterable listByArcSetting( * @param clusterName The name of the cluster. * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. * @param extensionName The name of the machine extension. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return particular Arc Extension of HCI Cluster. + * @return particular Arc Extension of HCI Cluster along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - ExtensionInner get(String resourceGroupName, String clusterName, String arcSettingName, String extensionName); + Response getWithResponse( + String resourceGroupName, String clusterName, String arcSettingName, String extensionName, Context context); /** * Get particular Arc Extension of HCI Cluster. @@ -67,15 +71,13 @@ PagedIterable listByArcSetting( * @param clusterName The name of the cluster. * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. * @param extensionName The name of the machine extension. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return particular Arc Extension of HCI Cluster along with {@link Response}. + * @return particular Arc Extension of HCI Cluster. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String clusterName, String arcSettingName, String extensionName, Context context); + ExtensionInner get(String resourceGroupName, String clusterName, String arcSettingName, String extensionName); /** * Create Extension for HCI cluster. @@ -184,7 +186,7 @@ SyncPoller, ExtensionInner> beginUpdate( String clusterName, String arcSettingName, String extensionName, - ExtensionInner extension); + ExtensionPatch extension); /** * Update Extension for HCI cluster. @@ -206,7 +208,7 @@ SyncPoller, ExtensionInner> beginUpdate( String clusterName, String arcSettingName, String extensionName, - ExtensionInner extension, + ExtensionPatch extension, Context context); /** @@ -228,7 +230,7 @@ ExtensionInner update( String clusterName, String arcSettingName, String extensionName, - ExtensionInner extension); + ExtensionPatch extension); /** * Update Extension for HCI cluster. @@ -250,7 +252,7 @@ ExtensionInner update( String clusterName, String arcSettingName, String extensionName, - ExtensionInner extension, + ExtensionPatch extension, Context context); /** @@ -315,4 +317,90 @@ SyncPoller, Void> beginDelete( @ServiceMethod(returns = ReturnType.SINGLE) void delete( String resourceGroupName, String clusterName, String arcSettingName, String extensionName, Context context); + + /** + * Upgrade a particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginUpgrade( + String resourceGroupName, + String clusterName, + String arcSettingName, + String extensionName, + ExtensionUpgradeParameters extensionUpgradeParameters); + + /** + * Upgrade a particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginUpgrade( + String resourceGroupName, + String clusterName, + String arcSettingName, + String extensionName, + ExtensionUpgradeParameters extensionUpgradeParameters, + Context context); + + /** + * Upgrade a particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void upgrade( + String resourceGroupName, + String clusterName, + String arcSettingName, + String extensionName, + ExtensionUpgradeParameters extensionUpgradeParameters); + + /** + * Upgrade a particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void upgrade( + String resourceGroupName, + String clusterName, + String arcSettingName, + String extensionName, + ExtensionUpgradeParameters extensionUpgradeParameters, + Context context); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/OffersClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/OffersClient.java new file mode 100644 index 0000000000000..de2d0e4575c7a --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/OffersClient.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.fluent.models.OfferInner; + +/** An instance of this class provides access to all the operations defined in OffersClient. */ +public interface OffersClient { + /** + * List Offers available for a publisher within the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Offer proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByPublisher(String resourceGroupName, String clusterName, String publisherName); + + /** + * List Offers available for a publisher within the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Offer proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByPublisher( + String resourceGroupName, String clusterName, String publisherName, String expand, Context context); + + /** + * List Offers available across publishers for the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Offer proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByCluster(String resourceGroupName, String clusterName); + + /** + * List Offers available across publishers for the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Offer proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByCluster( + String resourceGroupName, String clusterName, String expand, Context context); + + /** + * Get Offer resource details within a publisher of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return offer resource details within a publisher of HCI Cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String clusterName, + String publisherName, + String offerName, + String expand, + Context context); + + /** + * Get Offer resource details within a publisher of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return offer resource details within a publisher of HCI Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OfferInner get(String resourceGroupName, String clusterName, String publisherName, String offerName); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/OperationsClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/OperationsClient.java index 0b8e907abe681..f0b6560317b01 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/OperationsClient.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/OperationsClient.java @@ -15,22 +15,22 @@ public interface OperationsClient { /** * List all available Microsoft.AzureStackHCI provider operations. * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - OperationListResultInner list(); + Response listWithResponse(Context context); /** * List all available Microsoft.AzureStackHCI provider operations. * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider along with {@link Response}. + * @return a list of REST API operations supported by an Azure Resource Provider. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse(Context context); + OperationListResultInner list(); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/PublishersClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/PublishersClient.java new file mode 100644 index 0000000000000..4848319e64a26 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/PublishersClient.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.fluent.models.PublisherInner; + +/** An instance of this class provides access to all the operations defined in PublishersClient. */ +public interface PublishersClient { + /** + * List Publishers available for the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Publisher proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByCluster(String resourceGroupName, String clusterName); + + /** + * List Publishers available for the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Publisher proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByCluster(String resourceGroupName, String clusterName, Context context); + + /** + * Get Publisher resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher resource details of HCI Cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String clusterName, String publisherName, Context context); + + /** + * Get Publisher resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher resource details of HCI Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PublisherInner get(String resourceGroupName, String clusterName, String publisherName); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/SkusClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/SkusClient.java new file mode 100644 index 0000000000000..1966f641671bf --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/SkusClient.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.fluent.models.SkuInner; + +/** An instance of this class provides access to all the operations defined in SkusClient. */ +public interface SkusClient { + /** + * List Skus available for a offer within the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SKU proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByOffer( + String resourceGroupName, String clusterName, String publisherName, String offerName); + + /** + * List Skus available for a offer within the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SKU proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByOffer( + String resourceGroupName, + String clusterName, + String publisherName, + String offerName, + String expand, + Context context); + + /** + * Get SKU resource details within a offer of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @param skuName The name of the SKU available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sKU resource details within a offer of HCI Cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String clusterName, + String publisherName, + String offerName, + String skuName, + String expand, + Context context); + + /** + * Get SKU resource details within a offer of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @param skuName The name of the SKU available within HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sKU resource details within a offer of HCI Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SkuInner get(String resourceGroupName, String clusterName, String publisherName, String offerName, String skuName); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/UpdateRunsClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/UpdateRunsClient.java new file mode 100644 index 0000000000000..b858b8dd7ae79 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/UpdateRunsClient.java @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.azurestackhci.fluent.models.UpdateRunInner; + +/** An instance of this class provides access to all the operations defined in UpdateRunsClient. */ +public interface UpdateRunsClient { + /** + * List all Update runs for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Update runs as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String clusterName, String updateName); + + /** + * List all Update runs for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Update runs as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String clusterName, String updateName, Context context); + + /** + * Delete specified Update Run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String clusterName, String updateName, String updateRunName); + + /** + * Delete specified Update Run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String clusterName, String updateName, String updateRunName, Context context); + + /** + * Delete specified Update Run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String clusterName, String updateName, String updateRunName); + + /** + * Delete specified Update Run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String clusterName, String updateName, String updateRunName, Context context); + + /** + * Put Update runs for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @param updateRunsProperties Properties of the updateRuns object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of an Update run along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response putWithResponse( + String resourceGroupName, + String clusterName, + String updateName, + String updateRunName, + UpdateRunInner updateRunsProperties, + Context context); + + /** + * Put Update runs for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @param updateRunsProperties Properties of the updateRuns object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of an Update run. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + UpdateRunInner put( + String resourceGroupName, + String clusterName, + String updateName, + String updateRunName, + UpdateRunInner updateRunsProperties); + + /** + * Get the Update run for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Update run for a specified update along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String clusterName, String updateName, String updateRunName, Context context); + + /** + * Get the Update run for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Update run for a specified update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + UpdateRunInner get(String resourceGroupName, String clusterName, String updateName, String updateRunName); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/UpdateSummariesOperationsClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/UpdateSummariesOperationsClient.java new file mode 100644 index 0000000000000..97d1cf58e764d --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/UpdateSummariesOperationsClient.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.azurestackhci.fluent.models.UpdateSummariesInner; + +/** An instance of this class provides access to all the operations defined in UpdateSummariesOperationsClient. */ +public interface UpdateSummariesOperationsClient { + /** + * List all Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Update Summaries as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String clusterName); + + /** + * List all Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Update Summaries as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String clusterName, Context context); + + /** + * Delete Update Summaries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName); + + /** + * Delete Update Summaries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, Context context); + + /** + * Delete Update Summaries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String clusterName); + + /** + * Delete Update Summaries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String clusterName, Context context); + + /** + * Put Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateLocationProperties Properties of the UpdateSummaries resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return get the update summaries for the cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response putWithResponse( + String resourceGroupName, String clusterName, UpdateSummariesInner updateLocationProperties, Context context); + + /** + * Put Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateLocationProperties Properties of the UpdateSummaries resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return get the update summaries for the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + UpdateSummariesInner put( + String resourceGroupName, String clusterName, UpdateSummariesInner updateLocationProperties); + + /** + * Get all Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Update summaries under the HCI cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String clusterName, Context context); + + /** + * Get all Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Update summaries under the HCI cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + UpdateSummariesInner get(String resourceGroupName, String clusterName); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/UpdatesClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/UpdatesClient.java new file mode 100644 index 0000000000000..774ad20708271 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/UpdatesClient.java @@ -0,0 +1,225 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.azurestackhci.fluent.models.HciUpdateInner; + +/** An instance of this class provides access to all the operations defined in UpdatesClient. */ +public interface UpdatesClient { + /** + * Apply Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginPost(String resourceGroupName, String clusterName, String updateName); + + /** + * Apply Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginPost( + String resourceGroupName, String clusterName, String updateName, Context context); + + /** + * Apply Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void post(String resourceGroupName, String clusterName, String updateName); + + /** + * Apply Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void post(String resourceGroupName, String clusterName, String updateName, Context context); + + /** + * List all Updates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Updates as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String clusterName); + + /** + * List all Updates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Updates as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String clusterName, Context context); + + /** + * Delete specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, String updateName); + + /** + * Delete specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String clusterName, String updateName, Context context); + + /** + * Delete specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String clusterName, String updateName); + + /** + * Delete specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String clusterName, String updateName, Context context); + + /** + * Put specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateProperties Properties of the Updates object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return update details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response putWithResponse( + String resourceGroupName, + String clusterName, + String updateName, + HciUpdateInner updateProperties, + Context context); + + /** + * Put specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateProperties Properties of the Updates object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return update details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HciUpdateInner put( + String resourceGroupName, String clusterName, String updateName, HciUpdateInner updateProperties); + + /** + * Get specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specified Update along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String clusterName, String updateName, Context context); + + /** + * Get specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specified Update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HciUpdateInner get(String resourceGroupName, String clusterName, String updateName); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcIdentityResponseInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcIdentityResponseInner.java index 909acd05b51ed..b78ef3f989869 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcIdentityResponseInner.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcIdentityResponseInner.java @@ -16,6 +16,10 @@ public final class ArcIdentityResponseInner { @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) private ArcIdentityResponseProperties innerProperties; + /** Creates an instance of ArcIdentityResponseInner class. */ + public ArcIdentityResponseInner() { + } + /** * Get the innerProperties property: ArcIdentity properties. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcIdentityResponseProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcIdentityResponseProperties.java index 5b20f4848fb72..5ab585ca46e17 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcIdentityResponseProperties.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcIdentityResponseProperties.java @@ -34,6 +34,10 @@ public final class ArcIdentityResponseProperties { @JsonProperty(value = "arcApplicationObjectId") private String arcApplicationObjectId; + /** Creates an instance of ArcIdentityResponseProperties class. */ + public ArcIdentityResponseProperties() { + } + /** * Get the arcApplicationClientId property: The arcApplicationClientId property. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcSettingInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcSettingInner.java index cfdbb16c5d221..80598e5653607 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcSettingInner.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcSettingInner.java @@ -8,6 +8,7 @@ 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.DefaultExtensionDetails; import com.azure.resourcemanager.azurestackhci.models.PerNodeState; import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; import com.fasterxml.jackson.annotation.JsonProperty; @@ -16,25 +17,20 @@ /** ArcSetting details. */ @Fluent public final class ArcSettingInner extends ProxyResource { - /* - * System data of ArcSetting resource - */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) - private SystemData systemData; - /* * ArcSetting properties. */ @JsonProperty(value = "properties") private ArcSettingProperties innerProperties; - /** - * Get the systemData property: System data of ArcSetting resource. - * - * @return the systemData value. + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - public SystemData systemData() { - return this.systemData; + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of ArcSettingInner class. */ + public ArcSettingInner() { } /** @@ -46,6 +42,15 @@ private ArcSettingProperties innerProperties() { return this.innerProperties; } + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the provisioningState property: Provisioning state of the ArcSetting proxy resource. * @@ -213,6 +218,15 @@ public ArcSettingInner withConnectivityProperties(Object connectivityProperties) return this; } + /** + * Get the defaultExtensions property: Properties for each of the default extensions category. + * + * @return the defaultExtensions value. + */ + public List defaultExtensions() { + return this.innerProperties() == null ? null : this.innerProperties().defaultExtensions(); + } + /** * Validates the instance. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcSettingProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcSettingProperties.java index e628ec8d6f034..3cf2cf1b82c25 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcSettingProperties.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcSettingProperties.java @@ -6,6 +6,7 @@ import com.azure.core.annotation.Fluent; import com.azure.resourcemanager.azurestackhci.models.ArcSettingAggregateState; +import com.azure.resourcemanager.azurestackhci.models.DefaultExtensionDetails; import com.azure.resourcemanager.azurestackhci.models.PerNodeState; import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; import com.fasterxml.jackson.annotation.JsonProperty; @@ -21,8 +22,7 @@ public final class ArcSettingProperties { private ProvisioningState provisioningState; /* - * The resource group that hosts the Arc agents, ie. Hybrid Compute Machine - * resources. + * The resource group that hosts the Arc agents, ie. Hybrid Compute Machine resources. */ @JsonProperty(value = "arcInstanceResourceGroup") private String arcInstanceResourceGroup; @@ -69,6 +69,16 @@ public final class ArcSettingProperties { @JsonProperty(value = "connectivityProperties") private Object connectivityProperties; + /* + * Properties for each of the default extensions category + */ + @JsonProperty(value = "defaultExtensions", access = JsonProperty.Access.WRITE_ONLY) + private List defaultExtensions; + + /** Creates an instance of ArcSettingProperties class. */ + public ArcSettingProperties() { + } + /** * Get the provisioningState property: Provisioning state of the ArcSetting proxy resource. * @@ -218,6 +228,15 @@ public ArcSettingProperties withConnectivityProperties(Object connectivityProper return this; } + /** + * Get the defaultExtensions property: Properties for each of the default extensions category. + * + * @return the defaultExtensions value. + */ + public List defaultExtensions() { + return this.defaultExtensions; + } + /** * Validates the instance. * @@ -227,5 +246,8 @@ public void validate() { if (perNodeDetails() != null) { perNodeDetails().forEach(e -> e.validate()); } + if (defaultExtensions() != null) { + defaultExtensions().forEach(e -> e.validate()); + } } } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcSettingsPatchProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcSettingsPatchProperties.java index ea82478352316..bbd2f95830e2c 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcSettingsPatchProperties.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcSettingsPatchProperties.java @@ -16,6 +16,10 @@ public final class ArcSettingsPatchProperties { @JsonProperty(value = "connectivityProperties") private Object connectivityProperties; + /** Creates an instance of ArcSettingsPatchProperties class. */ + public ArcSettingsPatchProperties() { + } + /** * Get the connectivityProperties property: contains connectivity related configuration for ARC resources. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterIdentityResponseInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterIdentityResponseInner.java index be934a9d5d353..0e602f5ca269b 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterIdentityResponseInner.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterIdentityResponseInner.java @@ -16,6 +16,10 @@ public final class ClusterIdentityResponseInner { @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) private ClusterIdentityResponseProperties innerProperties; + /** Creates an instance of ClusterIdentityResponseInner class. */ + public ClusterIdentityResponseInner() { + } + /** * Get the innerProperties property: Cluster identity properties. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterIdentityResponseProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterIdentityResponseProperties.java index 745b333748ae2..56a135b5b73d6 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterIdentityResponseProperties.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterIdentityResponseProperties.java @@ -34,6 +34,10 @@ public final class ClusterIdentityResponseProperties { @JsonProperty(value = "aadApplicationObjectId") private String aadApplicationObjectId; + /** Creates an instance of ClusterIdentityResponseProperties class. */ + public ClusterIdentityResponseProperties() { + } + /** * Get the aadClientId property: The aadClientId property. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterInner.java index 90830dc5dd720..a8efa88c31427 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterInner.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterInner.java @@ -9,20 +9,26 @@ 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.ConnectivityStatus; +import com.azure.resourcemanager.azurestackhci.models.IsolatedVmAttestationConfiguration; +import com.azure.resourcemanager.azurestackhci.models.ManagedServiceIdentityType; import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; +import com.azure.resourcemanager.azurestackhci.models.SoftwareAssuranceProperties; import com.azure.resourcemanager.azurestackhci.models.Status; +import com.azure.resourcemanager.azurestackhci.models.UserAssignedIdentity; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; import java.util.Map; +import java.util.UUID; /** Cluster details. */ @Fluent public final class ClusterInner extends Resource { /* - * System data of Cluster resource + * Identity of Cluster resource */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) - private SystemData systemData; + @JsonProperty(value = "identity") + private ManagedServiceIdentity innerIdentity; /* * Cluster properties. @@ -30,13 +36,23 @@ public final class ClusterInner extends Resource { @JsonProperty(value = "properties") private ClusterProperties innerProperties; + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of ClusterInner class. */ + public ClusterInner() { + } + /** - * Get the systemData property: System data of Cluster resource. + * Get the innerIdentity property: Identity of Cluster resource. * - * @return the systemData value. + * @return the innerIdentity value. */ - public SystemData systemData() { - return this.systemData; + private ManagedServiceIdentity innerIdentity() { + return this.innerIdentity; } /** @@ -48,6 +64,15 @@ private ClusterProperties innerProperties() { return this.innerProperties; } + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** {@inheritDoc} */ @Override public ClusterInner withLocation(String location) { @@ -62,6 +87,80 @@ public ClusterInner withTags(Map tags) { return this; } + /** + * Get the principalId property: The service principal ID of the system assigned identity. This property will only + * be provided for a system assigned identity. + * + * @return the principalId value. + */ + public UUID principalId() { + return this.innerIdentity() == null ? null : this.innerIdentity().principalId(); + } + + /** + * Get the tenantId property: The tenant ID of the system assigned identity. This property will only be provided for + * a system assigned identity. + * + * @return the tenantId value. + */ + public UUID tenantId() { + return this.innerIdentity() == null ? null : this.innerIdentity().tenantId(); + } + + /** + * Get the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are + * allowed). + * + * @return the type value. + */ + public ManagedServiceIdentityType typeIdentityType() { + return this.innerIdentity() == null ? null : this.innerIdentity().type(); + } + + /** + * Set the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are + * allowed). + * + * @param type the type value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withTypeIdentityType(ManagedServiceIdentityType type) { + if (this.innerIdentity() == null) { + this.innerIdentity = new ManagedServiceIdentity(); + } + this.innerIdentity().withType(type); + return this; + } + + /** + * Get the userAssignedIdentities property: The set of user assigned identities associated with the resource. The + * userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.innerIdentity() == null ? null : this.innerIdentity().userAssignedIdentities(); + } + + /** + * Set the userAssignedIdentities property: The set of user assigned identities associated with the resource. The + * userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withUserAssignedIdentities(Map userAssignedIdentities) { + if (this.innerIdentity() == null) { + this.innerIdentity = new ManagedServiceIdentity(); + } + this.innerIdentity().withUserAssignedIdentities(userAssignedIdentities); + return this; + } + /** * Get the provisioningState property: Provisioning state. * @@ -80,6 +179,15 @@ public Status status() { return this.innerProperties() == null ? null : this.innerProperties().status(); } + /** + * Get the connectivityStatus property: Overall connectivity status for the cluster resource. + * + * @return the connectivityStatus value. + */ + public ConnectivityStatus connectivityStatus() { + return this.innerProperties() == null ? null : this.innerProperties().connectivityStatus(); + } + /** * Get the cloudId property: Unique, immutable resource id. * @@ -204,6 +312,29 @@ public ClusterInner withAadServicePrincipalObjectId(String aadServicePrincipalOb return this; } + /** + * Get the softwareAssuranceProperties property: Software Assurance properties of the cluster. + * + * @return the softwareAssuranceProperties value. + */ + public SoftwareAssuranceProperties softwareAssuranceProperties() { + return this.innerProperties() == null ? null : this.innerProperties().softwareAssuranceProperties(); + } + + /** + * Set the softwareAssuranceProperties property: Software Assurance properties of the cluster. + * + * @param softwareAssuranceProperties the softwareAssuranceProperties value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withSoftwareAssuranceProperties(SoftwareAssuranceProperties softwareAssuranceProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterProperties(); + } + this.innerProperties().withSoftwareAssuranceProperties(softwareAssuranceProperties); + return this; + } + /** * Get the desiredProperties property: Desired properties of the cluster. * @@ -236,6 +367,16 @@ public ClusterReportedProperties reportedProperties() { return this.innerProperties() == null ? null : this.innerProperties().reportedProperties(); } + /** + * Get the isolatedVmAttestationConfiguration property: Attestation configurations for isolated VM (e.g. TVM, CVM) + * of the cluster. + * + * @return the isolatedVmAttestationConfiguration value. + */ + public IsolatedVmAttestationConfiguration isolatedVmAttestationConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().isolatedVmAttestationConfiguration(); + } + /** * Get the trialDaysRemaining property: Number of days remaining in the trial period. * @@ -290,12 +431,24 @@ public String serviceEndpoint() { return this.innerProperties() == null ? null : this.innerProperties().serviceEndpoint(); } + /** + * Get the resourceProviderObjectId property: Object id of RP Service Principal. + * + * @return the resourceProviderObjectId value. + */ + public String resourceProviderObjectId() { + return this.innerProperties() == null ? null : this.innerProperties().resourceProviderObjectId(); + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (innerIdentity() != null) { + innerIdentity().validate(); + } if (innerProperties() != null) { innerProperties().validate(); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterPatchProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterPatchProperties.java index 170d36a4d2b3a..32e69e11ce96f 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterPatchProperties.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterPatchProperties.java @@ -35,6 +35,10 @@ public final class ClusterPatchProperties { @JsonProperty(value = "desiredProperties") private ClusterDesiredProperties desiredProperties; + /** Creates an instance of ClusterPatchProperties class. */ + public ClusterPatchProperties() { + } + /** * Get the cloudManagementEndpoint property: Endpoint configured for management from the Azure portal. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterProperties.java index cb7310c87094d..772d3afe992a8 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterProperties.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterProperties.java @@ -7,7 +7,10 @@ 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.ConnectivityStatus; +import com.azure.resourcemanager.azurestackhci.models.IsolatedVmAttestationConfiguration; import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; +import com.azure.resourcemanager.azurestackhci.models.SoftwareAssuranceProperties; import com.azure.resourcemanager.azurestackhci.models.Status; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; @@ -27,6 +30,12 @@ public final class ClusterProperties { @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) private Status status; + /* + * Overall connectivity status for the cluster resource. + */ + @JsonProperty(value = "connectivityStatus", access = JsonProperty.Access.WRITE_ONLY) + private ConnectivityStatus connectivityStatus; + /* * Unique, immutable resource id. */ @@ -63,6 +72,12 @@ public final class ClusterProperties { @JsonProperty(value = "aadServicePrincipalObjectId") private String aadServicePrincipalObjectId; + /* + * Software Assurance properties of the cluster. + */ + @JsonProperty(value = "softwareAssuranceProperties") + private SoftwareAssuranceProperties softwareAssuranceProperties; + /* * Desired properties of the cluster. */ @@ -75,6 +90,12 @@ public final class ClusterProperties { @JsonProperty(value = "reportedProperties", access = JsonProperty.Access.WRITE_ONLY) private ClusterReportedProperties reportedProperties; + /* + * Attestation configurations for isolated VM (e.g. TVM, CVM) of the cluster. + */ + @JsonProperty(value = "isolatedVmAttestationConfiguration", access = JsonProperty.Access.WRITE_ONLY) + private IsolatedVmAttestationConfiguration isolatedVmAttestationConfiguration; + /* * Number of days remaining in the trial period. */ @@ -111,6 +132,16 @@ public final class ClusterProperties { @JsonProperty(value = "serviceEndpoint", access = JsonProperty.Access.WRITE_ONLY) private String serviceEndpoint; + /* + * Object id of RP Service Principal + */ + @JsonProperty(value = "resourceProviderObjectId", access = JsonProperty.Access.WRITE_ONLY) + private String resourceProviderObjectId; + + /** Creates an instance of ClusterProperties class. */ + public ClusterProperties() { + } + /** * Get the provisioningState property: Provisioning state. * @@ -129,6 +160,15 @@ public Status status() { return this.status; } + /** + * Get the connectivityStatus property: Overall connectivity status for the cluster resource. + * + * @return the connectivityStatus value. + */ + public ConnectivityStatus connectivityStatus() { + return this.connectivityStatus; + } + /** * Get the cloudId property: Unique, immutable resource id. * @@ -238,6 +278,26 @@ public ClusterProperties withAadServicePrincipalObjectId(String aadServicePrinci return this; } + /** + * Get the softwareAssuranceProperties property: Software Assurance properties of the cluster. + * + * @return the softwareAssuranceProperties value. + */ + public SoftwareAssuranceProperties softwareAssuranceProperties() { + return this.softwareAssuranceProperties; + } + + /** + * Set the softwareAssuranceProperties property: Software Assurance properties of the cluster. + * + * @param softwareAssuranceProperties the softwareAssuranceProperties value to set. + * @return the ClusterProperties object itself. + */ + public ClusterProperties withSoftwareAssuranceProperties(SoftwareAssuranceProperties softwareAssuranceProperties) { + this.softwareAssuranceProperties = softwareAssuranceProperties; + return this; + } + /** * Get the desiredProperties property: Desired properties of the cluster. * @@ -267,6 +327,16 @@ public ClusterReportedProperties reportedProperties() { return this.reportedProperties; } + /** + * Get the isolatedVmAttestationConfiguration property: Attestation configurations for isolated VM (e.g. TVM, CVM) + * of the cluster. + * + * @return the isolatedVmAttestationConfiguration value. + */ + public IsolatedVmAttestationConfiguration isolatedVmAttestationConfiguration() { + return this.isolatedVmAttestationConfiguration; + } + /** * Get the trialDaysRemaining property: Number of days remaining in the trial period. * @@ -321,17 +391,32 @@ public String serviceEndpoint() { return this.serviceEndpoint; } + /** + * Get the resourceProviderObjectId property: Object id of RP Service Principal. + * + * @return the resourceProviderObjectId value. + */ + public String resourceProviderObjectId() { + return this.resourceProviderObjectId; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (softwareAssuranceProperties() != null) { + softwareAssuranceProperties().validate(); + } if (desiredProperties() != null) { desiredProperties().validate(); } if (reportedProperties() != null) { reportedProperties().validate(); } + if (isolatedVmAttestationConfiguration() != null) { + isolatedVmAttestationConfiguration().validate(); + } } } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ExtensionInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ExtensionInner.java index 915af50280efa..626aa96a93265 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ExtensionInner.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ExtensionInner.java @@ -8,6 +8,7 @@ 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.ExtensionManagedBy; import com.azure.resourcemanager.azurestackhci.models.PerNodeExtensionState; import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; import com.fasterxml.jackson.annotation.JsonProperty; @@ -16,25 +17,20 @@ /** Details of a particular extension in HCI Cluster. */ @Fluent public final class ExtensionInner extends ProxyResource { - /* - * System data of Extension resource. - */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) - private SystemData systemData; - /* * Describes Machine Extension Properties. */ @JsonProperty(value = "properties") private ExtensionProperties innerProperties; - /** - * Get the systemData property: System data of Extension resource. - * - * @return the systemData value. + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - public SystemData systemData() { - return this.systemData; + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of ExtensionInner class. */ + public ExtensionInner() { } /** @@ -46,6 +42,15 @@ private ExtensionProperties innerProperties() { return this.innerProperties; } + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the provisioningState property: Provisioning state of the Extension proxy resource. * @@ -73,6 +78,15 @@ public List perNodeExtensionDetails() { return this.innerProperties() == null ? null : this.innerProperties().perNodeExtensionDetails(); } + /** + * Get the managedBy property: Indicates if the extension is managed by azure or the user. + * + * @return the managedBy value. + */ + public ExtensionManagedBy managedBy() { + return this.innerProperties() == null ? null : this.innerProperties().managedBy(); + } + /** * Get the forceUpdateTag property: How the extension handler should be forced to update even if the extension * configuration has not changed. @@ -145,7 +159,8 @@ public ExtensionInner withTypePropertiesType(String type) { } /** - * Get the typeHandlerVersion property: Specifies the version of the script handler. + * Get the typeHandlerVersion property: Specifies the version of the script handler. Latest version would be used if + * not specified. * * @return the typeHandlerVersion value. */ @@ -154,7 +169,8 @@ public String typeHandlerVersion() { } /** - * Set the typeHandlerVersion property: Specifies the version of the script handler. + * Set the typeHandlerVersion property: Specifies the version of the script handler. Latest version would be used if + * not specified. * * @param typeHandlerVersion the typeHandlerVersion value to set. * @return the ExtensionInner object itself. @@ -240,6 +256,31 @@ public ExtensionInner withProtectedSettings(Object protectedSettings) { return this; } + /** + * Get the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version available. + * + * @return the enableAutomaticUpgrade value. + */ + public Boolean enableAutomaticUpgrade() { + return this.innerProperties() == null ? null : this.innerProperties().enableAutomaticUpgrade(); + } + + /** + * Set the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version available. + * + * @param enableAutomaticUpgrade the enableAutomaticUpgrade value to set. + * @return the ExtensionInner object itself. + */ + public ExtensionInner withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { + if (this.innerProperties() == null) { + this.innerProperties = new ExtensionProperties(); + } + this.innerProperties().withEnableAutomaticUpgrade(enableAutomaticUpgrade); + return this; + } + /** * Validates the instance. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ExtensionParameters.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ExtensionParameters.java index 52eea9ddbd4ae..4129808bd7ce3 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ExtensionParameters.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ExtensionParameters.java @@ -11,8 +11,7 @@ @Fluent public final class ExtensionParameters { /* - * How the extension handler should be forced to update even if the - * extension configuration has not changed. + * How the extension handler should be forced to update even if the extension configuration has not changed. */ @JsonProperty(value = "forceUpdateTag") private String forceUpdateTag; @@ -24,23 +23,21 @@ public final class ExtensionParameters { private String publisher; /* - * Specifies the type of the extension; an example is - * "CustomScriptExtension". + * Specifies the type of the extension; an example is "CustomScriptExtension". */ @JsonProperty(value = "type") private String type; /* - * Specifies the version of the script handler. + * Specifies the version of the script handler. Latest version would be used if not specified. */ @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. + * Indicates whether the extension should use a newer minor version if one is available at deployment time. Once + * deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set + * to true. */ @JsonProperty(value = "autoUpgradeMinorVersion") private Boolean autoUpgradeMinorVersion; @@ -57,6 +54,17 @@ public final class ExtensionParameters { @JsonProperty(value = "protectedSettings") private Object protectedSettings; + /* + * Indicates whether the extension should be automatically upgraded by the platform if there is a newer version + * available. + */ + @JsonProperty(value = "enableAutomaticUpgrade") + private Boolean enableAutomaticUpgrade; + + /** Creates an instance of ExtensionParameters class. */ + public ExtensionParameters() { + } + /** * Get the forceUpdateTag property: How the extension handler should be forced to update even if the extension * configuration has not changed. @@ -120,7 +128,8 @@ public ExtensionParameters withType(String type) { } /** - * Get the typeHandlerVersion property: Specifies the version of the script handler. + * Get the typeHandlerVersion property: Specifies the version of the script handler. Latest version would be used if + * not specified. * * @return the typeHandlerVersion value. */ @@ -129,7 +138,8 @@ public String typeHandlerVersion() { } /** - * Set the typeHandlerVersion property: Specifies the version of the script handler. + * Set the typeHandlerVersion property: Specifies the version of the script handler. Latest version would be used if + * not specified. * * @param typeHandlerVersion the typeHandlerVersion value to set. * @return the ExtensionParameters object itself. @@ -203,6 +213,28 @@ public ExtensionParameters withProtectedSettings(Object protectedSettings) { return this; } + /** + * Get the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version available. + * + * @return the enableAutomaticUpgrade value. + */ + public Boolean enableAutomaticUpgrade() { + return this.enableAutomaticUpgrade; + } + + /** + * Set the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version available. + * + * @param enableAutomaticUpgrade the enableAutomaticUpgrade value to set. + * @return the ExtensionParameters object itself. + */ + public ExtensionParameters withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { + this.enableAutomaticUpgrade = enableAutomaticUpgrade; + return this; + } + /** * Validates the instance. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ExtensionPatchProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ExtensionPatchProperties.java new file mode 100644 index 0000000000000..bd1361fd58494 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ExtensionPatchProperties.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurestackhci.models.ExtensionPatchParameters; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes Machine Extension Properties that can be updated. */ +@Fluent +public final class ExtensionPatchProperties { + /* + * Describes the properties of a Machine Extension that can be updated. + */ + @JsonProperty(value = "extensionParameters") + private ExtensionPatchParameters extensionParameters; + + /** Creates an instance of ExtensionPatchProperties class. */ + public ExtensionPatchProperties() { + } + + /** + * Get the extensionParameters property: Describes the properties of a Machine Extension that can be updated. + * + * @return the extensionParameters value. + */ + public ExtensionPatchParameters extensionParameters() { + return this.extensionParameters; + } + + /** + * Set the extensionParameters property: Describes the properties of a Machine Extension that can be updated. + * + * @param extensionParameters the extensionParameters value to set. + * @return the ExtensionPatchProperties object itself. + */ + public ExtensionPatchProperties withExtensionParameters(ExtensionPatchParameters extensionParameters) { + this.extensionParameters = extensionParameters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (extensionParameters() != null) { + extensionParameters().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ExtensionProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ExtensionProperties.java index 0a19e3a728d56..4d480ccefc908 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ExtensionProperties.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ExtensionProperties.java @@ -6,6 +6,7 @@ import com.azure.core.annotation.Fluent; import com.azure.resourcemanager.azurestackhci.models.ExtensionAggregateState; +import com.azure.resourcemanager.azurestackhci.models.ExtensionManagedBy; import com.azure.resourcemanager.azurestackhci.models.PerNodeExtensionState; import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; import com.fasterxml.jackson.annotation.JsonProperty; @@ -38,6 +39,16 @@ public final class ExtensionProperties { @JsonProperty(value = "perNodeExtensionDetails", access = JsonProperty.Access.WRITE_ONLY) private List perNodeExtensionDetails; + /* + * Indicates if the extension is managed by azure or the user. + */ + @JsonProperty(value = "managedBy", access = JsonProperty.Access.WRITE_ONLY) + private ExtensionManagedBy managedBy; + + /** Creates an instance of ExtensionProperties class. */ + public ExtensionProperties() { + } + /** * Get the provisioningState property: Provisioning state of the Extension proxy resource. * @@ -74,6 +85,15 @@ public List perNodeExtensionDetails() { return this.perNodeExtensionDetails; } + /** + * Get the managedBy property: Indicates if the extension is managed by azure or the user. + * + * @return the managedBy value. + */ + public ExtensionManagedBy managedBy() { + return this.managedBy; + } + /** * Get the forceUpdateTag property: How the extension handler should be forced to update even if the extension * configuration has not changed. @@ -146,7 +166,8 @@ public ExtensionProperties withType(String type) { } /** - * Get the typeHandlerVersion property: Specifies the version of the script handler. + * Get the typeHandlerVersion property: Specifies the version of the script handler. Latest version would be used if + * not specified. * * @return the typeHandlerVersion value. */ @@ -155,7 +176,8 @@ public String typeHandlerVersion() { } /** - * Set the typeHandlerVersion property: Specifies the version of the script handler. + * Set the typeHandlerVersion property: Specifies the version of the script handler. Latest version would be used if + * not specified. * * @param typeHandlerVersion the typeHandlerVersion value to set. * @return the ExtensionProperties object itself. @@ -243,6 +265,33 @@ public ExtensionProperties withProtectedSettings(Object protectedSettings) { return this; } + /** + * Get the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version available. + * + * @return the enableAutomaticUpgrade value. + */ + public Boolean enableAutomaticUpgrade() { + return this.innerExtensionParameters() == null + ? null + : this.innerExtensionParameters().enableAutomaticUpgrade(); + } + + /** + * Set the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version available. + * + * @param enableAutomaticUpgrade the enableAutomaticUpgrade value to set. + * @return the ExtensionProperties object itself. + */ + public ExtensionProperties withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { + if (this.innerExtensionParameters() == null) { + this.innerExtensionParameters = new ExtensionParameters(); + } + this.innerExtensionParameters().withEnableAutomaticUpgrade(enableAutomaticUpgrade); + return this; + } + /** * Validates the instance. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/HciUpdateInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/HciUpdateInner.java new file mode 100644 index 0000000000000..fe7f6dabd5e8b --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/HciUpdateInner.java @@ -0,0 +1,578 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.azurestackhci.models.AvailabilityType; +import com.azure.resourcemanager.azurestackhci.models.HealthState; +import com.azure.resourcemanager.azurestackhci.models.PackageVersionInfo; +import com.azure.resourcemanager.azurestackhci.models.PrecheckResult; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; +import com.azure.resourcemanager.azurestackhci.models.RebootRequirement; +import com.azure.resourcemanager.azurestackhci.models.State; +import com.azure.resourcemanager.azurestackhci.models.UpdatePrerequisite; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Update details. */ +@Fluent +public final class HciUpdateInner extends ProxyResource { + /* + * The geo-location where the resource lives + */ + @JsonProperty(value = "location") + private String location; + + /* + * Update properties + */ + @JsonProperty(value = "properties") + private UpdateProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of HciUpdateInner class. */ + public HciUpdateInner() { + } + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The geo-location where the resource lives. + * + * @param location the location value to set. + * @return the HciUpdateInner object itself. + */ + public HciUpdateInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the innerProperties property: Update properties. + * + * @return the innerProperties value. + */ + private UpdateProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the provisioningState property: Provisioning state of the Updates proxy resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the installedDate property: Date that the update was installed. + * + * @return the installedDate value. + */ + public OffsetDateTime installedDate() { + return this.innerProperties() == null ? null : this.innerProperties().installedDate(); + } + + /** + * Set the installedDate property: Date that the update was installed. + * + * @param installedDate the installedDate value to set. + * @return the HciUpdateInner object itself. + */ + public HciUpdateInner withInstalledDate(OffsetDateTime installedDate) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateProperties(); + } + this.innerProperties().withInstalledDate(installedDate); + return this; + } + + /** + * Get the description property: Description of the update. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: Description of the update. + * + * @param description the description value to set. + * @return the HciUpdateInner object itself. + */ + public HciUpdateInner withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateProperties(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the state property: State of the update as it relates to this stamp. + * + * @return the state value. + */ + public State state() { + return this.innerProperties() == null ? null : this.innerProperties().state(); + } + + /** + * Set the state property: State of the update as it relates to this stamp. + * + * @param state the state value to set. + * @return the HciUpdateInner object itself. + */ + public HciUpdateInner withState(State state) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateProperties(); + } + this.innerProperties().withState(state); + return this; + } + + /** + * Get the prerequisites property: If update State is HasPrerequisite, this property contains an array of objects + * describing prerequisite updates before installing this update. Otherwise, it is empty. + * + * @return the prerequisites value. + */ + public List prerequisites() { + return this.innerProperties() == null ? null : this.innerProperties().prerequisites(); + } + + /** + * Set the prerequisites property: If update State is HasPrerequisite, this property contains an array of objects + * describing prerequisite updates before installing this update. Otherwise, it is empty. + * + * @param prerequisites the prerequisites value to set. + * @return the HciUpdateInner object itself. + */ + public HciUpdateInner withPrerequisites(List prerequisites) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateProperties(); + } + this.innerProperties().withPrerequisites(prerequisites); + return this; + } + + /** + * Get the componentVersions property: An array of component versions for a Solution Bundle update, and an empty + * array otherwise. + * + * @return the componentVersions value. + */ + public List componentVersions() { + return this.innerProperties() == null ? null : this.innerProperties().componentVersions(); + } + + /** + * Set the componentVersions property: An array of component versions for a Solution Bundle update, and an empty + * array otherwise. + * + * @param componentVersions the componentVersions value to set. + * @return the HciUpdateInner object itself. + */ + public HciUpdateInner withComponentVersions(List componentVersions) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateProperties(); + } + this.innerProperties().withComponentVersions(componentVersions); + return this; + } + + /** + * Get the rebootRequired property: The rebootRequired property. + * + * @return the rebootRequired value. + */ + public RebootRequirement rebootRequired() { + return this.innerProperties() == null ? null : this.innerProperties().rebootRequired(); + } + + /** + * Set the rebootRequired property: The rebootRequired property. + * + * @param rebootRequired the rebootRequired value to set. + * @return the HciUpdateInner object itself. + */ + public HciUpdateInner withRebootRequired(RebootRequirement rebootRequired) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateProperties(); + } + this.innerProperties().withRebootRequired(rebootRequired); + return this; + } + + /** + * Get the healthState property: Overall health state for update-specific health checks. + * + * @return the healthState value. + */ + public HealthState healthState() { + return this.innerProperties() == null ? null : this.innerProperties().healthState(); + } + + /** + * Set the healthState property: Overall health state for update-specific health checks. + * + * @param healthState the healthState value to set. + * @return the HciUpdateInner object itself. + */ + public HciUpdateInner withHealthState(HealthState healthState) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateProperties(); + } + this.innerProperties().withHealthState(healthState); + return this; + } + + /** + * Get the healthCheckResult property: An array of PrecheckResult objects. + * + * @return the healthCheckResult value. + */ + public List healthCheckResult() { + return this.innerProperties() == null ? null : this.innerProperties().healthCheckResult(); + } + + /** + * Set the healthCheckResult property: An array of PrecheckResult objects. + * + * @param healthCheckResult the healthCheckResult value to set. + * @return the HciUpdateInner object itself. + */ + public HciUpdateInner withHealthCheckResult(List healthCheckResult) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateProperties(); + } + this.innerProperties().withHealthCheckResult(healthCheckResult); + return this; + } + + /** + * Get the healthCheckDate property: Last time the package-specific checks were run. + * + * @return the healthCheckDate value. + */ + public OffsetDateTime healthCheckDate() { + return this.innerProperties() == null ? null : this.innerProperties().healthCheckDate(); + } + + /** + * Set the healthCheckDate property: Last time the package-specific checks were run. + * + * @param healthCheckDate the healthCheckDate value to set. + * @return the HciUpdateInner object itself. + */ + public HciUpdateInner withHealthCheckDate(OffsetDateTime healthCheckDate) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateProperties(); + } + this.innerProperties().withHealthCheckDate(healthCheckDate); + return this; + } + + /** + * Get the packagePath property: Path where the update package is available. + * + * @return the packagePath value. + */ + public String packagePath() { + return this.innerProperties() == null ? null : this.innerProperties().packagePath(); + } + + /** + * Set the packagePath property: Path where the update package is available. + * + * @param packagePath the packagePath value to set. + * @return the HciUpdateInner object itself. + */ + public HciUpdateInner withPackagePath(String packagePath) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateProperties(); + } + this.innerProperties().withPackagePath(packagePath); + return this; + } + + /** + * Get the packageSizeInMb property: Size of the package. This value is a combination of the size from update + * metadata and size of the payload that results from the live scan operation for OS update content. + * + * @return the packageSizeInMb value. + */ + public Float packageSizeInMb() { + return this.innerProperties() == null ? null : this.innerProperties().packageSizeInMb(); + } + + /** + * Set the packageSizeInMb property: Size of the package. This value is a combination of the size from update + * metadata and size of the payload that results from the live scan operation for OS update content. + * + * @param packageSizeInMb the packageSizeInMb value to set. + * @return the HciUpdateInner object itself. + */ + public HciUpdateInner withPackageSizeInMb(Float packageSizeInMb) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateProperties(); + } + this.innerProperties().withPackageSizeInMb(packageSizeInMb); + return this; + } + + /** + * Get the displayName property: Display name of the Update. + * + * @return the displayName value. + */ + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); + } + + /** + * Set the displayName property: Display name of the Update. + * + * @param displayName the displayName value to set. + * @return the HciUpdateInner object itself. + */ + public HciUpdateInner withDisplayName(String displayName) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateProperties(); + } + this.innerProperties().withDisplayName(displayName); + return this; + } + + /** + * Get the version property: Version of the update. + * + * @return the version value. + */ + public String version() { + return this.innerProperties() == null ? null : this.innerProperties().version(); + } + + /** + * Set the version property: Version of the update. + * + * @param version the version value to set. + * @return the HciUpdateInner object itself. + */ + public HciUpdateInner withVersion(String version) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateProperties(); + } + this.innerProperties().withVersion(version); + return this; + } + + /** + * Get the publisher property: Publisher of the update package. + * + * @return the publisher value. + */ + public String publisher() { + return this.innerProperties() == null ? null : this.innerProperties().publisher(); + } + + /** + * Set the publisher property: Publisher of the update package. + * + * @param publisher the publisher value to set. + * @return the HciUpdateInner object itself. + */ + public HciUpdateInner withPublisher(String publisher) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateProperties(); + } + this.innerProperties().withPublisher(publisher); + return this; + } + + /** + * Get the releaseLink property: Link to release notes for the update. + * + * @return the releaseLink value. + */ + public String releaseLink() { + return this.innerProperties() == null ? null : this.innerProperties().releaseLink(); + } + + /** + * Set the releaseLink property: Link to release notes for the update. + * + * @param releaseLink the releaseLink value to set. + * @return the HciUpdateInner object itself. + */ + public HciUpdateInner withReleaseLink(String releaseLink) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateProperties(); + } + this.innerProperties().withReleaseLink(releaseLink); + return this; + } + + /** + * Get the availabilityType property: Indicates the way the update content can be downloaded. + * + * @return the availabilityType value. + */ + public AvailabilityType availabilityType() { + return this.innerProperties() == null ? null : this.innerProperties().availabilityType(); + } + + /** + * Set the availabilityType property: Indicates the way the update content can be downloaded. + * + * @param availabilityType the availabilityType value to set. + * @return the HciUpdateInner object itself. + */ + public HciUpdateInner withAvailabilityType(AvailabilityType availabilityType) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateProperties(); + } + this.innerProperties().withAvailabilityType(availabilityType); + return this; + } + + /** + * Get the packageType property: Customer-visible type of the update. + * + * @return the packageType value. + */ + public String packageType() { + return this.innerProperties() == null ? null : this.innerProperties().packageType(); + } + + /** + * Set the packageType property: Customer-visible type of the update. + * + * @param packageType the packageType value to set. + * @return the HciUpdateInner object itself. + */ + public HciUpdateInner withPackageType(String packageType) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateProperties(); + } + this.innerProperties().withPackageType(packageType); + return this; + } + + /** + * Get the additionalProperties property: Extensible KV pairs serialized as a string. This is currently used to + * report the stamp OEM family and hardware model information when an update is flagged as Invalid for the stamp + * based on OEM type. + * + * @return the additionalProperties value. + */ + public String additionalProperties() { + return this.innerProperties() == null ? null : this.innerProperties().additionalProperties(); + } + + /** + * Set the additionalProperties property: Extensible KV pairs serialized as a string. This is currently used to + * report the stamp OEM family and hardware model information when an update is flagged as Invalid for the stamp + * based on OEM type. + * + * @param additionalProperties the additionalProperties value to set. + * @return the HciUpdateInner object itself. + */ + public HciUpdateInner withAdditionalProperties(String additionalProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateProperties(); + } + this.innerProperties().withAdditionalProperties(additionalProperties); + return this; + } + + /** + * Get the progressPercentage property: Progress percentage of ongoing operation. Currently this property is only + * valid when the update is in the Downloading state, where it maps to how much of the update content has been + * downloaded. + * + * @return the progressPercentage value. + */ + public Float progressPercentage() { + return this.innerProperties() == null ? null : this.innerProperties().progressPercentage(); + } + + /** + * Set the progressPercentage property: Progress percentage of ongoing operation. Currently this property is only + * valid when the update is in the Downloading state, where it maps to how much of the update content has been + * downloaded. + * + * @param progressPercentage the progressPercentage value to set. + * @return the HciUpdateInner object itself. + */ + public HciUpdateInner withProgressPercentage(Float progressPercentage) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateProperties(); + } + this.innerProperties().withProgressPercentage(progressPercentage); + return this; + } + + /** + * Get the notifyMessage property: Brief message with instructions for updates of AvailabilityType Notify. + * + * @return the notifyMessage value. + */ + public String notifyMessage() { + return this.innerProperties() == null ? null : this.innerProperties().notifyMessage(); + } + + /** + * Set the notifyMessage property: Brief message with instructions for updates of AvailabilityType Notify. + * + * @param notifyMessage the notifyMessage value to set. + * @return the HciUpdateInner object itself. + */ + public HciUpdateInner withNotifyMessage(String notifyMessage) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateProperties(); + } + this.innerProperties().withNotifyMessage(notifyMessage); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ManagedServiceIdentity.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ManagedServiceIdentity.java new file mode 100644 index 0000000000000..728342be44acd --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ManagedServiceIdentity.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.azurestackhci.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.azurestackhci.models.UserAssignedIdentity; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; +import java.util.UUID; + +/** Managed service identity (system assigned and/or user assigned identities). */ +@Fluent +public final class ManagedServiceIdentity { + /* + * The service principal ID of the system assigned identity. This property will only be provided for a system + * assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private UUID principalId; + + /* + * The tenant ID of the system assigned identity. This property will only be provided for a system assigned + * identity. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private UUID tenantId; + + /* + * Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + */ + @JsonProperty(value = "type", required = true) + private ManagedServiceIdentityType type; + + /* + * The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys + * will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + */ + @JsonProperty(value = "userAssignedIdentities") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map userAssignedIdentities; + + /** Creates an instance of ManagedServiceIdentity class. */ + public ManagedServiceIdentity() { + } + + /** + * Get the principalId property: The service principal ID of the system assigned identity. This property will only + * be provided for a system assigned identity. + * + * @return the principalId value. + */ + public UUID principalId() { + return this.principalId; + } + + /** + * Get the tenantId property: The tenant ID of the system assigned identity. This property will only be provided for + * a system assigned identity. + * + * @return the tenantId value. + */ + public UUID tenantId() { + return this.tenantId; + } + + /** + * Get the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are + * allowed). + * + * @return the type value. + */ + public ManagedServiceIdentityType type() { + return this.type; + } + + /** + * Set the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are + * allowed). + * + * @param type the type value to set. + * @return the ManagedServiceIdentity object itself. + */ + public ManagedServiceIdentity withType(ManagedServiceIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the userAssignedIdentities property: The set of user assigned identities associated with the resource. The + * userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: The set of user assigned identities associated with the resource. The + * userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the ManagedServiceIdentity object itself. + */ + public ManagedServiceIdentity withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (type() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property type in model ManagedServiceIdentity")); + } + if (userAssignedIdentities() != null) { + userAssignedIdentities() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagedServiceIdentity.class); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/OfferInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/OfferInner.java new file mode 100644 index 0000000000000..650252e8d9f47 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/OfferInner.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.azurestackhci.models.SkuMappings; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Offer details. */ +@Fluent +public final class OfferInner extends ProxyResource { + /* + * Offer properties. + */ + @JsonProperty(value = "properties") + private OfferProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of OfferInner class. */ + public OfferInner() { + } + + /** + * Get the innerProperties property: Offer properties. + * + * @return the innerProperties value. + */ + private OfferProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the provisioningState property: Provisioning State. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the publisherId property: Identifier of the Publisher for the offer. + * + * @return the publisherId value. + */ + public String publisherId() { + return this.innerProperties() == null ? null : this.innerProperties().publisherId(); + } + + /** + * Set the publisherId property: Identifier of the Publisher for the offer. + * + * @param publisherId the publisherId value to set. + * @return the OfferInner object itself. + */ + public OfferInner withPublisherId(String publisherId) { + if (this.innerProperties() == null) { + this.innerProperties = new OfferProperties(); + } + this.innerProperties().withPublisherId(publisherId); + return this; + } + + /** + * Get the content property: JSON serialized catalog content of the offer. + * + * @return the content value. + */ + public String content() { + return this.innerProperties() == null ? null : this.innerProperties().content(); + } + + /** + * Set the content property: JSON serialized catalog content of the offer. + * + * @param content the content value to set. + * @return the OfferInner object itself. + */ + public OfferInner withContent(String content) { + if (this.innerProperties() == null) { + this.innerProperties = new OfferProperties(); + } + this.innerProperties().withContent(content); + return this; + } + + /** + * Get the contentVersion property: The API version of the catalog service used to serve the catalog content. + * + * @return the contentVersion value. + */ + public String contentVersion() { + return this.innerProperties() == null ? null : this.innerProperties().contentVersion(); + } + + /** + * Set the contentVersion property: The API version of the catalog service used to serve the catalog content. + * + * @param contentVersion the contentVersion value to set. + * @return the OfferInner object itself. + */ + public OfferInner withContentVersion(String contentVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new OfferProperties(); + } + this.innerProperties().withContentVersion(contentVersion); + return this; + } + + /** + * Get the skuMappings property: Array of SKU mappings. + * + * @return the skuMappings value. + */ + public List skuMappings() { + return this.innerProperties() == null ? null : this.innerProperties().skuMappings(); + } + + /** + * Set the skuMappings property: Array of SKU mappings. + * + * @param skuMappings the skuMappings value to set. + * @return the OfferInner object itself. + */ + public OfferInner withSkuMappings(List skuMappings) { + if (this.innerProperties() == null) { + this.innerProperties = new OfferProperties(); + } + this.innerProperties().withSkuMappings(skuMappings); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/OfferProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/OfferProperties.java new file mode 100644 index 0000000000000..77872ea85b613 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/OfferProperties.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurestackhci.models.SkuMappings; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Publisher properties. */ +@Fluent +public final class OfferProperties { + /* + * Provisioning State + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * Identifier of the Publisher for the offer + */ + @JsonProperty(value = "publisherId") + private String publisherId; + + /* + * JSON serialized catalog content of the offer + */ + @JsonProperty(value = "content") + private String content; + + /* + * The API version of the catalog service used to serve the catalog content + */ + @JsonProperty(value = "contentVersion") + private String contentVersion; + + /* + * Array of SKU mappings + */ + @JsonProperty(value = "skuMappings") + private List skuMappings; + + /** Creates an instance of OfferProperties class. */ + public OfferProperties() { + } + + /** + * Get the provisioningState property: Provisioning State. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the publisherId property: Identifier of the Publisher for the offer. + * + * @return the publisherId value. + */ + public String publisherId() { + return this.publisherId; + } + + /** + * Set the publisherId property: Identifier of the Publisher for the offer. + * + * @param publisherId the publisherId value to set. + * @return the OfferProperties object itself. + */ + public OfferProperties withPublisherId(String publisherId) { + this.publisherId = publisherId; + return this; + } + + /** + * Get the content property: JSON serialized catalog content of the offer. + * + * @return the content value. + */ + public String content() { + return this.content; + } + + /** + * Set the content property: JSON serialized catalog content of the offer. + * + * @param content the content value to set. + * @return the OfferProperties object itself. + */ + public OfferProperties withContent(String content) { + this.content = content; + return this; + } + + /** + * Get the contentVersion property: The API version of the catalog service used to serve the catalog content. + * + * @return the contentVersion value. + */ + public String contentVersion() { + return this.contentVersion; + } + + /** + * Set the contentVersion property: The API version of the catalog service used to serve the catalog content. + * + * @param contentVersion the contentVersion value to set. + * @return the OfferProperties object itself. + */ + public OfferProperties withContentVersion(String contentVersion) { + this.contentVersion = contentVersion; + return this; + } + + /** + * Get the skuMappings property: Array of SKU mappings. + * + * @return the skuMappings value. + */ + public List skuMappings() { + return this.skuMappings; + } + + /** + * Set the skuMappings property: Array of SKU mappings. + * + * @param skuMappings the skuMappings value to set. + * @return the OfferProperties object itself. + */ + public OfferProperties withSkuMappings(List skuMappings) { + this.skuMappings = skuMappings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (skuMappings() != null) { + skuMappings().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/OperationListResultInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/OperationListResultInner.java index cd70af853a48e..4c05d5ac2ed3c 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/OperationListResultInner.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/OperationListResultInner.java @@ -27,6 +27,10 @@ public final class OperationListResultInner { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; + /** Creates an instance of OperationListResultInner class. */ + public OperationListResultInner() { + } + /** * Get the value property: List of operations supported by the resource provider. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/PasswordCredentialInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/PasswordCredentialInner.java index 92abc341b7391..dffbc7e9a7de7 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/PasswordCredentialInner.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/PasswordCredentialInner.java @@ -35,6 +35,10 @@ public final class PasswordCredentialInner { @JsonProperty(value = "endDateTime") private OffsetDateTime endDateTime; + /** Creates an instance of PasswordCredentialInner class. */ + public PasswordCredentialInner() { + } + /** * Get the secretText property: The secretText property. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/PublisherInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/PublisherInner.java new file mode 100644 index 0000000000000..a1715a0f49a2b --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/PublisherInner.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Publisher details. */ +@Immutable +public final class PublisherInner extends ProxyResource { + /* + * Publisher properties. + */ + @JsonProperty(value = "properties") + private PublisherProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of PublisherInner class. */ + public PublisherInner() { + } + + /** + * Get the innerProperties property: Publisher properties. + * + * @return the innerProperties value. + */ + private PublisherProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the provisioningState property: Provisioning State. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/PublisherProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/PublisherProperties.java new file mode 100644 index 0000000000000..8536c871c29e2 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/PublisherProperties.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Publisher properties. */ +@Immutable +public final class PublisherProperties { + /* + * Provisioning State + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** Creates an instance of PublisherProperties class. */ + public PublisherProperties() { + } + + /** + * Get the provisioningState property: Provisioning State. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/SkuInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/SkuInner.java new file mode 100644 index 0000000000000..7aa0fb06a66f1 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/SkuInner.java @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.azurestackhci.models.SkuMappings; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Sku details. */ +@Fluent +public final class SkuInner extends ProxyResource { + /* + * SKU properties. + */ + @JsonProperty(value = "properties") + private SkuProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of SkuInner class. */ + public SkuInner() { + } + + /** + * Get the innerProperties property: SKU properties. + * + * @return the innerProperties value. + */ + private SkuProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the provisioningState property: Provisioning State. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the publisherId property: Identifier of the Publisher for the offer. + * + * @return the publisherId value. + */ + public String publisherId() { + return this.innerProperties() == null ? null : this.innerProperties().publisherId(); + } + + /** + * Set the publisherId property: Identifier of the Publisher for the offer. + * + * @param publisherId the publisherId value to set. + * @return the SkuInner object itself. + */ + public SkuInner withPublisherId(String publisherId) { + if (this.innerProperties() == null) { + this.innerProperties = new SkuProperties(); + } + this.innerProperties().withPublisherId(publisherId); + return this; + } + + /** + * Get the offerId property: Identifier of the Offer for the sku. + * + * @return the offerId value. + */ + public String offerId() { + return this.innerProperties() == null ? null : this.innerProperties().offerId(); + } + + /** + * Set the offerId property: Identifier of the Offer for the sku. + * + * @param offerId the offerId value to set. + * @return the SkuInner object itself. + */ + public SkuInner withOfferId(String offerId) { + if (this.innerProperties() == null) { + this.innerProperties = new SkuProperties(); + } + this.innerProperties().withOfferId(offerId); + return this; + } + + /** + * Get the content property: JSON serialized catalog content of the sku offer. + * + * @return the content value. + */ + public String content() { + return this.innerProperties() == null ? null : this.innerProperties().content(); + } + + /** + * Set the content property: JSON serialized catalog content of the sku offer. + * + * @param content the content value to set. + * @return the SkuInner object itself. + */ + public SkuInner withContent(String content) { + if (this.innerProperties() == null) { + this.innerProperties = new SkuProperties(); + } + this.innerProperties().withContent(content); + return this; + } + + /** + * Get the contentVersion property: The API version of the catalog service used to serve the catalog content. + * + * @return the contentVersion value. + */ + public String contentVersion() { + return this.innerProperties() == null ? null : this.innerProperties().contentVersion(); + } + + /** + * Set the contentVersion property: The API version of the catalog service used to serve the catalog content. + * + * @param contentVersion the contentVersion value to set. + * @return the SkuInner object itself. + */ + public SkuInner withContentVersion(String contentVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new SkuProperties(); + } + this.innerProperties().withContentVersion(contentVersion); + return this; + } + + /** + * Get the skuMappings property: Array of SKU mappings. + * + * @return the skuMappings value. + */ + public List skuMappings() { + return this.innerProperties() == null ? null : this.innerProperties().skuMappings(); + } + + /** + * Set the skuMappings property: Array of SKU mappings. + * + * @param skuMappings the skuMappings value to set. + * @return the SkuInner object itself. + */ + public SkuInner withSkuMappings(List skuMappings) { + if (this.innerProperties() == null) { + this.innerProperties = new SkuProperties(); + } + this.innerProperties().withSkuMappings(skuMappings); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/SkuProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/SkuProperties.java new file mode 100644 index 0000000000000..faee738844374 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/SkuProperties.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurestackhci.models.SkuMappings; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** SKU properties. */ +@Fluent +public final class SkuProperties { + /* + * Provisioning State + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * Identifier of the Publisher for the offer + */ + @JsonProperty(value = "publisherId") + private String publisherId; + + /* + * Identifier of the Offer for the sku + */ + @JsonProperty(value = "offerId") + private String offerId; + + /* + * JSON serialized catalog content of the sku offer + */ + @JsonProperty(value = "content") + private String content; + + /* + * The API version of the catalog service used to serve the catalog content + */ + @JsonProperty(value = "contentVersion") + private String contentVersion; + + /* + * Array of SKU mappings + */ + @JsonProperty(value = "skuMappings") + private List skuMappings; + + /** Creates an instance of SkuProperties class. */ + public SkuProperties() { + } + + /** + * Get the provisioningState property: Provisioning State. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the publisherId property: Identifier of the Publisher for the offer. + * + * @return the publisherId value. + */ + public String publisherId() { + return this.publisherId; + } + + /** + * Set the publisherId property: Identifier of the Publisher for the offer. + * + * @param publisherId the publisherId value to set. + * @return the SkuProperties object itself. + */ + public SkuProperties withPublisherId(String publisherId) { + this.publisherId = publisherId; + return this; + } + + /** + * Get the offerId property: Identifier of the Offer for the sku. + * + * @return the offerId value. + */ + public String offerId() { + return this.offerId; + } + + /** + * Set the offerId property: Identifier of the Offer for the sku. + * + * @param offerId the offerId value to set. + * @return the SkuProperties object itself. + */ + public SkuProperties withOfferId(String offerId) { + this.offerId = offerId; + return this; + } + + /** + * Get the content property: JSON serialized catalog content of the sku offer. + * + * @return the content value. + */ + public String content() { + return this.content; + } + + /** + * Set the content property: JSON serialized catalog content of the sku offer. + * + * @param content the content value to set. + * @return the SkuProperties object itself. + */ + public SkuProperties withContent(String content) { + this.content = content; + return this; + } + + /** + * Get the contentVersion property: The API version of the catalog service used to serve the catalog content. + * + * @return the contentVersion value. + */ + public String contentVersion() { + return this.contentVersion; + } + + /** + * Set the contentVersion property: The API version of the catalog service used to serve the catalog content. + * + * @param contentVersion the contentVersion value to set. + * @return the SkuProperties object itself. + */ + public SkuProperties withContentVersion(String contentVersion) { + this.contentVersion = contentVersion; + return this; + } + + /** + * Get the skuMappings property: Array of SKU mappings. + * + * @return the skuMappings value. + */ + public List skuMappings() { + return this.skuMappings; + } + + /** + * Set the skuMappings property: Array of SKU mappings. + * + * @param skuMappings the skuMappings value to set. + * @return the SkuProperties object itself. + */ + public SkuProperties withSkuMappings(List skuMappings) { + this.skuMappings = skuMappings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (skuMappings() != null) { + skuMappings().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/Step.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/Step.java new file mode 100644 index 0000000000000..e66ad1627fdc7 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/Step.java @@ -0,0 +1,240 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Progress representation of the update run steps. */ +@Fluent +public final class Step { + /* + * Name of the step. + */ + @JsonProperty(value = "name") + private String name; + + /* + * More detailed description of the step. + */ + @JsonProperty(value = "description") + private String description; + + /* + * Error message, specified if the step is in a failed state. + */ + @JsonProperty(value = "errorMessage") + private String errorMessage; + + /* + * Status of the step, bubbled up from the ECE action plan for installation attempts. Values are: 'Success', + * 'Error', 'InProgress', and 'Unknown status'. + */ + @JsonProperty(value = "status") + private String status; + + /* + * When the step started, or empty if it has not started executing. + */ + @JsonProperty(value = "startTimeUtc") + private OffsetDateTime startTimeUtc; + + /* + * When the step reached a terminal state. + */ + @JsonProperty(value = "endTimeUtc") + private OffsetDateTime endTimeUtc; + + /* + * Completion time of this step or the last completed sub-step. + */ + @JsonProperty(value = "lastUpdatedTimeUtc") + private OffsetDateTime lastUpdatedTimeUtc; + + /* + * Recursive model for child steps of this step. + */ + @JsonProperty(value = "steps") + private List steps; + + /** Creates an instance of Step class. */ + public Step() { + } + + /** + * Get the name property: Name of the step. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the step. + * + * @param name the name value to set. + * @return the Step object itself. + */ + public Step withName(String name) { + this.name = name; + return this; + } + + /** + * Get the description property: More detailed description of the step. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: More detailed description of the step. + * + * @param description the description value to set. + * @return the Step object itself. + */ + public Step withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the errorMessage property: Error message, specified if the step is in a failed state. + * + * @return the errorMessage value. + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * Set the errorMessage property: Error message, specified if the step is in a failed state. + * + * @param errorMessage the errorMessage value to set. + * @return the Step object itself. + */ + public Step withErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + return this; + } + + /** + * Get the status property: Status of the step, bubbled up from the ECE action plan for installation attempts. + * Values are: 'Success', 'Error', 'InProgress', and 'Unknown status'. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Set the status property: Status of the step, bubbled up from the ECE action plan for installation attempts. + * Values are: 'Success', 'Error', 'InProgress', and 'Unknown status'. + * + * @param status the status value to set. + * @return the Step object itself. + */ + public Step withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the startTimeUtc property: When the step started, or empty if it has not started executing. + * + * @return the startTimeUtc value. + */ + public OffsetDateTime startTimeUtc() { + return this.startTimeUtc; + } + + /** + * Set the startTimeUtc property: When the step started, or empty if it has not started executing. + * + * @param startTimeUtc the startTimeUtc value to set. + * @return the Step object itself. + */ + public Step withStartTimeUtc(OffsetDateTime startTimeUtc) { + this.startTimeUtc = startTimeUtc; + return this; + } + + /** + * Get the endTimeUtc property: When the step reached a terminal state. + * + * @return the endTimeUtc value. + */ + public OffsetDateTime endTimeUtc() { + return this.endTimeUtc; + } + + /** + * Set the endTimeUtc property: When the step reached a terminal state. + * + * @param endTimeUtc the endTimeUtc value to set. + * @return the Step object itself. + */ + public Step withEndTimeUtc(OffsetDateTime endTimeUtc) { + this.endTimeUtc = endTimeUtc; + return this; + } + + /** + * Get the lastUpdatedTimeUtc property: Completion time of this step or the last completed sub-step. + * + * @return the lastUpdatedTimeUtc value. + */ + public OffsetDateTime lastUpdatedTimeUtc() { + return this.lastUpdatedTimeUtc; + } + + /** + * Set the lastUpdatedTimeUtc property: Completion time of this step or the last completed sub-step. + * + * @param lastUpdatedTimeUtc the lastUpdatedTimeUtc value to set. + * @return the Step object itself. + */ + public Step withLastUpdatedTimeUtc(OffsetDateTime lastUpdatedTimeUtc) { + this.lastUpdatedTimeUtc = lastUpdatedTimeUtc; + return this; + } + + /** + * Get the steps property: Recursive model for child steps of this step. + * + * @return the steps value. + */ + public List steps() { + return this.steps; + } + + /** + * Set the steps property: Recursive model for child steps of this step. + * + * @param steps the steps value to set. + * @return the Step object itself. + */ + public Step withSteps(List steps) { + this.steps = steps; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (steps() != null) { + steps().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateProperties.java new file mode 100644 index 0000000000000..f3d71b6eae493 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateProperties.java @@ -0,0 +1,611 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurestackhci.models.AvailabilityType; +import com.azure.resourcemanager.azurestackhci.models.HealthState; +import com.azure.resourcemanager.azurestackhci.models.PackageVersionInfo; +import com.azure.resourcemanager.azurestackhci.models.PrecheckResult; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; +import com.azure.resourcemanager.azurestackhci.models.RebootRequirement; +import com.azure.resourcemanager.azurestackhci.models.State; +import com.azure.resourcemanager.azurestackhci.models.UpdatePrerequisite; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Details of a singular Update in HCI Cluster. */ +@Fluent +public final class UpdateProperties { + /* + * Provisioning state of the Updates proxy resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Date that the update was installed. + */ + @JsonProperty(value = "installedDate") + private OffsetDateTime installedDate; + + /* + * Description of the update. + */ + @JsonProperty(value = "description") + private String description; + + /* + * State of the update as it relates to this stamp. + */ + @JsonProperty(value = "state") + private State state; + + /* + * If update State is HasPrerequisite, this property contains an array of objects describing prerequisite updates + * before installing this update. Otherwise, it is empty. + */ + @JsonProperty(value = "prerequisites") + private List prerequisites; + + /* + * An array of component versions for a Solution Bundle update, and an empty array otherwise. + */ + @JsonProperty(value = "componentVersions") + private List componentVersions; + + /* + * The rebootRequired property. + */ + @JsonProperty(value = "rebootRequired") + private RebootRequirement rebootRequired; + + /* + * Overall health state for update-specific health checks. + */ + @JsonProperty(value = "healthState") + private HealthState healthState; + + /* + * An array of PrecheckResult objects. + */ + @JsonProperty(value = "healthCheckResult") + private List healthCheckResult; + + /* + * Last time the package-specific checks were run. + */ + @JsonProperty(value = "healthCheckDate") + private OffsetDateTime healthCheckDate; + + /* + * Path where the update package is available. + */ + @JsonProperty(value = "packagePath") + private String packagePath; + + /* + * Size of the package. This value is a combination of the size from update metadata and size of the payload that + * results from the live scan operation for OS update content. + */ + @JsonProperty(value = "packageSizeInMb") + private Float packageSizeInMb; + + /* + * Display name of the Update + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * Version of the update. + */ + @JsonProperty(value = "version") + private String version; + + /* + * Publisher of the update package. + */ + @JsonProperty(value = "publisher") + private String publisher; + + /* + * Link to release notes for the update. + */ + @JsonProperty(value = "releaseLink") + private String releaseLink; + + /* + * Indicates the way the update content can be downloaded. + */ + @JsonProperty(value = "availabilityType") + private AvailabilityType availabilityType; + + /* + * Customer-visible type of the update. + */ + @JsonProperty(value = "packageType") + private String packageType; + + /* + * Extensible KV pairs serialized as a string. This is currently used to report the stamp OEM family and hardware + * model information when an update is flagged as Invalid for the stamp based on OEM type. + */ + @JsonProperty(value = "additionalProperties") + private String additionalProperties; + + /* + * Additional information regarding the state of the update. See definition of UpdateStateProperties type below for + * more details on this property. + */ + @JsonProperty(value = "updateStateProperties") + private UpdateStateProperties innerUpdateStateProperties; + + /** Creates an instance of UpdateProperties class. */ + public UpdateProperties() { + } + + /** + * Get the provisioningState property: Provisioning state of the Updates proxy resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the installedDate property: Date that the update was installed. + * + * @return the installedDate value. + */ + public OffsetDateTime installedDate() { + return this.installedDate; + } + + /** + * Set the installedDate property: Date that the update was installed. + * + * @param installedDate the installedDate value to set. + * @return the UpdateProperties object itself. + */ + public UpdateProperties withInstalledDate(OffsetDateTime installedDate) { + this.installedDate = installedDate; + return this; + } + + /** + * Get the description property: Description of the update. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of the update. + * + * @param description the description value to set. + * @return the UpdateProperties object itself. + */ + public UpdateProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the state property: State of the update as it relates to this stamp. + * + * @return the state value. + */ + public State state() { + return this.state; + } + + /** + * Set the state property: State of the update as it relates to this stamp. + * + * @param state the state value to set. + * @return the UpdateProperties object itself. + */ + public UpdateProperties withState(State state) { + this.state = state; + return this; + } + + /** + * Get the prerequisites property: If update State is HasPrerequisite, this property contains an array of objects + * describing prerequisite updates before installing this update. Otherwise, it is empty. + * + * @return the prerequisites value. + */ + public List prerequisites() { + return this.prerequisites; + } + + /** + * Set the prerequisites property: If update State is HasPrerequisite, this property contains an array of objects + * describing prerequisite updates before installing this update. Otherwise, it is empty. + * + * @param prerequisites the prerequisites value to set. + * @return the UpdateProperties object itself. + */ + public UpdateProperties withPrerequisites(List prerequisites) { + this.prerequisites = prerequisites; + return this; + } + + /** + * Get the componentVersions property: An array of component versions for a Solution Bundle update, and an empty + * array otherwise. + * + * @return the componentVersions value. + */ + public List componentVersions() { + return this.componentVersions; + } + + /** + * Set the componentVersions property: An array of component versions for a Solution Bundle update, and an empty + * array otherwise. + * + * @param componentVersions the componentVersions value to set. + * @return the UpdateProperties object itself. + */ + public UpdateProperties withComponentVersions(List componentVersions) { + this.componentVersions = componentVersions; + return this; + } + + /** + * Get the rebootRequired property: The rebootRequired property. + * + * @return the rebootRequired value. + */ + public RebootRequirement rebootRequired() { + return this.rebootRequired; + } + + /** + * Set the rebootRequired property: The rebootRequired property. + * + * @param rebootRequired the rebootRequired value to set. + * @return the UpdateProperties object itself. + */ + public UpdateProperties withRebootRequired(RebootRequirement rebootRequired) { + this.rebootRequired = rebootRequired; + return this; + } + + /** + * Get the healthState property: Overall health state for update-specific health checks. + * + * @return the healthState value. + */ + public HealthState healthState() { + return this.healthState; + } + + /** + * Set the healthState property: Overall health state for update-specific health checks. + * + * @param healthState the healthState value to set. + * @return the UpdateProperties object itself. + */ + public UpdateProperties withHealthState(HealthState healthState) { + this.healthState = healthState; + return this; + } + + /** + * Get the healthCheckResult property: An array of PrecheckResult objects. + * + * @return the healthCheckResult value. + */ + public List healthCheckResult() { + return this.healthCheckResult; + } + + /** + * Set the healthCheckResult property: An array of PrecheckResult objects. + * + * @param healthCheckResult the healthCheckResult value to set. + * @return the UpdateProperties object itself. + */ + public UpdateProperties withHealthCheckResult(List healthCheckResult) { + this.healthCheckResult = healthCheckResult; + return this; + } + + /** + * Get the healthCheckDate property: Last time the package-specific checks were run. + * + * @return the healthCheckDate value. + */ + public OffsetDateTime healthCheckDate() { + return this.healthCheckDate; + } + + /** + * Set the healthCheckDate property: Last time the package-specific checks were run. + * + * @param healthCheckDate the healthCheckDate value to set. + * @return the UpdateProperties object itself. + */ + public UpdateProperties withHealthCheckDate(OffsetDateTime healthCheckDate) { + this.healthCheckDate = healthCheckDate; + return this; + } + + /** + * Get the packagePath property: Path where the update package is available. + * + * @return the packagePath value. + */ + public String packagePath() { + return this.packagePath; + } + + /** + * Set the packagePath property: Path where the update package is available. + * + * @param packagePath the packagePath value to set. + * @return the UpdateProperties object itself. + */ + public UpdateProperties withPackagePath(String packagePath) { + this.packagePath = packagePath; + return this; + } + + /** + * Get the packageSizeInMb property: Size of the package. This value is a combination of the size from update + * metadata and size of the payload that results from the live scan operation for OS update content. + * + * @return the packageSizeInMb value. + */ + public Float packageSizeInMb() { + return this.packageSizeInMb; + } + + /** + * Set the packageSizeInMb property: Size of the package. This value is a combination of the size from update + * metadata and size of the payload that results from the live scan operation for OS update content. + * + * @param packageSizeInMb the packageSizeInMb value to set. + * @return the UpdateProperties object itself. + */ + public UpdateProperties withPackageSizeInMb(Float packageSizeInMb) { + this.packageSizeInMb = packageSizeInMb; + return this; + } + + /** + * Get the displayName property: Display name of the Update. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Display name of the Update. + * + * @param displayName the displayName value to set. + * @return the UpdateProperties object itself. + */ + public UpdateProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the version property: Version of the update. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: Version of the update. + * + * @param version the version value to set. + * @return the UpdateProperties object itself. + */ + public UpdateProperties withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get the publisher property: Publisher of the update package. + * + * @return the publisher value. + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the publisher property: Publisher of the update package. + * + * @param publisher the publisher value to set. + * @return the UpdateProperties object itself. + */ + public UpdateProperties withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get the releaseLink property: Link to release notes for the update. + * + * @return the releaseLink value. + */ + public String releaseLink() { + return this.releaseLink; + } + + /** + * Set the releaseLink property: Link to release notes for the update. + * + * @param releaseLink the releaseLink value to set. + * @return the UpdateProperties object itself. + */ + public UpdateProperties withReleaseLink(String releaseLink) { + this.releaseLink = releaseLink; + return this; + } + + /** + * Get the availabilityType property: Indicates the way the update content can be downloaded. + * + * @return the availabilityType value. + */ + public AvailabilityType availabilityType() { + return this.availabilityType; + } + + /** + * Set the availabilityType property: Indicates the way the update content can be downloaded. + * + * @param availabilityType the availabilityType value to set. + * @return the UpdateProperties object itself. + */ + public UpdateProperties withAvailabilityType(AvailabilityType availabilityType) { + this.availabilityType = availabilityType; + return this; + } + + /** + * Get the packageType property: Customer-visible type of the update. + * + * @return the packageType value. + */ + public String packageType() { + return this.packageType; + } + + /** + * Set the packageType property: Customer-visible type of the update. + * + * @param packageType the packageType value to set. + * @return the UpdateProperties object itself. + */ + public UpdateProperties withPackageType(String packageType) { + this.packageType = packageType; + return this; + } + + /** + * Get the additionalProperties property: Extensible KV pairs serialized as a string. This is currently used to + * report the stamp OEM family and hardware model information when an update is flagged as Invalid for the stamp + * based on OEM type. + * + * @return the additionalProperties value. + */ + public String additionalProperties() { + return this.additionalProperties; + } + + /** + * Set the additionalProperties property: Extensible KV pairs serialized as a string. This is currently used to + * report the stamp OEM family and hardware model information when an update is flagged as Invalid for the stamp + * based on OEM type. + * + * @param additionalProperties the additionalProperties value to set. + * @return the UpdateProperties object itself. + */ + public UpdateProperties withAdditionalProperties(String additionalProperties) { + this.additionalProperties = additionalProperties; + return this; + } + + /** + * Get the innerUpdateStateProperties property: Additional information regarding the state of the update. See + * definition of UpdateStateProperties type below for more details on this property. + * + * @return the innerUpdateStateProperties value. + */ + private UpdateStateProperties innerUpdateStateProperties() { + return this.innerUpdateStateProperties; + } + + /** + * Get the progressPercentage property: Progress percentage of ongoing operation. Currently this property is only + * valid when the update is in the Downloading state, where it maps to how much of the update content has been + * downloaded. + * + * @return the progressPercentage value. + */ + public Float progressPercentage() { + return this.innerUpdateStateProperties() == null + ? null + : this.innerUpdateStateProperties().progressPercentage(); + } + + /** + * Set the progressPercentage property: Progress percentage of ongoing operation. Currently this property is only + * valid when the update is in the Downloading state, where it maps to how much of the update content has been + * downloaded. + * + * @param progressPercentage the progressPercentage value to set. + * @return the UpdateProperties object itself. + */ + public UpdateProperties withProgressPercentage(Float progressPercentage) { + if (this.innerUpdateStateProperties() == null) { + this.innerUpdateStateProperties = new UpdateStateProperties(); + } + this.innerUpdateStateProperties().withProgressPercentage(progressPercentage); + return this; + } + + /** + * Get the notifyMessage property: Brief message with instructions for updates of AvailabilityType Notify. + * + * @return the notifyMessage value. + */ + public String notifyMessage() { + return this.innerUpdateStateProperties() == null ? null : this.innerUpdateStateProperties().notifyMessage(); + } + + /** + * Set the notifyMessage property: Brief message with instructions for updates of AvailabilityType Notify. + * + * @param notifyMessage the notifyMessage value to set. + * @return the UpdateProperties object itself. + */ + public UpdateProperties withNotifyMessage(String notifyMessage) { + if (this.innerUpdateStateProperties() == null) { + this.innerUpdateStateProperties = new UpdateStateProperties(); + } + this.innerUpdateStateProperties().withNotifyMessage(notifyMessage); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (prerequisites() != null) { + prerequisites().forEach(e -> e.validate()); + } + if (componentVersions() != null) { + componentVersions().forEach(e -> e.validate()); + } + if (healthCheckResult() != null) { + healthCheckResult().forEach(e -> e.validate()); + } + if (innerUpdateStateProperties() != null) { + innerUpdateStateProperties().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateRunInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateRunInner.java new file mode 100644 index 0000000000000..07fa8a2dab038 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateRunInner.java @@ -0,0 +1,376 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; +import com.azure.resourcemanager.azurestackhci.models.UpdateRunPropertiesState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Details of an Update run. */ +@Fluent +public final class UpdateRunInner extends ProxyResource { + /* + * The geo-location where the resource lives + */ + @JsonProperty(value = "location") + private String location; + + /* + * Describes Update Run Properties. + */ + @JsonProperty(value = "properties") + private UpdateRunProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of UpdateRunInner class. */ + public UpdateRunInner() { + } + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The geo-location where the resource lives. + * + * @param location the location value to set. + * @return the UpdateRunInner object itself. + */ + public UpdateRunInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the innerProperties property: Describes Update Run Properties. + * + * @return the innerProperties value. + */ + private UpdateRunProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the provisioningState property: Provisioning state of the UpdateRuns proxy resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the timeStarted property: Timestamp of the update run was started. + * + * @return the timeStarted value. + */ + public OffsetDateTime timeStarted() { + return this.innerProperties() == null ? null : this.innerProperties().timeStarted(); + } + + /** + * Set the timeStarted property: Timestamp of the update run was started. + * + * @param timeStarted the timeStarted value to set. + * @return the UpdateRunInner object itself. + */ + public UpdateRunInner withTimeStarted(OffsetDateTime timeStarted) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateRunProperties(); + } + this.innerProperties().withTimeStarted(timeStarted); + return this; + } + + /** + * Get the lastUpdatedTime property: Timestamp of the most recently completed step in the update run. + * + * @return the lastUpdatedTime value. + */ + public OffsetDateTime lastUpdatedTime() { + return this.innerProperties() == null ? null : this.innerProperties().lastUpdatedTime(); + } + + /** + * Set the lastUpdatedTime property: Timestamp of the most recently completed step in the update run. + * + * @param lastUpdatedTime the lastUpdatedTime value to set. + * @return the UpdateRunInner object itself. + */ + public UpdateRunInner withLastUpdatedTime(OffsetDateTime lastUpdatedTime) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateRunProperties(); + } + this.innerProperties().withLastUpdatedTime(lastUpdatedTime); + return this; + } + + /** + * Get the duration property: Duration of the update run. + * + * @return the duration value. + */ + public String duration() { + return this.innerProperties() == null ? null : this.innerProperties().duration(); + } + + /** + * Set the duration property: Duration of the update run. + * + * @param duration the duration value to set. + * @return the UpdateRunInner object itself. + */ + public UpdateRunInner withDuration(String duration) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateRunProperties(); + } + this.innerProperties().withDuration(duration); + return this; + } + + /** + * Get the state property: State of the update run. + * + * @return the state value. + */ + public UpdateRunPropertiesState state() { + return this.innerProperties() == null ? null : this.innerProperties().state(); + } + + /** + * Set the state property: State of the update run. + * + * @param state the state value to set. + * @return the UpdateRunInner object itself. + */ + public UpdateRunInner withState(UpdateRunPropertiesState state) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateRunProperties(); + } + this.innerProperties().withState(state); + return this; + } + + /** + * Get the name property: Name of the step. + * + * @return the name value. + */ + public String namePropertiesName() { + return this.innerProperties() == null ? null : this.innerProperties().name(); + } + + /** + * Set the name property: Name of the step. + * + * @param name the name value to set. + * @return the UpdateRunInner object itself. + */ + public UpdateRunInner withNamePropertiesName(String name) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateRunProperties(); + } + this.innerProperties().withName(name); + return this; + } + + /** + * Get the description property: More detailed description of the step. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: More detailed description of the step. + * + * @param description the description value to set. + * @return the UpdateRunInner object itself. + */ + public UpdateRunInner withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateRunProperties(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the errorMessage property: Error message, specified if the step is in a failed state. + * + * @return the errorMessage value. + */ + public String errorMessage() { + return this.innerProperties() == null ? null : this.innerProperties().errorMessage(); + } + + /** + * Set the errorMessage property: Error message, specified if the step is in a failed state. + * + * @param errorMessage the errorMessage value to set. + * @return the UpdateRunInner object itself. + */ + public UpdateRunInner withErrorMessage(String errorMessage) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateRunProperties(); + } + this.innerProperties().withErrorMessage(errorMessage); + return this; + } + + /** + * Get the status property: Status of the step, bubbled up from the ECE action plan for installation attempts. + * Values are: 'Success', 'Error', 'InProgress', and 'Unknown status'. + * + * @return the status value. + */ + public String status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Set the status property: Status of the step, bubbled up from the ECE action plan for installation attempts. + * Values are: 'Success', 'Error', 'InProgress', and 'Unknown status'. + * + * @param status the status value to set. + * @return the UpdateRunInner object itself. + */ + public UpdateRunInner withStatus(String status) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateRunProperties(); + } + this.innerProperties().withStatus(status); + return this; + } + + /** + * Get the startTimeUtc property: When the step started, or empty if it has not started executing. + * + * @return the startTimeUtc value. + */ + public OffsetDateTime startTimeUtc() { + return this.innerProperties() == null ? null : this.innerProperties().startTimeUtc(); + } + + /** + * Set the startTimeUtc property: When the step started, or empty if it has not started executing. + * + * @param startTimeUtc the startTimeUtc value to set. + * @return the UpdateRunInner object itself. + */ + public UpdateRunInner withStartTimeUtc(OffsetDateTime startTimeUtc) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateRunProperties(); + } + this.innerProperties().withStartTimeUtc(startTimeUtc); + return this; + } + + /** + * Get the endTimeUtc property: When the step reached a terminal state. + * + * @return the endTimeUtc value. + */ + public OffsetDateTime endTimeUtc() { + return this.innerProperties() == null ? null : this.innerProperties().endTimeUtc(); + } + + /** + * Set the endTimeUtc property: When the step reached a terminal state. + * + * @param endTimeUtc the endTimeUtc value to set. + * @return the UpdateRunInner object itself. + */ + public UpdateRunInner withEndTimeUtc(OffsetDateTime endTimeUtc) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateRunProperties(); + } + this.innerProperties().withEndTimeUtc(endTimeUtc); + return this; + } + + /** + * Get the lastUpdatedTimeUtc property: Completion time of this step or the last completed sub-step. + * + * @return the lastUpdatedTimeUtc value. + */ + public OffsetDateTime lastUpdatedTimeUtc() { + return this.innerProperties() == null ? null : this.innerProperties().lastUpdatedTimeUtc(); + } + + /** + * Set the lastUpdatedTimeUtc property: Completion time of this step or the last completed sub-step. + * + * @param lastUpdatedTimeUtc the lastUpdatedTimeUtc value to set. + * @return the UpdateRunInner object itself. + */ + public UpdateRunInner withLastUpdatedTimeUtc(OffsetDateTime lastUpdatedTimeUtc) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateRunProperties(); + } + this.innerProperties().withLastUpdatedTimeUtc(lastUpdatedTimeUtc); + return this; + } + + /** + * Get the steps property: Recursive model for child steps of this step. + * + * @return the steps value. + */ + public List steps() { + return this.innerProperties() == null ? null : this.innerProperties().steps(); + } + + /** + * Set the steps property: Recursive model for child steps of this step. + * + * @param steps the steps value to set. + * @return the UpdateRunInner object itself. + */ + public UpdateRunInner withSteps(List steps) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateRunProperties(); + } + this.innerProperties().withSteps(steps); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateRunProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateRunProperties.java new file mode 100644 index 0000000000000..a78c125e2e6ea --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateRunProperties.java @@ -0,0 +1,351 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; +import com.azure.resourcemanager.azurestackhci.models.UpdateRunPropertiesState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Details of an Update run. */ +@Fluent +public final class UpdateRunProperties { + /* + * Provisioning state of the UpdateRuns proxy resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Timestamp of the update run was started. + */ + @JsonProperty(value = "timeStarted") + private OffsetDateTime timeStarted; + + /* + * Timestamp of the most recently completed step in the update run. + */ + @JsonProperty(value = "lastUpdatedTime") + private OffsetDateTime lastUpdatedTime; + + /* + * Duration of the update run. + */ + @JsonProperty(value = "duration") + private String duration; + + /* + * State of the update run. + */ + @JsonProperty(value = "state") + private UpdateRunPropertiesState state; + + /* + * Progress representation of the update run steps. + */ + @JsonProperty(value = "progress") + private Step innerProgress; + + /** Creates an instance of UpdateRunProperties class. */ + public UpdateRunProperties() { + } + + /** + * Get the provisioningState property: Provisioning state of the UpdateRuns proxy resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the timeStarted property: Timestamp of the update run was started. + * + * @return the timeStarted value. + */ + public OffsetDateTime timeStarted() { + return this.timeStarted; + } + + /** + * Set the timeStarted property: Timestamp of the update run was started. + * + * @param timeStarted the timeStarted value to set. + * @return the UpdateRunProperties object itself. + */ + public UpdateRunProperties withTimeStarted(OffsetDateTime timeStarted) { + this.timeStarted = timeStarted; + return this; + } + + /** + * Get the lastUpdatedTime property: Timestamp of the most recently completed step in the update run. + * + * @return the lastUpdatedTime value. + */ + public OffsetDateTime lastUpdatedTime() { + return this.lastUpdatedTime; + } + + /** + * Set the lastUpdatedTime property: Timestamp of the most recently completed step in the update run. + * + * @param lastUpdatedTime the lastUpdatedTime value to set. + * @return the UpdateRunProperties object itself. + */ + public UpdateRunProperties withLastUpdatedTime(OffsetDateTime lastUpdatedTime) { + this.lastUpdatedTime = lastUpdatedTime; + return this; + } + + /** + * Get the duration property: Duration of the update run. + * + * @return the duration value. + */ + public String duration() { + return this.duration; + } + + /** + * Set the duration property: Duration of the update run. + * + * @param duration the duration value to set. + * @return the UpdateRunProperties object itself. + */ + public UpdateRunProperties withDuration(String duration) { + this.duration = duration; + return this; + } + + /** + * Get the state property: State of the update run. + * + * @return the state value. + */ + public UpdateRunPropertiesState state() { + return this.state; + } + + /** + * Set the state property: State of the update run. + * + * @param state the state value to set. + * @return the UpdateRunProperties object itself. + */ + public UpdateRunProperties withState(UpdateRunPropertiesState state) { + this.state = state; + return this; + } + + /** + * Get the innerProgress property: Progress representation of the update run steps. + * + * @return the innerProgress value. + */ + private Step innerProgress() { + return this.innerProgress; + } + + /** + * Get the name property: Name of the step. + * + * @return the name value. + */ + public String name() { + return this.innerProgress() == null ? null : this.innerProgress().name(); + } + + /** + * Set the name property: Name of the step. + * + * @param name the name value to set. + * @return the UpdateRunProperties object itself. + */ + public UpdateRunProperties withName(String name) { + if (this.innerProgress() == null) { + this.innerProgress = new Step(); + } + this.innerProgress().withName(name); + return this; + } + + /** + * Get the description property: More detailed description of the step. + * + * @return the description value. + */ + public String description() { + return this.innerProgress() == null ? null : this.innerProgress().description(); + } + + /** + * Set the description property: More detailed description of the step. + * + * @param description the description value to set. + * @return the UpdateRunProperties object itself. + */ + public UpdateRunProperties withDescription(String description) { + if (this.innerProgress() == null) { + this.innerProgress = new Step(); + } + this.innerProgress().withDescription(description); + return this; + } + + /** + * Get the errorMessage property: Error message, specified if the step is in a failed state. + * + * @return the errorMessage value. + */ + public String errorMessage() { + return this.innerProgress() == null ? null : this.innerProgress().errorMessage(); + } + + /** + * Set the errorMessage property: Error message, specified if the step is in a failed state. + * + * @param errorMessage the errorMessage value to set. + * @return the UpdateRunProperties object itself. + */ + public UpdateRunProperties withErrorMessage(String errorMessage) { + if (this.innerProgress() == null) { + this.innerProgress = new Step(); + } + this.innerProgress().withErrorMessage(errorMessage); + return this; + } + + /** + * Get the status property: Status of the step, bubbled up from the ECE action plan for installation attempts. + * Values are: 'Success', 'Error', 'InProgress', and 'Unknown status'. + * + * @return the status value. + */ + public String status() { + return this.innerProgress() == null ? null : this.innerProgress().status(); + } + + /** + * Set the status property: Status of the step, bubbled up from the ECE action plan for installation attempts. + * Values are: 'Success', 'Error', 'InProgress', and 'Unknown status'. + * + * @param status the status value to set. + * @return the UpdateRunProperties object itself. + */ + public UpdateRunProperties withStatus(String status) { + if (this.innerProgress() == null) { + this.innerProgress = new Step(); + } + this.innerProgress().withStatus(status); + return this; + } + + /** + * Get the startTimeUtc property: When the step started, or empty if it has not started executing. + * + * @return the startTimeUtc value. + */ + public OffsetDateTime startTimeUtc() { + return this.innerProgress() == null ? null : this.innerProgress().startTimeUtc(); + } + + /** + * Set the startTimeUtc property: When the step started, or empty if it has not started executing. + * + * @param startTimeUtc the startTimeUtc value to set. + * @return the UpdateRunProperties object itself. + */ + public UpdateRunProperties withStartTimeUtc(OffsetDateTime startTimeUtc) { + if (this.innerProgress() == null) { + this.innerProgress = new Step(); + } + this.innerProgress().withStartTimeUtc(startTimeUtc); + return this; + } + + /** + * Get the endTimeUtc property: When the step reached a terminal state. + * + * @return the endTimeUtc value. + */ + public OffsetDateTime endTimeUtc() { + return this.innerProgress() == null ? null : this.innerProgress().endTimeUtc(); + } + + /** + * Set the endTimeUtc property: When the step reached a terminal state. + * + * @param endTimeUtc the endTimeUtc value to set. + * @return the UpdateRunProperties object itself. + */ + public UpdateRunProperties withEndTimeUtc(OffsetDateTime endTimeUtc) { + if (this.innerProgress() == null) { + this.innerProgress = new Step(); + } + this.innerProgress().withEndTimeUtc(endTimeUtc); + return this; + } + + /** + * Get the lastUpdatedTimeUtc property: Completion time of this step or the last completed sub-step. + * + * @return the lastUpdatedTimeUtc value. + */ + public OffsetDateTime lastUpdatedTimeUtc() { + return this.innerProgress() == null ? null : this.innerProgress().lastUpdatedTimeUtc(); + } + + /** + * Set the lastUpdatedTimeUtc property: Completion time of this step or the last completed sub-step. + * + * @param lastUpdatedTimeUtc the lastUpdatedTimeUtc value to set. + * @return the UpdateRunProperties object itself. + */ + public UpdateRunProperties withLastUpdatedTimeUtc(OffsetDateTime lastUpdatedTimeUtc) { + if (this.innerProgress() == null) { + this.innerProgress = new Step(); + } + this.innerProgress().withLastUpdatedTimeUtc(lastUpdatedTimeUtc); + return this; + } + + /** + * Get the steps property: Recursive model for child steps of this step. + * + * @return the steps value. + */ + public List steps() { + return this.innerProgress() == null ? null : this.innerProgress().steps(); + } + + /** + * Set the steps property: Recursive model for child steps of this step. + * + * @param steps the steps value to set. + * @return the UpdateRunProperties object itself. + */ + public UpdateRunProperties withSteps(List steps) { + if (this.innerProgress() == null) { + this.innerProgress = new Step(); + } + this.innerProgress().withSteps(steps); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProgress() != null) { + innerProgress().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateStateProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateStateProperties.java new file mode 100644 index 0000000000000..f60984021df1c --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateStateProperties.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Additional information regarding the state of the update. See definition of UpdateStateProperties type below for more + * details on this property. + */ +@Fluent +public final class UpdateStateProperties { + /* + * Progress percentage of ongoing operation. Currently this property is only valid when the update is in the + * Downloading state, where it maps to how much of the update content has been downloaded. + */ + @JsonProperty(value = "progressPercentage") + private Float progressPercentage; + + /* + * Brief message with instructions for updates of AvailabilityType Notify. + */ + @JsonProperty(value = "notifyMessage") + private String notifyMessage; + + /** Creates an instance of UpdateStateProperties class. */ + public UpdateStateProperties() { + } + + /** + * Get the progressPercentage property: Progress percentage of ongoing operation. Currently this property is only + * valid when the update is in the Downloading state, where it maps to how much of the update content has been + * downloaded. + * + * @return the progressPercentage value. + */ + public Float progressPercentage() { + return this.progressPercentage; + } + + /** + * Set the progressPercentage property: Progress percentage of ongoing operation. Currently this property is only + * valid when the update is in the Downloading state, where it maps to how much of the update content has been + * downloaded. + * + * @param progressPercentage the progressPercentage value to set. + * @return the UpdateStateProperties object itself. + */ + public UpdateStateProperties withProgressPercentage(Float progressPercentage) { + this.progressPercentage = progressPercentage; + return this; + } + + /** + * Get the notifyMessage property: Brief message with instructions for updates of AvailabilityType Notify. + * + * @return the notifyMessage value. + */ + public String notifyMessage() { + return this.notifyMessage; + } + + /** + * Set the notifyMessage property: Brief message with instructions for updates of AvailabilityType Notify. + * + * @param notifyMessage the notifyMessage value to set. + * @return the UpdateStateProperties object itself. + */ + public UpdateStateProperties withNotifyMessage(String notifyMessage) { + this.notifyMessage = notifyMessage; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateSummariesInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateSummariesInner.java new file mode 100644 index 0000000000000..3f9f82cee4ec4 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateSummariesInner.java @@ -0,0 +1,331 @@ +// Copyright (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.HealthState; +import com.azure.resourcemanager.azurestackhci.models.PackageVersionInfo; +import com.azure.resourcemanager.azurestackhci.models.PrecheckResult; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; +import com.azure.resourcemanager.azurestackhci.models.UpdateSummariesPropertiesState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Get the update summaries for the cluster. */ +@Fluent +public final class UpdateSummariesInner extends ProxyResource { + /* + * The geo-location where the resource lives + */ + @JsonProperty(value = "location") + private String location; + + /* + * Update summaries properties + */ + @JsonProperty(value = "properties") + private UpdateSummariesProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of UpdateSummariesInner class. */ + public UpdateSummariesInner() { + } + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The geo-location where the resource lives. + * + * @param location the location value to set. + * @return the UpdateSummariesInner object itself. + */ + public UpdateSummariesInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the innerProperties property: Update summaries properties. + * + * @return the innerProperties value. + */ + private UpdateSummariesProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the provisioningState property: Provisioning state of the UpdateSummaries proxy resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the oemFamily property: OEM family name. + * + * @return the oemFamily value. + */ + public String oemFamily() { + return this.innerProperties() == null ? null : this.innerProperties().oemFamily(); + } + + /** + * Set the oemFamily property: OEM family name. + * + * @param oemFamily the oemFamily value to set. + * @return the UpdateSummariesInner object itself. + */ + public UpdateSummariesInner withOemFamily(String oemFamily) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateSummariesProperties(); + } + this.innerProperties().withOemFamily(oemFamily); + return this; + } + + /** + * Get the hardwareModel property: Name of the hardware model. + * + * @return the hardwareModel value. + */ + public String hardwareModel() { + return this.innerProperties() == null ? null : this.innerProperties().hardwareModel(); + } + + /** + * Set the hardwareModel property: Name of the hardware model. + * + * @param hardwareModel the hardwareModel value to set. + * @return the UpdateSummariesInner object itself. + */ + public UpdateSummariesInner withHardwareModel(String hardwareModel) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateSummariesProperties(); + } + this.innerProperties().withHardwareModel(hardwareModel); + return this; + } + + /** + * Get the packageVersions property: Current version of each updatable component. + * + * @return the packageVersions value. + */ + public List packageVersions() { + return this.innerProperties() == null ? null : this.innerProperties().packageVersions(); + } + + /** + * Set the packageVersions property: Current version of each updatable component. + * + * @param packageVersions the packageVersions value to set. + * @return the UpdateSummariesInner object itself. + */ + public UpdateSummariesInner withPackageVersions(List packageVersions) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateSummariesProperties(); + } + this.innerProperties().withPackageVersions(packageVersions); + return this; + } + + /** + * Get the currentVersion property: Current Solution Bundle version of the stamp. + * + * @return the currentVersion value. + */ + public String currentVersion() { + return this.innerProperties() == null ? null : this.innerProperties().currentVersion(); + } + + /** + * Set the currentVersion property: Current Solution Bundle version of the stamp. + * + * @param currentVersion the currentVersion value to set. + * @return the UpdateSummariesInner object itself. + */ + public UpdateSummariesInner withCurrentVersion(String currentVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateSummariesProperties(); + } + this.innerProperties().withCurrentVersion(currentVersion); + return this; + } + + /** + * Get the lastUpdated property: Last time an update installation completed successfully. + * + * @return the lastUpdated value. + */ + public OffsetDateTime lastUpdated() { + return this.innerProperties() == null ? null : this.innerProperties().lastUpdated(); + } + + /** + * Set the lastUpdated property: Last time an update installation completed successfully. + * + * @param lastUpdated the lastUpdated value to set. + * @return the UpdateSummariesInner object itself. + */ + public UpdateSummariesInner withLastUpdated(OffsetDateTime lastUpdated) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateSummariesProperties(); + } + this.innerProperties().withLastUpdated(lastUpdated); + return this; + } + + /** + * Get the lastChecked property: Last time the update service successfully checked for updates. + * + * @return the lastChecked value. + */ + public OffsetDateTime lastChecked() { + return this.innerProperties() == null ? null : this.innerProperties().lastChecked(); + } + + /** + * Set the lastChecked property: Last time the update service successfully checked for updates. + * + * @param lastChecked the lastChecked value to set. + * @return the UpdateSummariesInner object itself. + */ + public UpdateSummariesInner withLastChecked(OffsetDateTime lastChecked) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateSummariesProperties(); + } + this.innerProperties().withLastChecked(lastChecked); + return this; + } + + /** + * Get the healthState property: Overall health state for update-specific health checks. + * + * @return the healthState value. + */ + public HealthState healthState() { + return this.innerProperties() == null ? null : this.innerProperties().healthState(); + } + + /** + * Set the healthState property: Overall health state for update-specific health checks. + * + * @param healthState the healthState value to set. + * @return the UpdateSummariesInner object itself. + */ + public UpdateSummariesInner withHealthState(HealthState healthState) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateSummariesProperties(); + } + this.innerProperties().withHealthState(healthState); + return this; + } + + /** + * Get the healthCheckResult property: An array of pre-check result objects. + * + * @return the healthCheckResult value. + */ + public List healthCheckResult() { + return this.innerProperties() == null ? null : this.innerProperties().healthCheckResult(); + } + + /** + * Set the healthCheckResult property: An array of pre-check result objects. + * + * @param healthCheckResult the healthCheckResult value to set. + * @return the UpdateSummariesInner object itself. + */ + public UpdateSummariesInner withHealthCheckResult(List healthCheckResult) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateSummariesProperties(); + } + this.innerProperties().withHealthCheckResult(healthCheckResult); + return this; + } + + /** + * Get the healthCheckDate property: Last time the package-specific checks were run. + * + * @return the healthCheckDate value. + */ + public OffsetDateTime healthCheckDate() { + return this.innerProperties() == null ? null : this.innerProperties().healthCheckDate(); + } + + /** + * Set the healthCheckDate property: Last time the package-specific checks were run. + * + * @param healthCheckDate the healthCheckDate value to set. + * @return the UpdateSummariesInner object itself. + */ + public UpdateSummariesInner withHealthCheckDate(OffsetDateTime healthCheckDate) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateSummariesProperties(); + } + this.innerProperties().withHealthCheckDate(healthCheckDate); + return this; + } + + /** + * Get the state property: Overall update state of the stamp. + * + * @return the state value. + */ + public UpdateSummariesPropertiesState state() { + return this.innerProperties() == null ? null : this.innerProperties().state(); + } + + /** + * Set the state property: Overall update state of the stamp. + * + * @param state the state value to set. + * @return the UpdateSummariesInner object itself. + */ + public UpdateSummariesInner withState(UpdateSummariesPropertiesState state) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateSummariesProperties(); + } + this.innerProperties().withState(state); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateSummariesProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateSummariesProperties.java new file mode 100644 index 0000000000000..29b3196d2bec3 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/UpdateSummariesProperties.java @@ -0,0 +1,312 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurestackhci.models.HealthState; +import com.azure.resourcemanager.azurestackhci.models.PackageVersionInfo; +import com.azure.resourcemanager.azurestackhci.models.PrecheckResult; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; +import com.azure.resourcemanager.azurestackhci.models.UpdateSummariesPropertiesState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Properties of Update summaries. */ +@Fluent +public final class UpdateSummariesProperties { + /* + * Provisioning state of the UpdateSummaries proxy resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * OEM family name. + */ + @JsonProperty(value = "oemFamily") + private String oemFamily; + + /* + * Name of the hardware model. + */ + @JsonProperty(value = "hardwareModel") + private String hardwareModel; + + /* + * Current version of each updatable component. + */ + @JsonProperty(value = "packageVersions") + private List packageVersions; + + /* + * Current Solution Bundle version of the stamp. + */ + @JsonProperty(value = "currentVersion") + private String currentVersion; + + /* + * Last time an update installation completed successfully. + */ + @JsonProperty(value = "lastUpdated") + private OffsetDateTime lastUpdated; + + /* + * Last time the update service successfully checked for updates + */ + @JsonProperty(value = "lastChecked") + private OffsetDateTime lastChecked; + + /* + * Overall health state for update-specific health checks. + */ + @JsonProperty(value = "healthState") + private HealthState healthState; + + /* + * An array of pre-check result objects. + */ + @JsonProperty(value = "healthCheckResult") + private List healthCheckResult; + + /* + * Last time the package-specific checks were run. + */ + @JsonProperty(value = "healthCheckDate") + private OffsetDateTime healthCheckDate; + + /* + * Overall update state of the stamp. + */ + @JsonProperty(value = "state") + private UpdateSummariesPropertiesState state; + + /** Creates an instance of UpdateSummariesProperties class. */ + public UpdateSummariesProperties() { + } + + /** + * Get the provisioningState property: Provisioning state of the UpdateSummaries proxy resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the oemFamily property: OEM family name. + * + * @return the oemFamily value. + */ + public String oemFamily() { + return this.oemFamily; + } + + /** + * Set the oemFamily property: OEM family name. + * + * @param oemFamily the oemFamily value to set. + * @return the UpdateSummariesProperties object itself. + */ + public UpdateSummariesProperties withOemFamily(String oemFamily) { + this.oemFamily = oemFamily; + return this; + } + + /** + * Get the hardwareModel property: Name of the hardware model. + * + * @return the hardwareModel value. + */ + public String hardwareModel() { + return this.hardwareModel; + } + + /** + * Set the hardwareModel property: Name of the hardware model. + * + * @param hardwareModel the hardwareModel value to set. + * @return the UpdateSummariesProperties object itself. + */ + public UpdateSummariesProperties withHardwareModel(String hardwareModel) { + this.hardwareModel = hardwareModel; + return this; + } + + /** + * Get the packageVersions property: Current version of each updatable component. + * + * @return the packageVersions value. + */ + public List packageVersions() { + return this.packageVersions; + } + + /** + * Set the packageVersions property: Current version of each updatable component. + * + * @param packageVersions the packageVersions value to set. + * @return the UpdateSummariesProperties object itself. + */ + public UpdateSummariesProperties withPackageVersions(List packageVersions) { + this.packageVersions = packageVersions; + return this; + } + + /** + * Get the currentVersion property: Current Solution Bundle version of the stamp. + * + * @return the currentVersion value. + */ + public String currentVersion() { + return this.currentVersion; + } + + /** + * Set the currentVersion property: Current Solution Bundle version of the stamp. + * + * @param currentVersion the currentVersion value to set. + * @return the UpdateSummariesProperties object itself. + */ + public UpdateSummariesProperties withCurrentVersion(String currentVersion) { + this.currentVersion = currentVersion; + return this; + } + + /** + * Get the lastUpdated property: Last time an update installation completed successfully. + * + * @return the lastUpdated value. + */ + public OffsetDateTime lastUpdated() { + return this.lastUpdated; + } + + /** + * Set the lastUpdated property: Last time an update installation completed successfully. + * + * @param lastUpdated the lastUpdated value to set. + * @return the UpdateSummariesProperties object itself. + */ + public UpdateSummariesProperties withLastUpdated(OffsetDateTime lastUpdated) { + this.lastUpdated = lastUpdated; + return this; + } + + /** + * Get the lastChecked property: Last time the update service successfully checked for updates. + * + * @return the lastChecked value. + */ + public OffsetDateTime lastChecked() { + return this.lastChecked; + } + + /** + * Set the lastChecked property: Last time the update service successfully checked for updates. + * + * @param lastChecked the lastChecked value to set. + * @return the UpdateSummariesProperties object itself. + */ + public UpdateSummariesProperties withLastChecked(OffsetDateTime lastChecked) { + this.lastChecked = lastChecked; + return this; + } + + /** + * Get the healthState property: Overall health state for update-specific health checks. + * + * @return the healthState value. + */ + public HealthState healthState() { + return this.healthState; + } + + /** + * Set the healthState property: Overall health state for update-specific health checks. + * + * @param healthState the healthState value to set. + * @return the UpdateSummariesProperties object itself. + */ + public UpdateSummariesProperties withHealthState(HealthState healthState) { + this.healthState = healthState; + return this; + } + + /** + * Get the healthCheckResult property: An array of pre-check result objects. + * + * @return the healthCheckResult value. + */ + public List healthCheckResult() { + return this.healthCheckResult; + } + + /** + * Set the healthCheckResult property: An array of pre-check result objects. + * + * @param healthCheckResult the healthCheckResult value to set. + * @return the UpdateSummariesProperties object itself. + */ + public UpdateSummariesProperties withHealthCheckResult(List healthCheckResult) { + this.healthCheckResult = healthCheckResult; + return this; + } + + /** + * Get the healthCheckDate property: Last time the package-specific checks were run. + * + * @return the healthCheckDate value. + */ + public OffsetDateTime healthCheckDate() { + return this.healthCheckDate; + } + + /** + * Set the healthCheckDate property: Last time the package-specific checks were run. + * + * @param healthCheckDate the healthCheckDate value to set. + * @return the UpdateSummariesProperties object itself. + */ + public UpdateSummariesProperties withHealthCheckDate(OffsetDateTime healthCheckDate) { + this.healthCheckDate = healthCheckDate; + return this; + } + + /** + * Get the state property: Overall update state of the stamp. + * + * @return the state value. + */ + public UpdateSummariesPropertiesState state() { + return this.state; + } + + /** + * Set the state property: Overall update state of the stamp. + * + * @param state the state value to set. + * @return the UpdateSummariesProperties object itself. + */ + public UpdateSummariesProperties withState(UpdateSummariesPropertiesState state) { + this.state = state; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (packageVersions() != null) { + packageVersions().forEach(e -> e.validate()); + } + if (healthCheckResult() != null) { + healthCheckResult().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingImpl.java index e7c22ee4ecd1a..ff5e5ecbb0a21 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingImpl.java @@ -12,6 +12,7 @@ import com.azure.resourcemanager.azurestackhci.models.ArcSetting; import com.azure.resourcemanager.azurestackhci.models.ArcSettingAggregateState; import com.azure.resourcemanager.azurestackhci.models.ArcSettingsPatch; +import com.azure.resourcemanager.azurestackhci.models.DefaultExtensionDetails; import com.azure.resourcemanager.azurestackhci.models.PasswordCredential; import com.azure.resourcemanager.azurestackhci.models.PerNodeState; import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; @@ -81,6 +82,15 @@ public Object connectivityProperties() { return this.innerModel().connectivityProperties(); } + public List defaultExtensions() { + List inner = this.innerModel().defaultExtensions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + public String resourceGroupName() { return resourceGroupName; } @@ -187,16 +197,16 @@ public ArcSetting refresh(Context context) { return this; } - public PasswordCredential generatePassword() { - return serviceManager.arcSettings().generatePassword(resourceGroupName, clusterName, arcSettingName); - } - public Response generatePasswordWithResponse(Context context) { return serviceManager .arcSettings() .generatePasswordWithResponse(resourceGroupName, clusterName, arcSettingName, context); } + public PasswordCredential generatePassword() { + return serviceManager.arcSettings().generatePassword(resourceGroupName, clusterName, arcSettingName); + } + public ArcIdentityResponse createIdentity() { return serviceManager.arcSettings().createIdentity(resourceGroupName, clusterName, arcSettingName); } @@ -205,6 +215,26 @@ public ArcIdentityResponse createIdentity(Context context) { return serviceManager.arcSettings().createIdentity(resourceGroupName, clusterName, arcSettingName, context); } + public Response consentAndInstallDefaultExtensionsWithResponse(Context context) { + return serviceManager + .arcSettings() + .consentAndInstallDefaultExtensionsWithResponse(resourceGroupName, clusterName, arcSettingName, context); + } + + public ArcSetting consentAndInstallDefaultExtensions() { + return serviceManager + .arcSettings() + .consentAndInstallDefaultExtensions(resourceGroupName, clusterName, arcSettingName); + } + + public void initializeDisableProcess() { + serviceManager.arcSettings().initializeDisableProcess(resourceGroupName, clusterName, arcSettingName); + } + + public void initializeDisableProcess(Context context) { + serviceManager.arcSettings().initializeDisableProcess(resourceGroupName, clusterName, arcSettingName, context); + } + public ArcSettingImpl withArcInstanceResourceGroup(String arcInstanceResourceGroup) { this.innerModel().withArcInstanceResourceGroup(arcInstanceResourceGroup); return this; diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingsClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingsClientImpl.java index 0da1463d48572..37ef17ef06c19 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingsClientImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingsClientImpl.java @@ -68,11 +68,10 @@ public final class ArcSettingsClientImpl implements ArcSettingsClient { */ @Host("{$host}") @ServiceInterface(name = "AzureStackHciClientA") - private interface ArcSettingsService { + public interface ArcSettingsService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" - + "/clusters/{clusterName}/arcSettings") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByCluster( @@ -86,8 +85,7 @@ Mono> listByCluster( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" - + "/clusters/{clusterName}/arcSettings/{arcSettingName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( @@ -102,8 +100,7 @@ Mono> get( @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" - + "/clusters/{clusterName}/arcSettings/{arcSettingName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> create( @@ -119,8 +116,7 @@ Mono> create( @Headers({"Content-Type: application/json"}) @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" - + "/clusters/{clusterName}/arcSettings/{arcSettingName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> update( @@ -136,8 +132,7 @@ Mono> update( @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" - + "/clusters/{clusterName}/arcSettings/{arcSettingName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> delete( @@ -152,8 +147,7 @@ Mono>> delete( @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" - + "/clusters/{clusterName}/arcSettings/{arcSettingName}/generatePassword") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/generatePassword") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> generatePassword( @@ -168,8 +162,7 @@ Mono> generatePassword( @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" - + "/clusters/{clusterName}/arcSettings/{arcSettingName}/createArcIdentity") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/createArcIdentity") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> createIdentity( @@ -182,6 +175,36 @@ Mono>> createIdentity( @HeaderParam("Accept") String accept, Context context); + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/consentAndInstallDefaultExtensions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> consentAndInstallDefaultExtensions( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("arcSettingName") String arcSettingName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/initializeDisableProcess") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> initializeDisableProcess( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("arcSettingName") String arcSettingName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + @Headers({"Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -503,14 +526,16 @@ private Mono getAsync(String resourceGroupName, String clusterN * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return arcSetting resource details of HCI Cluster. + * @return arcSetting resource details of HCI Cluster along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ArcSettingInner get(String resourceGroupName, String clusterName, String arcSettingName) { - return getAsync(resourceGroupName, clusterName, arcSettingName).block(); + public Response getWithResponse( + String resourceGroupName, String clusterName, String arcSettingName, Context context) { + return getWithResponseAsync(resourceGroupName, clusterName, arcSettingName, context).block(); } /** @@ -519,16 +544,14 @@ public ArcSettingInner get(String resourceGroupName, String clusterName, String * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return arcSetting resource details of HCI Cluster along with {@link Response}. + * @return arcSetting resource details of HCI Cluster. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String clusterName, String arcSettingName, Context context) { - return getWithResponseAsync(resourceGroupName, clusterName, arcSettingName, context).block(); + public ArcSettingInner get(String resourceGroupName, String clusterName, String arcSettingName) { + return getWithResponse(resourceGroupName, clusterName, arcSettingName, Context.NONE).getValue(); } /** @@ -679,15 +702,20 @@ private Mono createAsync( * @param clusterName The name of the cluster. * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. * @param arcSetting Parameters supplied to the Create ArcSetting resource for this HCI cluster. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return arcSetting details. + * @return arcSetting details along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ArcSettingInner create( - String resourceGroupName, String clusterName, String arcSettingName, ArcSettingInner arcSetting) { - return createAsync(resourceGroupName, clusterName, arcSettingName, arcSetting).block(); + public Response createWithResponse( + String resourceGroupName, + String clusterName, + String arcSettingName, + ArcSettingInner arcSetting, + Context context) { + return createWithResponseAsync(resourceGroupName, clusterName, arcSettingName, arcSetting, context).block(); } /** @@ -697,20 +725,15 @@ public ArcSettingInner create( * @param clusterName The name of the cluster. * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. * @param arcSetting Parameters supplied to the Create ArcSetting resource for this HCI cluster. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return arcSetting details along with {@link Response}. + * @return arcSetting details. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse( - String resourceGroupName, - String clusterName, - String arcSettingName, - ArcSettingInner arcSetting, - Context context) { - return createWithResponseAsync(resourceGroupName, clusterName, arcSettingName, arcSetting, context).block(); + public ArcSettingInner create( + String resourceGroupName, String clusterName, String arcSettingName, ArcSettingInner arcSetting) { + return createWithResponse(resourceGroupName, clusterName, arcSettingName, arcSetting, Context.NONE).getValue(); } /** @@ -861,15 +884,20 @@ private Mono updateAsync( * @param clusterName The name of the cluster. * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. * @param arcSetting ArcSettings parameters that needs to be updated. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return arcSetting details. + * @return arcSetting details along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ArcSettingInner update( - String resourceGroupName, String clusterName, String arcSettingName, ArcSettingsPatch arcSetting) { - return updateAsync(resourceGroupName, clusterName, arcSettingName, arcSetting).block(); + public Response updateWithResponse( + String resourceGroupName, + String clusterName, + String arcSettingName, + ArcSettingsPatch arcSetting, + Context context) { + return updateWithResponseAsync(resourceGroupName, clusterName, arcSettingName, arcSetting, context).block(); } /** @@ -879,20 +907,15 @@ public ArcSettingInner update( * @param clusterName The name of the cluster. * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. * @param arcSetting ArcSettings parameters that needs to be updated. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return arcSetting details along with {@link Response}. + * @return arcSetting details. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, - String clusterName, - String arcSettingName, - ArcSettingsPatch arcSetting, - Context context) { - return updateWithResponseAsync(resourceGroupName, clusterName, arcSettingName, arcSetting, context).block(); + public ArcSettingInner update( + String resourceGroupName, String clusterName, String arcSettingName, ArcSettingsPatch arcSetting) { + return updateWithResponse(resourceGroupName, clusterName, arcSettingName, arcSetting, Context.NONE).getValue(); } /** @@ -1057,7 +1080,7 @@ private PollerFlux, Void> beginDeleteAsync( @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String clusterName, String arcSettingName) { - return beginDeleteAsync(resourceGroupName, clusterName, arcSettingName).getSyncPoller(); + return this.beginDeleteAsync(resourceGroupName, clusterName, arcSettingName).getSyncPoller(); } /** @@ -1075,7 +1098,7 @@ public SyncPoller, Void> beginDelete( @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(); + return this.beginDeleteAsync(resourceGroupName, clusterName, arcSettingName, context).getSyncPoller(); } /** @@ -1275,15 +1298,16 @@ private Mono generatePasswordAsync( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PasswordCredentialInner generatePassword( - String resourceGroupName, String clusterName, String arcSettingName) { - return generatePasswordAsync(resourceGroupName, clusterName, arcSettingName).block(); + public Response generatePasswordWithResponse( + String resourceGroupName, String clusterName, String arcSettingName, Context context) { + return generatePasswordWithResponseAsync(resourceGroupName, clusterName, arcSettingName, context).block(); } /** @@ -1292,16 +1316,15 @@ public PasswordCredentialInner generatePassword( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response generatePasswordWithResponse( - String resourceGroupName, String clusterName, String arcSettingName, Context context) { - return generatePasswordWithResponseAsync(resourceGroupName, clusterName, arcSettingName, context).block(); + public PasswordCredentialInner generatePassword( + String resourceGroupName, String clusterName, String arcSettingName) { + return generatePasswordWithResponse(resourceGroupName, clusterName, arcSettingName, Context.NONE).getValue(); } /** @@ -1476,7 +1499,7 @@ private PollerFlux, ArcIdentityResponseInne @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ArcIdentityResponseInner> beginCreateIdentity( String resourceGroupName, String clusterName, String arcSettingName) { - return beginCreateIdentityAsync(resourceGroupName, clusterName, arcSettingName).getSyncPoller(); + return this.beginCreateIdentityAsync(resourceGroupName, clusterName, arcSettingName).getSyncPoller(); } /** @@ -1494,7 +1517,7 @@ public SyncPoller, ArcIdentityResponseInner @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(); + return this.beginCreateIdentityAsync(resourceGroupName, clusterName, arcSettingName, context).getSyncPoller(); } /** @@ -1571,10 +1594,429 @@ public ArcIdentityResponseInner createIdentity( return createIdentityAsync(resourceGroupName, clusterName, arcSettingName, context).block(); } + /** + * Add consent time for default extensions and initiate extensions installation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> consentAndInstallDefaultExtensionsWithResponseAsync( + String resourceGroupName, String clusterName, String arcSettingName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (arcSettingName == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .consentAndInstallDefaultExtensions( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + arcSettingName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Add consent time for default extensions and initiate extensions installation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> consentAndInstallDefaultExtensionsWithResponseAsync( + String resourceGroupName, String clusterName, String arcSettingName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (arcSettingName == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .consentAndInstallDefaultExtensions( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + arcSettingName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Add consent time for default extensions and initiate extensions installation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono consentAndInstallDefaultExtensionsAsync( + String resourceGroupName, String clusterName, String arcSettingName) { + return consentAndInstallDefaultExtensionsWithResponseAsync(resourceGroupName, clusterName, arcSettingName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Add consent time for default extensions and initiate extensions installation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response consentAndInstallDefaultExtensionsWithResponse( + String resourceGroupName, String clusterName, String arcSettingName, Context context) { + return consentAndInstallDefaultExtensionsWithResponseAsync( + resourceGroupName, clusterName, arcSettingName, context) + .block(); + } + + /** + * Add consent time for default extensions and initiate extensions installation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ArcSettingInner consentAndInstallDefaultExtensions( + String resourceGroupName, String clusterName, String arcSettingName) { + return consentAndInstallDefaultExtensionsWithResponse( + resourceGroupName, clusterName, arcSettingName, Context.NONE) + .getValue(); + } + + /** + * Initializes ARC Disable process on the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> initializeDisableProcessWithResponseAsync( + String resourceGroupName, String clusterName, String arcSettingName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (arcSettingName == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .initializeDisableProcess( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + arcSettingName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Initializes ARC Disable process on the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> initializeDisableProcessWithResponseAsync( + String resourceGroupName, String clusterName, String arcSettingName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (arcSettingName == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .initializeDisableProcess( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + arcSettingName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Initializes ARC Disable process on the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginInitializeDisableProcessAsync( + String resourceGroupName, String clusterName, String arcSettingName) { + Mono>> mono = + initializeDisableProcessWithResponseAsync(resourceGroupName, clusterName, arcSettingName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Initializes ARC Disable process on the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginInitializeDisableProcessAsync( + String resourceGroupName, String clusterName, String arcSettingName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + initializeDisableProcessWithResponseAsync(resourceGroupName, clusterName, arcSettingName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Initializes ARC Disable process on the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginInitializeDisableProcess( + String resourceGroupName, String clusterName, String arcSettingName) { + return this.beginInitializeDisableProcessAsync(resourceGroupName, clusterName, arcSettingName).getSyncPoller(); + } + + /** + * Initializes ARC Disable process on the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginInitializeDisableProcess( + String resourceGroupName, String clusterName, String arcSettingName, Context context) { + return this + .beginInitializeDisableProcessAsync(resourceGroupName, clusterName, arcSettingName, context) + .getSyncPoller(); + } + + /** + * Initializes ARC Disable process on the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono initializeDisableProcessAsync( + String resourceGroupName, String clusterName, String arcSettingName) { + return beginInitializeDisableProcessAsync(resourceGroupName, clusterName, arcSettingName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Initializes ARC Disable process on the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono initializeDisableProcessAsync( + String resourceGroupName, String clusterName, String arcSettingName, Context context) { + return beginInitializeDisableProcessAsync(resourceGroupName, clusterName, arcSettingName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Initializes ARC Disable process on the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void initializeDisableProcess(String resourceGroupName, String clusterName, String arcSettingName) { + initializeDisableProcessAsync(resourceGroupName, clusterName, arcSettingName).block(); + } + + /** + * Initializes ARC Disable process on the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void initializeDisableProcess( + String resourceGroupName, String clusterName, String arcSettingName, Context context) { + initializeDisableProcessAsync(resourceGroupName, clusterName, arcSettingName, context).block(); + } + /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

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

The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingsImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingsImpl.java index e7fc8d055b322..98ab568fe3705 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingsImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingsImpl.java @@ -42,15 +42,6 @@ public PagedIterable listByCluster(String resourceGroupName, String return Utils.mapPage(inner, inner1 -> new ArcSettingImpl(inner1, this.manager())); } - public ArcSetting get(String resourceGroupName, String clusterName, String arcSettingName) { - ArcSettingInner inner = this.serviceClient().get(resourceGroupName, clusterName, arcSettingName); - if (inner != null) { - return new ArcSettingImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getWithResponse( String resourceGroupName, String clusterName, String arcSettingName, Context context) { Response inner = @@ -66,6 +57,15 @@ public Response getWithResponse( } } + public ArcSetting get(String resourceGroupName, String clusterName, String arcSettingName) { + ArcSettingInner inner = this.serviceClient().get(resourceGroupName, clusterName, arcSettingName); + if (inner != null) { + return new ArcSettingImpl(inner, this.manager()); + } else { + return null; + } + } + public void delete(String resourceGroupName, String clusterName, String arcSettingName) { this.serviceClient().delete(resourceGroupName, clusterName, arcSettingName); } @@ -74,16 +74,6 @@ public void delete(String resourceGroupName, String clusterName, String arcSetti this.serviceClient().delete(resourceGroupName, clusterName, arcSettingName, context); } - public PasswordCredential generatePassword(String resourceGroupName, String clusterName, String arcSettingName) { - PasswordCredentialInner inner = - this.serviceClient().generatePassword(resourceGroupName, clusterName, arcSettingName); - if (inner != null) { - return new PasswordCredentialImpl(inner, this.manager()); - } else { - return null; - } - } - public Response generatePasswordWithResponse( String resourceGroupName, String clusterName, String arcSettingName, Context context) { Response inner = @@ -99,6 +89,16 @@ public Response generatePasswordWithResponse( } } + public PasswordCredential generatePassword(String resourceGroupName, String clusterName, String arcSettingName) { + PasswordCredentialInner inner = + this.serviceClient().generatePassword(resourceGroupName, clusterName, arcSettingName); + if (inner != null) { + return new PasswordCredentialImpl(inner, this.manager()); + } else { + return null; + } + } + public ArcIdentityResponse createIdentity(String resourceGroupName, String clusterName, String arcSettingName) { ArcIdentityResponseInner inner = this.serviceClient().createIdentity(resourceGroupName, clusterName, arcSettingName); @@ -120,6 +120,44 @@ public ArcIdentityResponse createIdentity( } } + public Response consentAndInstallDefaultExtensionsWithResponse( + String resourceGroupName, String clusterName, String arcSettingName, Context context) { + Response inner = + this + .serviceClient() + .consentAndInstallDefaultExtensionsWithResponse( + resourceGroupName, clusterName, arcSettingName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ArcSettingImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ArcSetting consentAndInstallDefaultExtensions( + String resourceGroupName, String clusterName, String arcSettingName) { + ArcSettingInner inner = + this.serviceClient().consentAndInstallDefaultExtensions(resourceGroupName, clusterName, arcSettingName); + if (inner != null) { + return new ArcSettingImpl(inner, this.manager()); + } else { + return null; + } + } + + public void initializeDisableProcess(String resourceGroupName, String clusterName, String arcSettingName) { + this.serviceClient().initializeDisableProcess(resourceGroupName, clusterName, arcSettingName); + } + + public void initializeDisableProcess( + String resourceGroupName, String clusterName, String arcSettingName, Context context) { + this.serviceClient().initializeDisableProcess(resourceGroupName, clusterName, arcSettingName, context); + } + public ArcSetting getById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/AzureStackHciClientBuilder.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/AzureStackHciClientBuilder.java index 31e4c5141f028..dafafa520ac61 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/AzureStackHciClientBuilder.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/AzureStackHciClientBuilder.java @@ -119,24 +119,26 @@ public AzureStackHciClientBuilder serializerAdapter(SerializerAdapter serializer * @return an instance of AzureStackHciClientImpl. */ public AzureStackHciClientImpl buildClient() { - if (endpoint == null) { - this.endpoint = "https://management.azure.com"; - } - if (environment == null) { - this.environment = AzureEnvironment.AZURE; - } - if (pipeline == null) { - this.pipeline = new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); - } - if (defaultPollInterval == null) { - this.defaultPollInterval = Duration.ofSeconds(30); - } - if (serializerAdapter == null) { - this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); - } + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; + AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; + HttpPipeline localPipeline = + (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval = + (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = + (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); AzureStackHciClientImpl client = new AzureStackHciClientImpl( - pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + localPipeline, + localSerializerAdapter, + localDefaultPollInterval, + localEnvironment, + this.subscriptionId, + localEndpoint); return client; } } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/AzureStackHciClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/AzureStackHciClientImpl.java index 773a2426d48da..78513f53f093b 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/AzureStackHciClientImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/AzureStackHciClientImpl.java @@ -26,7 +26,13 @@ import com.azure.resourcemanager.azurestackhci.fluent.AzureStackHciClient; import com.azure.resourcemanager.azurestackhci.fluent.ClustersClient; import com.azure.resourcemanager.azurestackhci.fluent.ExtensionsClient; +import com.azure.resourcemanager.azurestackhci.fluent.OffersClient; import com.azure.resourcemanager.azurestackhci.fluent.OperationsClient; +import com.azure.resourcemanager.azurestackhci.fluent.PublishersClient; +import com.azure.resourcemanager.azurestackhci.fluent.SkusClient; +import com.azure.resourcemanager.azurestackhci.fluent.UpdateRunsClient; +import com.azure.resourcemanager.azurestackhci.fluent.UpdateSummariesOperationsClient; +import com.azure.resourcemanager.azurestackhci.fluent.UpdatesClient; import java.io.IOException; import java.lang.reflect.Type; import java.nio.ByteBuffer; @@ -147,6 +153,18 @@ public ExtensionsClient getExtensions() { return this.extensions; } + /** The OffersClient object to access its operations. */ + private final OffersClient offers; + + /** + * Gets the OffersClient object to access its operations. + * + * @return the OffersClient object. + */ + public OffersClient getOffers() { + return this.offers; + } + /** The OperationsClient object to access its operations. */ private final OperationsClient operations; @@ -159,6 +177,66 @@ public OperationsClient getOperations() { return this.operations; } + /** The PublishersClient object to access its operations. */ + private final PublishersClient publishers; + + /** + * Gets the PublishersClient object to access its operations. + * + * @return the PublishersClient object. + */ + public PublishersClient getPublishers() { + return this.publishers; + } + + /** The SkusClient object to access its operations. */ + private final SkusClient skus; + + /** + * Gets the SkusClient object to access its operations. + * + * @return the SkusClient object. + */ + public SkusClient getSkus() { + return this.skus; + } + + /** The UpdateRunsClient object to access its operations. */ + private final UpdateRunsClient updateRuns; + + /** + * Gets the UpdateRunsClient object to access its operations. + * + * @return the UpdateRunsClient object. + */ + public UpdateRunsClient getUpdateRuns() { + return this.updateRuns; + } + + /** The UpdateSummariesOperationsClient object to access its operations. */ + private final UpdateSummariesOperationsClient updateSummariesOperations; + + /** + * Gets the UpdateSummariesOperationsClient object to access its operations. + * + * @return the UpdateSummariesOperationsClient object. + */ + public UpdateSummariesOperationsClient getUpdateSummariesOperations() { + return this.updateSummariesOperations; + } + + /** The UpdatesClient object to access its operations. */ + private final UpdatesClient updates; + + /** + * Gets the UpdatesClient object to access its operations. + * + * @return the UpdatesClient object. + */ + public UpdatesClient getUpdates() { + return this.updates; + } + /** * Initializes an instance of AzureStackHciClient client. * @@ -181,11 +259,17 @@ public OperationsClient getOperations() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2022-05-01"; + this.apiVersion = "2023-08-01"; this.arcSettings = new ArcSettingsClientImpl(this); this.clusters = new ClustersClientImpl(this); this.extensions = new ExtensionsClientImpl(this); + this.offers = new OffersClientImpl(this); this.operations = new OperationsClientImpl(this); + this.publishers = new PublishersClientImpl(this); + this.skus = new SkusClientImpl(this); + this.updateRuns = new UpdateRunsClientImpl(this); + this.updateSummariesOperations = new UpdateSummariesOperationsClientImpl(this); + this.updates = new UpdatesClientImpl(this); } /** diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClusterImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClusterImpl.java index 3bb9fccdd06c7..601d665927505 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClusterImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClusterImpl.java @@ -13,12 +13,19 @@ import com.azure.resourcemanager.azurestackhci.models.ClusterIdentityResponse; import com.azure.resourcemanager.azurestackhci.models.ClusterPatch; import com.azure.resourcemanager.azurestackhci.models.ClusterReportedProperties; +import com.azure.resourcemanager.azurestackhci.models.ConnectivityStatus; +import com.azure.resourcemanager.azurestackhci.models.IsolatedVmAttestationConfiguration; +import com.azure.resourcemanager.azurestackhci.models.ManagedServiceIdentityType; import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; +import com.azure.resourcemanager.azurestackhci.models.SoftwareAssuranceChangeRequest; +import com.azure.resourcemanager.azurestackhci.models.SoftwareAssuranceProperties; import com.azure.resourcemanager.azurestackhci.models.Status; import com.azure.resourcemanager.azurestackhci.models.UploadCertificateRequest; +import com.azure.resourcemanager.azurestackhci.models.UserAssignedIdentity; import java.time.OffsetDateTime; import java.util.Collections; import java.util.Map; +import java.util.UUID; public final class ClusterImpl implements Cluster, Cluster.Definition, Cluster.Update { private ClusterInner innerObject; @@ -54,6 +61,27 @@ public SystemData systemData() { return this.innerModel().systemData(); } + public UUID principalId() { + return this.innerModel().principalId(); + } + + public UUID tenantId() { + return this.innerModel().tenantId(); + } + + public ManagedServiceIdentityType typeIdentityType() { + return this.innerModel().typeIdentityType(); + } + + public Map userAssignedIdentities() { + Map inner = this.innerModel().userAssignedIdentities(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + public ProvisioningState provisioningState() { return this.innerModel().provisioningState(); } @@ -62,6 +90,10 @@ public Status status() { return this.innerModel().status(); } + public ConnectivityStatus connectivityStatus() { + return this.innerModel().connectivityStatus(); + } + public String cloudId() { return this.innerModel().cloudId(); } @@ -86,6 +118,10 @@ public String aadServicePrincipalObjectId() { return this.innerModel().aadServicePrincipalObjectId(); } + public SoftwareAssuranceProperties softwareAssuranceProperties() { + return this.innerModel().softwareAssuranceProperties(); + } + public ClusterDesiredProperties desiredProperties() { return this.innerModel().desiredProperties(); } @@ -94,6 +130,10 @@ public ClusterReportedProperties reportedProperties() { return this.innerModel().reportedProperties(); } + public IsolatedVmAttestationConfiguration isolatedVmAttestationConfiguration() { + return this.innerModel().isolatedVmAttestationConfiguration(); + } + public Float trialDaysRemaining() { return this.innerModel().trialDaysRemaining(); } @@ -118,6 +158,10 @@ public String serviceEndpoint() { return this.innerModel().serviceEndpoint(); } + public String resourceProviderObjectId() { + return this.innerModel().resourceProviderObjectId(); + } + public Region region() { return Region.fromName(this.regionName()); } @@ -243,6 +287,19 @@ public ClusterIdentityResponse createIdentity(Context context) { return serviceManager.clusters().createIdentity(resourceGroupName, clusterName, context); } + public Cluster extendSoftwareAssuranceBenefit(SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest) { + return serviceManager + .clusters() + .extendSoftwareAssuranceBenefit(resourceGroupName, clusterName, softwareAssuranceChangeRequest); + } + + public Cluster extendSoftwareAssuranceBenefit( + SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest, Context context) { + return serviceManager + .clusters() + .extendSoftwareAssuranceBenefit(resourceGroupName, clusterName, softwareAssuranceChangeRequest, context); + } + public ClusterImpl withRegion(Region location) { this.innerModel().withLocation(location.toString()); return this; @@ -263,6 +320,21 @@ public ClusterImpl withTags(Map tags) { } } + public ClusterImpl withTypeIdentityType(ManagedServiceIdentityType typeIdentityType) { + this.innerModel().withTypeIdentityType(typeIdentityType); + return this; + } + + public ClusterImpl withUserAssignedIdentities(Map userAssignedIdentities) { + if (isInCreateMode()) { + this.innerModel().withUserAssignedIdentities(userAssignedIdentities); + return this; + } else { + this.updateCluster.withUserAssignedIdentities(userAssignedIdentities); + return this; + } + } + public ClusterImpl withCloudManagementEndpoint(String cloudManagementEndpoint) { if (isInCreateMode()) { this.innerModel().withCloudManagementEndpoint(cloudManagementEndpoint); @@ -303,6 +375,11 @@ public ClusterImpl withAadServicePrincipalObjectId(String aadServicePrincipalObj return this; } + public ClusterImpl withSoftwareAssuranceProperties(SoftwareAssuranceProperties softwareAssuranceProperties) { + this.innerModel().withSoftwareAssuranceProperties(softwareAssuranceProperties); + return this; + } + public ClusterImpl withDesiredProperties(ClusterDesiredProperties desiredProperties) { if (isInCreateMode()) { this.innerModel().withDesiredProperties(desiredProperties); @@ -313,6 +390,11 @@ public ClusterImpl withDesiredProperties(ClusterDesiredProperties desiredPropert } } + public ClusterImpl withType(ManagedServiceIdentityType type) { + this.updateCluster.withType(type); + return this; + } + private boolean isInCreateMode() { return this.innerModel().id() == null; } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClustersClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClustersClientImpl.java index d04da2f864039..30d6772fe29fd 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClustersClientImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClustersClientImpl.java @@ -38,6 +38,7 @@ import com.azure.resourcemanager.azurestackhci.fluent.models.ClusterInner; import com.azure.resourcemanager.azurestackhci.models.ClusterList; import com.azure.resourcemanager.azurestackhci.models.ClusterPatch; +import com.azure.resourcemanager.azurestackhci.models.SoftwareAssuranceChangeRequest; import com.azure.resourcemanager.azurestackhci.models.UploadCertificateRequest; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; @@ -67,7 +68,7 @@ public final class ClustersClientImpl implements ClustersClient { */ @Host("{$host}") @ServiceInterface(name = "AzureStackHciClientC") - private interface ClustersService { + public interface ClustersService { @Headers({"Content-Type: application/json"}) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/clusters") @ExpectedResponses({200}) @@ -81,8 +82,7 @@ Mono> list( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" - + "/clusters") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroup( @@ -95,8 +95,7 @@ Mono> listByResourceGroup( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" - + "/clusters/{clusterName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getByResourceGroup( @@ -110,8 +109,7 @@ Mono> getByResourceGroup( @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" - + "/clusters/{clusterName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> create( @@ -126,8 +124,7 @@ Mono> create( @Headers({"Content-Type: application/json"}) @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" - + "/clusters/{clusterName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> update( @@ -142,8 +139,7 @@ Mono> update( @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" - + "/clusters/{clusterName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> delete( @@ -157,8 +153,7 @@ Mono>> delete( @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" - + "/clusters/{clusterName}/uploadCertificate") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/uploadCertificate") @ExpectedResponses({202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> uploadCertificate( @@ -173,8 +168,7 @@ Mono>> uploadCertificate( @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" - + "/clusters/{clusterName}/createClusterIdentity") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/createClusterIdentity") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> createIdentity( @@ -186,6 +180,21 @@ Mono>> createIdentity( @HeaderParam("Accept") String accept, Context context); + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/extendSoftwareAssuranceBenefit") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> extendSoftwareAssuranceBenefit( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest, + @HeaderParam("Accept") String accept, + Context context); + @Headers({"Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -626,14 +635,16 @@ private Mono getByResourceGroupAsync(String resourceGroupName, Str * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hCI cluster. + * @return hCI cluster along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ClusterInner getByResourceGroup(String resourceGroupName, String clusterName) { - return getByResourceGroupAsync(resourceGroupName, clusterName).block(); + public Response getByResourceGroupWithResponse( + String resourceGroupName, String clusterName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, clusterName, context).block(); } /** @@ -641,16 +652,14 @@ public ClusterInner getByResourceGroup(String resourceGroupName, String clusterN * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hCI cluster along with {@link Response}. + * @return hCI cluster. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String clusterName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, clusterName, context).block(); + public ClusterInner getByResourceGroup(String resourceGroupName, String clusterName) { + return getByResourceGroupWithResponse(resourceGroupName, clusterName, Context.NONE).getValue(); } /** @@ -784,14 +793,16 @@ private Mono createAsync(String resourceGroupName, String clusterN * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param cluster Details of the HCI cluster. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster details. + * @return cluster details along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ClusterInner create(String resourceGroupName, String clusterName, ClusterInner cluster) { - return createAsync(resourceGroupName, clusterName, cluster).block(); + public Response createWithResponse( + String resourceGroupName, String clusterName, ClusterInner cluster, Context context) { + return createWithResponseAsync(resourceGroupName, clusterName, cluster, context).block(); } /** @@ -800,16 +811,14 @@ public ClusterInner create(String resourceGroupName, String clusterName, Cluster * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param cluster Details of the HCI cluster. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster details along with {@link Response}. + * @return cluster details. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse( - String resourceGroupName, String clusterName, ClusterInner cluster, Context context) { - return createWithResponseAsync(resourceGroupName, clusterName, cluster, context).block(); + public ClusterInner create(String resourceGroupName, String clusterName, ClusterInner cluster) { + return createWithResponse(resourceGroupName, clusterName, cluster, Context.NONE).getValue(); } /** @@ -943,14 +952,16 @@ private Mono updateAsync(String resourceGroupName, String clusterN * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param cluster Details of the HCI cluster. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster details. + * @return cluster details along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ClusterInner update(String resourceGroupName, String clusterName, ClusterPatch cluster) { - return updateAsync(resourceGroupName, clusterName, cluster).block(); + public Response updateWithResponse( + String resourceGroupName, String clusterName, ClusterPatch cluster, Context context) { + return updateWithResponseAsync(resourceGroupName, clusterName, cluster, context).block(); } /** @@ -959,16 +970,14 @@ public ClusterInner update(String resourceGroupName, String clusterName, Cluster * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param cluster Details of the HCI cluster. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cluster details along with {@link Response}. + * @return cluster details. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, String clusterName, ClusterPatch cluster, Context context) { - return updateWithResponseAsync(resourceGroupName, clusterName, cluster, context).block(); + public ClusterInner update(String resourceGroupName, String clusterName, ClusterPatch cluster) { + return updateWithResponse(resourceGroupName, clusterName, cluster, Context.NONE).getValue(); } /** @@ -1116,7 +1125,7 @@ private PollerFlux, Void> beginDeleteAsync( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName) { - return beginDeleteAsync(resourceGroupName, clusterName).getSyncPoller(); + return this.beginDeleteAsync(resourceGroupName, clusterName).getSyncPoller(); } /** @@ -1133,7 +1142,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String clusterName, Context context) { - return beginDeleteAsync(resourceGroupName, clusterName, context).getSyncPoller(); + return this.beginDeleteAsync(resourceGroupName, clusterName, context).getSyncPoller(); } /** @@ -1375,7 +1384,9 @@ private PollerFlux, Void> beginUploadCertificateAsync( @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginUploadCertificate( String resourceGroupName, String clusterName, UploadCertificateRequest uploadCertificateRequest) { - return beginUploadCertificateAsync(resourceGroupName, clusterName, uploadCertificateRequest).getSyncPoller(); + return this + .beginUploadCertificateAsync(resourceGroupName, clusterName, uploadCertificateRequest) + .getSyncPoller(); } /** @@ -1396,7 +1407,8 @@ public SyncPoller, Void> beginUploadCertificate( String clusterName, UploadCertificateRequest uploadCertificateRequest, Context context) { - return beginUploadCertificateAsync(resourceGroupName, clusterName, uploadCertificateRequest, context) + return this + .beginUploadCertificateAsync(resourceGroupName, clusterName, uploadCertificateRequest, context) .getSyncPoller(); } @@ -1636,7 +1648,7 @@ private PollerFlux, ClusterIdentityResp @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ClusterIdentityResponseInner> beginCreateIdentity( String resourceGroupName, String clusterName) { - return beginCreateIdentityAsync(resourceGroupName, clusterName).getSyncPoller(); + return this.beginCreateIdentityAsync(resourceGroupName, clusterName).getSyncPoller(); } /** @@ -1653,7 +1665,7 @@ public SyncPoller, ClusterIdentityRespo @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ClusterIdentityResponseInner> beginCreateIdentity( String resourceGroupName, String clusterName, Context context) { - return beginCreateIdentityAsync(resourceGroupName, clusterName, context).getSyncPoller(); + return this.beginCreateIdentityAsync(resourceGroupName, clusterName, context).getSyncPoller(); } /** @@ -1723,10 +1735,306 @@ public ClusterIdentityResponseInner createIdentity(String resourceGroupName, Str return createIdentityAsync(resourceGroupName, clusterName, context).block(); } + /** + * Extends Software Assurance Benefit to a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param softwareAssuranceChangeRequest Software Assurance Change Request Payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> extendSoftwareAssuranceBenefitWithResponseAsync( + String resourceGroupName, String clusterName, SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (softwareAssuranceChangeRequest == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter softwareAssuranceChangeRequest is required and cannot be null.")); + } else { + softwareAssuranceChangeRequest.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .extendSoftwareAssuranceBenefit( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + softwareAssuranceChangeRequest, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Extends Software Assurance Benefit to a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param softwareAssuranceChangeRequest Software Assurance Change Request Payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> extendSoftwareAssuranceBenefitWithResponseAsync( + String resourceGroupName, + String clusterName, + SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (softwareAssuranceChangeRequest == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter softwareAssuranceChangeRequest is required and cannot be null.")); + } else { + softwareAssuranceChangeRequest.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .extendSoftwareAssuranceBenefit( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + softwareAssuranceChangeRequest, + accept, + context); + } + + /** + * Extends Software Assurance Benefit to a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param softwareAssuranceChangeRequest Software Assurance Change Request Payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of cluster details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ClusterInner> beginExtendSoftwareAssuranceBenefitAsync( + String resourceGroupName, String clusterName, SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest) { + Mono>> mono = + extendSoftwareAssuranceBenefitWithResponseAsync( + resourceGroupName, clusterName, softwareAssuranceChangeRequest); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ClusterInner.class, ClusterInner.class, this.client.getContext()); + } + + /** + * Extends Software Assurance Benefit to a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param softwareAssuranceChangeRequest Software Assurance Change Request Payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of cluster details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ClusterInner> beginExtendSoftwareAssuranceBenefitAsync( + String resourceGroupName, + String clusterName, + SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + extendSoftwareAssuranceBenefitWithResponseAsync( + resourceGroupName, clusterName, softwareAssuranceChangeRequest, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ClusterInner.class, ClusterInner.class, context); + } + + /** + * Extends Software Assurance Benefit to a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param softwareAssuranceChangeRequest Software Assurance Change Request Payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of cluster details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ClusterInner> beginExtendSoftwareAssuranceBenefit( + String resourceGroupName, String clusterName, SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest) { + return this + .beginExtendSoftwareAssuranceBenefitAsync(resourceGroupName, clusterName, softwareAssuranceChangeRequest) + .getSyncPoller(); + } + + /** + * Extends Software Assurance Benefit to a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param softwareAssuranceChangeRequest Software Assurance Change Request Payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of cluster details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ClusterInner> beginExtendSoftwareAssuranceBenefit( + String resourceGroupName, + String clusterName, + SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest, + Context context) { + return this + .beginExtendSoftwareAssuranceBenefitAsync( + resourceGroupName, clusterName, softwareAssuranceChangeRequest, context) + .getSyncPoller(); + } + + /** + * Extends Software Assurance Benefit to a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param softwareAssuranceChangeRequest Software Assurance Change Request Payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono extendSoftwareAssuranceBenefitAsync( + String resourceGroupName, String clusterName, SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest) { + return beginExtendSoftwareAssuranceBenefitAsync(resourceGroupName, clusterName, softwareAssuranceChangeRequest) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Extends Software Assurance Benefit to a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param softwareAssuranceChangeRequest Software Assurance Change Request Payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono extendSoftwareAssuranceBenefitAsync( + String resourceGroupName, + String clusterName, + SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest, + Context context) { + return beginExtendSoftwareAssuranceBenefitAsync( + resourceGroupName, clusterName, softwareAssuranceChangeRequest, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Extends Software Assurance Benefit to a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param softwareAssuranceChangeRequest Software Assurance Change Request Payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterInner extendSoftwareAssuranceBenefit( + String resourceGroupName, String clusterName, SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest) { + return extendSoftwareAssuranceBenefitAsync(resourceGroupName, clusterName, softwareAssuranceChangeRequest) + .block(); + } + + /** + * Extends Software Assurance Benefit to a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param softwareAssuranceChangeRequest Software Assurance Change Request Payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterInner extendSoftwareAssuranceBenefit( + String resourceGroupName, + String clusterName, + SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest, + Context context) { + return extendSoftwareAssuranceBenefitAsync( + resourceGroupName, clusterName, softwareAssuranceChangeRequest, context) + .block(); + } + /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

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

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

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

The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClustersImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClustersImpl.java index 980c49de2240a..e7b6926116dda 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClustersImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClustersImpl.java @@ -15,6 +15,7 @@ import com.azure.resourcemanager.azurestackhci.models.Cluster; import com.azure.resourcemanager.azurestackhci.models.ClusterIdentityResponse; import com.azure.resourcemanager.azurestackhci.models.Clusters; +import com.azure.resourcemanager.azurestackhci.models.SoftwareAssuranceChangeRequest; import com.azure.resourcemanager.azurestackhci.models.UploadCertificateRequest; public final class ClustersImpl implements Clusters { @@ -50,15 +51,6 @@ public PagedIterable listByResourceGroup(String resourceGroupName, Cont return Utils.mapPage(inner, inner1 -> new ClusterImpl(inner1, this.manager())); } - public Cluster getByResourceGroup(String resourceGroupName, String clusterName) { - ClusterInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, clusterName); - if (inner != null) { - return new ClusterImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getByResourceGroupWithResponse( String resourceGroupName, String clusterName, Context context) { Response inner = @@ -74,6 +66,15 @@ public Response getByResourceGroupWithResponse( } } + public Cluster getByResourceGroup(String resourceGroupName, String clusterName) { + ClusterInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, clusterName); + if (inner != null) { + return new ClusterImpl(inner, this.manager()); + } else { + return null; + } + } + public void deleteByResourceGroup(String resourceGroupName, String clusterName) { this.serviceClient().delete(resourceGroupName, clusterName); } @@ -114,6 +115,36 @@ public ClusterIdentityResponse createIdentity(String resourceGroupName, String c } } + public Cluster extendSoftwareAssuranceBenefit( + String resourceGroupName, String clusterName, SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest) { + ClusterInner inner = + this + .serviceClient() + .extendSoftwareAssuranceBenefit(resourceGroupName, clusterName, softwareAssuranceChangeRequest); + if (inner != null) { + return new ClusterImpl(inner, this.manager()); + } else { + return null; + } + } + + public Cluster extendSoftwareAssuranceBenefit( + String resourceGroupName, + String clusterName, + SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest, + Context context) { + ClusterInner inner = + this + .serviceClient() + .extendSoftwareAssuranceBenefit( + resourceGroupName, clusterName, softwareAssuranceChangeRequest, context); + if (inner != null) { + return new ClusterImpl(inner, this.manager()); + } else { + return null; + } + } + public Cluster getById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ExtensionImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ExtensionImpl.java index 4340ad680657a..e4aec4ea90bae 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ExtensionImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ExtensionImpl.java @@ -9,6 +9,10 @@ import com.azure.resourcemanager.azurestackhci.fluent.models.ExtensionInner; import com.azure.resourcemanager.azurestackhci.models.Extension; import com.azure.resourcemanager.azurestackhci.models.ExtensionAggregateState; +import com.azure.resourcemanager.azurestackhci.models.ExtensionManagedBy; +import com.azure.resourcemanager.azurestackhci.models.ExtensionPatch; +import com.azure.resourcemanager.azurestackhci.models.ExtensionPatchParameters; +import com.azure.resourcemanager.azurestackhci.models.ExtensionUpgradeParameters; import com.azure.resourcemanager.azurestackhci.models.PerNodeExtensionState; import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; import java.util.Collections; @@ -52,6 +56,10 @@ public List perNodeExtensionDetails() { } } + public ExtensionManagedBy managedBy() { + return this.innerModel().managedBy(); + } + public String forceUpdateTag() { return this.innerModel().forceUpdateTag(); } @@ -80,6 +88,10 @@ public Object protectedSettings() { return this.innerModel().protectedSettings(); } + public Boolean enableAutomaticUpgrade() { + return this.innerModel().enableAutomaticUpgrade(); + } + public String resourceGroupName() { return resourceGroupName; } @@ -100,6 +112,8 @@ private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { private String extensionName; + private ExtensionPatch updateExtension; + public ExtensionImpl withExistingArcSetting(String resourceGroupName, String clusterName, String arcSettingName) { this.resourceGroupName = resourceGroupName; this.clusterName = clusterName; @@ -132,6 +146,7 @@ public Extension create(Context context) { } public ExtensionImpl update() { + this.updateExtension = new ExtensionPatch(); return this; } @@ -140,7 +155,7 @@ public Extension apply() { serviceManager .serviceClient() .getExtensions() - .update(resourceGroupName, clusterName, arcSettingName, extensionName, this.innerModel(), Context.NONE); + .update(resourceGroupName, clusterName, arcSettingName, extensionName, updateExtension, Context.NONE); return this; } @@ -149,7 +164,7 @@ public Extension apply(Context context) { serviceManager .serviceClient() .getExtensions() - .update(resourceGroupName, clusterName, arcSettingName, extensionName, this.innerModel(), context); + .update(resourceGroupName, clusterName, arcSettingName, extensionName, updateExtension, context); return this; } @@ -183,6 +198,19 @@ public Extension refresh(Context context) { return this; } + public void upgrade(ExtensionUpgradeParameters extensionUpgradeParameters) { + serviceManager + .extensions() + .upgrade(resourceGroupName, clusterName, arcSettingName, extensionName, extensionUpgradeParameters); + } + + public void upgrade(ExtensionUpgradeParameters extensionUpgradeParameters, Context context) { + serviceManager + .extensions() + .upgrade( + resourceGroupName, clusterName, arcSettingName, extensionName, extensionUpgradeParameters, context); + } + public ExtensionImpl withForceUpdateTag(String forceUpdateTag) { this.innerModel().withForceUpdateTag(forceUpdateTag); return this; @@ -217,4 +245,14 @@ public ExtensionImpl withProtectedSettings(Object protectedSettings) { this.innerModel().withProtectedSettings(protectedSettings); return this; } + + public ExtensionImpl withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { + this.innerModel().withEnableAutomaticUpgrade(enableAutomaticUpgrade); + return this; + } + + public ExtensionImpl withExtensionParameters(ExtensionPatchParameters extensionParameters) { + this.updateExtension.withExtensionParameters(extensionParameters); + return this; + } } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ExtensionsClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ExtensionsClientImpl.java index ea047f5486e1e..5e04ee1fa7cdd 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ExtensionsClientImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ExtensionsClientImpl.java @@ -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; @@ -35,6 +36,8 @@ import com.azure.resourcemanager.azurestackhci.fluent.ExtensionsClient; import com.azure.resourcemanager.azurestackhci.fluent.models.ExtensionInner; import com.azure.resourcemanager.azurestackhci.models.ExtensionList; +import com.azure.resourcemanager.azurestackhci.models.ExtensionPatch; +import com.azure.resourcemanager.azurestackhci.models.ExtensionUpgradeParameters; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -64,11 +67,10 @@ public final class ExtensionsClientImpl implements ExtensionsClient { */ @Host("{$host}") @ServiceInterface(name = "AzureStackHciClientE") - private interface ExtensionsService { + public interface ExtensionsService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" - + "/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByArcSetting( @@ -83,8 +85,7 @@ Mono> listByArcSetting( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" - + "/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( @@ -100,8 +101,7 @@ Mono> get( @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" - + "/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> create( @@ -118,8 +118,7 @@ Mono>> create( @Headers({"Content-Type: application/json"}) @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" - + "/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> update( @@ -130,14 +129,13 @@ Mono>> update( @PathParam("arcSettingName") String arcSettingName, @PathParam("extensionName") String extensionName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ExtensionInner extension, + @BodyParam("application/json") ExtensionPatch extension, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" - + "/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> delete( @@ -151,6 +149,23 @@ Mono>> delete( @HeaderParam("Accept") String accept, Context context); + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}/upgrade") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> upgrade( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("arcSettingName") String arcSettingName, + @PathParam("extensionName") String extensionName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ExtensionUpgradeParameters extensionUpgradeParameters, + @HeaderParam("Accept") String accept, + Context context); + @Headers({"Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -502,15 +517,16 @@ private Mono getAsync( * @param clusterName The name of the cluster. * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. * @param extensionName The name of the machine extension. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return particular Arc Extension of HCI Cluster. + * @return particular Arc Extension of HCI Cluster along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ExtensionInner get( - String resourceGroupName, String clusterName, String arcSettingName, String extensionName) { - return getAsync(resourceGroupName, clusterName, arcSettingName, extensionName).block(); + public Response getWithResponse( + String resourceGroupName, String clusterName, String arcSettingName, String extensionName, Context context) { + return getWithResponseAsync(resourceGroupName, clusterName, arcSettingName, extensionName, context).block(); } /** @@ -520,16 +536,15 @@ public ExtensionInner get( * @param clusterName The name of the cluster. * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. * @param extensionName The name of the machine extension. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return particular Arc Extension of HCI Cluster along with {@link Response}. + * @return particular Arc Extension of HCI Cluster. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String clusterName, String arcSettingName, String extensionName, Context context) { - return getWithResponseAsync(resourceGroupName, clusterName, arcSettingName, extensionName, context).block(); + public ExtensionInner get( + String resourceGroupName, String clusterName, String arcSettingName, String extensionName) { + return getWithResponse(resourceGroupName, clusterName, arcSettingName, extensionName, Context.NONE).getValue(); } /** @@ -754,7 +769,8 @@ public SyncPoller, ExtensionInner> beginCreate( String arcSettingName, String extensionName, ExtensionInner extension) { - return beginCreateAsync(resourceGroupName, clusterName, arcSettingName, extensionName, extension) + return this + .beginCreateAsync(resourceGroupName, clusterName, arcSettingName, extensionName, extension) .getSyncPoller(); } @@ -780,7 +796,8 @@ public SyncPoller, ExtensionInner> beginCreate( String extensionName, ExtensionInner extension, Context context) { - return beginCreateAsync(resourceGroupName, clusterName, arcSettingName, extensionName, extension, context) + return this + .beginCreateAsync(resourceGroupName, clusterName, arcSettingName, extensionName, extension, context) .getSyncPoller(); } @@ -904,7 +921,7 @@ private Mono>> updateWithResponseAsync( String clusterName, String arcSettingName, String extensionName, - ExtensionInner extension) { + ExtensionPatch extension) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -975,7 +992,7 @@ private Mono>> updateWithResponseAsync( String clusterName, String arcSettingName, String extensionName, - ExtensionInner extension, + ExtensionPatch extension, Context context) { if (this.client.getEndpoint() == null) { return Mono @@ -1042,7 +1059,7 @@ private PollerFlux, ExtensionInner> beginUpdateAsync( String clusterName, String arcSettingName, String extensionName, - ExtensionInner extension) { + ExtensionPatch extension) { Mono>> mono = updateWithResponseAsync(resourceGroupName, clusterName, arcSettingName, extensionName, extension); return this @@ -1075,7 +1092,7 @@ private PollerFlux, ExtensionInner> beginUpdateAsync( String clusterName, String arcSettingName, String extensionName, - ExtensionInner extension, + ExtensionPatch extension, Context context) { context = this.client.mergeContext(context); Mono>> mono = @@ -1105,8 +1122,9 @@ public SyncPoller, ExtensionInner> beginUpdate( String clusterName, String arcSettingName, String extensionName, - ExtensionInner extension) { - return beginUpdateAsync(resourceGroupName, clusterName, arcSettingName, extensionName, extension) + ExtensionPatch extension) { + return this + .beginUpdateAsync(resourceGroupName, clusterName, arcSettingName, extensionName, extension) .getSyncPoller(); } @@ -1130,9 +1148,10 @@ public SyncPoller, ExtensionInner> beginUpdate( String clusterName, String arcSettingName, String extensionName, - ExtensionInner extension, + ExtensionPatch extension, Context context) { - return beginUpdateAsync(resourceGroupName, clusterName, arcSettingName, extensionName, extension, context) + return this + .beginUpdateAsync(resourceGroupName, clusterName, arcSettingName, extensionName, extension, context) .getSyncPoller(); } @@ -1155,7 +1174,7 @@ private Mono updateAsync( String clusterName, String arcSettingName, String extensionName, - ExtensionInner extension) { + ExtensionPatch extension) { return beginUpdateAsync(resourceGroupName, clusterName, arcSettingName, extensionName, extension) .last() .flatMap(this.client::getLroFinalResultOrError); @@ -1181,7 +1200,7 @@ private Mono updateAsync( String clusterName, String arcSettingName, String extensionName, - ExtensionInner extension, + ExtensionPatch extension, Context context) { return beginUpdateAsync(resourceGroupName, clusterName, arcSettingName, extensionName, extension, context) .last() @@ -1207,7 +1226,7 @@ public ExtensionInner update( String clusterName, String arcSettingName, String extensionName, - ExtensionInner extension) { + ExtensionPatch extension) { return updateAsync(resourceGroupName, clusterName, arcSettingName, extensionName, extension).block(); } @@ -1231,7 +1250,7 @@ public ExtensionInner update( String clusterName, String arcSettingName, String extensionName, - ExtensionInner extension, + ExtensionPatch extension, Context context) { return updateAsync(resourceGroupName, clusterName, arcSettingName, extensionName, extension, context).block(); } @@ -1412,7 +1431,7 @@ private PollerFlux, Void> beginDeleteAsync( @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(); + return this.beginDeleteAsync(resourceGroupName, clusterName, arcSettingName, extensionName).getSyncPoller(); } /** @@ -1431,7 +1450,9 @@ public SyncPoller, Void> beginDelete( @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(); + return this + .beginDeleteAsync(resourceGroupName, clusterName, arcSettingName, extensionName, context) + .getSyncPoller(); } /** @@ -1509,10 +1530,369 @@ public void delete( deleteAsync(resourceGroupName, clusterName, arcSettingName, extensionName, context).block(); } + /** + * Upgrade a particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> upgradeWithResponseAsync( + String resourceGroupName, + String clusterName, + String arcSettingName, + String extensionName, + ExtensionUpgradeParameters extensionUpgradeParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (arcSettingName == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + } + if (extensionName == null) { + return Mono.error(new IllegalArgumentException("Parameter extensionName is required and cannot be null.")); + } + if (extensionUpgradeParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter extensionUpgradeParameters is required and cannot be null.")); + } else { + extensionUpgradeParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .upgrade( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + arcSettingName, + extensionName, + this.client.getApiVersion(), + extensionUpgradeParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Upgrade a particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> upgradeWithResponseAsync( + String resourceGroupName, + String clusterName, + String arcSettingName, + String extensionName, + ExtensionUpgradeParameters extensionUpgradeParameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (arcSettingName == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + } + if (extensionName == null) { + return Mono.error(new IllegalArgumentException("Parameter extensionName is required and cannot be null.")); + } + if (extensionUpgradeParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter extensionUpgradeParameters is required and cannot be null.")); + } else { + extensionUpgradeParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .upgrade( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + arcSettingName, + extensionName, + this.client.getApiVersion(), + extensionUpgradeParameters, + accept, + context); + } + + /** + * Upgrade a particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginUpgradeAsync( + String resourceGroupName, + String clusterName, + String arcSettingName, + String extensionName, + ExtensionUpgradeParameters extensionUpgradeParameters) { + Mono>> mono = + upgradeWithResponseAsync( + resourceGroupName, clusterName, arcSettingName, extensionName, extensionUpgradeParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Upgrade a particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginUpgradeAsync( + String resourceGroupName, + String clusterName, + String arcSettingName, + String extensionName, + ExtensionUpgradeParameters extensionUpgradeParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + upgradeWithResponseAsync( + resourceGroupName, clusterName, arcSettingName, extensionName, extensionUpgradeParameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Upgrade a particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginUpgrade( + String resourceGroupName, + String clusterName, + String arcSettingName, + String extensionName, + ExtensionUpgradeParameters extensionUpgradeParameters) { + return this + .beginUpgradeAsync( + resourceGroupName, clusterName, arcSettingName, extensionName, extensionUpgradeParameters) + .getSyncPoller(); + } + + /** + * Upgrade a particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginUpgrade( + String resourceGroupName, + String clusterName, + String arcSettingName, + String extensionName, + ExtensionUpgradeParameters extensionUpgradeParameters, + Context context) { + return this + .beginUpgradeAsync( + resourceGroupName, clusterName, arcSettingName, extensionName, extensionUpgradeParameters, context) + .getSyncPoller(); + } + + /** + * Upgrade a particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono upgradeAsync( + String resourceGroupName, + String clusterName, + String arcSettingName, + String extensionName, + ExtensionUpgradeParameters extensionUpgradeParameters) { + return beginUpgradeAsync( + resourceGroupName, clusterName, arcSettingName, extensionName, extensionUpgradeParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Upgrade a particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono upgradeAsync( + String resourceGroupName, + String clusterName, + String arcSettingName, + String extensionName, + ExtensionUpgradeParameters extensionUpgradeParameters, + Context context) { + return beginUpgradeAsync( + resourceGroupName, clusterName, arcSettingName, extensionName, extensionUpgradeParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Upgrade a particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void upgrade( + String resourceGroupName, + String clusterName, + String arcSettingName, + String extensionName, + ExtensionUpgradeParameters extensionUpgradeParameters) { + upgradeAsync(resourceGroupName, clusterName, arcSettingName, extensionName, extensionUpgradeParameters).block(); + } + + /** + * Upgrade a particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void upgrade( + String resourceGroupName, + String clusterName, + String arcSettingName, + String extensionName, + ExtensionUpgradeParameters extensionUpgradeParameters, + Context context) { + upgradeAsync(resourceGroupName, clusterName, arcSettingName, extensionName, extensionUpgradeParameters, context) + .block(); + } + /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

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

The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ExtensionsImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ExtensionsImpl.java index a2ed71822024c..7c4ad14b936a9 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ExtensionsImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ExtensionsImpl.java @@ -12,6 +12,7 @@ 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.ExtensionUpgradeParameters; import com.azure.resourcemanager.azurestackhci.models.Extensions; public final class ExtensionsImpl implements Extensions { @@ -41,15 +42,6 @@ public PagedIterable listByArcSetting( return Utils.mapPage(inner, inner1 -> new ExtensionImpl(inner1, this.manager())); } - public Extension get(String resourceGroupName, String clusterName, String arcSettingName, String extensionName) { - ExtensionInner inner = this.serviceClient().get(resourceGroupName, clusterName, arcSettingName, extensionName); - if (inner != null) { - return new ExtensionImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getWithResponse( String resourceGroupName, String clusterName, String arcSettingName, String extensionName, Context context) { Response inner = @@ -67,6 +59,15 @@ public Response getWithResponse( } } + public Extension get(String resourceGroupName, String clusterName, String arcSettingName, String extensionName) { + ExtensionInner inner = this.serviceClient().get(resourceGroupName, clusterName, arcSettingName, extensionName); + if (inner != null) { + return new ExtensionImpl(inner, this.manager()); + } else { + return null; + } + } + public void delete(String resourceGroupName, String clusterName, String arcSettingName, String extensionName) { this.serviceClient().delete(resourceGroupName, clusterName, arcSettingName, extensionName); } @@ -76,6 +77,30 @@ public void delete( this.serviceClient().delete(resourceGroupName, clusterName, arcSettingName, extensionName, context); } + public void upgrade( + String resourceGroupName, + String clusterName, + String arcSettingName, + String extensionName, + ExtensionUpgradeParameters extensionUpgradeParameters) { + this + .serviceClient() + .upgrade(resourceGroupName, clusterName, arcSettingName, extensionName, extensionUpgradeParameters); + } + + public void upgrade( + String resourceGroupName, + String clusterName, + String arcSettingName, + String extensionName, + ExtensionUpgradeParameters extensionUpgradeParameters, + Context context) { + this + .serviceClient() + .upgrade( + resourceGroupName, clusterName, arcSettingName, extensionName, extensionUpgradeParameters, context); + } + public Extension getById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/HciUpdateImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/HciUpdateImpl.java new file mode 100644 index 0000000000000..947b79b990846 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/HciUpdateImpl.java @@ -0,0 +1,376 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.fluent.models.HciUpdateInner; +import com.azure.resourcemanager.azurestackhci.models.AvailabilityType; +import com.azure.resourcemanager.azurestackhci.models.HciUpdate; +import com.azure.resourcemanager.azurestackhci.models.HealthState; +import com.azure.resourcemanager.azurestackhci.models.PackageVersionInfo; +import com.azure.resourcemanager.azurestackhci.models.PrecheckResult; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; +import com.azure.resourcemanager.azurestackhci.models.RebootRequirement; +import com.azure.resourcemanager.azurestackhci.models.State; +import com.azure.resourcemanager.azurestackhci.models.UpdatePrerequisite; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class HciUpdateImpl implements HciUpdate, HciUpdate.Definition, HciUpdate.Update { + private HciUpdateInner innerObject; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public OffsetDateTime installedDate() { + return this.innerModel().installedDate(); + } + + public String description() { + return this.innerModel().description(); + } + + public State state() { + return this.innerModel().state(); + } + + public List prerequisites() { + List inner = this.innerModel().prerequisites(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List componentVersions() { + List inner = this.innerModel().componentVersions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public RebootRequirement rebootRequired() { + return this.innerModel().rebootRequired(); + } + + public HealthState healthState() { + return this.innerModel().healthState(); + } + + public List healthCheckResult() { + List inner = this.innerModel().healthCheckResult(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public OffsetDateTime healthCheckDate() { + return this.innerModel().healthCheckDate(); + } + + public String packagePath() { + return this.innerModel().packagePath(); + } + + public Float packageSizeInMb() { + return this.innerModel().packageSizeInMb(); + } + + public String displayName() { + return this.innerModel().displayName(); + } + + public String version() { + return this.innerModel().version(); + } + + public String publisher() { + return this.innerModel().publisher(); + } + + public String releaseLink() { + return this.innerModel().releaseLink(); + } + + public AvailabilityType availabilityType() { + return this.innerModel().availabilityType(); + } + + public String packageType() { + return this.innerModel().packageType(); + } + + public String additionalProperties() { + return this.innerModel().additionalProperties(); + } + + public Float progressPercentage() { + return this.innerModel().progressPercentage(); + } + + public String notifyMessage() { + return this.innerModel().notifyMessage(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public HciUpdateInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String clusterName; + + private String updateName; + + public HciUpdateImpl withExistingCluster(String resourceGroupName, String clusterName) { + this.resourceGroupName = resourceGroupName; + this.clusterName = clusterName; + return this; + } + + public HciUpdate create() { + this.innerObject = + serviceManager + .serviceClient() + .getUpdates() + .putWithResponse(resourceGroupName, clusterName, updateName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public HciUpdate create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getUpdates() + .putWithResponse(resourceGroupName, clusterName, updateName, this.innerModel(), context) + .getValue(); + return this; + } + + HciUpdateImpl(String name, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = new HciUpdateInner(); + this.serviceManager = serviceManager; + this.updateName = name; + } + + public HciUpdateImpl update() { + return this; + } + + public HciUpdate apply() { + this.innerObject = + serviceManager + .serviceClient() + .getUpdates() + .putWithResponse(resourceGroupName, clusterName, updateName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public HciUpdate apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getUpdates() + .putWithResponse(resourceGroupName, clusterName, updateName, this.innerModel(), context) + .getValue(); + return this; + } + + HciUpdateImpl( + HciUpdateInner innerObject, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.clusterName = Utils.getValueFromIdByName(innerObject.id(), "clusters"); + this.updateName = Utils.getValueFromIdByName(innerObject.id(), "updates"); + } + + public HciUpdate refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getUpdates() + .getWithResponse(resourceGroupName, clusterName, updateName, Context.NONE) + .getValue(); + return this; + } + + public HciUpdate refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getUpdates() + .getWithResponse(resourceGroupName, clusterName, updateName, context) + .getValue(); + return this; + } + + public void post() { + serviceManager.updates().post(resourceGroupName, clusterName, updateName); + } + + public void post(Context context) { + serviceManager.updates().post(resourceGroupName, clusterName, updateName, context); + } + + public HciUpdateImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public HciUpdateImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public HciUpdateImpl withInstalledDate(OffsetDateTime installedDate) { + this.innerModel().withInstalledDate(installedDate); + return this; + } + + public HciUpdateImpl withDescription(String description) { + this.innerModel().withDescription(description); + return this; + } + + public HciUpdateImpl withState(State state) { + this.innerModel().withState(state); + return this; + } + + public HciUpdateImpl withPrerequisites(List prerequisites) { + this.innerModel().withPrerequisites(prerequisites); + return this; + } + + public HciUpdateImpl withComponentVersions(List componentVersions) { + this.innerModel().withComponentVersions(componentVersions); + return this; + } + + public HciUpdateImpl withRebootRequired(RebootRequirement rebootRequired) { + this.innerModel().withRebootRequired(rebootRequired); + return this; + } + + public HciUpdateImpl withHealthState(HealthState healthState) { + this.innerModel().withHealthState(healthState); + return this; + } + + public HciUpdateImpl withHealthCheckResult(List healthCheckResult) { + this.innerModel().withHealthCheckResult(healthCheckResult); + return this; + } + + public HciUpdateImpl withHealthCheckDate(OffsetDateTime healthCheckDate) { + this.innerModel().withHealthCheckDate(healthCheckDate); + return this; + } + + public HciUpdateImpl withPackagePath(String packagePath) { + this.innerModel().withPackagePath(packagePath); + return this; + } + + public HciUpdateImpl withPackageSizeInMb(Float packageSizeInMb) { + this.innerModel().withPackageSizeInMb(packageSizeInMb); + return this; + } + + public HciUpdateImpl withDisplayName(String displayName) { + this.innerModel().withDisplayName(displayName); + return this; + } + + public HciUpdateImpl withVersion(String version) { + this.innerModel().withVersion(version); + return this; + } + + public HciUpdateImpl withPublisher(String publisher) { + this.innerModel().withPublisher(publisher); + return this; + } + + public HciUpdateImpl withReleaseLink(String releaseLink) { + this.innerModel().withReleaseLink(releaseLink); + return this; + } + + public HciUpdateImpl withAvailabilityType(AvailabilityType availabilityType) { + this.innerModel().withAvailabilityType(availabilityType); + return this; + } + + public HciUpdateImpl withPackageType(String packageType) { + this.innerModel().withPackageType(packageType); + return this; + } + + public HciUpdateImpl withAdditionalProperties(String additionalProperties) { + this.innerModel().withAdditionalProperties(additionalProperties); + return this; + } + + public HciUpdateImpl withProgressPercentage(Float progressPercentage) { + this.innerModel().withProgressPercentage(progressPercentage); + return this; + } + + public HciUpdateImpl withNotifyMessage(String notifyMessage) { + this.innerModel().withNotifyMessage(notifyMessage); + return this; + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OfferImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OfferImpl.java new file mode 100644 index 0000000000000..2b1ebff07b918 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OfferImpl.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.azurestackhci.fluent.models.OfferInner; +import com.azure.resourcemanager.azurestackhci.models.Offer; +import com.azure.resourcemanager.azurestackhci.models.SkuMappings; +import java.util.Collections; +import java.util.List; + +public final class OfferImpl implements Offer { + private OfferInner innerObject; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + OfferImpl(OfferInner innerObject, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public String publisherId() { + return this.innerModel().publisherId(); + } + + public String content() { + return this.innerModel().content(); + } + + public String contentVersion() { + return this.innerModel().contentVersion(); + } + + public List skuMappings() { + List inner = this.innerModel().skuMappings(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public OfferInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OffersClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OffersClientImpl.java new file mode 100644 index 0000000000000..1da3135f59c4b --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OffersClientImpl.java @@ -0,0 +1,913 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.azurestackhci.fluent.OffersClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.OfferInner; +import com.azure.resourcemanager.azurestackhci.models.OfferList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in OffersClient. */ +public final class OffersClientImpl implements OffersClient { + /** The proxy service used to perform REST calls. */ + private final OffersService service; + + /** The service client containing this operation class. */ + private final AzureStackHciClientImpl client; + + /** + * Initializes an instance of OffersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OffersClientImpl(AzureStackHciClientImpl client) { + this.service = RestProxy.create(OffersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureStackHciClientOffers to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureStackHciClientO") + public interface OffersService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/publishers/{publisherName}/offers") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByPublisher( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("publisherName") String publisherName, + @QueryParam("api-version") String apiVersion, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/offers") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByCluster( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/publishers/{publisherName}/offers/{offerName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("publisherName") String publisherName, + @PathParam("offerName") String offerName, + @QueryParam("api-version") String apiVersion, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByPublisherNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByClusterNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List Offers available for a publisher within the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Offer proxy resources for the HCI cluster along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPublisherSinglePageAsync( + String resourceGroupName, String clusterName, String publisherName, String expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByPublisher( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + publisherName, + this.client.getApiVersion(), + expand, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Offers available for a publisher within the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Offer proxy resources for the HCI cluster along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPublisherSinglePageAsync( + String resourceGroupName, String clusterName, String publisherName, String expand, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByPublisher( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + publisherName, + this.client.getApiVersion(), + expand, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List Offers available for a publisher within the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Offer proxy resources for the HCI cluster as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByPublisherAsync( + String resourceGroupName, String clusterName, String publisherName, String expand) { + return new PagedFlux<>( + () -> listByPublisherSinglePageAsync(resourceGroupName, clusterName, publisherName, expand), + nextLink -> listByPublisherNextSinglePageAsync(nextLink)); + } + + /** + * List Offers available for a publisher within the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Offer proxy resources for the HCI cluster as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByPublisherAsync( + String resourceGroupName, String clusterName, String publisherName) { + final String expand = null; + return new PagedFlux<>( + () -> listByPublisherSinglePageAsync(resourceGroupName, clusterName, publisherName, expand), + nextLink -> listByPublisherNextSinglePageAsync(nextLink)); + } + + /** + * List Offers available for a publisher within the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Offer proxy resources for the HCI cluster as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByPublisherAsync( + String resourceGroupName, String clusterName, String publisherName, String expand, Context context) { + return new PagedFlux<>( + () -> listByPublisherSinglePageAsync(resourceGroupName, clusterName, publisherName, expand, context), + nextLink -> listByPublisherNextSinglePageAsync(nextLink, context)); + } + + /** + * List Offers available for a publisher within the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Offer proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByPublisher( + String resourceGroupName, String clusterName, String publisherName) { + final String expand = null; + return new PagedIterable<>(listByPublisherAsync(resourceGroupName, clusterName, publisherName, expand)); + } + + /** + * List Offers available for a publisher within the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Offer proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByPublisher( + String resourceGroupName, String clusterName, String publisherName, String expand, Context context) { + return new PagedIterable<>( + listByPublisherAsync(resourceGroupName, clusterName, publisherName, expand, context)); + } + + /** + * List Offers available across publishers for the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Offer proxy resources for the HCI cluster along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByClusterSinglePageAsync( + String resourceGroupName, String clusterName, String expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByCluster( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + expand, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Offers available across publishers for the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Offer proxy resources for the HCI cluster along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByClusterSinglePageAsync( + String resourceGroupName, String clusterName, String expand, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByCluster( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + expand, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List Offers available across publishers for the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Offer proxy resources for the HCI cluster as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByClusterAsync(String resourceGroupName, String clusterName, String expand) { + return new PagedFlux<>( + () -> listByClusterSinglePageAsync(resourceGroupName, clusterName, expand), + nextLink -> listByClusterNextSinglePageAsync(nextLink)); + } + + /** + * List Offers available across publishers for the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Offer proxy resources for the HCI cluster as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByClusterAsync(String resourceGroupName, String clusterName) { + final String expand = null; + return new PagedFlux<>( + () -> listByClusterSinglePageAsync(resourceGroupName, clusterName, expand), + nextLink -> listByClusterNextSinglePageAsync(nextLink)); + } + + /** + * List Offers available across publishers for the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Offer proxy resources for the HCI cluster as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByClusterAsync( + String resourceGroupName, String clusterName, String expand, Context context) { + return new PagedFlux<>( + () -> listByClusterSinglePageAsync(resourceGroupName, clusterName, expand, context), + nextLink -> listByClusterNextSinglePageAsync(nextLink, context)); + } + + /** + * List Offers available across publishers for the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Offer proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByCluster(String resourceGroupName, String clusterName) { + final String expand = null; + return new PagedIterable<>(listByClusterAsync(resourceGroupName, clusterName, expand)); + } + + /** + * List Offers available across publishers for the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Offer proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByCluster( + String resourceGroupName, String clusterName, String expand, Context context) { + return new PagedIterable<>(listByClusterAsync(resourceGroupName, clusterName, expand, context)); + } + + /** + * Get Offer resource details within a publisher of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return offer resource details within a publisher of HCI Cluster along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String clusterName, String publisherName, String offerName, String expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (offerName == null) { + return Mono.error(new IllegalArgumentException("Parameter offerName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + publisherName, + offerName, + this.client.getApiVersion(), + expand, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get Offer resource details within a publisher of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return offer resource details within a publisher of HCI Cluster along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String clusterName, + String publisherName, + String offerName, + String expand, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (offerName == null) { + return Mono.error(new IllegalArgumentException("Parameter offerName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + publisherName, + offerName, + this.client.getApiVersion(), + expand, + accept, + context); + } + + /** + * Get Offer resource details within a publisher of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return offer resource details within a publisher of HCI Cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String clusterName, String publisherName, String offerName) { + final String expand = null; + return getWithResponseAsync(resourceGroupName, clusterName, publisherName, offerName, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get Offer resource details within a publisher of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return offer resource details within a publisher of HCI Cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String clusterName, + String publisherName, + String offerName, + String expand, + Context context) { + return getWithResponseAsync(resourceGroupName, clusterName, publisherName, offerName, expand, context).block(); + } + + /** + * Get Offer resource details within a publisher of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return offer resource details within a publisher of HCI Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OfferInner get(String resourceGroupName, String clusterName, String publisherName, String offerName) { + final String expand = null; + return getWithResponse(resourceGroupName, clusterName, publisherName, offerName, expand, Context.NONE) + .getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Offer proxy resources for the HCI cluster along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPublisherNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByPublisherNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Offer proxy resources for the HCI cluster along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPublisherNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByPublisherNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Offer proxy resources for the HCI cluster along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByClusterNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByClusterNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Offer proxy resources for the HCI cluster along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByClusterNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByClusterNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OffersImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OffersImpl.java new file mode 100644 index 0000000000000..fdb94afa2aada --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OffersImpl.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.azurestackhci.fluent.OffersClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.OfferInner; +import com.azure.resourcemanager.azurestackhci.models.Offer; +import com.azure.resourcemanager.azurestackhci.models.Offers; + +public final class OffersImpl implements Offers { + private static final ClientLogger LOGGER = new ClientLogger(OffersImpl.class); + + private final OffersClient innerClient; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + public OffersImpl( + OffersClient innerClient, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByPublisher(String resourceGroupName, String clusterName, String publisherName) { + PagedIterable inner = + this.serviceClient().listByPublisher(resourceGroupName, clusterName, publisherName); + return Utils.mapPage(inner, inner1 -> new OfferImpl(inner1, this.manager())); + } + + public PagedIterable listByPublisher( + String resourceGroupName, String clusterName, String publisherName, String expand, Context context) { + PagedIterable inner = + this.serviceClient().listByPublisher(resourceGroupName, clusterName, publisherName, expand, context); + return Utils.mapPage(inner, inner1 -> new OfferImpl(inner1, this.manager())); + } + + public PagedIterable listByCluster(String resourceGroupName, String clusterName) { + PagedIterable inner = this.serviceClient().listByCluster(resourceGroupName, clusterName); + return Utils.mapPage(inner, inner1 -> new OfferImpl(inner1, this.manager())); + } + + public PagedIterable listByCluster( + String resourceGroupName, String clusterName, String expand, Context context) { + PagedIterable inner = + this.serviceClient().listByCluster(resourceGroupName, clusterName, expand, context); + return Utils.mapPage(inner, inner1 -> new OfferImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceGroupName, + String clusterName, + String publisherName, + String offerName, + String expand, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, clusterName, publisherName, offerName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new OfferImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Offer get(String resourceGroupName, String clusterName, String publisherName, String offerName) { + OfferInner inner = this.serviceClient().get(resourceGroupName, clusterName, publisherName, offerName); + if (inner != null) { + return new OfferImpl(inner, this.manager()); + } else { + return null; + } + } + + private OffersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OperationsClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OperationsClientImpl.java index 1e22db58c5969..96802f4b47fd5 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 @@ -49,7 +49,7 @@ public final class OperationsClientImpl implements OperationsClient { */ @Host("{$host}") @ServiceInterface(name = "AzureStackHciClientO") - private interface OperationsService { + public interface OperationsService { @Headers({"Content-Type: application/json"}) @Get("/providers/Microsoft.AzureStackHCI/operations") @ExpectedResponses({200}) @@ -123,26 +123,26 @@ private Mono listAsync() { /** * List all available Microsoft.AzureStackHCI provider operations. * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public OperationListResultInner list() { - return listAsync().block(); + public Response listWithResponse(Context context) { + return listWithResponseAsync(context).block(); } /** * List all available Microsoft.AzureStackHCI provider operations. * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider along with {@link Response}. + * @return a list of REST API operations supported by an Azure Resource Provider. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse(Context context) { - return listWithResponseAsync(context).block(); + public OperationListResultInner list() { + return listWithResponse(Context.NONE).getValue(); } } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OperationsImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OperationsImpl.java index 9a5400b784a4d..6ffcd8432998c 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OperationsImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/OperationsImpl.java @@ -26,15 +26,6 @@ public OperationsImpl( this.serviceManager = serviceManager; } - public OperationListResult list() { - OperationListResultInner inner = this.serviceClient().list(); - if (inner != null) { - return new OperationListResultImpl(inner, this.manager()); - } else { - return null; - } - } - public Response listWithResponse(Context context) { Response inner = this.serviceClient().listWithResponse(context); if (inner != null) { @@ -48,6 +39,15 @@ public Response listWithResponse(Context context) { } } + public OperationListResult list() { + OperationListResultInner inner = this.serviceClient().list(); + if (inner != null) { + return new OperationListResultImpl(inner, this.manager()); + } else { + return null; + } + } + private OperationsClient serviceClient() { return this.innerClient; } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/PublisherImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/PublisherImpl.java new file mode 100644 index 0000000000000..7267b2bfb7356 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/PublisherImpl.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.azurestackhci.fluent.models.PublisherInner; +import com.azure.resourcemanager.azurestackhci.models.Publisher; + +public final class PublisherImpl implements Publisher { + private PublisherInner innerObject; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + PublisherImpl( + PublisherInner innerObject, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public PublisherInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/PublishersClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/PublishersClientImpl.java new file mode 100644 index 0000000000000..e02a10c2a9aa8 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/PublishersClientImpl.java @@ -0,0 +1,511 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.azurestackhci.fluent.PublishersClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.PublisherInner; +import com.azure.resourcemanager.azurestackhci.models.PublisherList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PublishersClient. */ +public final class PublishersClientImpl implements PublishersClient { + /** The proxy service used to perform REST calls. */ + private final PublishersService service; + + /** The service client containing this operation class. */ + private final AzureStackHciClientImpl client; + + /** + * Initializes an instance of PublishersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PublishersClientImpl(AzureStackHciClientImpl client) { + this.service = + RestProxy.create(PublishersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureStackHciClientPublishers to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureStackHciClientP") + public interface PublishersService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/publishers") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByCluster( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/publishers/{publisherName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("publisherName") String publisherName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByClusterNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List Publishers available for the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Publisher proxy resources for the HCI cluster along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByClusterSinglePageAsync( + String resourceGroupName, String clusterName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByCluster( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Publishers available for the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Publisher proxy resources for the HCI cluster along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByClusterSinglePageAsync( + String resourceGroupName, String clusterName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByCluster( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List Publishers available for the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Publisher proxy resources for the HCI cluster as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByClusterAsync(String resourceGroupName, String clusterName) { + return new PagedFlux<>( + () -> listByClusterSinglePageAsync(resourceGroupName, clusterName), + nextLink -> listByClusterNextSinglePageAsync(nextLink)); + } + + /** + * List Publishers available for the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Publisher proxy resources for the HCI cluster as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByClusterAsync( + String resourceGroupName, String clusterName, Context context) { + return new PagedFlux<>( + () -> listByClusterSinglePageAsync(resourceGroupName, clusterName, context), + nextLink -> listByClusterNextSinglePageAsync(nextLink, context)); + } + + /** + * List Publishers available for the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Publisher proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByCluster(String resourceGroupName, String clusterName) { + return new PagedIterable<>(listByClusterAsync(resourceGroupName, clusterName)); + } + + /** + * List Publishers available for the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Publisher proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByCluster(String resourceGroupName, String clusterName, Context context) { + return new PagedIterable<>(listByClusterAsync(resourceGroupName, clusterName, context)); + } + + /** + * Get Publisher resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher resource details of HCI Cluster along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String clusterName, String publisherName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + publisherName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get Publisher resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher resource details of HCI Cluster along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String clusterName, String publisherName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + publisherName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get Publisher resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher resource details of HCI Cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String clusterName, String publisherName) { + return getWithResponseAsync(resourceGroupName, clusterName, publisherName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get Publisher resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher resource details of HCI Cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String clusterName, String publisherName, Context context) { + return getWithResponseAsync(resourceGroupName, clusterName, publisherName, context).block(); + } + + /** + * Get Publisher resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher resource details of HCI Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PublisherInner get(String resourceGroupName, String clusterName, String publisherName) { + return getWithResponse(resourceGroupName, clusterName, publisherName, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Publisher proxy resources for the HCI cluster along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByClusterNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByClusterNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Publisher proxy resources for the HCI cluster along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByClusterNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByClusterNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/PublishersImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/PublishersImpl.java new file mode 100644 index 0000000000000..0c57da8ee8047 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/PublishersImpl.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.azurestackhci.fluent.PublishersClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.PublisherInner; +import com.azure.resourcemanager.azurestackhci.models.Publisher; +import com.azure.resourcemanager.azurestackhci.models.Publishers; + +public final class PublishersImpl implements Publishers { + private static final ClientLogger LOGGER = new ClientLogger(PublishersImpl.class); + + private final PublishersClient innerClient; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + public PublishersImpl( + PublishersClient innerClient, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByCluster(String resourceGroupName, String clusterName) { + PagedIterable inner = this.serviceClient().listByCluster(resourceGroupName, clusterName); + return Utils.mapPage(inner, inner1 -> new PublisherImpl(inner1, this.manager())); + } + + public PagedIterable listByCluster(String resourceGroupName, String clusterName, Context context) { + PagedIterable inner = + this.serviceClient().listByCluster(resourceGroupName, clusterName, context); + return Utils.mapPage(inner, inner1 -> new PublisherImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceGroupName, String clusterName, String publisherName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, clusterName, publisherName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PublisherImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Publisher get(String resourceGroupName, String clusterName, String publisherName) { + PublisherInner inner = this.serviceClient().get(resourceGroupName, clusterName, publisherName); + if (inner != null) { + return new PublisherImpl(inner, this.manager()); + } else { + return null; + } + } + + private PublishersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/SkuImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/SkuImpl.java new file mode 100644 index 0000000000000..8a2673751d6ff --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/SkuImpl.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.azurestackhci.fluent.models.SkuInner; +import com.azure.resourcemanager.azurestackhci.models.Sku; +import com.azure.resourcemanager.azurestackhci.models.SkuMappings; +import java.util.Collections; +import java.util.List; + +public final class SkuImpl implements Sku { + private SkuInner innerObject; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + SkuImpl(SkuInner innerObject, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public String publisherId() { + return this.innerModel().publisherId(); + } + + public String offerId() { + return this.innerModel().offerId(); + } + + public String content() { + return this.innerModel().content(); + } + + public String contentVersion() { + return this.innerModel().contentVersion(); + } + + public List skuMappings() { + List inner = this.innerModel().skuMappings(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public SkuInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/SkusClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/SkusClientImpl.java new file mode 100644 index 0000000000000..6e69720cf6442 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/SkusClientImpl.java @@ -0,0 +1,654 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.azurestackhci.fluent.SkusClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.SkuInner; +import com.azure.resourcemanager.azurestackhci.models.SkuList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SkusClient. */ +public final class SkusClientImpl implements SkusClient { + /** The proxy service used to perform REST calls. */ + private final SkusService service; + + /** The service client containing this operation class. */ + private final AzureStackHciClientImpl client; + + /** + * Initializes an instance of SkusClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SkusClientImpl(AzureStackHciClientImpl client) { + this.service = RestProxy.create(SkusService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureStackHciClientSkus to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureStackHciClientS") + public interface SkusService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/publishers/{publisherName}/offers/{offerName}/skus") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByOffer( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("publisherName") String publisherName, + @PathParam("offerName") String offerName, + @QueryParam("api-version") String apiVersion, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/publishers/{publisherName}/offers/{offerName}/skus/{skuName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("publisherName") String publisherName, + @PathParam("offerName") String offerName, + @PathParam("skuName") String skuName, + @QueryParam("api-version") String apiVersion, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByOfferNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List Skus available for a offer within the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SKU proxy resources for the HCI cluster along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByOfferSinglePageAsync( + String resourceGroupName, String clusterName, String publisherName, String offerName, String expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (offerName == null) { + return Mono.error(new IllegalArgumentException("Parameter offerName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByOffer( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + publisherName, + offerName, + this.client.getApiVersion(), + expand, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Skus available for a offer within the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SKU proxy resources for the HCI cluster along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByOfferSinglePageAsync( + String resourceGroupName, + String clusterName, + String publisherName, + String offerName, + String expand, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (offerName == null) { + return Mono.error(new IllegalArgumentException("Parameter offerName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByOffer( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + publisherName, + offerName, + this.client.getApiVersion(), + expand, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List Skus available for a offer within the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SKU proxy resources for the HCI cluster as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByOfferAsync( + String resourceGroupName, String clusterName, String publisherName, String offerName, String expand) { + return new PagedFlux<>( + () -> listByOfferSinglePageAsync(resourceGroupName, clusterName, publisherName, offerName, expand), + nextLink -> listByOfferNextSinglePageAsync(nextLink)); + } + + /** + * List Skus available for a offer within the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SKU proxy resources for the HCI cluster as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByOfferAsync( + String resourceGroupName, String clusterName, String publisherName, String offerName) { + final String expand = null; + return new PagedFlux<>( + () -> listByOfferSinglePageAsync(resourceGroupName, clusterName, publisherName, offerName, expand), + nextLink -> listByOfferNextSinglePageAsync(nextLink)); + } + + /** + * List Skus available for a offer within the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SKU proxy resources for the HCI cluster as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByOfferAsync( + String resourceGroupName, + String clusterName, + String publisherName, + String offerName, + String expand, + Context context) { + return new PagedFlux<>( + () -> listByOfferSinglePageAsync(resourceGroupName, clusterName, publisherName, offerName, expand, context), + nextLink -> listByOfferNextSinglePageAsync(nextLink, context)); + } + + /** + * List Skus available for a offer within the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SKU proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByOffer( + String resourceGroupName, String clusterName, String publisherName, String offerName) { + final String expand = null; + return new PagedIterable<>(listByOfferAsync(resourceGroupName, clusterName, publisherName, offerName, expand)); + } + + /** + * List Skus available for a offer within the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SKU proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByOffer( + String resourceGroupName, + String clusterName, + String publisherName, + String offerName, + String expand, + Context context) { + return new PagedIterable<>( + listByOfferAsync(resourceGroupName, clusterName, publisherName, offerName, expand, context)); + } + + /** + * Get SKU resource details within a offer of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @param skuName The name of the SKU available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sKU resource details within a offer of HCI Cluster along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String clusterName, + String publisherName, + String offerName, + String skuName, + String expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (offerName == null) { + return Mono.error(new IllegalArgumentException("Parameter offerName is required and cannot be null.")); + } + if (skuName == null) { + return Mono.error(new IllegalArgumentException("Parameter skuName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + publisherName, + offerName, + skuName, + this.client.getApiVersion(), + expand, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get SKU resource details within a offer of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @param skuName The name of the SKU available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sKU resource details within a offer of HCI Cluster along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String clusterName, + String publisherName, + String offerName, + String skuName, + String expand, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (publisherName == null) { + return Mono.error(new IllegalArgumentException("Parameter publisherName is required and cannot be null.")); + } + if (offerName == null) { + return Mono.error(new IllegalArgumentException("Parameter offerName is required and cannot be null.")); + } + if (skuName == null) { + return Mono.error(new IllegalArgumentException("Parameter skuName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + publisherName, + offerName, + skuName, + this.client.getApiVersion(), + expand, + accept, + context); + } + + /** + * Get SKU resource details within a offer of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @param skuName The name of the SKU available within HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sKU resource details within a offer of HCI Cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String clusterName, String publisherName, String offerName, String skuName) { + final String expand = null; + return getWithResponseAsync(resourceGroupName, clusterName, publisherName, offerName, skuName, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get SKU resource details within a offer of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @param skuName The name of the SKU available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sKU resource details within a offer of HCI Cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String clusterName, + String publisherName, + String offerName, + String skuName, + String expand, + Context context) { + return getWithResponseAsync(resourceGroupName, clusterName, publisherName, offerName, skuName, expand, context) + .block(); + } + + /** + * Get SKU resource details within a offer of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @param skuName The name of the SKU available within HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sKU resource details within a offer of HCI Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SkuInner get( + String resourceGroupName, String clusterName, String publisherName, String offerName, String skuName) { + final String expand = null; + return getWithResponse(resourceGroupName, clusterName, publisherName, offerName, skuName, expand, Context.NONE) + .getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SKU proxy resources for the HCI cluster along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByOfferNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByOfferNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SKU proxy resources for the HCI cluster along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByOfferNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByOfferNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/SkusImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/SkusImpl.java new file mode 100644 index 0000000000000..af1432e043037 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/SkusImpl.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.azurestackhci.fluent.SkusClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.SkuInner; +import com.azure.resourcemanager.azurestackhci.models.Sku; +import com.azure.resourcemanager.azurestackhci.models.Skus; + +public final class SkusImpl implements Skus { + private static final ClientLogger LOGGER = new ClientLogger(SkusImpl.class); + + private final SkusClient innerClient; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + public SkusImpl( + SkusClient innerClient, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByOffer( + String resourceGroupName, String clusterName, String publisherName, String offerName) { + PagedIterable inner = + this.serviceClient().listByOffer(resourceGroupName, clusterName, publisherName, offerName); + return Utils.mapPage(inner, inner1 -> new SkuImpl(inner1, this.manager())); + } + + public PagedIterable listByOffer( + String resourceGroupName, + String clusterName, + String publisherName, + String offerName, + String expand, + Context context) { + PagedIterable inner = + this.serviceClient().listByOffer(resourceGroupName, clusterName, publisherName, offerName, expand, context); + return Utils.mapPage(inner, inner1 -> new SkuImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceGroupName, + String clusterName, + String publisherName, + String offerName, + String skuName, + String expand, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, clusterName, publisherName, offerName, skuName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SkuImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Sku get( + String resourceGroupName, String clusterName, String publisherName, String offerName, String skuName) { + SkuInner inner = this.serviceClient().get(resourceGroupName, clusterName, publisherName, offerName, skuName); + if (inner != null) { + return new SkuImpl(inner, this.manager()); + } else { + return null; + } + } + + private SkusClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateRunImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateRunImpl.java new file mode 100644 index 0000000000000..bebe89c1bc114 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateRunImpl.java @@ -0,0 +1,287 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.fluent.models.Step; +import com.azure.resourcemanager.azurestackhci.fluent.models.UpdateRunInner; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; +import com.azure.resourcemanager.azurestackhci.models.UpdateRun; +import com.azure.resourcemanager.azurestackhci.models.UpdateRunPropertiesState; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class UpdateRunImpl implements UpdateRun, UpdateRun.Definition, UpdateRun.Update { + private UpdateRunInner innerObject; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public OffsetDateTime timeStarted() { + return this.innerModel().timeStarted(); + } + + public OffsetDateTime lastUpdatedTime() { + return this.innerModel().lastUpdatedTime(); + } + + public String duration() { + return this.innerModel().duration(); + } + + public UpdateRunPropertiesState state() { + return this.innerModel().state(); + } + + public String namePropertiesName() { + return this.innerModel().namePropertiesName(); + } + + public String description() { + return this.innerModel().description(); + } + + public String errorMessage() { + return this.innerModel().errorMessage(); + } + + public String status() { + return this.innerModel().status(); + } + + public OffsetDateTime startTimeUtc() { + return this.innerModel().startTimeUtc(); + } + + public OffsetDateTime endTimeUtc() { + return this.innerModel().endTimeUtc(); + } + + public OffsetDateTime lastUpdatedTimeUtc() { + return this.innerModel().lastUpdatedTimeUtc(); + } + + public List steps() { + List inner = this.innerModel().steps(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public UpdateRunInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String clusterName; + + private String updateName; + + private String updateRunName; + + public UpdateRunImpl withExistingUpdate(String resourceGroupName, String clusterName, String updateName) { + this.resourceGroupName = resourceGroupName; + this.clusterName = clusterName; + this.updateName = updateName; + return this; + } + + public UpdateRun create() { + this.innerObject = + serviceManager + .serviceClient() + .getUpdateRuns() + .putWithResponse( + resourceGroupName, clusterName, updateName, updateRunName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public UpdateRun create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getUpdateRuns() + .putWithResponse(resourceGroupName, clusterName, updateName, updateRunName, this.innerModel(), context) + .getValue(); + return this; + } + + UpdateRunImpl(String name, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = new UpdateRunInner(); + this.serviceManager = serviceManager; + this.updateRunName = name; + } + + public UpdateRunImpl update() { + return this; + } + + public UpdateRun apply() { + this.innerObject = + serviceManager + .serviceClient() + .getUpdateRuns() + .putWithResponse( + resourceGroupName, clusterName, updateName, updateRunName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public UpdateRun apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getUpdateRuns() + .putWithResponse(resourceGroupName, clusterName, updateName, updateRunName, this.innerModel(), context) + .getValue(); + return this; + } + + UpdateRunImpl( + UpdateRunInner innerObject, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.clusterName = Utils.getValueFromIdByName(innerObject.id(), "clusters"); + this.updateName = Utils.getValueFromIdByName(innerObject.id(), "updates"); + this.updateRunName = Utils.getValueFromIdByName(innerObject.id(), "updateRuns"); + } + + public UpdateRun refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getUpdateRuns() + .getWithResponse(resourceGroupName, clusterName, updateName, updateRunName, Context.NONE) + .getValue(); + return this; + } + + public UpdateRun refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getUpdateRuns() + .getWithResponse(resourceGroupName, clusterName, updateName, updateRunName, context) + .getValue(); + return this; + } + + public UpdateRunImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public UpdateRunImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public UpdateRunImpl withTimeStarted(OffsetDateTime timeStarted) { + this.innerModel().withTimeStarted(timeStarted); + return this; + } + + public UpdateRunImpl withLastUpdatedTime(OffsetDateTime lastUpdatedTime) { + this.innerModel().withLastUpdatedTime(lastUpdatedTime); + return this; + } + + public UpdateRunImpl withDuration(String duration) { + this.innerModel().withDuration(duration); + return this; + } + + public UpdateRunImpl withState(UpdateRunPropertiesState state) { + this.innerModel().withState(state); + return this; + } + + public UpdateRunImpl withNamePropertiesName(String namePropertiesName) { + this.innerModel().withNamePropertiesName(namePropertiesName); + return this; + } + + public UpdateRunImpl withDescription(String description) { + this.innerModel().withDescription(description); + return this; + } + + public UpdateRunImpl withErrorMessage(String errorMessage) { + this.innerModel().withErrorMessage(errorMessage); + return this; + } + + public UpdateRunImpl withStatus(String status) { + this.innerModel().withStatus(status); + return this; + } + + public UpdateRunImpl withStartTimeUtc(OffsetDateTime startTimeUtc) { + this.innerModel().withStartTimeUtc(startTimeUtc); + return this; + } + + public UpdateRunImpl withEndTimeUtc(OffsetDateTime endTimeUtc) { + this.innerModel().withEndTimeUtc(endTimeUtc); + return this; + } + + public UpdateRunImpl withLastUpdatedTimeUtc(OffsetDateTime lastUpdatedTimeUtc) { + this.innerModel().withLastUpdatedTimeUtc(lastUpdatedTimeUtc); + return this; + } + + public UpdateRunImpl withSteps(List steps) { + this.innerModel().withSteps(steps); + return this; + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateRunsClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateRunsClientImpl.java new file mode 100644 index 0000000000000..0bd3652704c88 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateRunsClientImpl.java @@ -0,0 +1,1069 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.azurestackhci.fluent.UpdateRunsClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.UpdateRunInner; +import com.azure.resourcemanager.azurestackhci.models.UpdateRunList; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in UpdateRunsClient. */ +public final class UpdateRunsClientImpl implements UpdateRunsClient { + /** The proxy service used to perform REST calls. */ + private final UpdateRunsService service; + + /** The service client containing this operation class. */ + private final AzureStackHciClientImpl client; + + /** + * Initializes an instance of UpdateRunsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + UpdateRunsClientImpl(AzureStackHciClientImpl client) { + this.service = + RestProxy.create(UpdateRunsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureStackHciClientUpdateRuns to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureStackHciClientU") + public interface UpdateRunsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates/{updateName}/updateRuns") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("updateName") String updateName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates/{updateName}/updateRuns/{updateRunName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("updateName") String updateName, + @PathParam("updateRunName") String updateRunName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates/{updateName}/updateRuns/{updateRunName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> put( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("updateName") String updateName, + @PathParam("updateRunName") String updateRunName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") UpdateRunInner updateRunsProperties, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates/{updateName}/updateRuns/{updateRunName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("updateName") String updateName, + @PathParam("updateRunName") String updateRunName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List all Update runs for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Update runs along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String clusterName, String updateName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (updateName == null) { + return Mono.error(new IllegalArgumentException("Parameter updateName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + updateName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all Update runs for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Update runs along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String clusterName, String updateName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (updateName == null) { + return Mono.error(new IllegalArgumentException("Parameter updateName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + updateName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List all Update runs for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Update runs as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String clusterName, String updateName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, clusterName, updateName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List all Update runs for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Update runs as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String clusterName, String updateName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, clusterName, updateName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List all Update runs for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Update runs as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String clusterName, String updateName) { + return new PagedIterable<>(listAsync(resourceGroupName, clusterName, updateName)); + } + + /** + * List all Update runs for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Update runs as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String clusterName, String updateName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, clusterName, updateName, context)); + } + + /** + * Delete specified Update Run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String clusterName, String updateName, String updateRunName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (updateName == null) { + return Mono.error(new IllegalArgumentException("Parameter updateName is required and cannot be null.")); + } + if (updateRunName == null) { + return Mono.error(new IllegalArgumentException("Parameter updateRunName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + updateName, + updateRunName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete specified Update Run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String clusterName, String updateName, String updateRunName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (updateName == null) { + return Mono.error(new IllegalArgumentException("Parameter updateName is required and cannot be null.")); + } + if (updateRunName == null) { + return Mono.error(new IllegalArgumentException("Parameter updateRunName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + updateName, + updateRunName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Delete specified Update Run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String clusterName, String updateName, String updateRunName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, clusterName, updateName, updateRunName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete specified Update Run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String clusterName, String updateName, String updateRunName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, clusterName, updateName, updateRunName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete specified Update Run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String clusterName, String updateName, String updateRunName) { + return this.beginDeleteAsync(resourceGroupName, clusterName, updateName, updateRunName).getSyncPoller(); + } + + /** + * Delete specified Update Run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String clusterName, String updateName, String updateRunName, Context context) { + return this + .beginDeleteAsync(resourceGroupName, clusterName, updateName, updateRunName, context) + .getSyncPoller(); + } + + /** + * Delete specified Update Run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String clusterName, String updateName, String updateRunName) { + return beginDeleteAsync(resourceGroupName, clusterName, updateName, updateRunName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete specified Update Run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String clusterName, String updateName, String updateRunName, Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, updateName, updateRunName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete specified Update Run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String clusterName, String updateName, String updateRunName) { + deleteAsync(resourceGroupName, clusterName, updateName, updateRunName).block(); + } + + /** + * Delete specified Update Run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, String clusterName, String updateName, String updateRunName, Context context) { + deleteAsync(resourceGroupName, clusterName, updateName, updateRunName, context).block(); + } + + /** + * Put Update runs for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @param updateRunsProperties Properties of the updateRuns object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of an Update run along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> putWithResponseAsync( + String resourceGroupName, + String clusterName, + String updateName, + String updateRunName, + UpdateRunInner updateRunsProperties) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (updateName == null) { + return Mono.error(new IllegalArgumentException("Parameter updateName is required and cannot be null.")); + } + if (updateRunName == null) { + return Mono.error(new IllegalArgumentException("Parameter updateRunName is required and cannot be null.")); + } + if (updateRunsProperties == null) { + return Mono + .error(new IllegalArgumentException("Parameter updateRunsProperties is required and cannot be null.")); + } else { + updateRunsProperties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .put( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + updateName, + updateRunName, + this.client.getApiVersion(), + updateRunsProperties, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Put Update runs for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @param updateRunsProperties Properties of the updateRuns object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of an Update run along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> putWithResponseAsync( + String resourceGroupName, + String clusterName, + String updateName, + String updateRunName, + UpdateRunInner updateRunsProperties, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (updateName == null) { + return Mono.error(new IllegalArgumentException("Parameter updateName is required and cannot be null.")); + } + if (updateRunName == null) { + return Mono.error(new IllegalArgumentException("Parameter updateRunName is required and cannot be null.")); + } + if (updateRunsProperties == null) { + return Mono + .error(new IllegalArgumentException("Parameter updateRunsProperties is required and cannot be null.")); + } else { + updateRunsProperties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .put( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + updateName, + updateRunName, + this.client.getApiVersion(), + updateRunsProperties, + accept, + context); + } + + /** + * Put Update runs for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @param updateRunsProperties Properties of the updateRuns object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of an Update run on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono putAsync( + String resourceGroupName, + String clusterName, + String updateName, + String updateRunName, + UpdateRunInner updateRunsProperties) { + return putWithResponseAsync(resourceGroupName, clusterName, updateName, updateRunName, updateRunsProperties) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Put Update runs for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @param updateRunsProperties Properties of the updateRuns object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of an Update run along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse( + String resourceGroupName, + String clusterName, + String updateName, + String updateRunName, + UpdateRunInner updateRunsProperties, + Context context) { + return putWithResponseAsync( + resourceGroupName, clusterName, updateName, updateRunName, updateRunsProperties, context) + .block(); + } + + /** + * Put Update runs for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @param updateRunsProperties Properties of the updateRuns object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of an Update run. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public UpdateRunInner put( + String resourceGroupName, + String clusterName, + String updateName, + String updateRunName, + UpdateRunInner updateRunsProperties) { + return putWithResponse( + resourceGroupName, clusterName, updateName, updateRunName, updateRunsProperties, Context.NONE) + .getValue(); + } + + /** + * Get the Update run for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Update run for a specified update along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String clusterName, String updateName, String updateRunName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (updateName == null) { + return Mono.error(new IllegalArgumentException("Parameter updateName is required and cannot be null.")); + } + if (updateRunName == null) { + return Mono.error(new IllegalArgumentException("Parameter updateRunName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + updateName, + updateRunName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the Update run for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Update run for a specified update along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String clusterName, String updateName, String updateRunName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (updateName == null) { + return Mono.error(new IllegalArgumentException("Parameter updateName is required and cannot be null.")); + } + if (updateRunName == null) { + return Mono.error(new IllegalArgumentException("Parameter updateRunName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + updateName, + updateRunName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get the Update run for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Update run for a specified update on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String clusterName, String updateName, String updateRunName) { + return getWithResponseAsync(resourceGroupName, clusterName, updateName, updateRunName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the Update run for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Update run for a specified update along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String clusterName, String updateName, String updateRunName, Context context) { + return getWithResponseAsync(resourceGroupName, clusterName, updateName, updateRunName, context).block(); + } + + /** + * Get the Update run for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Update run for a specified update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public UpdateRunInner get(String resourceGroupName, String clusterName, String updateName, String updateRunName) { + return getWithResponse(resourceGroupName, clusterName, updateName, updateRunName, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Update runs along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Update runs along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateRunsImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateRunsImpl.java new file mode 100644 index 0000000000000..e7f000599f3ca --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateRunsImpl.java @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.azurestackhci.fluent.UpdateRunsClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.UpdateRunInner; +import com.azure.resourcemanager.azurestackhci.models.UpdateRun; +import com.azure.resourcemanager.azurestackhci.models.UpdateRuns; + +public final class UpdateRunsImpl implements UpdateRuns { + private static final ClientLogger LOGGER = new ClientLogger(UpdateRunsImpl.class); + + private final UpdateRunsClient innerClient; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + public UpdateRunsImpl( + UpdateRunsClient innerClient, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String clusterName, String updateName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, clusterName, updateName); + return Utils.mapPage(inner, inner1 -> new UpdateRunImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String clusterName, String updateName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, clusterName, updateName, context); + return Utils.mapPage(inner, inner1 -> new UpdateRunImpl(inner1, this.manager())); + } + + public void delete(String resourceGroupName, String clusterName, String updateName, String updateRunName) { + this.serviceClient().delete(resourceGroupName, clusterName, updateName, updateRunName); + } + + public void delete( + String resourceGroupName, String clusterName, String updateName, String updateRunName, Context context) { + this.serviceClient().delete(resourceGroupName, clusterName, updateName, updateRunName, context); + } + + public Response getWithResponse( + String resourceGroupName, String clusterName, String updateName, String updateRunName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, clusterName, updateName, updateRunName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new UpdateRunImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public UpdateRun get(String resourceGroupName, String clusterName, String updateName, String updateRunName) { + UpdateRunInner inner = this.serviceClient().get(resourceGroupName, clusterName, updateName, updateRunName); + if (inner != null) { + return new UpdateRunImpl(inner, this.manager()); + } else { + return null; + } + } + + public UpdateRun getById(String id) { + String resourceGroupName = 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 updateName = Utils.getValueFromIdByName(id, "updates"); + if (updateName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'updates'.", id))); + } + String updateRunName = Utils.getValueFromIdByName(id, "updateRuns"); + if (updateRunName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'updateRuns'.", id))); + } + return this.getWithResponse(resourceGroupName, clusterName, updateName, updateRunName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = 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 updateName = Utils.getValueFromIdByName(id, "updates"); + if (updateName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'updates'.", id))); + } + String updateRunName = Utils.getValueFromIdByName(id, "updateRuns"); + if (updateRunName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'updateRuns'.", id))); + } + return this.getWithResponse(resourceGroupName, clusterName, updateName, updateRunName, context); + } + + public void deleteById(String id) { + String resourceGroupName = 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 updateName = Utils.getValueFromIdByName(id, "updates"); + if (updateName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'updates'.", id))); + } + String updateRunName = Utils.getValueFromIdByName(id, "updateRuns"); + if (updateRunName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'updateRuns'.", id))); + } + this.delete(resourceGroupName, clusterName, updateName, updateRunName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = 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 updateName = Utils.getValueFromIdByName(id, "updates"); + if (updateName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'updates'.", id))); + } + String updateRunName = Utils.getValueFromIdByName(id, "updateRuns"); + if (updateRunName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'updateRuns'.", id))); + } + this.delete(resourceGroupName, clusterName, updateName, updateRunName, context); + } + + private UpdateRunsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } + + public UpdateRunImpl define(String name) { + return new UpdateRunImpl(name, this.manager()); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateSummariesImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateSummariesImpl.java new file mode 100644 index 0000000000000..89ac8fb00fe29 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateSummariesImpl.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.azurestackhci.fluent.models.UpdateSummariesInner; +import com.azure.resourcemanager.azurestackhci.models.HealthState; +import com.azure.resourcemanager.azurestackhci.models.PackageVersionInfo; +import com.azure.resourcemanager.azurestackhci.models.PrecheckResult; +import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; +import com.azure.resourcemanager.azurestackhci.models.UpdateSummaries; +import com.azure.resourcemanager.azurestackhci.models.UpdateSummariesPropertiesState; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class UpdateSummariesImpl implements UpdateSummaries { + private UpdateSummariesInner innerObject; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + UpdateSummariesImpl( + UpdateSummariesInner innerObject, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String oemFamily() { + return this.innerModel().oemFamily(); + } + + public String hardwareModel() { + return this.innerModel().hardwareModel(); + } + + public List packageVersions() { + List inner = this.innerModel().packageVersions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String currentVersion() { + return this.innerModel().currentVersion(); + } + + public OffsetDateTime lastUpdated() { + return this.innerModel().lastUpdated(); + } + + public OffsetDateTime lastChecked() { + return this.innerModel().lastChecked(); + } + + public HealthState healthState() { + return this.innerModel().healthState(); + } + + public List healthCheckResult() { + List inner = this.innerModel().healthCheckResult(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public OffsetDateTime healthCheckDate() { + return this.innerModel().healthCheckDate(); + } + + public UpdateSummariesPropertiesState state() { + return this.innerModel().state(); + } + + public UpdateSummariesInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateSummariesOperationsClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateSummariesOperationsClientImpl.java new file mode 100644 index 0000000000000..2da8a2e9e6ab8 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateSummariesOperationsClientImpl.java @@ -0,0 +1,922 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.azurestackhci.fluent.UpdateSummariesOperationsClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.UpdateSummariesInner; +import com.azure.resourcemanager.azurestackhci.models.UpdateSummariesList; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in UpdateSummariesOperationsClient. */ +public final class UpdateSummariesOperationsClientImpl implements UpdateSummariesOperationsClient { + /** The proxy service used to perform REST calls. */ + private final UpdateSummariesOperationsService service; + + /** The service client containing this operation class. */ + private final AzureStackHciClientImpl client; + + /** + * Initializes an instance of UpdateSummariesOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + UpdateSummariesOperationsClientImpl(AzureStackHciClientImpl client) { + this.service = + RestProxy + .create( + UpdateSummariesOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureStackHciClientUpdateSummariesOperations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureStackHciClientU") + public interface UpdateSummariesOperationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updateSummaries") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updateSummaries/default") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updateSummaries/default") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> put( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") UpdateSummariesInner updateLocationProperties, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updateSummaries/default") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List all Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Update Summaries along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String clusterName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Update Summaries along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String clusterName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List all Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Update Summaries as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String clusterName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, clusterName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List all Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Update Summaries as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String clusterName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, clusterName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List all Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Update Summaries as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String clusterName) { + return new PagedIterable<>(listAsync(resourceGroupName, clusterName)); + } + + /** + * List all Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Update Summaries as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String clusterName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, clusterName, context)); + } + + /** + * Delete Update Summaries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete Update Summaries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String clusterName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Delete Update Summaries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete Update Summaries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String clusterName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete Update Summaries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName) { + return this.beginDeleteAsync(resourceGroupName, clusterName).getSyncPoller(); + } + + /** + * Delete Update Summaries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String clusterName, Context context) { + return this.beginDeleteAsync(resourceGroupName, clusterName, context).getSyncPoller(); + } + + /** + * Delete Update Summaries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String clusterName) { + return beginDeleteAsync(resourceGroupName, clusterName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete Update Summaries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String clusterName, Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete Update Summaries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String clusterName) { + deleteAsync(resourceGroupName, clusterName).block(); + } + + /** + * Delete Update Summaries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String clusterName, Context context) { + deleteAsync(resourceGroupName, clusterName, context).block(); + } + + /** + * Put Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateLocationProperties Properties of the UpdateSummaries resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return get the update summaries for the cluster along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> putWithResponseAsync( + String resourceGroupName, String clusterName, UpdateSummariesInner updateLocationProperties) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (updateLocationProperties == null) { + return Mono + .error( + new IllegalArgumentException("Parameter updateLocationProperties is required and cannot be null.")); + } else { + updateLocationProperties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .put( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + updateLocationProperties, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Put Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateLocationProperties Properties of the UpdateSummaries resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return get the update summaries for the cluster along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> putWithResponseAsync( + String resourceGroupName, String clusterName, UpdateSummariesInner updateLocationProperties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (updateLocationProperties == null) { + return Mono + .error( + new IllegalArgumentException("Parameter updateLocationProperties is required and cannot be null.")); + } else { + updateLocationProperties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .put( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + updateLocationProperties, + accept, + context); + } + + /** + * Put Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateLocationProperties Properties of the UpdateSummaries resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return get the update summaries for the cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono putAsync( + String resourceGroupName, String clusterName, UpdateSummariesInner updateLocationProperties) { + return putWithResponseAsync(resourceGroupName, clusterName, updateLocationProperties) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Put Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateLocationProperties Properties of the UpdateSummaries resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return get the update summaries for the cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse( + String resourceGroupName, String clusterName, UpdateSummariesInner updateLocationProperties, Context context) { + return putWithResponseAsync(resourceGroupName, clusterName, updateLocationProperties, context).block(); + } + + /** + * Put Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateLocationProperties Properties of the UpdateSummaries resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return get the update summaries for the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public UpdateSummariesInner put( + String resourceGroupName, String clusterName, UpdateSummariesInner updateLocationProperties) { + return putWithResponse(resourceGroupName, clusterName, updateLocationProperties, Context.NONE).getValue(); + } + + /** + * Get all Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Update summaries under the HCI cluster along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String clusterName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get all Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Update summaries under the HCI cluster along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String clusterName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get all Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Update summaries under the HCI cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String clusterName) { + return getWithResponseAsync(resourceGroupName, clusterName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get all Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Update summaries under the HCI cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String clusterName, Context context) { + return getWithResponseAsync(resourceGroupName, clusterName, context).block(); + } + + /** + * Get all Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Update summaries under the HCI cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public UpdateSummariesInner get(String resourceGroupName, String clusterName) { + return getWithResponse(resourceGroupName, clusterName, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Update Summaries along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Update Summaries along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateSummariesOperationsImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateSummariesOperationsImpl.java new file mode 100644 index 0000000000000..7ab8e7edc1de7 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdateSummariesOperationsImpl.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.azurestackhci.fluent.UpdateSummariesOperationsClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.UpdateSummariesInner; +import com.azure.resourcemanager.azurestackhci.models.UpdateSummaries; +import com.azure.resourcemanager.azurestackhci.models.UpdateSummariesOperations; + +public final class UpdateSummariesOperationsImpl implements UpdateSummariesOperations { + private static final ClientLogger LOGGER = new ClientLogger(UpdateSummariesOperationsImpl.class); + + private final UpdateSummariesOperationsClient innerClient; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + public UpdateSummariesOperationsImpl( + UpdateSummariesOperationsClient innerClient, + com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String clusterName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, clusterName); + return Utils.mapPage(inner, inner1 -> new UpdateSummariesImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String clusterName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, clusterName, context); + return Utils.mapPage(inner, inner1 -> new UpdateSummariesImpl(inner1, this.manager())); + } + + public void deleteByResourceGroup(String resourceGroupName, String clusterName) { + this.serviceClient().delete(resourceGroupName, clusterName); + } + + public void delete(String resourceGroupName, String clusterName, Context context) { + this.serviceClient().delete(resourceGroupName, clusterName, context); + } + + public Response putWithResponse( + String resourceGroupName, String clusterName, UpdateSummariesInner updateLocationProperties, Context context) { + Response inner = + this.serviceClient().putWithResponse(resourceGroupName, clusterName, updateLocationProperties, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new UpdateSummariesImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public UpdateSummaries put( + String resourceGroupName, String clusterName, UpdateSummariesInner updateLocationProperties) { + UpdateSummariesInner inner = this.serviceClient().put(resourceGroupName, clusterName, updateLocationProperties); + if (inner != null) { + return new UpdateSummariesImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse(String resourceGroupName, String clusterName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, clusterName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new UpdateSummariesImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public UpdateSummaries get(String resourceGroupName, String clusterName) { + UpdateSummariesInner inner = this.serviceClient().get(resourceGroupName, clusterName); + if (inner != null) { + return new UpdateSummariesImpl(inner, this.manager()); + } else { + return null; + } + } + + private UpdateSummariesOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdatesClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdatesClientImpl.java new file mode 100644 index 0000000000000..a66ee06c02a1b --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdatesClientImpl.java @@ -0,0 +1,1242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.azurestackhci.fluent.UpdatesClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.HciUpdateInner; +import com.azure.resourcemanager.azurestackhci.models.UpdateList; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in UpdatesClient. */ +public final class UpdatesClientImpl implements UpdatesClient { + /** The proxy service used to perform REST calls. */ + private final UpdatesService service; + + /** The service client containing this operation class. */ + private final AzureStackHciClientImpl client; + + /** + * Initializes an instance of UpdatesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + UpdatesClientImpl(AzureStackHciClientImpl client) { + this.service = RestProxy.create(UpdatesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureStackHciClientUpdates to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureStackHciClientU") + public interface UpdatesService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates/{updateName}/apply") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> post( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("updateName") String updateName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates/{updateName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("updateName") String updateName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates/{updateName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> put( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("updateName") String updateName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") HciUpdateInner updateProperties, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates/{updateName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("updateName") String updateName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Apply Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> postWithResponseAsync( + String resourceGroupName, String clusterName, String updateName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (updateName == null) { + return Mono.error(new IllegalArgumentException("Parameter updateName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .post( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + updateName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Apply Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> postWithResponseAsync( + String resourceGroupName, String clusterName, String updateName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (updateName == null) { + return Mono.error(new IllegalArgumentException("Parameter updateName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .post( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + updateName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Apply Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginPostAsync( + String resourceGroupName, String clusterName, String updateName) { + Mono>> mono = postWithResponseAsync(resourceGroupName, clusterName, updateName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Apply Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginPostAsync( + String resourceGroupName, String clusterName, String updateName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + postWithResponseAsync(resourceGroupName, clusterName, updateName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Apply Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginPost( + String resourceGroupName, String clusterName, String updateName) { + return this.beginPostAsync(resourceGroupName, clusterName, updateName).getSyncPoller(); + } + + /** + * Apply Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginPost( + String resourceGroupName, String clusterName, String updateName, Context context) { + return this.beginPostAsync(resourceGroupName, clusterName, updateName, context).getSyncPoller(); + } + + /** + * Apply Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono postAsync(String resourceGroupName, String clusterName, String updateName) { + return beginPostAsync(resourceGroupName, clusterName, updateName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Apply Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono postAsync(String resourceGroupName, String clusterName, String updateName, Context context) { + return beginPostAsync(resourceGroupName, clusterName, updateName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Apply Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void post(String resourceGroupName, String clusterName, String updateName) { + postAsync(resourceGroupName, clusterName, updateName).block(); + } + + /** + * Apply Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void post(String resourceGroupName, String clusterName, String updateName, Context context) { + postAsync(resourceGroupName, clusterName, updateName, context).block(); + } + + /** + * List all Updates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Updates along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String clusterName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all Updates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Updates along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String clusterName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List all Updates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Updates as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String clusterName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, clusterName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List all Updates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Updates as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String clusterName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, clusterName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List all Updates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Updates as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String clusterName) { + return new PagedIterable<>(listAsync(resourceGroupName, clusterName)); + } + + /** + * List all Updates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Updates as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String clusterName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, clusterName, context)); + } + + /** + * Delete specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String clusterName, String updateName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (updateName == null) { + return Mono.error(new IllegalArgumentException("Parameter updateName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + updateName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String clusterName, String updateName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (updateName == null) { + return Mono.error(new IllegalArgumentException("Parameter updateName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + updateName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Delete specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String clusterName, String updateName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName, updateName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String clusterName, String updateName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, clusterName, updateName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String clusterName, String updateName) { + return this.beginDeleteAsync(resourceGroupName, clusterName, updateName).getSyncPoller(); + } + + /** + * Delete specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String clusterName, String updateName, Context context) { + return this.beginDeleteAsync(resourceGroupName, clusterName, updateName, context).getSyncPoller(); + } + + /** + * Delete specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String clusterName, String updateName) { + return beginDeleteAsync(resourceGroupName, clusterName, updateName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String clusterName, String updateName, Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, updateName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String clusterName, String updateName) { + deleteAsync(resourceGroupName, clusterName, updateName).block(); + } + + /** + * Delete specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String clusterName, String updateName, Context context) { + deleteAsync(resourceGroupName, clusterName, updateName, context).block(); + } + + /** + * Put specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateProperties Properties of the Updates object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return update details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> putWithResponseAsync( + String resourceGroupName, String clusterName, String updateName, HciUpdateInner updateProperties) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (updateName == null) { + return Mono.error(new IllegalArgumentException("Parameter updateName is required and cannot be null.")); + } + if (updateProperties == null) { + return Mono + .error(new IllegalArgumentException("Parameter updateProperties is required and cannot be null.")); + } else { + updateProperties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .put( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + updateName, + this.client.getApiVersion(), + updateProperties, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Put specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateProperties Properties of the Updates object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return update details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> putWithResponseAsync( + String resourceGroupName, + String clusterName, + String updateName, + HciUpdateInner updateProperties, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (updateName == null) { + return Mono.error(new IllegalArgumentException("Parameter updateName is required and cannot be null.")); + } + if (updateProperties == null) { + return Mono + .error(new IllegalArgumentException("Parameter updateProperties is required and cannot be null.")); + } else { + updateProperties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .put( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + updateName, + this.client.getApiVersion(), + updateProperties, + accept, + context); + } + + /** + * Put specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateProperties Properties of the Updates object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return update details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono putAsync( + String resourceGroupName, String clusterName, String updateName, HciUpdateInner updateProperties) { + return putWithResponseAsync(resourceGroupName, clusterName, updateName, updateProperties) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Put specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateProperties Properties of the Updates object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return update details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse( + String resourceGroupName, + String clusterName, + String updateName, + HciUpdateInner updateProperties, + Context context) { + return putWithResponseAsync(resourceGroupName, clusterName, updateName, updateProperties, context).block(); + } + + /** + * Put specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateProperties Properties of the Updates object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return update details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HciUpdateInner put( + String resourceGroupName, String clusterName, String updateName, HciUpdateInner updateProperties) { + return putWithResponse(resourceGroupName, clusterName, updateName, updateProperties, Context.NONE).getValue(); + } + + /** + * Get specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specified Update along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String clusterName, String updateName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (updateName == null) { + return Mono.error(new IllegalArgumentException("Parameter updateName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + updateName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specified Update along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String clusterName, String updateName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (updateName == null) { + return Mono.error(new IllegalArgumentException("Parameter updateName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + updateName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specified Update on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String clusterName, String updateName) { + return getWithResponseAsync(resourceGroupName, clusterName, updateName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specified Update along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String clusterName, String updateName, Context context) { + return getWithResponseAsync(resourceGroupName, clusterName, updateName, context).block(); + } + + /** + * Get specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specified Update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HciUpdateInner get(String resourceGroupName, String clusterName, String updateName) { + return getWithResponse(resourceGroupName, clusterName, updateName, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Updates along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Updates along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdatesImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdatesImpl.java new file mode 100644 index 0000000000000..856a746c25014 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/UpdatesImpl.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.azurestackhci.fluent.UpdatesClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.HciUpdateInner; +import com.azure.resourcemanager.azurestackhci.models.HciUpdate; +import com.azure.resourcemanager.azurestackhci.models.Updates; + +public final class UpdatesImpl implements Updates { + private static final ClientLogger LOGGER = new ClientLogger(UpdatesImpl.class); + + private final UpdatesClient innerClient; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + public UpdatesImpl( + UpdatesClient innerClient, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void post(String resourceGroupName, String clusterName, String updateName) { + this.serviceClient().post(resourceGroupName, clusterName, updateName); + } + + public void post(String resourceGroupName, String clusterName, String updateName, Context context) { + this.serviceClient().post(resourceGroupName, clusterName, updateName, context); + } + + public PagedIterable list(String resourceGroupName, String clusterName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, clusterName); + return Utils.mapPage(inner, inner1 -> new HciUpdateImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String clusterName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, clusterName, context); + return Utils.mapPage(inner, inner1 -> new HciUpdateImpl(inner1, this.manager())); + } + + public void delete(String resourceGroupName, String clusterName, String updateName) { + this.serviceClient().delete(resourceGroupName, clusterName, updateName); + } + + public void delete(String resourceGroupName, String clusterName, String updateName, Context context) { + this.serviceClient().delete(resourceGroupName, clusterName, updateName, context); + } + + public Response getWithResponse( + String resourceGroupName, String clusterName, String updateName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, clusterName, updateName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new HciUpdateImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public HciUpdate get(String resourceGroupName, String clusterName, String updateName) { + HciUpdateInner inner = this.serviceClient().get(resourceGroupName, clusterName, updateName); + if (inner != null) { + return new HciUpdateImpl(inner, this.manager()); + } else { + return null; + } + } + + public HciUpdate getById(String id) { + String resourceGroupName = 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 updateName = Utils.getValueFromIdByName(id, "updates"); + if (updateName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'updates'.", id))); + } + return this.getWithResponse(resourceGroupName, clusterName, updateName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = 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 updateName = Utils.getValueFromIdByName(id, "updates"); + if (updateName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'updates'.", id))); + } + return this.getWithResponse(resourceGroupName, clusterName, updateName, context); + } + + public void deleteById(String id) { + String resourceGroupName = 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 updateName = Utils.getValueFromIdByName(id, "updates"); + if (updateName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'updates'.", id))); + } + this.delete(resourceGroupName, clusterName, updateName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = 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 updateName = Utils.getValueFromIdByName(id, "updates"); + if (updateName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'updates'.", id))); + } + this.delete(resourceGroupName, clusterName, updateName, context); + } + + private UpdatesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } + + public HciUpdateImpl define(String name) { + return new HciUpdateImpl(name, this.manager()); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ActionType.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ActionType.java index 2b1410993e7d7..aa1ce726b5b4a 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ActionType.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ActionType.java @@ -8,11 +8,20 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for ActionType. */ +/** Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ public final class ActionType extends ExpandableStringEnum { /** Static value Internal for ActionType. */ public static final ActionType INTERNAL = fromString("Internal"); + /** + * Creates a new instance of ActionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ActionType() { + } + /** * Creates or finds a ActionType from its string representation. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSetting.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSetting.java index db757dbf992a7..b251aa39a7095 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSetting.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSetting.java @@ -35,7 +35,7 @@ public interface ArcSetting { String type(); /** - * Gets the systemData property: System data of ArcSetting resource. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ @@ -105,6 +105,13 @@ public interface ArcSetting { */ Object connectivityProperties(); + /** + * Gets the defaultExtensions property: Properties for each of the default extensions category. + * + * @return the defaultExtensions value. + */ + List defaultExtensions(); + /** * Gets the name of the resource group. * @@ -123,11 +130,13 @@ public interface ArcSetting { 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 { /** @@ -139,6 +148,7 @@ interface WithParentResource { */ 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. @@ -165,6 +175,7 @@ interface WithCreate */ ArcSetting create(Context context); } + /** The stage of the ArcSetting definition allowing to specify arcInstanceResourceGroup. */ interface WithArcInstanceResourceGroup { /** @@ -177,6 +188,7 @@ interface WithArcInstanceResourceGroup { */ WithCreate withArcInstanceResourceGroup(String arcInstanceResourceGroup); } + /** The stage of the ArcSetting definition allowing to specify arcApplicationClientId. */ interface WithArcApplicationClientId { /** @@ -187,6 +199,7 @@ interface WithArcApplicationClientId { */ WithCreate withArcApplicationClientId(String arcApplicationClientId); } + /** The stage of the ArcSetting definition allowing to specify arcApplicationTenantId. */ interface WithArcApplicationTenantId { /** @@ -197,6 +210,7 @@ interface WithArcApplicationTenantId { */ WithCreate withArcApplicationTenantId(String arcApplicationTenantId); } + /** The stage of the ArcSetting definition allowing to specify arcServicePrincipalObjectId. */ interface WithArcServicePrincipalObjectId { /** @@ -207,6 +221,7 @@ interface WithArcServicePrincipalObjectId { */ WithCreate withArcServicePrincipalObjectId(String arcServicePrincipalObjectId); } + /** The stage of the ArcSetting definition allowing to specify arcApplicationObjectId. */ interface WithArcApplicationObjectId { /** @@ -217,6 +232,7 @@ interface WithArcApplicationObjectId { */ WithCreate withArcApplicationObjectId(String arcApplicationObjectId); } + /** The stage of the ArcSetting definition allowing to specify connectivityProperties. */ interface WithConnectivityProperties { /** @@ -229,6 +245,7 @@ interface WithConnectivityProperties { WithCreate withConnectivityProperties(Object connectivityProperties); } } + /** * Begins update for the ArcSetting resource. * @@ -253,6 +270,7 @@ interface Update extends UpdateStages.WithTags, UpdateStages.WithConnectivityPro */ ArcSetting apply(Context context); } + /** The ArcSetting update stages. */ interface UpdateStages { /** The stage of the ArcSetting update allowing to specify tags. */ @@ -265,6 +283,7 @@ interface WithTags { */ Update withTags(Map tags); } + /** The stage of the ArcSetting update allowing to specify connectivityProperties. */ interface WithConnectivityProperties { /** @@ -277,6 +296,7 @@ interface WithConnectivityProperties { Update withConnectivityProperties(Object connectivityProperties); } } + /** * Refreshes the resource to sync with Azure. * @@ -295,22 +315,22 @@ interface WithConnectivityProperties { /** * Generate password for arc settings. * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the response body along with {@link Response}. */ - PasswordCredential generatePassword(); + Response generatePasswordWithResponse(Context context); /** * Generate password for arc settings. * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. + * @return the response. */ - Response generatePasswordWithResponse(Context context); + PasswordCredential generatePassword(); /** * Create Aad identity for arc settings. @@ -331,4 +351,42 @@ interface WithConnectivityProperties { * @return arcIdentity details. */ ArcIdentityResponse createIdentity(Context context); + + /** + * Add consent time for default extensions and initiate extensions installation. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting details along with {@link Response}. + */ + Response consentAndInstallDefaultExtensionsWithResponse(Context context); + + /** + * Add consent time for default extensions and initiate extensions installation. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting details. + */ + ArcSetting consentAndInstallDefaultExtensions(); + + /** + * Initializes ARC Disable process on the cluster. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void initializeDisableProcess(); + + /** + * Initializes ARC Disable process on the cluster. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void initializeDisableProcess(Context context); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSettingAggregateState.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSettingAggregateState.java index b784d7a58be9e..8dfb957496c2b 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSettingAggregateState.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSettingAggregateState.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for ArcSettingAggregateState. */ +/** Aggregate state of Arc agent across the nodes in this HCI cluster. */ public final class ArcSettingAggregateState extends ExpandableStringEnum { /** Static value NotSpecified for ArcSettingAggregateState. */ public static final ArcSettingAggregateState NOT_SPECIFIED = fromString("NotSpecified"); @@ -55,6 +55,24 @@ public final class ArcSettingAggregateState extends ExpandableStringEnum getWithResponse( + String resourceGroupName, String clusterName, String arcSettingName, Context context); /** * Get ArcSetting resource details of HCI Cluster. @@ -54,14 +56,12 @@ public interface ArcSettings { * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return arcSetting resource details of HCI Cluster along with {@link Response}. + * @return arcSetting resource details of HCI Cluster. */ - Response getWithResponse( - String resourceGroupName, String clusterName, String arcSettingName, Context context); + ArcSetting get(String resourceGroupName, String clusterName, String arcSettingName); /** * Delete ArcSetting resource details of HCI Cluster. @@ -94,12 +94,14 @@ Response getWithResponse( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the response body along with {@link Response}. */ - PasswordCredential generatePassword(String resourceGroupName, String clusterName, String arcSettingName); + Response generatePasswordWithResponse( + String resourceGroupName, String clusterName, String arcSettingName, Context context); /** * Generate password for arc settings. @@ -107,14 +109,12 @@ Response getWithResponse( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. + * @return the response. */ - Response generatePasswordWithResponse( - String resourceGroupName, String clusterName, String arcSettingName, Context context); + PasswordCredential generatePassword(String resourceGroupName, String clusterName, String arcSettingName); /** * Create Aad identity for arc settings. @@ -144,6 +144,59 @@ Response generatePasswordWithResponse( ArcIdentityResponse createIdentity( String resourceGroupName, String clusterName, String arcSettingName, Context context); + /** + * Add consent time for default extensions and initiate extensions installation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting details along with {@link Response}. + */ + Response consentAndInstallDefaultExtensionsWithResponse( + String resourceGroupName, String clusterName, String arcSettingName, Context context); + + /** + * Add consent time for default extensions and initiate extensions installation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting details. + */ + ArcSetting consentAndInstallDefaultExtensions(String resourceGroupName, String clusterName, String arcSettingName); + + /** + * Initializes ARC Disable process on the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void initializeDisableProcess(String resourceGroupName, String clusterName, String arcSettingName); + + /** + * Initializes ARC Disable process on the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void initializeDisableProcess(String resourceGroupName, String clusterName, String arcSettingName, Context context); + /** * Get ArcSetting resource details of HCI Cluster. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSettingsPatch.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSettingsPatch.java index b9187894e0c5e..0d30b01baa883 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSettingsPatch.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSettingsPatch.java @@ -26,6 +26,10 @@ public final class ArcSettingsPatch { @JsonProperty(value = "properties") private ArcSettingsPatchProperties innerProperties; + /** Creates an instance of ArcSettingsPatch class. */ + public ArcSettingsPatch() { + } + /** * Get the tags property: Resource tags. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/AvailabilityType.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/AvailabilityType.java new file mode 100644 index 0000000000000..6ce88079a1688 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/AvailabilityType.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Indicates the way the update content can be downloaded. */ +public final class AvailabilityType extends ExpandableStringEnum { + /** Static value Local for AvailabilityType. */ + public static final AvailabilityType LOCAL = fromString("Local"); + + /** Static value Online for AvailabilityType. */ + public static final AvailabilityType ONLINE = fromString("Online"); + + /** Static value Notify for AvailabilityType. */ + public static final AvailabilityType NOTIFY = fromString("Notify"); + + /** + * Creates a new instance of AvailabilityType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AvailabilityType() { + } + + /** + * Creates or finds a AvailabilityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AvailabilityType. + */ + @JsonCreator + public static AvailabilityType fromString(String name) { + return fromString(name, AvailabilityType.class); + } + + /** + * Gets known AvailabilityType values. + * + * @return known AvailabilityType values. + */ + public static Collection values() { + return values(AvailabilityType.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Cluster.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Cluster.java index 1bc5810040be0..308f1457e414c 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Cluster.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Cluster.java @@ -10,6 +10,7 @@ import com.azure.resourcemanager.azurestackhci.fluent.models.ClusterInner; import java.time.OffsetDateTime; import java.util.Map; +import java.util.UUID; /** An immutable client-side representation of Cluster. */ public interface Cluster { @@ -49,12 +50,46 @@ public interface Cluster { Map tags(); /** - * Gets the systemData property: System data of Cluster resource. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ SystemData systemData(); + /** + * Gets the principalId property: The service principal ID of the system assigned identity. This property will only + * be provided for a system assigned identity. + * + * @return the principalId value. + */ + UUID principalId(); + + /** + * Gets the tenantId property: The tenant ID of the system assigned identity. This property will only be provided + * for a system assigned identity. + * + * @return the tenantId value. + */ + UUID tenantId(); + + /** + * Gets the typeIdentityType property: Type of managed service identity (where both SystemAssigned and UserAssigned + * types are allowed). + * + * @return the typeIdentityType value. + */ + ManagedServiceIdentityType typeIdentityType(); + + /** + * Gets the userAssignedIdentities property: The set of user assigned identities associated with the resource. The + * userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + * + * @return the userAssignedIdentities value. + */ + Map userAssignedIdentities(); + /** * Gets the provisioningState property: Provisioning state. * @@ -69,6 +104,13 @@ public interface Cluster { */ Status status(); + /** + * Gets the connectivityStatus property: Overall connectivity status for the cluster resource. + * + * @return the connectivityStatus value. + */ + ConnectivityStatus connectivityStatus(); + /** * Gets the cloudId property: Unique, immutable resource id. * @@ -111,6 +153,13 @@ public interface Cluster { */ String aadServicePrincipalObjectId(); + /** + * Gets the softwareAssuranceProperties property: Software Assurance properties of the cluster. + * + * @return the softwareAssuranceProperties value. + */ + SoftwareAssuranceProperties softwareAssuranceProperties(); + /** * Gets the desiredProperties property: Desired properties of the cluster. * @@ -125,6 +174,14 @@ public interface Cluster { */ ClusterReportedProperties reportedProperties(); + /** + * Gets the isolatedVmAttestationConfiguration property: Attestation configurations for isolated VM (e.g. TVM, CVM) + * of the cluster. + * + * @return the isolatedVmAttestationConfiguration value. + */ + IsolatedVmAttestationConfiguration isolatedVmAttestationConfiguration(); + /** * Gets the trialDaysRemaining property: Number of days remaining in the trial period. * @@ -167,6 +224,13 @@ public interface Cluster { */ String serviceEndpoint(); + /** + * Gets the resourceProviderObjectId property: Object id of RP Service Principal. + * + * @return the resourceProviderObjectId value. + */ + String resourceProviderObjectId(); + /** * Gets the region of the resource. * @@ -202,11 +266,13 @@ interface Definition DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { } + /** The Cluster definition stages. */ interface DefinitionStages { /** The first stage of the Cluster definition. */ interface Blank extends WithLocation { } + /** The stage of the Cluster definition allowing to specify location. */ interface WithLocation { /** @@ -225,6 +291,7 @@ interface WithLocation { */ WithResourceGroup withRegion(String location); } + /** The stage of the Cluster definition allowing to specify parent resource. */ interface WithResourceGroup { /** @@ -235,17 +302,21 @@ interface WithResourceGroup { */ WithCreate withExistingResourceGroup(String resourceGroupName); } + /** * The stage of the Cluster definition which contains all the minimum required properties for the resource to be * created, but also allows for any other optional properties to be specified. */ interface WithCreate extends DefinitionStages.WithTags, + DefinitionStages.WithTypeIdentityType, + DefinitionStages.WithUserAssignedIdentities, DefinitionStages.WithCloudManagementEndpoint, DefinitionStages.WithAadClientId, DefinitionStages.WithAadTenantId, DefinitionStages.WithAadApplicationObjectId, DefinitionStages.WithAadServicePrincipalObjectId, + DefinitionStages.WithSoftwareAssuranceProperties, DefinitionStages.WithDesiredProperties { /** * Executes the create request. @@ -262,6 +333,7 @@ interface WithCreate */ Cluster create(Context context); } + /** The stage of the Cluster definition allowing to specify tags. */ interface WithTags { /** @@ -272,6 +344,37 @@ interface WithTags { */ WithCreate withTags(Map tags); } + + /** The stage of the Cluster definition allowing to specify typeIdentityType. */ + interface WithTypeIdentityType { + /** + * Specifies the typeIdentityType property: Type of managed service identity (where both SystemAssigned and + * UserAssigned types are allowed).. + * + * @param typeIdentityType Type of managed service identity (where both SystemAssigned and UserAssigned + * types are allowed). + * @return the next definition stage. + */ + WithCreate withTypeIdentityType(ManagedServiceIdentityType typeIdentityType); + } + + /** The stage of the Cluster definition allowing to specify userAssignedIdentities. */ + interface WithUserAssignedIdentities { + /** + * Specifies the userAssignedIdentities property: The set of user assigned identities associated with the + * resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests.. + * + * @param userAssignedIdentities The set of user assigned identities associated with the resource. The + * userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + * @return the next definition stage. + */ + WithCreate withUserAssignedIdentities(Map userAssignedIdentities); + } + /** The stage of the Cluster definition allowing to specify cloudManagementEndpoint. */ interface WithCloudManagementEndpoint { /** @@ -283,6 +386,7 @@ interface WithCloudManagementEndpoint { */ WithCreate withCloudManagementEndpoint(String cloudManagementEndpoint); } + /** The stage of the Cluster definition allowing to specify aadClientId. */ interface WithAadClientId { /** @@ -293,6 +397,7 @@ interface WithAadClientId { */ WithCreate withAadClientId(String aadClientId); } + /** The stage of the Cluster definition allowing to specify aadTenantId. */ interface WithAadTenantId { /** @@ -303,6 +408,7 @@ interface WithAadTenantId { */ WithCreate withAadTenantId(String aadTenantId); } + /** The stage of the Cluster definition allowing to specify aadApplicationObjectId. */ interface WithAadApplicationObjectId { /** @@ -313,6 +419,7 @@ interface WithAadApplicationObjectId { */ WithCreate withAadApplicationObjectId(String aadApplicationObjectId); } + /** The stage of the Cluster definition allowing to specify aadServicePrincipalObjectId. */ interface WithAadServicePrincipalObjectId { /** @@ -323,6 +430,18 @@ interface WithAadServicePrincipalObjectId { */ WithCreate withAadServicePrincipalObjectId(String aadServicePrincipalObjectId); } + + /** The stage of the Cluster definition allowing to specify softwareAssuranceProperties. */ + interface WithSoftwareAssuranceProperties { + /** + * Specifies the softwareAssuranceProperties property: Software Assurance properties of the cluster.. + * + * @param softwareAssuranceProperties Software Assurance properties of the cluster. + * @return the next definition stage. + */ + WithCreate withSoftwareAssuranceProperties(SoftwareAssuranceProperties softwareAssuranceProperties); + } + /** The stage of the Cluster definition allowing to specify desiredProperties. */ interface WithDesiredProperties { /** @@ -334,6 +453,7 @@ interface WithDesiredProperties { WithCreate withDesiredProperties(ClusterDesiredProperties desiredProperties); } } + /** * Begins update for the Cluster resource. * @@ -344,6 +464,8 @@ interface WithDesiredProperties { /** The template for Cluster update. */ interface Update extends UpdateStages.WithTags, + UpdateStages.WithType, + UpdateStages.WithUserAssignedIdentities, UpdateStages.WithCloudManagementEndpoint, UpdateStages.WithAadClientId, UpdateStages.WithAadTenantId, @@ -363,6 +485,7 @@ interface Update */ Cluster apply(Context context); } + /** The Cluster update stages. */ interface UpdateStages { /** The stage of the Cluster update allowing to specify tags. */ @@ -375,6 +498,37 @@ interface WithTags { */ Update withTags(Map tags); } + + /** The stage of the Cluster update allowing to specify type. */ + interface WithType { + /** + * Specifies the type property: Type of managed service identity (where both SystemAssigned and UserAssigned + * types are allowed).. + * + * @param type Type of managed service identity (where both SystemAssigned and UserAssigned types are + * allowed). + * @return the next definition stage. + */ + Update withType(ManagedServiceIdentityType type); + } + + /** The stage of the Cluster update allowing to specify userAssignedIdentities. */ + interface WithUserAssignedIdentities { + /** + * Specifies the userAssignedIdentities property: The set of user assigned identities associated with the + * resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests.. + * + * @param userAssignedIdentities The set of user assigned identities associated with the resource. The + * userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + * @return the next definition stage. + */ + Update withUserAssignedIdentities(Map userAssignedIdentities); + } + /** The stage of the Cluster update allowing to specify cloudManagementEndpoint. */ interface WithCloudManagementEndpoint { /** @@ -385,6 +539,7 @@ interface WithCloudManagementEndpoint { */ Update withCloudManagementEndpoint(String cloudManagementEndpoint); } + /** The stage of the Cluster update allowing to specify aadClientId. */ interface WithAadClientId { /** @@ -395,6 +550,7 @@ interface WithAadClientId { */ Update withAadClientId(String aadClientId); } + /** The stage of the Cluster update allowing to specify aadTenantId. */ interface WithAadTenantId { /** @@ -405,6 +561,7 @@ interface WithAadTenantId { */ Update withAadTenantId(String aadTenantId); } + /** The stage of the Cluster update allowing to specify desiredProperties. */ interface WithDesiredProperties { /** @@ -416,6 +573,7 @@ interface WithDesiredProperties { Update withDesiredProperties(ClusterDesiredProperties desiredProperties); } } + /** * Refreshes the resource to sync with Azure. * @@ -471,4 +629,28 @@ interface WithDesiredProperties { * @return cluster Identity details. */ ClusterIdentityResponse createIdentity(Context context); + + /** + * Extends Software Assurance Benefit to a cluster. + * + * @param softwareAssuranceChangeRequest Software Assurance Change Request Payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster details. + */ + Cluster extendSoftwareAssuranceBenefit(SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest); + + /** + * Extends Software Assurance Benefit to a cluster. + * + * @param softwareAssuranceChangeRequest Software Assurance Change Request Payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster details. + */ + Cluster extendSoftwareAssuranceBenefit( + SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest, Context context); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterDesiredProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterDesiredProperties.java index 6047cd6aac00a..5a11f22a5853e 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterDesiredProperties.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterDesiredProperties.java @@ -22,6 +22,10 @@ public final class ClusterDesiredProperties { @JsonProperty(value = "diagnosticLevel") private DiagnosticLevel diagnosticLevel; + /** Creates an instance of ClusterDesiredProperties class. */ + public ClusterDesiredProperties() { + } + /** * Get the windowsServerSubscription property: Desired state of Windows Server Subscription. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterList.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterList.java index 0a18e044fdbff..1763a1bb995c6 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterList.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterList.java @@ -24,6 +24,10 @@ public final class ClusterList { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; + /** Creates an instance of ClusterList class. */ + public ClusterList() { + } + /** * Get the value property: List of clusters. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterNode.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterNode.java index 1d7a5a571ed42..27165f61234cb 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 @@ -6,6 +6,7 @@ import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; /** Cluster node details. */ @Immutable @@ -28,6 +29,18 @@ public final class ClusterNode { @JsonProperty(value = "windowsServerSubscription", access = JsonProperty.Access.WRITE_ONLY) private WindowsServerSubscription windowsServerSubscription; + /* + * Type of the cluster node hardware. + */ + @JsonProperty(value = "nodeType", access = JsonProperty.Access.WRITE_ONLY) + private ClusterNodeType nodeType; + + /* + * Edge Hardware Center Resource Id + */ + @JsonProperty(value = "ehcResourceId", access = JsonProperty.Access.WRITE_ONLY) + private String ehcResourceId; + /* * Manufacturer of the cluster node hardware. */ @@ -52,6 +65,12 @@ public final class ClusterNode { @JsonProperty(value = "osVersion", access = JsonProperty.Access.WRITE_ONLY) private String osVersion; + /* + * Display version of the operating system running on the cluster node. + */ + @JsonProperty(value = "osDisplayVersion", access = JsonProperty.Access.WRITE_ONLY) + private String osDisplayVersion; + /* * Immutable id of the cluster node. */ @@ -70,6 +89,22 @@ public final class ClusterNode { @JsonProperty(value = "memoryInGiB", access = JsonProperty.Access.WRITE_ONLY) private Float memoryInGiB; + /* + * Most recent licensing timestamp. + */ + @JsonProperty(value = "lastLicensingTimestamp", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastLicensingTimestamp; + + /* + * OEM activation status of the node. + */ + @JsonProperty(value = "oemActivation", access = JsonProperty.Access.WRITE_ONLY) + private OemActivation oemActivation; + + /** Creates an instance of ClusterNode class. */ + public ClusterNode() { + } + /** * Get the name property: Name of the cluster node. * @@ -97,6 +132,24 @@ public WindowsServerSubscription windowsServerSubscription() { return this.windowsServerSubscription; } + /** + * Get the nodeType property: Type of the cluster node hardware. + * + * @return the nodeType value. + */ + public ClusterNodeType nodeType() { + return this.nodeType; + } + + /** + * Get the ehcResourceId property: Edge Hardware Center Resource Id. + * + * @return the ehcResourceId value. + */ + public String ehcResourceId() { + return this.ehcResourceId; + } + /** * Get the manufacturer property: Manufacturer of the cluster node hardware. * @@ -133,6 +186,15 @@ public String osVersion() { return this.osVersion; } + /** + * Get the osDisplayVersion property: Display version of the operating system running on the cluster node. + * + * @return the osDisplayVersion value. + */ + public String osDisplayVersion() { + return this.osDisplayVersion; + } + /** * Get the serialNumber property: Immutable id of the cluster node. * @@ -160,6 +222,24 @@ public Float memoryInGiB() { return this.memoryInGiB; } + /** + * Get the lastLicensingTimestamp property: Most recent licensing timestamp. + * + * @return the lastLicensingTimestamp value. + */ + public OffsetDateTime lastLicensingTimestamp() { + return this.lastLicensingTimestamp; + } + + /** + * Get the oemActivation property: OEM activation status of the node. + * + * @return the oemActivation value. + */ + public OemActivation oemActivation() { + return this.oemActivation; + } + /** * Validates the instance. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterNodeType.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterNodeType.java new file mode 100644 index 0000000000000..cc3a03a7129a9 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterNodeType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The node type of all the nodes of the cluster. */ +public final class ClusterNodeType extends ExpandableStringEnum { + /** Static value FirstParty for ClusterNodeType. */ + public static final ClusterNodeType FIRST_PARTY = fromString("FirstParty"); + + /** Static value ThirdParty for ClusterNodeType. */ + public static final ClusterNodeType THIRD_PARTY = fromString("ThirdParty"); + + /** + * Creates a new instance of ClusterNodeType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ClusterNodeType() { + } + + /** + * Creates or finds a ClusterNodeType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ClusterNodeType. + */ + @JsonCreator + public static ClusterNodeType fromString(String name) { + return fromString(name, ClusterNodeType.class); + } + + /** + * Gets known ClusterNodeType values. + * + * @return known ClusterNodeType values. + */ + public static Collection values() { + return values(ClusterNodeType.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterPatch.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterPatch.java index 2004f6129e9fe..88ca22d755e02 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterPatch.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterPatch.java @@ -6,9 +6,11 @@ import com.azure.core.annotation.Fluent; import com.azure.resourcemanager.azurestackhci.fluent.models.ClusterPatchProperties; +import com.azure.resourcemanager.azurestackhci.fluent.models.ManagedServiceIdentity; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; +import java.util.UUID; /** Cluster details to update. */ @Fluent @@ -20,12 +22,22 @@ public final class ClusterPatch { @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; + /* + * Identity of Cluster resource + */ + @JsonProperty(value = "identity") + private ManagedServiceIdentity innerIdentity; + /* * Cluster properties. */ @JsonProperty(value = "properties") private ClusterPatchProperties innerProperties; + /** Creates an instance of ClusterPatch class. */ + public ClusterPatch() { + } + /** * Get the tags property: Resource tags. * @@ -46,6 +58,15 @@ public ClusterPatch withTags(Map tags) { return this; } + /** + * Get the innerIdentity property: Identity of Cluster resource. + * + * @return the innerIdentity value. + */ + private ManagedServiceIdentity innerIdentity() { + return this.innerIdentity; + } + /** * Get the innerProperties property: Cluster properties. * @@ -55,6 +76,80 @@ private ClusterPatchProperties innerProperties() { return this.innerProperties; } + /** + * Get the principalId property: The service principal ID of the system assigned identity. This property will only + * be provided for a system assigned identity. + * + * @return the principalId value. + */ + public UUID principalId() { + return this.innerIdentity() == null ? null : this.innerIdentity().principalId(); + } + + /** + * Get the tenantId property: The tenant ID of the system assigned identity. This property will only be provided for + * a system assigned identity. + * + * @return the tenantId value. + */ + public UUID tenantId() { + return this.innerIdentity() == null ? null : this.innerIdentity().tenantId(); + } + + /** + * Get the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are + * allowed). + * + * @return the type value. + */ + public ManagedServiceIdentityType type() { + return this.innerIdentity() == null ? null : this.innerIdentity().type(); + } + + /** + * Set the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are + * allowed). + * + * @param type the type value to set. + * @return the ClusterPatch object itself. + */ + public ClusterPatch withType(ManagedServiceIdentityType type) { + if (this.innerIdentity() == null) { + this.innerIdentity = new ManagedServiceIdentity(); + } + this.innerIdentity().withType(type); + return this; + } + + /** + * Get the userAssignedIdentities property: The set of user assigned identities associated with the resource. The + * userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.innerIdentity() == null ? null : this.innerIdentity().userAssignedIdentities(); + } + + /** + * Set the userAssignedIdentities property: The set of user assigned identities associated with the resource. The + * userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the ClusterPatch object itself. + */ + public ClusterPatch withUserAssignedIdentities(Map userAssignedIdentities) { + if (this.innerIdentity() == null) { + this.innerIdentity = new ManagedServiceIdentity(); + } + this.innerIdentity().withUserAssignedIdentities(userAssignedIdentities); + return this; + } + /** * Get the cloudManagementEndpoint property: Endpoint configured for management from the Azure portal. * @@ -153,6 +248,9 @@ public ClusterPatch withDesiredProperties(ClusterDesiredProperties desiredProper * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (innerIdentity() != null) { + innerIdentity().validate(); + } if (innerProperties() != null) { innerProperties().validate(); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterReportedProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterReportedProperties.java index 4a2d2b7c7895d..49ebd50eb241f 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterReportedProperties.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterReportedProperties.java @@ -54,6 +54,34 @@ public final class ClusterReportedProperties { @JsonProperty(value = "diagnosticLevel") private DiagnosticLevel diagnosticLevel; + /* + * Capabilities supported by the cluster. + */ + @JsonProperty(value = "supportedCapabilities", access = JsonProperty.Access.WRITE_ONLY) + private List supportedCapabilities; + + /* + * The node type of all the nodes of the cluster. + */ + @JsonProperty(value = "clusterType", access = JsonProperty.Access.WRITE_ONLY) + private ClusterNodeType clusterType; + + /* + * The manufacturer of all the nodes of the cluster. + */ + @JsonProperty(value = "manufacturer", access = JsonProperty.Access.WRITE_ONLY) + private String manufacturer; + + /* + * OEM activation status of the cluster. + */ + @JsonProperty(value = "oemActivation", access = JsonProperty.Access.WRITE_ONLY) + private OemActivation oemActivation; + + /** Creates an instance of ClusterReportedProperties class. */ + public ClusterReportedProperties() { + } + /** * Get the clusterName property: Name of the on-prem cluster connected to this resource. * @@ -128,6 +156,42 @@ public ClusterReportedProperties withDiagnosticLevel(DiagnosticLevel diagnosticL return this; } + /** + * Get the supportedCapabilities property: Capabilities supported by the cluster. + * + * @return the supportedCapabilities value. + */ + public List supportedCapabilities() { + return this.supportedCapabilities; + } + + /** + * Get the clusterType property: The node type of all the nodes of the cluster. + * + * @return the clusterType value. + */ + public ClusterNodeType clusterType() { + return this.clusterType; + } + + /** + * Get the manufacturer property: The manufacturer of all the nodes of the cluster. + * + * @return the manufacturer value. + */ + public String manufacturer() { + return this.manufacturer; + } + + /** + * Get the oemActivation property: OEM activation status of the cluster. + * + * @return the oemActivation value. + */ + public OemActivation oemActivation() { + return this.oemActivation; + } + /** * Validates the instance. * 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 989e69c94dfca..2e7865951e97b 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Clusters.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Clusters.java @@ -58,25 +58,25 @@ public interface Clusters { * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hCI cluster. + * @return hCI cluster along with {@link Response}. */ - Cluster getByResourceGroup(String resourceGroupName, String clusterName); + Response getByResourceGroupWithResponse(String resourceGroupName, String clusterName, Context context); /** * Get HCI cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hCI cluster along with {@link Response}. + * @return hCI cluster. */ - Response getByResourceGroupWithResponse(String resourceGroupName, String clusterName, Context context); + Cluster getByResourceGroup(String resourceGroupName, String clusterName); /** * Delete an HCI cluster. @@ -156,6 +156,38 @@ void uploadCertificate( */ ClusterIdentityResponse createIdentity(String resourceGroupName, String clusterName, Context context); + /** + * Extends Software Assurance Benefit to a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param softwareAssuranceChangeRequest Software Assurance Change Request Payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster details. + */ + Cluster extendSoftwareAssuranceBenefit( + String resourceGroupName, String clusterName, SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest); + + /** + * Extends Software Assurance Benefit to a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param softwareAssuranceChangeRequest Software Assurance Change Request Payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster details. + */ + Cluster extendSoftwareAssuranceBenefit( + String resourceGroupName, + String clusterName, + SoftwareAssuranceChangeRequest softwareAssuranceChangeRequest, + Context context); + /** * Get HCI cluster. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ConnectivityStatus.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ConnectivityStatus.java new file mode 100644 index 0000000000000..a76c6a40d46cb --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ConnectivityStatus.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Overall connectivity status for the cluster resource. */ +public final class ConnectivityStatus extends ExpandableStringEnum { + /** Static value NotYetRegistered for ConnectivityStatus. */ + public static final ConnectivityStatus NOT_YET_REGISTERED = fromString("NotYetRegistered"); + + /** Static value Connected for ConnectivityStatus. */ + public static final ConnectivityStatus CONNECTED = fromString("Connected"); + + /** Static value NotConnectedRecently for ConnectivityStatus. */ + public static final ConnectivityStatus NOT_CONNECTED_RECENTLY = fromString("NotConnectedRecently"); + + /** Static value PartiallyConnected for ConnectivityStatus. */ + public static final ConnectivityStatus PARTIALLY_CONNECTED = fromString("PartiallyConnected"); + + /** Static value Disconnected for ConnectivityStatus. */ + public static final ConnectivityStatus DISCONNECTED = fromString("Disconnected"); + + /** Static value NotSpecified for ConnectivityStatus. */ + public static final ConnectivityStatus NOT_SPECIFIED = fromString("NotSpecified"); + + /** + * Creates a new instance of ConnectivityStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ConnectivityStatus() { + } + + /** + * Creates or finds a ConnectivityStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConnectivityStatus. + */ + @JsonCreator + public static ConnectivityStatus fromString(String name) { + return fromString(name, ConnectivityStatus.class); + } + + /** + * Gets known ConnectivityStatus values. + * + * @return known ConnectivityStatus values. + */ + public static Collection values() { + return values(ConnectivityStatus.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DefaultExtensionDetails.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DefaultExtensionDetails.java new file mode 100644 index 0000000000000..582870b207dc5 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DefaultExtensionDetails.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Properties for a particular default extension category. */ +@Immutable +public final class DefaultExtensionDetails { + /* + * Default extension category + */ + @JsonProperty(value = "category", access = JsonProperty.Access.WRITE_ONLY) + private String category; + + /* + * Consent time for extension category + */ + @JsonProperty(value = "consentTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime consentTime; + + /** Creates an instance of DefaultExtensionDetails class. */ + public DefaultExtensionDetails() { + } + + /** + * Get the category property: Default extension category. + * + * @return the category value. + */ + public String category() { + return this.category; + } + + /** + * Get the consentTime property: Consent time for extension category. + * + * @return the consentTime value. + */ + public OffsetDateTime consentTime() { + return this.consentTime; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DiagnosticLevel.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DiagnosticLevel.java index 055016a21b28a..484da36e3d54f 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DiagnosticLevel.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DiagnosticLevel.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for DiagnosticLevel. */ +/** Desired level of diagnostic data emitted by the cluster. */ public final class DiagnosticLevel extends ExpandableStringEnum { /** Static value Off for DiagnosticLevel. */ public static final DiagnosticLevel OFF = fromString("Off"); @@ -19,6 +19,15 @@ public final class DiagnosticLevel extends ExpandableStringEnum /** Static value Enhanced for DiagnosticLevel. */ public static final DiagnosticLevel ENHANCED = fromString("Enhanced"); + /** + * Creates a new instance of DiagnosticLevel value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DiagnosticLevel() { + } + /** * Creates or finds a DiagnosticLevel from its string representation. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Extension.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Extension.java index 6ca8c95e770fe..8d9b13361c554 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Extension.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Extension.java @@ -33,7 +33,7 @@ public interface Extension { String type(); /** - * Gets the systemData property: System data of Extension resource. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ @@ -60,6 +60,13 @@ public interface Extension { */ List perNodeExtensionDetails(); + /** + * Gets the managedBy property: Indicates if the extension is managed by azure or the user. + * + * @return the managedBy value. + */ + ExtensionManagedBy managedBy(); + /** * Gets the forceUpdateTag property: How the extension handler should be forced to update even if the extension * configuration has not changed. @@ -83,7 +90,8 @@ public interface Extension { String typePropertiesType(); /** - * Gets the typeHandlerVersion property: Specifies the version of the script handler. + * Gets the typeHandlerVersion property: Specifies the version of the script handler. Latest version would be used + * if not specified. * * @return the typeHandlerVersion value. */ @@ -112,6 +120,14 @@ public interface Extension { */ Object protectedSettings(); + /** + * Gets the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version available. + * + * @return the enableAutomaticUpgrade value. + */ + Boolean enableAutomaticUpgrade(); + /** * Gets the name of the resource group. * @@ -130,11 +146,13 @@ public interface Extension { 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 { /** @@ -147,6 +165,7 @@ interface WithParentResource { */ 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. @@ -158,7 +177,8 @@ interface WithCreate DefinitionStages.WithTypeHandlerVersion, DefinitionStages.WithAutoUpgradeMinorVersion, DefinitionStages.WithSettings, - DefinitionStages.WithProtectedSettings { + DefinitionStages.WithProtectedSettings, + DefinitionStages.WithEnableAutomaticUpgrade { /** * Executes the create request. * @@ -174,6 +194,7 @@ interface WithCreate */ Extension create(Context context); } + /** The stage of the Extension definition allowing to specify forceUpdateTag. */ interface WithForceUpdateTag { /** @@ -186,6 +207,7 @@ interface WithForceUpdateTag { */ WithCreate withForceUpdateTag(String forceUpdateTag); } + /** The stage of the Extension definition allowing to specify publisher. */ interface WithPublisher { /** @@ -196,6 +218,7 @@ interface WithPublisher { */ WithCreate withPublisher(String publisher); } + /** The stage of the Extension definition allowing to specify typePropertiesType. */ interface WithTypePropertiesType { /** @@ -207,16 +230,20 @@ interface WithTypePropertiesType { */ 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.. + * Specifies the typeHandlerVersion property: Specifies the version of the script handler. Latest version + * would be used if not specified.. * - * @param typeHandlerVersion Specifies the version of the script handler. + * @param typeHandlerVersion Specifies the version of the script handler. Latest version would be used if + * not specified. * @return the next definition stage. */ WithCreate withTypeHandlerVersion(String typeHandlerVersion); } + /** The stage of the Extension definition allowing to specify autoUpgradeMinorVersion. */ interface WithAutoUpgradeMinorVersion { /** @@ -231,6 +258,7 @@ interface WithAutoUpgradeMinorVersion { */ WithCreate withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion); } + /** The stage of the Extension definition allowing to specify settings. */ interface WithSettings { /** @@ -241,6 +269,7 @@ interface WithSettings { */ WithCreate withSettings(Object settings); } + /** The stage of the Extension definition allowing to specify protectedSettings. */ interface WithProtectedSettings { /** @@ -251,7 +280,21 @@ interface WithProtectedSettings { */ WithCreate withProtectedSettings(Object protectedSettings); } + + /** The stage of the Extension definition allowing to specify enableAutomaticUpgrade. */ + interface WithEnableAutomaticUpgrade { + /** + * Specifies the enableAutomaticUpgrade property: Indicates whether the extension should be automatically + * upgraded by the platform if there is a newer version available.. + * + * @param enableAutomaticUpgrade Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version available. + * @return the next definition stage. + */ + WithCreate withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade); + } } + /** * Begins update for the Extension resource. * @@ -260,14 +303,7 @@ interface WithProtectedSettings { 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 { + interface Update extends UpdateStages.WithExtensionParameters { /** * Executes the update request. * @@ -283,86 +319,22 @@ interface Update */ 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 { + /** The stage of the Extension update allowing to specify extensionParameters. */ + interface WithExtensionParameters { /** - * Specifies the settings property: Json formatted public settings for the extension.. + * Specifies the extensionParameters property: Describes the properties of a Machine Extension that can be + * updated.. * - * @param settings Json formatted public settings for the extension. + * @param extensionParameters Describes the properties of a Machine Extension that can be updated. * @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); + Update withExtensionParameters(ExtensionPatchParameters extensionParameters); } } + /** * Refreshes the resource to sync with Azure. * @@ -377,4 +349,25 @@ interface WithProtectedSettings { * @return the refreshed resource. */ Extension refresh(Context context); + + /** + * Upgrade a particular Arc Extension of HCI Cluster. + * + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void upgrade(ExtensionUpgradeParameters extensionUpgradeParameters); + + /** + * Upgrade a particular Arc Extension of HCI Cluster. + * + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void upgrade(ExtensionUpgradeParameters extensionUpgradeParameters, Context context); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionAggregateState.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionAggregateState.java index 23c5dfbc409d0..7fef686fde682 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionAggregateState.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionAggregateState.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for ExtensionAggregateState. */ +/** Aggregate state of Arc Extensions across the nodes in this HCI cluster. */ public final class ExtensionAggregateState extends ExpandableStringEnum { /** Static value NotSpecified for ExtensionAggregateState. */ public static final ExtensionAggregateState NOT_SPECIFIED = fromString("NotSpecified"); @@ -55,6 +55,25 @@ public final class ExtensionAggregateState extends ExpandableStringEnum { + /** Static value Azure for ExtensionManagedBy. */ + public static final ExtensionManagedBy AZURE = fromString("Azure"); + + /** Static value User for ExtensionManagedBy. */ + public static final ExtensionManagedBy USER = fromString("User"); + + /** + * Creates a new instance of ExtensionManagedBy value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ExtensionManagedBy() { + } + + /** + * Creates or finds a ExtensionManagedBy from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExtensionManagedBy. + */ + @JsonCreator + public static ExtensionManagedBy fromString(String name) { + return fromString(name, ExtensionManagedBy.class); + } + + /** + * Gets known ExtensionManagedBy values. + * + * @return known ExtensionManagedBy values. + */ + public static Collection values() { + return values(ExtensionManagedBy.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionPatch.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionPatch.java new file mode 100644 index 0000000000000..0b1110a248cbe --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionPatch.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.Fluent; +import com.azure.resourcemanager.azurestackhci.fluent.models.ExtensionPatchProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Extension Details to update. */ +@Fluent +public final class ExtensionPatch { + /* + * Describes Machine Extension Properties that can be updated. + */ + @JsonProperty(value = "properties") + private ExtensionPatchProperties innerProperties; + + /** Creates an instance of ExtensionPatch class. */ + public ExtensionPatch() { + } + + /** + * Get the innerProperties property: Describes Machine Extension Properties that can be updated. + * + * @return the innerProperties value. + */ + private ExtensionPatchProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the extensionParameters property: Describes the properties of a Machine Extension that can be updated. + * + * @return the extensionParameters value. + */ + public ExtensionPatchParameters extensionParameters() { + return this.innerProperties() == null ? null : this.innerProperties().extensionParameters(); + } + + /** + * Set the extensionParameters property: Describes the properties of a Machine Extension that can be updated. + * + * @param extensionParameters the extensionParameters value to set. + * @return the ExtensionPatch object itself. + */ + public ExtensionPatch withExtensionParameters(ExtensionPatchParameters extensionParameters) { + if (this.innerProperties() == null) { + this.innerProperties = new ExtensionPatchProperties(); + } + this.innerProperties().withExtensionParameters(extensionParameters); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionPatchParameters.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionPatchParameters.java new file mode 100644 index 0000000000000..63b3b9b987270 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionPatchParameters.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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; + +/** Describes the properties of a Machine Extension that can be updated. */ +@Fluent +public final class ExtensionPatchParameters { + /* + * Specifies the version of the script handler. Latest version would be used if not specified. + */ + @JsonProperty(value = "typeHandlerVersion") + private String typeHandlerVersion; + + /* + * Indicates whether the extension should be automatically upgraded by the platform if there is a newer version + * available. + */ + @JsonProperty(value = "enableAutomaticUpgrade") + private Boolean enableAutomaticUpgrade; + + /* + * Json formatted public settings for the extension. + */ + @JsonProperty(value = "settings") + private Object settings; + + /* + * Protected settings (may contain secrets). + */ + @JsonProperty(value = "protectedSettings") + private Object protectedSettings; + + /** Creates an instance of ExtensionPatchParameters class. */ + public ExtensionPatchParameters() { + } + + /** + * Get the typeHandlerVersion property: Specifies the version of the script handler. Latest version would be used if + * not specified. + * + * @return the typeHandlerVersion value. + */ + public String typeHandlerVersion() { + return this.typeHandlerVersion; + } + + /** + * Set the typeHandlerVersion property: Specifies the version of the script handler. Latest version would be used if + * not specified. + * + * @param typeHandlerVersion the typeHandlerVersion value to set. + * @return the ExtensionPatchParameters object itself. + */ + public ExtensionPatchParameters withTypeHandlerVersion(String typeHandlerVersion) { + this.typeHandlerVersion = typeHandlerVersion; + return this; + } + + /** + * Get the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version available. + * + * @return the enableAutomaticUpgrade value. + */ + public Boolean enableAutomaticUpgrade() { + return this.enableAutomaticUpgrade; + } + + /** + * Set the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version available. + * + * @param enableAutomaticUpgrade the enableAutomaticUpgrade value to set. + * @return the ExtensionPatchParameters object itself. + */ + public ExtensionPatchParameters withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { + this.enableAutomaticUpgrade = enableAutomaticUpgrade; + return this; + } + + /** + * Get the settings property: Json formatted public settings for the extension. + * + * @return the settings value. + */ + public Object settings() { + return this.settings; + } + + /** + * Set the settings property: Json formatted public settings for the extension. + * + * @param settings the settings value to set. + * @return the ExtensionPatchParameters object itself. + */ + public ExtensionPatchParameters withSettings(Object settings) { + this.settings = settings; + return this; + } + + /** + * Get the protectedSettings property: Protected settings (may contain secrets). + * + * @return the protectedSettings value. + */ + public Object protectedSettings() { + return this.protectedSettings; + } + + /** + * Set the protectedSettings property: Protected settings (may contain secrets). + * + * @param protectedSettings the protectedSettings value to set. + * @return the ExtensionPatchParameters object itself. + */ + public ExtensionPatchParameters withProtectedSettings(Object protectedSettings) { + this.protectedSettings = protectedSettings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionUpgradeParameters.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionUpgradeParameters.java new file mode 100644 index 0000000000000..26a6586f663d9 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionUpgradeParameters.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the parameters for Extension upgrade. */ +@Fluent +public final class ExtensionUpgradeParameters { + /* + * Extension Upgrade Target Version. + */ + @JsonProperty(value = "targetVersion") + private String targetVersion; + + /** Creates an instance of ExtensionUpgradeParameters class. */ + public ExtensionUpgradeParameters() { + } + + /** + * Get the targetVersion property: Extension Upgrade Target Version. + * + * @return the targetVersion value. + */ + public String targetVersion() { + return this.targetVersion; + } + + /** + * Set the targetVersion property: Extension Upgrade Target Version. + * + * @param targetVersion the targetVersion value to set. + * @return the ExtensionUpgradeParameters object itself. + */ + public ExtensionUpgradeParameters withTargetVersion(String targetVersion) { + this.targetVersion = targetVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Extensions.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Extensions.java index bc901c68316ac..9d8a698f3316e 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Extensions.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Extensions.java @@ -45,12 +45,14 @@ PagedIterable listByArcSetting( * @param clusterName The name of the cluster. * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. * @param extensionName The name of the machine extension. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return particular Arc Extension of HCI Cluster. + * @return particular Arc Extension of HCI Cluster along with {@link Response}. */ - Extension get(String resourceGroupName, String clusterName, String arcSettingName, String extensionName); + Response getWithResponse( + String resourceGroupName, String clusterName, String arcSettingName, String extensionName, Context context); /** * Get particular Arc Extension of HCI Cluster. @@ -59,14 +61,12 @@ PagedIterable listByArcSetting( * @param clusterName The name of the cluster. * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. * @param extensionName The name of the machine extension. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return particular Arc Extension of HCI Cluster along with {@link Response}. + * @return particular Arc Extension of HCI Cluster. */ - Response getWithResponse( - String resourceGroupName, String clusterName, String arcSettingName, String extensionName, Context context); + Extension get(String resourceGroupName, String clusterName, String arcSettingName, String extensionName); /** * Delete particular Arc Extension of HCI Cluster. @@ -96,6 +96,46 @@ Response getWithResponse( void delete( String resourceGroupName, String clusterName, String arcSettingName, String extensionName, Context context); + /** + * Upgrade a particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void upgrade( + String resourceGroupName, + String clusterName, + String arcSettingName, + String extensionName, + ExtensionUpgradeParameters extensionUpgradeParameters); + + /** + * Upgrade a particular Arc Extension of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param extensionName The name of the machine extension. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void upgrade( + String resourceGroupName, + String clusterName, + String arcSettingName, + String extensionName, + ExtensionUpgradeParameters extensionUpgradeParameters, + Context context); + /** * Get particular Arc Extension of HCI Cluster. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HciUpdate.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HciUpdate.java new file mode 100644 index 0000000000000..42fbd98a16b71 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HciUpdate.java @@ -0,0 +1,868 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.fluent.models.HciUpdateInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** An immutable client-side representation of HciUpdate. */ +public interface HciUpdate { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: Provisioning state of the Updates proxy resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the installedDate property: Date that the update was installed. + * + * @return the installedDate value. + */ + OffsetDateTime installedDate(); + + /** + * Gets the description property: Description of the update. + * + * @return the description value. + */ + String description(); + + /** + * Gets the state property: State of the update as it relates to this stamp. + * + * @return the state value. + */ + State state(); + + /** + * Gets the prerequisites property: If update State is HasPrerequisite, this property contains an array of objects + * describing prerequisite updates before installing this update. Otherwise, it is empty. + * + * @return the prerequisites value. + */ + List prerequisites(); + + /** + * Gets the componentVersions property: An array of component versions for a Solution Bundle update, and an empty + * array otherwise. + * + * @return the componentVersions value. + */ + List componentVersions(); + + /** + * Gets the rebootRequired property: The rebootRequired property. + * + * @return the rebootRequired value. + */ + RebootRequirement rebootRequired(); + + /** + * Gets the healthState property: Overall health state for update-specific health checks. + * + * @return the healthState value. + */ + HealthState healthState(); + + /** + * Gets the healthCheckResult property: An array of PrecheckResult objects. + * + * @return the healthCheckResult value. + */ + List healthCheckResult(); + + /** + * Gets the healthCheckDate property: Last time the package-specific checks were run. + * + * @return the healthCheckDate value. + */ + OffsetDateTime healthCheckDate(); + + /** + * Gets the packagePath property: Path where the update package is available. + * + * @return the packagePath value. + */ + String packagePath(); + + /** + * Gets the packageSizeInMb property: Size of the package. This value is a combination of the size from update + * metadata and size of the payload that results from the live scan operation for OS update content. + * + * @return the packageSizeInMb value. + */ + Float packageSizeInMb(); + + /** + * Gets the displayName property: Display name of the Update. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the version property: Version of the update. + * + * @return the version value. + */ + String version(); + + /** + * Gets the publisher property: Publisher of the update package. + * + * @return the publisher value. + */ + String publisher(); + + /** + * Gets the releaseLink property: Link to release notes for the update. + * + * @return the releaseLink value. + */ + String releaseLink(); + + /** + * Gets the availabilityType property: Indicates the way the update content can be downloaded. + * + * @return the availabilityType value. + */ + AvailabilityType availabilityType(); + + /** + * Gets the packageType property: Customer-visible type of the update. + * + * @return the packageType value. + */ + String packageType(); + + /** + * Gets the additionalProperties property: Extensible KV pairs serialized as a string. This is currently used to + * report the stamp OEM family and hardware model information when an update is flagged as Invalid for the stamp + * based on OEM type. + * + * @return the additionalProperties value. + */ + String additionalProperties(); + + /** + * Gets the progressPercentage property: Progress percentage of ongoing operation. Currently this property is only + * valid when the update is in the Downloading state, where it maps to how much of the update content has been + * downloaded. + * + * @return the progressPercentage value. + */ + Float progressPercentage(); + + /** + * Gets the notifyMessage property: Brief message with instructions for updates of AvailabilityType Notify. + * + * @return the notifyMessage value. + */ + String notifyMessage(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.azurestackhci.fluent.models.HciUpdateInner object. + * + * @return the inner object. + */ + HciUpdateInner innerModel(); + + /** The entirety of the HciUpdate definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** The HciUpdate definition stages. */ + interface DefinitionStages { + /** The first stage of the HciUpdate definition. */ + interface Blank extends WithParentResource { + } + + /** The stage of the HciUpdate definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, clusterName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @return the next definition stage. + */ + WithCreate withExistingCluster(String resourceGroupName, String clusterName); + } + + /** + * The stage of the HciUpdate definition which contains all the minimum required properties for the resource to + * be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithLocation, + DefinitionStages.WithInstalledDate, + DefinitionStages.WithDescription, + DefinitionStages.WithState, + DefinitionStages.WithPrerequisites, + DefinitionStages.WithComponentVersions, + DefinitionStages.WithRebootRequired, + DefinitionStages.WithHealthState, + DefinitionStages.WithHealthCheckResult, + DefinitionStages.WithHealthCheckDate, + DefinitionStages.WithPackagePath, + DefinitionStages.WithPackageSizeInMb, + DefinitionStages.WithDisplayName, + DefinitionStages.WithVersion, + DefinitionStages.WithPublisher, + DefinitionStages.WithReleaseLink, + DefinitionStages.WithAvailabilityType, + DefinitionStages.WithPackageType, + DefinitionStages.WithAdditionalProperties, + DefinitionStages.WithProgressPercentage, + DefinitionStages.WithNotifyMessage { + /** + * Executes the create request. + * + * @return the created resource. + */ + HciUpdate create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + HciUpdate create(Context context); + } + + /** The stage of the HciUpdate definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithCreate withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithCreate withRegion(String location); + } + + /** The stage of the HciUpdate definition allowing to specify installedDate. */ + interface WithInstalledDate { + /** + * Specifies the installedDate property: Date that the update was installed.. + * + * @param installedDate Date that the update was installed. + * @return the next definition stage. + */ + WithCreate withInstalledDate(OffsetDateTime installedDate); + } + + /** The stage of the HciUpdate definition allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: Description of the update.. + * + * @param description Description of the update. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + + /** The stage of the HciUpdate definition allowing to specify state. */ + interface WithState { + /** + * Specifies the state property: State of the update as it relates to this stamp.. + * + * @param state State of the update as it relates to this stamp. + * @return the next definition stage. + */ + WithCreate withState(State state); + } + + /** The stage of the HciUpdate definition allowing to specify prerequisites. */ + interface WithPrerequisites { + /** + * Specifies the prerequisites property: If update State is HasPrerequisite, this property contains an array + * of objects describing prerequisite updates before installing this update. Otherwise, it is empty.. + * + * @param prerequisites If update State is HasPrerequisite, this property contains an array of objects + * describing prerequisite updates before installing this update. Otherwise, it is empty. + * @return the next definition stage. + */ + WithCreate withPrerequisites(List prerequisites); + } + + /** The stage of the HciUpdate definition allowing to specify componentVersions. */ + interface WithComponentVersions { + /** + * Specifies the componentVersions property: An array of component versions for a Solution Bundle update, + * and an empty array otherwise. . + * + * @param componentVersions An array of component versions for a Solution Bundle update, and an empty array + * otherwise. + * @return the next definition stage. + */ + WithCreate withComponentVersions(List componentVersions); + } + + /** The stage of the HciUpdate definition allowing to specify rebootRequired. */ + interface WithRebootRequired { + /** + * Specifies the rebootRequired property: The rebootRequired property.. + * + * @param rebootRequired The rebootRequired property. + * @return the next definition stage. + */ + WithCreate withRebootRequired(RebootRequirement rebootRequired); + } + + /** The stage of the HciUpdate definition allowing to specify healthState. */ + interface WithHealthState { + /** + * Specifies the healthState property: Overall health state for update-specific health checks.. + * + * @param healthState Overall health state for update-specific health checks. + * @return the next definition stage. + */ + WithCreate withHealthState(HealthState healthState); + } + + /** The stage of the HciUpdate definition allowing to specify healthCheckResult. */ + interface WithHealthCheckResult { + /** + * Specifies the healthCheckResult property: An array of PrecheckResult objects.. + * + * @param healthCheckResult An array of PrecheckResult objects. + * @return the next definition stage. + */ + WithCreate withHealthCheckResult(List healthCheckResult); + } + + /** The stage of the HciUpdate definition allowing to specify healthCheckDate. */ + interface WithHealthCheckDate { + /** + * Specifies the healthCheckDate property: Last time the package-specific checks were run.. + * + * @param healthCheckDate Last time the package-specific checks were run. + * @return the next definition stage. + */ + WithCreate withHealthCheckDate(OffsetDateTime healthCheckDate); + } + + /** The stage of the HciUpdate definition allowing to specify packagePath. */ + interface WithPackagePath { + /** + * Specifies the packagePath property: Path where the update package is available.. + * + * @param packagePath Path where the update package is available. + * @return the next definition stage. + */ + WithCreate withPackagePath(String packagePath); + } + + /** The stage of the HciUpdate definition allowing to specify packageSizeInMb. */ + interface WithPackageSizeInMb { + /** + * Specifies the packageSizeInMb property: Size of the package. This value is a combination of the size from + * update metadata and size of the payload that results from the live scan operation for OS update content.. + * + * @param packageSizeInMb Size of the package. This value is a combination of the size from update metadata + * and size of the payload that results from the live scan operation for OS update content. + * @return the next definition stage. + */ + WithCreate withPackageSizeInMb(Float packageSizeInMb); + } + + /** The stage of the HciUpdate definition allowing to specify displayName. */ + interface WithDisplayName { + /** + * Specifies the displayName property: Display name of the Update. + * + * @param displayName Display name of the Update. + * @return the next definition stage. + */ + WithCreate withDisplayName(String displayName); + } + + /** The stage of the HciUpdate definition allowing to specify version. */ + interface WithVersion { + /** + * Specifies the version property: Version of the update.. + * + * @param version Version of the update. + * @return the next definition stage. + */ + WithCreate withVersion(String version); + } + + /** The stage of the HciUpdate definition allowing to specify publisher. */ + interface WithPublisher { + /** + * Specifies the publisher property: Publisher of the update package.. + * + * @param publisher Publisher of the update package. + * @return the next definition stage. + */ + WithCreate withPublisher(String publisher); + } + + /** The stage of the HciUpdate definition allowing to specify releaseLink. */ + interface WithReleaseLink { + /** + * Specifies the releaseLink property: Link to release notes for the update.. + * + * @param releaseLink Link to release notes for the update. + * @return the next definition stage. + */ + WithCreate withReleaseLink(String releaseLink); + } + + /** The stage of the HciUpdate definition allowing to specify availabilityType. */ + interface WithAvailabilityType { + /** + * Specifies the availabilityType property: Indicates the way the update content can be downloaded.. + * + * @param availabilityType Indicates the way the update content can be downloaded. + * @return the next definition stage. + */ + WithCreate withAvailabilityType(AvailabilityType availabilityType); + } + + /** The stage of the HciUpdate definition allowing to specify packageType. */ + interface WithPackageType { + /** + * Specifies the packageType property: Customer-visible type of the update.. + * + * @param packageType Customer-visible type of the update. + * @return the next definition stage. + */ + WithCreate withPackageType(String packageType); + } + + /** The stage of the HciUpdate definition allowing to specify additionalProperties. */ + interface WithAdditionalProperties { + /** + * Specifies the additionalProperties property: Extensible KV pairs serialized as a string. This is + * currently used to report the stamp OEM family and hardware model information when an update is flagged as + * Invalid for the stamp based on OEM type.. + * + * @param additionalProperties Extensible KV pairs serialized as a string. This is currently used to report + * the stamp OEM family and hardware model information when an update is flagged as Invalid for the + * stamp based on OEM type. + * @return the next definition stage. + */ + WithCreate withAdditionalProperties(String additionalProperties); + } + + /** The stage of the HciUpdate definition allowing to specify progressPercentage. */ + interface WithProgressPercentage { + /** + * Specifies the progressPercentage property: Progress percentage of ongoing operation. Currently this + * property is only valid when the update is in the Downloading state, where it maps to how much of the + * update content has been downloaded.. + * + * @param progressPercentage Progress percentage of ongoing operation. Currently this property is only valid + * when the update is in the Downloading state, where it maps to how much of the update content has been + * downloaded. + * @return the next definition stage. + */ + WithCreate withProgressPercentage(Float progressPercentage); + } + + /** The stage of the HciUpdate definition allowing to specify notifyMessage. */ + interface WithNotifyMessage { + /** + * Specifies the notifyMessage property: Brief message with instructions for updates of AvailabilityType + * Notify.. + * + * @param notifyMessage Brief message with instructions for updates of AvailabilityType Notify. + * @return the next definition stage. + */ + WithCreate withNotifyMessage(String notifyMessage); + } + } + + /** + * Begins update for the HciUpdate resource. + * + * @return the stage of resource update. + */ + HciUpdate.Update update(); + + /** The template for HciUpdate update. */ + interface Update + extends UpdateStages.WithInstalledDate, + UpdateStages.WithDescription, + UpdateStages.WithState, + UpdateStages.WithPrerequisites, + UpdateStages.WithComponentVersions, + UpdateStages.WithRebootRequired, + UpdateStages.WithHealthState, + UpdateStages.WithHealthCheckResult, + UpdateStages.WithHealthCheckDate, + UpdateStages.WithPackagePath, + UpdateStages.WithPackageSizeInMb, + UpdateStages.WithDisplayName, + UpdateStages.WithVersion, + UpdateStages.WithPublisher, + UpdateStages.WithReleaseLink, + UpdateStages.WithAvailabilityType, + UpdateStages.WithPackageType, + UpdateStages.WithAdditionalProperties, + UpdateStages.WithProgressPercentage, + UpdateStages.WithNotifyMessage { + /** + * Executes the update request. + * + * @return the updated resource. + */ + HciUpdate apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + HciUpdate apply(Context context); + } + + /** The HciUpdate update stages. */ + interface UpdateStages { + /** The stage of the HciUpdate update allowing to specify installedDate. */ + interface WithInstalledDate { + /** + * Specifies the installedDate property: Date that the update was installed.. + * + * @param installedDate Date that the update was installed. + * @return the next definition stage. + */ + Update withInstalledDate(OffsetDateTime installedDate); + } + + /** The stage of the HciUpdate update allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: Description of the update.. + * + * @param description Description of the update. + * @return the next definition stage. + */ + Update withDescription(String description); + } + + /** The stage of the HciUpdate update allowing to specify state. */ + interface WithState { + /** + * Specifies the state property: State of the update as it relates to this stamp.. + * + * @param state State of the update as it relates to this stamp. + * @return the next definition stage. + */ + Update withState(State state); + } + + /** The stage of the HciUpdate update allowing to specify prerequisites. */ + interface WithPrerequisites { + /** + * Specifies the prerequisites property: If update State is HasPrerequisite, this property contains an array + * of objects describing prerequisite updates before installing this update. Otherwise, it is empty.. + * + * @param prerequisites If update State is HasPrerequisite, this property contains an array of objects + * describing prerequisite updates before installing this update. Otherwise, it is empty. + * @return the next definition stage. + */ + Update withPrerequisites(List prerequisites); + } + + /** The stage of the HciUpdate update allowing to specify componentVersions. */ + interface WithComponentVersions { + /** + * Specifies the componentVersions property: An array of component versions for a Solution Bundle update, + * and an empty array otherwise. . + * + * @param componentVersions An array of component versions for a Solution Bundle update, and an empty array + * otherwise. + * @return the next definition stage. + */ + Update withComponentVersions(List componentVersions); + } + + /** The stage of the HciUpdate update allowing to specify rebootRequired. */ + interface WithRebootRequired { + /** + * Specifies the rebootRequired property: The rebootRequired property.. + * + * @param rebootRequired The rebootRequired property. + * @return the next definition stage. + */ + Update withRebootRequired(RebootRequirement rebootRequired); + } + + /** The stage of the HciUpdate update allowing to specify healthState. */ + interface WithHealthState { + /** + * Specifies the healthState property: Overall health state for update-specific health checks.. + * + * @param healthState Overall health state for update-specific health checks. + * @return the next definition stage. + */ + Update withHealthState(HealthState healthState); + } + + /** The stage of the HciUpdate update allowing to specify healthCheckResult. */ + interface WithHealthCheckResult { + /** + * Specifies the healthCheckResult property: An array of PrecheckResult objects.. + * + * @param healthCheckResult An array of PrecheckResult objects. + * @return the next definition stage. + */ + Update withHealthCheckResult(List healthCheckResult); + } + + /** The stage of the HciUpdate update allowing to specify healthCheckDate. */ + interface WithHealthCheckDate { + /** + * Specifies the healthCheckDate property: Last time the package-specific checks were run.. + * + * @param healthCheckDate Last time the package-specific checks were run. + * @return the next definition stage. + */ + Update withHealthCheckDate(OffsetDateTime healthCheckDate); + } + + /** The stage of the HciUpdate update allowing to specify packagePath. */ + interface WithPackagePath { + /** + * Specifies the packagePath property: Path where the update package is available.. + * + * @param packagePath Path where the update package is available. + * @return the next definition stage. + */ + Update withPackagePath(String packagePath); + } + + /** The stage of the HciUpdate update allowing to specify packageSizeInMb. */ + interface WithPackageSizeInMb { + /** + * Specifies the packageSizeInMb property: Size of the package. This value is a combination of the size from + * update metadata and size of the payload that results from the live scan operation for OS update content.. + * + * @param packageSizeInMb Size of the package. This value is a combination of the size from update metadata + * and size of the payload that results from the live scan operation for OS update content. + * @return the next definition stage. + */ + Update withPackageSizeInMb(Float packageSizeInMb); + } + + /** The stage of the HciUpdate update allowing to specify displayName. */ + interface WithDisplayName { + /** + * Specifies the displayName property: Display name of the Update. + * + * @param displayName Display name of the Update. + * @return the next definition stage. + */ + Update withDisplayName(String displayName); + } + + /** The stage of the HciUpdate update allowing to specify version. */ + interface WithVersion { + /** + * Specifies the version property: Version of the update.. + * + * @param version Version of the update. + * @return the next definition stage. + */ + Update withVersion(String version); + } + + /** The stage of the HciUpdate update allowing to specify publisher. */ + interface WithPublisher { + /** + * Specifies the publisher property: Publisher of the update package.. + * + * @param publisher Publisher of the update package. + * @return the next definition stage. + */ + Update withPublisher(String publisher); + } + + /** The stage of the HciUpdate update allowing to specify releaseLink. */ + interface WithReleaseLink { + /** + * Specifies the releaseLink property: Link to release notes for the update.. + * + * @param releaseLink Link to release notes for the update. + * @return the next definition stage. + */ + Update withReleaseLink(String releaseLink); + } + + /** The stage of the HciUpdate update allowing to specify availabilityType. */ + interface WithAvailabilityType { + /** + * Specifies the availabilityType property: Indicates the way the update content can be downloaded.. + * + * @param availabilityType Indicates the way the update content can be downloaded. + * @return the next definition stage. + */ + Update withAvailabilityType(AvailabilityType availabilityType); + } + + /** The stage of the HciUpdate update allowing to specify packageType. */ + interface WithPackageType { + /** + * Specifies the packageType property: Customer-visible type of the update.. + * + * @param packageType Customer-visible type of the update. + * @return the next definition stage. + */ + Update withPackageType(String packageType); + } + + /** The stage of the HciUpdate update allowing to specify additionalProperties. */ + interface WithAdditionalProperties { + /** + * Specifies the additionalProperties property: Extensible KV pairs serialized as a string. This is + * currently used to report the stamp OEM family and hardware model information when an update is flagged as + * Invalid for the stamp based on OEM type.. + * + * @param additionalProperties Extensible KV pairs serialized as a string. This is currently used to report + * the stamp OEM family and hardware model information when an update is flagged as Invalid for the + * stamp based on OEM type. + * @return the next definition stage. + */ + Update withAdditionalProperties(String additionalProperties); + } + + /** The stage of the HciUpdate update allowing to specify progressPercentage. */ + interface WithProgressPercentage { + /** + * Specifies the progressPercentage property: Progress percentage of ongoing operation. Currently this + * property is only valid when the update is in the Downloading state, where it maps to how much of the + * update content has been downloaded.. + * + * @param progressPercentage Progress percentage of ongoing operation. Currently this property is only valid + * when the update is in the Downloading state, where it maps to how much of the update content has been + * downloaded. + * @return the next definition stage. + */ + Update withProgressPercentage(Float progressPercentage); + } + + /** The stage of the HciUpdate update allowing to specify notifyMessage. */ + interface WithNotifyMessage { + /** + * Specifies the notifyMessage property: Brief message with instructions for updates of AvailabilityType + * Notify.. + * + * @param notifyMessage Brief message with instructions for updates of AvailabilityType Notify. + * @return the next definition stage. + */ + Update withNotifyMessage(String notifyMessage); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + HciUpdate refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + HciUpdate refresh(Context context); + + /** + * Apply Update. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void post(); + + /** + * Apply Update. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void post(Context context); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HealthState.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HealthState.java new file mode 100644 index 0000000000000..05d24c32b069a --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/HealthState.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for HealthState. */ +public final class HealthState extends ExpandableStringEnum { + /** Static value Unknown for HealthState. */ + public static final HealthState UNKNOWN = fromString("Unknown"); + + /** Static value Success for HealthState. */ + public static final HealthState SUCCESS = fromString("Success"); + + /** Static value Failure for HealthState. */ + public static final HealthState FAILURE = fromString("Failure"); + + /** Static value Warning for HealthState. */ + public static final HealthState WARNING = fromString("Warning"); + + /** Static value Error for HealthState. */ + public static final HealthState ERROR = fromString("Error"); + + /** Static value InProgress for HealthState. */ + public static final HealthState IN_PROGRESS = fromString("InProgress"); + + /** + * Creates a new instance of HealthState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public HealthState() { + } + + /** + * Creates or finds a HealthState from its string representation. + * + * @param name a name to look for. + * @return the corresponding HealthState. + */ + @JsonCreator + public static HealthState fromString(String name) { + return fromString(name, HealthState.class); + } + + /** + * Gets known HealthState values. + * + * @return known HealthState values. + */ + public static Collection values() { + return values(HealthState.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ImdsAttestation.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ImdsAttestation.java index c3ca4a6a0bcfe..3c5b40aabeb94 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ImdsAttestation.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ImdsAttestation.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for ImdsAttestation. */ +/** IMDS attestation status of the cluster. */ public final class ImdsAttestation extends ExpandableStringEnum { /** Static value Disabled for ImdsAttestation. */ public static final ImdsAttestation DISABLED = fromString("Disabled"); @@ -16,6 +16,15 @@ public final class ImdsAttestation extends ExpandableStringEnum /** Static value Enabled for ImdsAttestation. */ public static final ImdsAttestation ENABLED = fromString("Enabled"); + /** + * Creates a new instance of ImdsAttestation value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ImdsAttestation() { + } + /** * Creates or finds a ImdsAttestation from its string representation. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/IsolatedVmAttestationConfiguration.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/IsolatedVmAttestationConfiguration.java new file mode 100644 index 0000000000000..47a77ba524a83 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/IsolatedVmAttestationConfiguration.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Attestation configurations for isolated VM (e.g. TVM, CVM) of the cluster. */ +@Immutable +public final class IsolatedVmAttestationConfiguration { + /* + * Fully qualified Arm Resource Id of the Microsoft Azure Attestation resource associated with this cluster. + */ + @JsonProperty(value = "attestationResourceId", access = JsonProperty.Access.WRITE_ONLY) + private String attestationResourceId; + + /* + * Region specific endpoint for relying party service. + */ + @JsonProperty(value = "relyingPartyServiceEndpoint", access = JsonProperty.Access.WRITE_ONLY) + private String relyingPartyServiceEndpoint; + + /* + * Region specific endpoint for Microsoft Azure Attestation service for the cluster + */ + @JsonProperty(value = "attestationServiceEndpoint", access = JsonProperty.Access.WRITE_ONLY) + private String attestationServiceEndpoint; + + /** Creates an instance of IsolatedVmAttestationConfiguration class. */ + public IsolatedVmAttestationConfiguration() { + } + + /** + * Get the attestationResourceId property: Fully qualified Arm Resource Id of the Microsoft Azure Attestation + * resource associated with this cluster. + * + * @return the attestationResourceId value. + */ + public String attestationResourceId() { + return this.attestationResourceId; + } + + /** + * Get the relyingPartyServiceEndpoint property: Region specific endpoint for relying party service. + * + * @return the relyingPartyServiceEndpoint value. + */ + public String relyingPartyServiceEndpoint() { + return this.relyingPartyServiceEndpoint; + } + + /** + * Get the attestationServiceEndpoint property: Region specific endpoint for Microsoft Azure Attestation service for + * the cluster. + * + * @return the attestationServiceEndpoint value. + */ + public String attestationServiceEndpoint() { + return this.attestationServiceEndpoint; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ManagedServiceIdentityType.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ManagedServiceIdentityType.java new file mode 100644 index 0000000000000..97357405bcd52 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ManagedServiceIdentityType.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). */ +public final class ManagedServiceIdentityType extends ExpandableStringEnum { + /** Static value None for ManagedServiceIdentityType. */ + public static final ManagedServiceIdentityType NONE = fromString("None"); + + /** Static value SystemAssigned for ManagedServiceIdentityType. */ + public static final ManagedServiceIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + + /** Static value UserAssigned for ManagedServiceIdentityType. */ + public static final ManagedServiceIdentityType USER_ASSIGNED = fromString("UserAssigned"); + + /** Static value SystemAssigned, UserAssigned for ManagedServiceIdentityType. */ + public static final ManagedServiceIdentityType SYSTEM_ASSIGNED_USER_ASSIGNED = + fromString("SystemAssigned, UserAssigned"); + + /** + * Creates a new instance of ManagedServiceIdentityType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ManagedServiceIdentityType() { + } + + /** + * Creates or finds a ManagedServiceIdentityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedServiceIdentityType. + */ + @JsonCreator + public static ManagedServiceIdentityType fromString(String name) { + return fromString(name, ManagedServiceIdentityType.class); + } + + /** + * Gets known ManagedServiceIdentityType values. + * + * @return known ManagedServiceIdentityType values. + */ + public static Collection values() { + return values(ManagedServiceIdentityType.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NodeArcState.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NodeArcState.java index c4f967773edf3..b85013fc21d09 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NodeArcState.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NodeArcState.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for NodeArcState. */ +/** State of Arc agent in this node. */ public final class NodeArcState extends ExpandableStringEnum { /** Static value NotSpecified for NodeArcState. */ public static final NodeArcState NOT_SPECIFIED = fromString("NotSpecified"); @@ -46,6 +46,33 @@ public final class NodeArcState extends ExpandableStringEnum { /** Static value Moving for NodeArcState. */ public static final NodeArcState MOVING = fromString("Moving"); + /** Static value PartiallySucceeded for NodeArcState. */ + public static final NodeArcState PARTIALLY_SUCCEEDED = fromString("PartiallySucceeded"); + + /** Static value PartiallyConnected for NodeArcState. */ + public static final NodeArcState PARTIALLY_CONNECTED = fromString("PartiallyConnected"); + + /** Static value InProgress for NodeArcState. */ + public static final NodeArcState IN_PROGRESS = fromString("InProgress"); + + /** Static value Accepted for NodeArcState. */ + public static final NodeArcState ACCEPTED = fromString("Accepted"); + + /** Static value Provisioning for NodeArcState. */ + public static final NodeArcState PROVISIONING = fromString("Provisioning"); + + /** Static value DisableInProgress for NodeArcState. */ + public static final NodeArcState DISABLE_IN_PROGRESS = fromString("DisableInProgress"); + + /** + * Creates a new instance of NodeArcState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NodeArcState() { + } + /** * Creates or finds a NodeArcState from its string representation. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NodeExtensionState.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NodeExtensionState.java index c3394d36855f4..5af59a21cd266 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NodeExtensionState.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NodeExtensionState.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for NodeExtensionState. */ +/** State of Arc Extension in this node. */ public final class NodeExtensionState extends ExpandableStringEnum { /** Static value NotSpecified for NodeExtensionState. */ public static final NodeExtensionState NOT_SPECIFIED = fromString("NotSpecified"); @@ -46,6 +46,30 @@ public final class NodeExtensionState extends ExpandableStringEnum { + /** Static value Disabled for OemActivation. */ + public static final OemActivation DISABLED = fromString("Disabled"); + + /** Static value Enabled for OemActivation. */ + public static final OemActivation ENABLED = fromString("Enabled"); + + /** + * Creates a new instance of OemActivation value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public OemActivation() { + } + + /** + * Creates or finds a OemActivation from its string representation. + * + * @param name a name to look for. + * @return the corresponding OemActivation. + */ + @JsonCreator + public static OemActivation fromString(String name) { + return fromString(name, OemActivation.class); + } + + /** + * Gets known OemActivation values. + * + * @return known OemActivation values. + */ + public static Collection values() { + return values(OemActivation.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Offer.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Offer.java new file mode 100644 index 0000000000000..7377f5027237f --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Offer.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.azurestackhci.fluent.models.OfferInner; +import java.util.List; + +/** An immutable client-side representation of Offer. */ +public interface Offer { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: Provisioning State. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the publisherId property: Identifier of the Publisher for the offer. + * + * @return the publisherId value. + */ + String publisherId(); + + /** + * Gets the content property: JSON serialized catalog content of the offer. + * + * @return the content value. + */ + String content(); + + /** + * Gets the contentVersion property: The API version of the catalog service used to serve the catalog content. + * + * @return the contentVersion value. + */ + String contentVersion(); + + /** + * Gets the skuMappings property: Array of SKU mappings. + * + * @return the skuMappings value. + */ + List skuMappings(); + + /** + * Gets the inner com.azure.resourcemanager.azurestackhci.fluent.models.OfferInner object. + * + * @return the inner object. + */ + OfferInner innerModel(); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OfferList.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OfferList.java new file mode 100644 index 0000000000000..df7f18b491a87 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OfferList.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.azurestackhci.fluent.models.OfferInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of Offer proxy resources for the HCI cluster. */ +@Immutable +public final class OfferList { + /* + * List of Offer proxy resources. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Link to the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** Creates an instance of OfferList class. */ + public OfferList() { + } + + /** + * Get the value property: List of Offer proxy resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Link to the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Offers.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Offers.java new file mode 100644 index 0000000000000..05a0069a5c847 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Offers.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Offers. */ +public interface Offers { + /** + * List Offers available for a publisher within the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Offer proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + PagedIterable listByPublisher(String resourceGroupName, String clusterName, String publisherName); + + /** + * List Offers available for a publisher within the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Offer proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + PagedIterable listByPublisher( + String resourceGroupName, String clusterName, String publisherName, String expand, Context context); + + /** + * List Offers available across publishers for the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Offer proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + PagedIterable listByCluster(String resourceGroupName, String clusterName); + + /** + * List Offers available across publishers for the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Offer proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + PagedIterable listByCluster(String resourceGroupName, String clusterName, String expand, Context context); + + /** + * Get Offer resource details within a publisher of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return offer resource details within a publisher of HCI Cluster along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, + String clusterName, + String publisherName, + String offerName, + String expand, + Context context); + + /** + * Get Offer resource details within a publisher of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return offer resource details within a publisher of HCI Cluster. + */ + Offer get(String resourceGroupName, String clusterName, String publisherName, String offerName); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Operation.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Operation.java index 8a8c66e2aafe5..2edd1d043c053 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Operation.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Operation.java @@ -7,20 +7,23 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** REST API Operation Details of a REST API operation, returned from the Resource Provider Operations API. */ +/** + * REST API Operation + * + *

Details of a REST API operation, returned from the Resource Provider Operations API. + */ @Fluent public final class Operation { /* - * The name of the operation, as per Resource-Based Access Control (RBAC). - * Examples: "Microsoft.Compute/virtualMachines/write", - * "Microsoft.Compute/virtualMachines/capture/action" + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" */ @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) private String name; /* - * Whether the operation applies to data-plane. This is "true" for - * data-plane operations and "false" for ARM/control-plane operations. + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for + * ARM/control-plane operations. */ @JsonProperty(value = "isDataAction", access = JsonProperty.Access.WRITE_ONLY) private Boolean isDataAction; @@ -32,19 +35,22 @@ public final class Operation { private OperationDisplay display; /* - * The intended executor of the operation; as in Resource Based Access - * Control (RBAC) and audit logs UX. Default value is "user,system" + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default + * value is "user,system" */ @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) private Origin origin; /* - * Enum. Indicates the action type. "Internal" refers to actions that are - * for internal only APIs. + * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ @JsonProperty(value = "actionType", access = JsonProperty.Access.WRITE_ONLY) private ActionType actionType; + /** Creates an instance of Operation class. */ + public Operation() { + } + /** * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OperationDisplay.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OperationDisplay.java index 75a95b413ce47..2d240728b7e43 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OperationDisplay.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/OperationDisplay.java @@ -11,34 +11,36 @@ @Immutable public final class OperationDisplay { /* - * The localized friendly form of the resource provider name, e.g. - * "Microsoft Monitoring Insights" or "Microsoft Compute". + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft + * Compute". */ @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) private String provider; /* - * The localized friendly name of the resource type related to this - * operation. E.g. "Virtual Machines" or "Job Schedule Collections". + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job + * Schedule Collections". */ @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) private String resource; /* - * The concise, localized friendly name for the operation; suitable for - * dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual - * Machine". + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual + * Machine", "Restart Virtual Machine". */ @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) private String operation; /* - * The short, localized friendly description of the operation; suitable for - * tool tips and detailed views. + * The short, localized friendly description of the operation; suitable for tool tips and detailed views. */ @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) private String description; + /** Creates an instance of OperationDisplay class. */ + public OperationDisplay() { + } + /** * Get the provider property: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring * Insights" or "Microsoft Compute". diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Operations.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Operations.java index 570a7f0abbd4b..a2b004c68e7db 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Operations.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Operations.java @@ -12,20 +12,20 @@ public interface Operations { /** * List all available Microsoft.AzureStackHCI provider operations. * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link Response}. */ - OperationListResult list(); + Response listWithResponse(Context context); /** * List all available Microsoft.AzureStackHCI provider operations. * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider along with {@link Response}. + * @return a list of REST API operations supported by an Azure Resource Provider. */ - Response listWithResponse(Context context); + OperationListResult list(); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Origin.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Origin.java index 5eb928fb9ec93..d45e549be2fa1 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Origin.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Origin.java @@ -8,7 +8,10 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for Origin. */ +/** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value + * is "user,system". + */ public final class Origin extends ExpandableStringEnum { /** Static value user for Origin. */ public static final Origin USER = fromString("user"); @@ -19,6 +22,15 @@ public final class Origin extends ExpandableStringEnum { /** Static value user,system for Origin. */ public static final Origin USER_SYSTEM = fromString("user,system"); + /** + * Creates a new instance of Origin value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Origin() { + } + /** * Creates or finds a Origin from its string representation. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PackageVersionInfo.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PackageVersionInfo.java new file mode 100644 index 0000000000000..e110cff3201ad --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PackageVersionInfo.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Current version of each updatable component. */ +@Fluent +public final class PackageVersionInfo { + /* + * Package type + */ + @JsonProperty(value = "packageType") + private String packageType; + + /* + * Package version + */ + @JsonProperty(value = "version") + private String version; + + /* + * Last time this component was updated. + */ + @JsonProperty(value = "lastUpdated") + private OffsetDateTime lastUpdated; + + /** Creates an instance of PackageVersionInfo class. */ + public PackageVersionInfo() { + } + + /** + * Get the packageType property: Package type. + * + * @return the packageType value. + */ + public String packageType() { + return this.packageType; + } + + /** + * Set the packageType property: Package type. + * + * @param packageType the packageType value to set. + * @return the PackageVersionInfo object itself. + */ + public PackageVersionInfo withPackageType(String packageType) { + this.packageType = packageType; + return this; + } + + /** + * Get the version property: Package version. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: Package version. + * + * @param version the version value to set. + * @return the PackageVersionInfo object itself. + */ + public PackageVersionInfo withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get the lastUpdated property: Last time this component was updated. + * + * @return the lastUpdated value. + */ + public OffsetDateTime lastUpdated() { + return this.lastUpdated; + } + + /** + * Set the lastUpdated property: Last time this component was updated. + * + * @param lastUpdated the lastUpdated value to set. + * @return the PackageVersionInfo object itself. + */ + public PackageVersionInfo withLastUpdated(OffsetDateTime lastUpdated) { + this.lastUpdated = lastUpdated; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PerNodeExtensionState.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PerNodeExtensionState.java index 54a16e384b67d..7e82658fdeb82 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PerNodeExtensionState.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PerNodeExtensionState.java @@ -17,18 +17,33 @@ public final class PerNodeExtensionState { private String name; /* - * Fully qualified resource ID for the particular Arc Extension on this - * node. + * Fully qualified resource ID for the particular Arc Extension on this node. */ @JsonProperty(value = "extension", access = JsonProperty.Access.WRITE_ONLY) private String extension; + /* + * Specifies the version of the script handler. + */ + @JsonProperty(value = "typeHandlerVersion", access = JsonProperty.Access.WRITE_ONLY) + private String typeHandlerVersion; + /* * State of Arc Extension in this node. */ @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) private NodeExtensionState state; + /* + * The extension instance view. + */ + @JsonProperty(value = "instanceView", access = JsonProperty.Access.WRITE_ONLY) + private ExtensionInstanceView instanceView; + + /** Creates an instance of PerNodeExtensionState class. */ + public PerNodeExtensionState() { + } + /** * Get the name property: Name of the node in HCI Cluster. * @@ -47,6 +62,15 @@ public String extension() { return this.extension; } + /** + * Get the typeHandlerVersion property: Specifies the version of the script handler. + * + * @return the typeHandlerVersion value. + */ + public String typeHandlerVersion() { + return this.typeHandlerVersion; + } + /** * Get the state property: State of Arc Extension in this node. * @@ -56,11 +80,23 @@ public NodeExtensionState state() { return this.state; } + /** + * Get the instanceView property: The extension instance view. + * + * @return the instanceView value. + */ + public ExtensionInstanceView instanceView() { + return this.instanceView; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (instanceView() != null) { + instanceView().validate(); + } } } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PerNodeState.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PerNodeState.java index 9dad6d8d94a08..e13cca3e814fa 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PerNodeState.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PerNodeState.java @@ -28,6 +28,10 @@ public final class PerNodeState { @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) private NodeArcState state; + /** Creates an instance of PerNodeState class. */ + public PerNodeState() { + } + /** * Get the name property: Name of the Node in HCI Cluster. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PrecheckResult.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PrecheckResult.java new file mode 100644 index 0000000000000..74768e436be09 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PrecheckResult.java @@ -0,0 +1,350 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The PrecheckResult model. */ +@Fluent +public final class PrecheckResult { + /* + * Name of the individual test/rule/alert that was executed. Unique, not exposed to the customer. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Key-value pairs that allow grouping/filtering individual tests. + */ + @JsonProperty(value = "tags") + private PrecheckResultTags tags; + + /* + * User-facing name; one or more sentences indicating the direct issue. + */ + @JsonProperty(value = "title") + private String title; + + /* + * The status of the check running (i.e. Failed, Succeeded, In Progress). This answers whether the check ran, and + * passed or failed. + */ + @JsonProperty(value = "status") + private Status status; + + /* + * Severity of the result (Critical, Warning, Informational, Hidden). This answers how important the result is. + * Critical is the only update-blocking severity. + */ + @JsonProperty(value = "severity") + private Severity severity; + + /* + * Detailed overview of the issue and what impact the issue has on the stamp. + */ + @JsonProperty(value = "description") + private String description; + + /* + * Set of steps that can be taken to resolve the issue found. + */ + @JsonProperty(value = "remediation") + private String remediation; + + /* + * The unique identifier for the affected resource (such as a node or drive). + */ + @JsonProperty(value = "targetResourceID") + private String targetResourceId; + + /* + * The name of the affected resource. + */ + @JsonProperty(value = "targetResourceName") + private String targetResourceName; + + /* + * The Time in which the HealthCheck was called. + */ + @JsonProperty(value = "timestamp") + private OffsetDateTime timestamp; + + /* + * Property bag of key value pairs for additional information. + */ + @JsonProperty(value = "additionalData") + private String additionalData; + + /* + * The name of the services called for the HealthCheck (I.E. Test-AzureStack, Test-Cluster). + */ + @JsonProperty(value = "healthCheckSource") + private String healthCheckSource; + + /** Creates an instance of PrecheckResult class. */ + public PrecheckResult() { + } + + /** + * Get the name property: Name of the individual test/rule/alert that was executed. Unique, not exposed to the + * customer. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the individual test/rule/alert that was executed. Unique, not exposed to the + * customer. + * + * @param name the name value to set. + * @return the PrecheckResult object itself. + */ + public PrecheckResult withName(String name) { + this.name = name; + return this; + } + + /** + * Get the tags property: Key-value pairs that allow grouping/filtering individual tests. + * + * @return the tags value. + */ + public PrecheckResultTags tags() { + return this.tags; + } + + /** + * Set the tags property: Key-value pairs that allow grouping/filtering individual tests. + * + * @param tags the tags value to set. + * @return the PrecheckResult object itself. + */ + public PrecheckResult withTags(PrecheckResultTags tags) { + this.tags = tags; + return this; + } + + /** + * Get the title property: User-facing name; one or more sentences indicating the direct issue. + * + * @return the title value. + */ + public String title() { + return this.title; + } + + /** + * Set the title property: User-facing name; one or more sentences indicating the direct issue. + * + * @param title the title value to set. + * @return the PrecheckResult object itself. + */ + public PrecheckResult withTitle(String title) { + this.title = title; + return this; + } + + /** + * Get the status property: The status of the check running (i.e. Failed, Succeeded, In Progress). This answers + * whether the check ran, and passed or failed. + * + * @return the status value. + */ + public Status status() { + return this.status; + } + + /** + * Set the status property: The status of the check running (i.e. Failed, Succeeded, In Progress). This answers + * whether the check ran, and passed or failed. + * + * @param status the status value to set. + * @return the PrecheckResult object itself. + */ + public PrecheckResult withStatus(Status status) { + this.status = status; + return this; + } + + /** + * Get the severity property: Severity of the result (Critical, Warning, Informational, Hidden). This answers how + * important the result is. Critical is the only update-blocking severity. + * + * @return the severity value. + */ + public Severity severity() { + return this.severity; + } + + /** + * Set the severity property: Severity of the result (Critical, Warning, Informational, Hidden). This answers how + * important the result is. Critical is the only update-blocking severity. + * + * @param severity the severity value to set. + * @return the PrecheckResult object itself. + */ + public PrecheckResult withSeverity(Severity severity) { + this.severity = severity; + return this; + } + + /** + * Get the description property: Detailed overview of the issue and what impact the issue has on the stamp. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Detailed overview of the issue and what impact the issue has on the stamp. + * + * @param description the description value to set. + * @return the PrecheckResult object itself. + */ + public PrecheckResult withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the remediation property: Set of steps that can be taken to resolve the issue found. + * + * @return the remediation value. + */ + public String remediation() { + return this.remediation; + } + + /** + * Set the remediation property: Set of steps that can be taken to resolve the issue found. + * + * @param remediation the remediation value to set. + * @return the PrecheckResult object itself. + */ + public PrecheckResult withRemediation(String remediation) { + this.remediation = remediation; + return this; + } + + /** + * Get the targetResourceId property: The unique identifier for the affected resource (such as a node or drive). + * + * @return the targetResourceId value. + */ + public String targetResourceId() { + return this.targetResourceId; + } + + /** + * Set the targetResourceId property: The unique identifier for the affected resource (such as a node or drive). + * + * @param targetResourceId the targetResourceId value to set. + * @return the PrecheckResult object itself. + */ + public PrecheckResult withTargetResourceId(String targetResourceId) { + this.targetResourceId = targetResourceId; + return this; + } + + /** + * Get the targetResourceName property: The name of the affected resource. + * + * @return the targetResourceName value. + */ + public String targetResourceName() { + return this.targetResourceName; + } + + /** + * Set the targetResourceName property: The name of the affected resource. + * + * @param targetResourceName the targetResourceName value to set. + * @return the PrecheckResult object itself. + */ + public PrecheckResult withTargetResourceName(String targetResourceName) { + this.targetResourceName = targetResourceName; + return this; + } + + /** + * Get the timestamp property: The Time in which the HealthCheck was called. + * + * @return the timestamp value. + */ + public OffsetDateTime timestamp() { + return this.timestamp; + } + + /** + * Set the timestamp property: The Time in which the HealthCheck was called. + * + * @param timestamp the timestamp value to set. + * @return the PrecheckResult object itself. + */ + public PrecheckResult withTimestamp(OffsetDateTime timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Get the additionalData property: Property bag of key value pairs for additional information. + * + * @return the additionalData value. + */ + public String additionalData() { + return this.additionalData; + } + + /** + * Set the additionalData property: Property bag of key value pairs for additional information. + * + * @param additionalData the additionalData value to set. + * @return the PrecheckResult object itself. + */ + public PrecheckResult withAdditionalData(String additionalData) { + this.additionalData = additionalData; + return this; + } + + /** + * Get the healthCheckSource property: The name of the services called for the HealthCheck (I.E. Test-AzureStack, + * Test-Cluster). + * + * @return the healthCheckSource value. + */ + public String healthCheckSource() { + return this.healthCheckSource; + } + + /** + * Set the healthCheckSource property: The name of the services called for the HealthCheck (I.E. Test-AzureStack, + * Test-Cluster). + * + * @param healthCheckSource the healthCheckSource value to set. + * @return the PrecheckResult object itself. + */ + public PrecheckResult withHealthCheckSource(String healthCheckSource) { + this.healthCheckSource = healthCheckSource; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tags() != null) { + tags().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PrecheckResultTags.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PrecheckResultTags.java new file mode 100644 index 0000000000000..d4e1493a0b9c0 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PrecheckResultTags.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Key-value pairs that allow grouping/filtering individual tests. */ +@Fluent +public final class PrecheckResultTags { + /* + * Key that allow grouping/filtering individual tests. + */ + @JsonProperty(value = "key") + private String key; + + /* + * Value of the key that allow grouping/filtering individual tests. + */ + @JsonProperty(value = "value") + private String value; + + /** Creates an instance of PrecheckResultTags class. */ + public PrecheckResultTags() { + } + + /** + * Get the key property: Key that allow grouping/filtering individual tests. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: Key that allow grouping/filtering individual tests. + * + * @param key the key value to set. + * @return the PrecheckResultTags object itself. + */ + public PrecheckResultTags withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: Value of the key that allow grouping/filtering individual tests. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Value of the key that allow grouping/filtering individual tests. + * + * @param value the value value to set. + * @return the PrecheckResultTags object itself. + */ + public PrecheckResultTags withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ProvisioningState.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ProvisioningState.java index 117f3584ed155..fce5fe2f0588d 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ProvisioningState.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ProvisioningState.java @@ -8,8 +8,14 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for ProvisioningState. */ +/** Provisioning state of the ArcSetting proxy resource. */ public final class ProvisioningState extends ExpandableStringEnum { + /** Static value NotSpecified for ProvisioningState. */ + public static final ProvisioningState NOT_SPECIFIED = fromString("NotSpecified"); + + /** Static value Error for ProvisioningState. */ + public static final ProvisioningState ERROR = fromString("Error"); + /** Static value Succeeded for ProvisioningState. */ public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); @@ -19,12 +25,54 @@ public final class ProvisioningState extends ExpandableStringEnum value; + + /* + * Link to the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** Creates an instance of PublisherList class. */ + public PublisherList() { + } + + /** + * Get the value property: List of Publisher proxy resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Link to the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Publishers.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Publishers.java new file mode 100644 index 0000000000000..65eddd19fb092 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Publishers.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Publishers. */ +public interface Publishers { + /** + * List Publishers available for the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Publisher proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + PagedIterable listByCluster(String resourceGroupName, String clusterName); + + /** + * List Publishers available for the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Publisher proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + PagedIterable listByCluster(String resourceGroupName, String clusterName, Context context); + + /** + * Get Publisher resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher resource details of HCI Cluster along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String clusterName, String publisherName, Context context); + + /** + * Get Publisher resource details of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return publisher resource details of HCI Cluster. + */ + Publisher get(String resourceGroupName, String clusterName, String publisherName); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/RawCertificateData.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/RawCertificateData.java index 5cb214a9d881a..53bf8ca189b07 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/RawCertificateData.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/RawCertificateData.java @@ -17,6 +17,10 @@ public final class RawCertificateData { @JsonProperty(value = "certificates") private List certificates; + /** Creates an instance of RawCertificateData class. */ + public RawCertificateData() { + } + /** * Get the certificates property: The certificates property. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/RebootRequirement.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/RebootRequirement.java new file mode 100644 index 0000000000000..640bacd8ba7ec --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/RebootRequirement.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RebootRequirement. */ +public final class RebootRequirement extends ExpandableStringEnum { + /** Static value Unknown for RebootRequirement. */ + public static final RebootRequirement UNKNOWN = fromString("Unknown"); + + /** Static value True for RebootRequirement. */ + public static final RebootRequirement TRUE = fromString("True"); + + /** Static value False for RebootRequirement. */ + public static final RebootRequirement FALSE = fromString("False"); + + /** + * Creates a new instance of RebootRequirement value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RebootRequirement() { + } + + /** + * Creates or finds a RebootRequirement from its string representation. + * + * @param name a name to look for. + * @return the corresponding RebootRequirement. + */ + @JsonCreator + public static RebootRequirement fromString(String name) { + return fromString(name, RebootRequirement.class); + } + + /** + * Gets known RebootRequirement values. + * + * @return known RebootRequirement values. + */ + public static Collection values() { + return values(RebootRequirement.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Severity.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Severity.java new file mode 100644 index 0000000000000..bad260cfb6804 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Severity.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Severity of the result (Critical, Warning, Informational, Hidden). This answers how important the result is. Critical + * is the only update-blocking severity. + */ +public final class Severity extends ExpandableStringEnum { + /** Static value Critical for Severity. */ + public static final Severity CRITICAL = fromString("Critical"); + + /** Static value Warning for Severity. */ + public static final Severity WARNING = fromString("Warning"); + + /** Static value Informational for Severity. */ + public static final Severity INFORMATIONAL = fromString("Informational"); + + /** Static value Hidden for Severity. */ + public static final Severity HIDDEN = fromString("Hidden"); + + /** + * Creates a new instance of Severity value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Severity() { + } + + /** + * Creates or finds a Severity from its string representation. + * + * @param name a name to look for. + * @return the corresponding Severity. + */ + @JsonCreator + public static Severity fromString(String name) { + return fromString(name, Severity.class); + } + + /** + * Gets known Severity values. + * + * @return known Severity values. + */ + public static Collection values() { + return values(Severity.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Sku.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Sku.java new file mode 100644 index 0000000000000..7e2ee240de5f8 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Sku.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.azurestackhci.fluent.models.SkuInner; +import java.util.List; + +/** An immutable client-side representation of Sku. */ +public interface Sku { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: Provisioning State. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the publisherId property: Identifier of the Publisher for the offer. + * + * @return the publisherId value. + */ + String publisherId(); + + /** + * Gets the offerId property: Identifier of the Offer for the sku. + * + * @return the offerId value. + */ + String offerId(); + + /** + * Gets the content property: JSON serialized catalog content of the sku offer. + * + * @return the content value. + */ + String content(); + + /** + * Gets the contentVersion property: The API version of the catalog service used to serve the catalog content. + * + * @return the contentVersion value. + */ + String contentVersion(); + + /** + * Gets the skuMappings property: Array of SKU mappings. + * + * @return the skuMappings value. + */ + List skuMappings(); + + /** + * Gets the inner com.azure.resourcemanager.azurestackhci.fluent.models.SkuInner object. + * + * @return the inner object. + */ + SkuInner innerModel(); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SkuList.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SkuList.java new file mode 100644 index 0000000000000..f1bcc39b54672 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SkuList.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.azurestackhci.fluent.models.SkuInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of SKU proxy resources for the HCI cluster. */ +@Immutable +public final class SkuList { + /* + * List of SKU proxy resources. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Link to the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** Creates an instance of SkuList class. */ + public SkuList() { + } + + /** + * Get the value property: List of SKU proxy resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Link to the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SkuMappings.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SkuMappings.java new file mode 100644 index 0000000000000..cc5f7f6ab6139 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SkuMappings.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** SKU Mapping details. */ +@Fluent +public final class SkuMappings { + /* + * Identifier of the CatalogPlan for the sku + */ + @JsonProperty(value = "catalogPlanId") + private String catalogPlanId; + + /* + * Identifier for the sku + */ + @JsonProperty(value = "marketplaceSkuId") + private String marketplaceSkuId; + + /* + * Array of SKU versions available + */ + @JsonProperty(value = "marketplaceSkuVersions") + private List marketplaceSkuVersions; + + /** Creates an instance of SkuMappings class. */ + public SkuMappings() { + } + + /** + * Get the catalogPlanId property: Identifier of the CatalogPlan for the sku. + * + * @return the catalogPlanId value. + */ + public String catalogPlanId() { + return this.catalogPlanId; + } + + /** + * Set the catalogPlanId property: Identifier of the CatalogPlan for the sku. + * + * @param catalogPlanId the catalogPlanId value to set. + * @return the SkuMappings object itself. + */ + public SkuMappings withCatalogPlanId(String catalogPlanId) { + this.catalogPlanId = catalogPlanId; + return this; + } + + /** + * Get the marketplaceSkuId property: Identifier for the sku. + * + * @return the marketplaceSkuId value. + */ + public String marketplaceSkuId() { + return this.marketplaceSkuId; + } + + /** + * Set the marketplaceSkuId property: Identifier for the sku. + * + * @param marketplaceSkuId the marketplaceSkuId value to set. + * @return the SkuMappings object itself. + */ + public SkuMappings withMarketplaceSkuId(String marketplaceSkuId) { + this.marketplaceSkuId = marketplaceSkuId; + return this; + } + + /** + * Get the marketplaceSkuVersions property: Array of SKU versions available. + * + * @return the marketplaceSkuVersions value. + */ + public List marketplaceSkuVersions() { + return this.marketplaceSkuVersions; + } + + /** + * Set the marketplaceSkuVersions property: Array of SKU versions available. + * + * @param marketplaceSkuVersions the marketplaceSkuVersions value to set. + * @return the SkuMappings object itself. + */ + public SkuMappings withMarketplaceSkuVersions(List marketplaceSkuVersions) { + this.marketplaceSkuVersions = marketplaceSkuVersions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Skus.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Skus.java new file mode 100644 index 0000000000000..35f403e506b34 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Skus.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Skus. */ +public interface Skus { + /** + * List Skus available for a offer within the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SKU proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + PagedIterable listByOffer( + String resourceGroupName, String clusterName, String publisherName, String offerName); + + /** + * List Skus available for a offer within the HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SKU proxy resources for the HCI cluster as paginated response with {@link PagedIterable}. + */ + PagedIterable listByOffer( + String resourceGroupName, + String clusterName, + String publisherName, + String offerName, + String expand, + Context context); + + /** + * Get SKU resource details within a offer of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @param skuName The name of the SKU available within HCI cluster. + * @param expand Specify $expand=content,contentVersion to populate additional fields related to the marketplace + * offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sKU resource details within a offer of HCI Cluster along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, + String clusterName, + String publisherName, + String offerName, + String skuName, + String expand, + Context context); + + /** + * Get SKU resource details within a offer of HCI Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param publisherName The name of the publisher available within HCI cluster. + * @param offerName The name of the offer available within HCI cluster. + * @param skuName The name of the SKU available within HCI cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sKU resource details within a offer of HCI Cluster. + */ + Sku get(String resourceGroupName, String clusterName, String publisherName, String offerName, String skuName); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SoftwareAssuranceChangeRequest.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SoftwareAssuranceChangeRequest.java new file mode 100644 index 0000000000000..023ac5e109bd8 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SoftwareAssuranceChangeRequest.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SoftwareAssuranceChangeRequest model. */ +@Fluent +public final class SoftwareAssuranceChangeRequest { + /* + * The properties property. + */ + @JsonProperty(value = "properties") + private SoftwareAssuranceChangeRequestProperties properties; + + /** Creates an instance of SoftwareAssuranceChangeRequest class. */ + public SoftwareAssuranceChangeRequest() { + } + + /** + * Get the properties property: The properties property. + * + * @return the properties value. + */ + public SoftwareAssuranceChangeRequestProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The properties property. + * + * @param properties the properties value to set. + * @return the SoftwareAssuranceChangeRequest object itself. + */ + public SoftwareAssuranceChangeRequest withProperties(SoftwareAssuranceChangeRequestProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SoftwareAssuranceChangeRequestProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SoftwareAssuranceChangeRequestProperties.java new file mode 100644 index 0000000000000..b3a97aa0b74b1 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SoftwareAssuranceChangeRequestProperties.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SoftwareAssuranceChangeRequestProperties model. */ +@Fluent +public final class SoftwareAssuranceChangeRequestProperties { + /* + * Customer Intent for Software Assurance Benefit. + */ + @JsonProperty(value = "softwareAssuranceIntent") + private SoftwareAssuranceIntent softwareAssuranceIntent; + + /** Creates an instance of SoftwareAssuranceChangeRequestProperties class. */ + public SoftwareAssuranceChangeRequestProperties() { + } + + /** + * Get the softwareAssuranceIntent property: Customer Intent for Software Assurance Benefit. + * + * @return the softwareAssuranceIntent value. + */ + public SoftwareAssuranceIntent softwareAssuranceIntent() { + return this.softwareAssuranceIntent; + } + + /** + * Set the softwareAssuranceIntent property: Customer Intent for Software Assurance Benefit. + * + * @param softwareAssuranceIntent the softwareAssuranceIntent value to set. + * @return the SoftwareAssuranceChangeRequestProperties object itself. + */ + public SoftwareAssuranceChangeRequestProperties withSoftwareAssuranceIntent( + SoftwareAssuranceIntent softwareAssuranceIntent) { + this.softwareAssuranceIntent = softwareAssuranceIntent; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SoftwareAssuranceIntent.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SoftwareAssuranceIntent.java new file mode 100644 index 0000000000000..486e9782749a8 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SoftwareAssuranceIntent.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Customer Intent for Software Assurance Benefit. */ +public final class SoftwareAssuranceIntent extends ExpandableStringEnum { + /** Static value Enable for SoftwareAssuranceIntent. */ + public static final SoftwareAssuranceIntent ENABLE = fromString("Enable"); + + /** Static value Disable for SoftwareAssuranceIntent. */ + public static final SoftwareAssuranceIntent DISABLE = fromString("Disable"); + + /** + * Creates a new instance of SoftwareAssuranceIntent value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SoftwareAssuranceIntent() { + } + + /** + * Creates or finds a SoftwareAssuranceIntent from its string representation. + * + * @param name a name to look for. + * @return the corresponding SoftwareAssuranceIntent. + */ + @JsonCreator + public static SoftwareAssuranceIntent fromString(String name) { + return fromString(name, SoftwareAssuranceIntent.class); + } + + /** + * Gets known SoftwareAssuranceIntent values. + * + * @return known SoftwareAssuranceIntent values. + */ + public static Collection values() { + return values(SoftwareAssuranceIntent.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SoftwareAssuranceProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SoftwareAssuranceProperties.java new file mode 100644 index 0000000000000..d1445e6aa20b3 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SoftwareAssuranceProperties.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Software Assurance properties of the cluster. */ +@Fluent +public final class SoftwareAssuranceProperties { + /* + * Status of the Software Assurance for the cluster. + */ + @JsonProperty(value = "softwareAssuranceStatus", access = JsonProperty.Access.WRITE_ONLY) + private SoftwareAssuranceStatus softwareAssuranceStatus; + + /* + * Customer Intent for Software Assurance Benefit. + */ + @JsonProperty(value = "softwareAssuranceIntent") + private SoftwareAssuranceIntent softwareAssuranceIntent; + + /* + * TimeStamp denoting the latest SA benefit applicability is validated. + */ + @JsonProperty(value = "lastUpdated", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastUpdated; + + /** Creates an instance of SoftwareAssuranceProperties class. */ + public SoftwareAssuranceProperties() { + } + + /** + * Get the softwareAssuranceStatus property: Status of the Software Assurance for the cluster. + * + * @return the softwareAssuranceStatus value. + */ + public SoftwareAssuranceStatus softwareAssuranceStatus() { + return this.softwareAssuranceStatus; + } + + /** + * Get the softwareAssuranceIntent property: Customer Intent for Software Assurance Benefit. + * + * @return the softwareAssuranceIntent value. + */ + public SoftwareAssuranceIntent softwareAssuranceIntent() { + return this.softwareAssuranceIntent; + } + + /** + * Set the softwareAssuranceIntent property: Customer Intent for Software Assurance Benefit. + * + * @param softwareAssuranceIntent the softwareAssuranceIntent value to set. + * @return the SoftwareAssuranceProperties object itself. + */ + public SoftwareAssuranceProperties withSoftwareAssuranceIntent(SoftwareAssuranceIntent softwareAssuranceIntent) { + this.softwareAssuranceIntent = softwareAssuranceIntent; + return this; + } + + /** + * Get the lastUpdated property: TimeStamp denoting the latest SA benefit applicability is validated. + * + * @return the lastUpdated value. + */ + public OffsetDateTime lastUpdated() { + return this.lastUpdated; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SoftwareAssuranceStatus.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SoftwareAssuranceStatus.java new file mode 100644 index 0000000000000..5d4ea7f69dd2b --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/SoftwareAssuranceStatus.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Status of the Software Assurance for the cluster. */ +public final class SoftwareAssuranceStatus extends ExpandableStringEnum { + /** Static value Enabled for SoftwareAssuranceStatus. */ + public static final SoftwareAssuranceStatus ENABLED = fromString("Enabled"); + + /** Static value Disabled for SoftwareAssuranceStatus. */ + public static final SoftwareAssuranceStatus DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of SoftwareAssuranceStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SoftwareAssuranceStatus() { + } + + /** + * Creates or finds a SoftwareAssuranceStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding SoftwareAssuranceStatus. + */ + @JsonCreator + public static SoftwareAssuranceStatus fromString(String name) { + return fromString(name, SoftwareAssuranceStatus.class); + } + + /** + * Gets known SoftwareAssuranceStatus values. + * + * @return known SoftwareAssuranceStatus values. + */ + public static Collection values() { + return values(SoftwareAssuranceStatus.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/State.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/State.java new file mode 100644 index 0000000000000..d3b0678a9e8bb --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/State.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** State of the update as it relates to this stamp. */ +public final class State extends ExpandableStringEnum { + /** Static value HasPrerequisite for State. */ + public static final State HAS_PREREQUISITE = fromString("HasPrerequisite"); + + /** Static value Obsolete for State. */ + public static final State OBSOLETE = fromString("Obsolete"); + + /** Static value Ready for State. */ + public static final State READY = fromString("Ready"); + + /** Static value NotApplicableBecauseAnotherUpdateIsInProgress for State. */ + public static final State NOT_APPLICABLE_BECAUSE_ANOTHER_UPDATE_IS_IN_PROGRESS = + fromString("NotApplicableBecauseAnotherUpdateIsInProgress"); + + /** Static value Preparing for State. */ + public static final State PREPARING = fromString("Preparing"); + + /** Static value Installing for State. */ + public static final State INSTALLING = fromString("Installing"); + + /** Static value Installed for State. */ + public static final State INSTALLED = fromString("Installed"); + + /** Static value PreparationFailed for State. */ + public static final State PREPARATION_FAILED = fromString("PreparationFailed"); + + /** Static value InstallationFailed for State. */ + public static final State INSTALLATION_FAILED = fromString("InstallationFailed"); + + /** Static value Invalid for State. */ + public static final State INVALID = fromString("Invalid"); + + /** Static value Recalled for State. */ + public static final State RECALLED = fromString("Recalled"); + + /** Static value Downloading for State. */ + public static final State DOWNLOADING = fromString("Downloading"); + + /** Static value DownloadFailed for State. */ + public static final State DOWNLOAD_FAILED = fromString("DownloadFailed"); + + /** Static value HealthChecking for State. */ + public static final State HEALTH_CHECKING = fromString("HealthChecking"); + + /** Static value HealthCheckFailed for State. */ + public static final State HEALTH_CHECK_FAILED = fromString("HealthCheckFailed"); + + /** Static value ReadyToInstall for State. */ + public static final State READY_TO_INSTALL = fromString("ReadyToInstall"); + + /** Static value ScanInProgress for State. */ + public static final State SCAN_IN_PROGRESS = fromString("ScanInProgress"); + + /** Static value ScanFailed for State. */ + public static final State SCAN_FAILED = fromString("ScanFailed"); + + /** + * Creates a new instance of State value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public State() { + } + + /** + * Creates or finds a State from its string representation. + * + * @param name a name to look for. + * @return the corresponding State. + */ + @JsonCreator + public static State fromString(String name) { + return fromString(name, State.class); + } + + /** + * Gets known State values. + * + * @return known State values. + */ + public static Collection values() { + return values(State.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Status.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Status.java index 91733d95bf457..38485ff5b39c2 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Status.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Status.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for Status. */ +/** Status of the cluster agent. */ public final class Status extends ExpandableStringEnum { /** Static value NotYetRegistered for Status. */ public static final Status NOT_YET_REGISTERED = fromString("NotYetRegistered"); @@ -25,6 +25,27 @@ public final class Status extends ExpandableStringEnum { /** Static value Error for Status. */ public static final Status ERROR = fromString("Error"); + /** Static value NotSpecified for Status. */ + public static final Status NOT_SPECIFIED = fromString("NotSpecified"); + + /** Static value Succeeded for Status. */ + public static final Status SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for Status. */ + public static final Status FAILED = fromString("Failed"); + + /** Static value InProgress for Status. */ + public static final Status IN_PROGRESS = fromString("InProgress"); + + /** + * Creates a new instance of Status value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Status() { + } + /** * Creates or finds a Status from its string representation. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StatusLevelTypes.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StatusLevelTypes.java new file mode 100644 index 0000000000000..961c0cb87ee50 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/StatusLevelTypes.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The level code. */ +public final class StatusLevelTypes extends ExpandableStringEnum { + /** Static value Info for StatusLevelTypes. */ + public static final StatusLevelTypes INFO = fromString("Info"); + + /** Static value Warning for StatusLevelTypes. */ + public static final StatusLevelTypes WARNING = fromString("Warning"); + + /** Static value Error for StatusLevelTypes. */ + public static final StatusLevelTypes ERROR = fromString("Error"); + + /** + * Creates a new instance of StatusLevelTypes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public StatusLevelTypes() { + } + + /** + * Creates or finds a StatusLevelTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding StatusLevelTypes. + */ + @JsonCreator + public static StatusLevelTypes fromString(String name) { + return fromString(name, StatusLevelTypes.class); + } + + /** + * Gets known StatusLevelTypes values. + * + * @return known StatusLevelTypes values. + */ + public static Collection values() { + return values(StatusLevelTypes.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateList.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateList.java new file mode 100644 index 0000000000000..ae50e4722b92a --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateList.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurestackhci.fluent.models.HciUpdateInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of Updates. */ +@Fluent +public final class UpdateList { + /* + * List of Updates + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link to the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** Creates an instance of UpdateList class. */ + public UpdateList() { + } + + /** + * Get the value property: List of Updates. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of Updates. + * + * @param value the value value to set. + * @return the UpdateList object itself. + */ + public UpdateList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdatePrerequisite.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdatePrerequisite.java new file mode 100644 index 0000000000000..23bfc58f35adc --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdatePrerequisite.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * If update State is HasPrerequisite, this property contains an array of objects describing prerequisite updates before + * installing this update. Otherwise, it is empty. + */ +@Fluent +public final class UpdatePrerequisite { + /* + * Updatable component type. + */ + @JsonProperty(value = "updateType") + private String updateType; + + /* + * Version of the prerequisite. + */ + @JsonProperty(value = "version") + private String version; + + /* + * Friendly name of the prerequisite. + */ + @JsonProperty(value = "packageName") + private String packageName; + + /** Creates an instance of UpdatePrerequisite class. */ + public UpdatePrerequisite() { + } + + /** + * Get the updateType property: Updatable component type. + * + * @return the updateType value. + */ + public String updateType() { + return this.updateType; + } + + /** + * Set the updateType property: Updatable component type. + * + * @param updateType the updateType value to set. + * @return the UpdatePrerequisite object itself. + */ + public UpdatePrerequisite withUpdateType(String updateType) { + this.updateType = updateType; + return this; + } + + /** + * Get the version property: Version of the prerequisite. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: Version of the prerequisite. + * + * @param version the version value to set. + * @return the UpdatePrerequisite object itself. + */ + public UpdatePrerequisite withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get the packageName property: Friendly name of the prerequisite. + * + * @return the packageName value. + */ + public String packageName() { + return this.packageName; + } + + /** + * Set the packageName property: Friendly name of the prerequisite. + * + * @param packageName the packageName value to set. + * @return the UpdatePrerequisite object itself. + */ + public UpdatePrerequisite withPackageName(String packageName) { + this.packageName = packageName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateRun.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateRun.java new file mode 100644 index 0000000000000..4af41673a3f2f --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateRun.java @@ -0,0 +1,572 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.fluent.models.Step; +import com.azure.resourcemanager.azurestackhci.fluent.models.UpdateRunInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** An immutable client-side representation of UpdateRun. */ +public interface UpdateRun { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: Provisioning state of the UpdateRuns proxy resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the timeStarted property: Timestamp of the update run was started. + * + * @return the timeStarted value. + */ + OffsetDateTime timeStarted(); + + /** + * Gets the lastUpdatedTime property: Timestamp of the most recently completed step in the update run. + * + * @return the lastUpdatedTime value. + */ + OffsetDateTime lastUpdatedTime(); + + /** + * Gets the duration property: Duration of the update run. + * + * @return the duration value. + */ + String duration(); + + /** + * Gets the state property: State of the update run. + * + * @return the state value. + */ + UpdateRunPropertiesState state(); + + /** + * Gets the namePropertiesName property: Name of the step. + * + * @return the namePropertiesName value. + */ + String namePropertiesName(); + + /** + * Gets the description property: More detailed description of the step. + * + * @return the description value. + */ + String description(); + + /** + * Gets the errorMessage property: Error message, specified if the step is in a failed state. + * + * @return the errorMessage value. + */ + String errorMessage(); + + /** + * Gets the status property: Status of the step, bubbled up from the ECE action plan for installation attempts. + * Values are: 'Success', 'Error', 'InProgress', and 'Unknown status'. + * + * @return the status value. + */ + String status(); + + /** + * Gets the startTimeUtc property: When the step started, or empty if it has not started executing. + * + * @return the startTimeUtc value. + */ + OffsetDateTime startTimeUtc(); + + /** + * Gets the endTimeUtc property: When the step reached a terminal state. + * + * @return the endTimeUtc value. + */ + OffsetDateTime endTimeUtc(); + + /** + * Gets the lastUpdatedTimeUtc property: Completion time of this step or the last completed sub-step. + * + * @return the lastUpdatedTimeUtc value. + */ + OffsetDateTime lastUpdatedTimeUtc(); + + /** + * Gets the steps property: Recursive model for child steps of this step. + * + * @return the steps value. + */ + List steps(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.azurestackhci.fluent.models.UpdateRunInner object. + * + * @return the inner object. + */ + UpdateRunInner innerModel(); + + /** The entirety of the UpdateRun definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** The UpdateRun definition stages. */ + interface DefinitionStages { + /** The first stage of the UpdateRun definition. */ + interface Blank extends WithParentResource { + } + + /** The stage of the UpdateRun definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, clusterName, updateName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @return the next definition stage. + */ + WithCreate withExistingUpdate(String resourceGroupName, String clusterName, String updateName); + } + + /** + * The stage of the UpdateRun definition which contains all the minimum required properties for the resource to + * be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithLocation, + DefinitionStages.WithTimeStarted, + DefinitionStages.WithLastUpdatedTime, + DefinitionStages.WithDuration, + DefinitionStages.WithState, + DefinitionStages.WithNamePropertiesName, + DefinitionStages.WithDescription, + DefinitionStages.WithErrorMessage, + DefinitionStages.WithStatus, + DefinitionStages.WithStartTimeUtc, + DefinitionStages.WithEndTimeUtc, + DefinitionStages.WithLastUpdatedTimeUtc, + DefinitionStages.WithSteps { + /** + * Executes the create request. + * + * @return the created resource. + */ + UpdateRun create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + UpdateRun create(Context context); + } + + /** The stage of the UpdateRun definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithCreate withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithCreate withRegion(String location); + } + + /** The stage of the UpdateRun definition allowing to specify timeStarted. */ + interface WithTimeStarted { + /** + * Specifies the timeStarted property: Timestamp of the update run was started.. + * + * @param timeStarted Timestamp of the update run was started. + * @return the next definition stage. + */ + WithCreate withTimeStarted(OffsetDateTime timeStarted); + } + + /** The stage of the UpdateRun definition allowing to specify lastUpdatedTime. */ + interface WithLastUpdatedTime { + /** + * Specifies the lastUpdatedTime property: Timestamp of the most recently completed step in the update run.. + * + * @param lastUpdatedTime Timestamp of the most recently completed step in the update run. + * @return the next definition stage. + */ + WithCreate withLastUpdatedTime(OffsetDateTime lastUpdatedTime); + } + + /** The stage of the UpdateRun definition allowing to specify duration. */ + interface WithDuration { + /** + * Specifies the duration property: Duration of the update run.. + * + * @param duration Duration of the update run. + * @return the next definition stage. + */ + WithCreate withDuration(String duration); + } + + /** The stage of the UpdateRun definition allowing to specify state. */ + interface WithState { + /** + * Specifies the state property: State of the update run.. + * + * @param state State of the update run. + * @return the next definition stage. + */ + WithCreate withState(UpdateRunPropertiesState state); + } + + /** The stage of the UpdateRun definition allowing to specify namePropertiesName. */ + interface WithNamePropertiesName { + /** + * Specifies the namePropertiesName property: Name of the step.. + * + * @param namePropertiesName Name of the step. + * @return the next definition stage. + */ + WithCreate withNamePropertiesName(String namePropertiesName); + } + + /** The stage of the UpdateRun definition allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: More detailed description of the step.. + * + * @param description More detailed description of the step. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + + /** The stage of the UpdateRun definition allowing to specify errorMessage. */ + interface WithErrorMessage { + /** + * Specifies the errorMessage property: Error message, specified if the step is in a failed state.. + * + * @param errorMessage Error message, specified if the step is in a failed state. + * @return the next definition stage. + */ + WithCreate withErrorMessage(String errorMessage); + } + + /** The stage of the UpdateRun definition allowing to specify status. */ + interface WithStatus { + /** + * Specifies the status property: Status of the step, bubbled up from the ECE action plan for installation + * attempts. Values are: 'Success', 'Error', 'InProgress', and 'Unknown status'.. + * + * @param status Status of the step, bubbled up from the ECE action plan for installation attempts. Values + * are: 'Success', 'Error', 'InProgress', and 'Unknown status'. + * @return the next definition stage. + */ + WithCreate withStatus(String status); + } + + /** The stage of the UpdateRun definition allowing to specify startTimeUtc. */ + interface WithStartTimeUtc { + /** + * Specifies the startTimeUtc property: When the step started, or empty if it has not started executing.. + * + * @param startTimeUtc When the step started, or empty if it has not started executing. + * @return the next definition stage. + */ + WithCreate withStartTimeUtc(OffsetDateTime startTimeUtc); + } + + /** The stage of the UpdateRun definition allowing to specify endTimeUtc. */ + interface WithEndTimeUtc { + /** + * Specifies the endTimeUtc property: When the step reached a terminal state.. + * + * @param endTimeUtc When the step reached a terminal state. + * @return the next definition stage. + */ + WithCreate withEndTimeUtc(OffsetDateTime endTimeUtc); + } + + /** The stage of the UpdateRun definition allowing to specify lastUpdatedTimeUtc. */ + interface WithLastUpdatedTimeUtc { + /** + * Specifies the lastUpdatedTimeUtc property: Completion time of this step or the last completed sub-step.. + * + * @param lastUpdatedTimeUtc Completion time of this step or the last completed sub-step. + * @return the next definition stage. + */ + WithCreate withLastUpdatedTimeUtc(OffsetDateTime lastUpdatedTimeUtc); + } + + /** The stage of the UpdateRun definition allowing to specify steps. */ + interface WithSteps { + /** + * Specifies the steps property: Recursive model for child steps of this step.. + * + * @param steps Recursive model for child steps of this step. + * @return the next definition stage. + */ + WithCreate withSteps(List steps); + } + } + + /** + * Begins update for the UpdateRun resource. + * + * @return the stage of resource update. + */ + UpdateRun.Update update(); + + /** The template for UpdateRun update. */ + interface Update + extends UpdateStages.WithTimeStarted, + UpdateStages.WithLastUpdatedTime, + UpdateStages.WithDuration, + UpdateStages.WithState, + UpdateStages.WithNamePropertiesName, + UpdateStages.WithDescription, + UpdateStages.WithErrorMessage, + UpdateStages.WithStatus, + UpdateStages.WithStartTimeUtc, + UpdateStages.WithEndTimeUtc, + UpdateStages.WithLastUpdatedTimeUtc, + UpdateStages.WithSteps { + /** + * Executes the update request. + * + * @return the updated resource. + */ + UpdateRun apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + UpdateRun apply(Context context); + } + + /** The UpdateRun update stages. */ + interface UpdateStages { + /** The stage of the UpdateRun update allowing to specify timeStarted. */ + interface WithTimeStarted { + /** + * Specifies the timeStarted property: Timestamp of the update run was started.. + * + * @param timeStarted Timestamp of the update run was started. + * @return the next definition stage. + */ + Update withTimeStarted(OffsetDateTime timeStarted); + } + + /** The stage of the UpdateRun update allowing to specify lastUpdatedTime. */ + interface WithLastUpdatedTime { + /** + * Specifies the lastUpdatedTime property: Timestamp of the most recently completed step in the update run.. + * + * @param lastUpdatedTime Timestamp of the most recently completed step in the update run. + * @return the next definition stage. + */ + Update withLastUpdatedTime(OffsetDateTime lastUpdatedTime); + } + + /** The stage of the UpdateRun update allowing to specify duration. */ + interface WithDuration { + /** + * Specifies the duration property: Duration of the update run.. + * + * @param duration Duration of the update run. + * @return the next definition stage. + */ + Update withDuration(String duration); + } + + /** The stage of the UpdateRun update allowing to specify state. */ + interface WithState { + /** + * Specifies the state property: State of the update run.. + * + * @param state State of the update run. + * @return the next definition stage. + */ + Update withState(UpdateRunPropertiesState state); + } + + /** The stage of the UpdateRun update allowing to specify namePropertiesName. */ + interface WithNamePropertiesName { + /** + * Specifies the namePropertiesName property: Name of the step.. + * + * @param namePropertiesName Name of the step. + * @return the next definition stage. + */ + Update withNamePropertiesName(String namePropertiesName); + } + + /** The stage of the UpdateRun update allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: More detailed description of the step.. + * + * @param description More detailed description of the step. + * @return the next definition stage. + */ + Update withDescription(String description); + } + + /** The stage of the UpdateRun update allowing to specify errorMessage. */ + interface WithErrorMessage { + /** + * Specifies the errorMessage property: Error message, specified if the step is in a failed state.. + * + * @param errorMessage Error message, specified if the step is in a failed state. + * @return the next definition stage. + */ + Update withErrorMessage(String errorMessage); + } + + /** The stage of the UpdateRun update allowing to specify status. */ + interface WithStatus { + /** + * Specifies the status property: Status of the step, bubbled up from the ECE action plan for installation + * attempts. Values are: 'Success', 'Error', 'InProgress', and 'Unknown status'.. + * + * @param status Status of the step, bubbled up from the ECE action plan for installation attempts. Values + * are: 'Success', 'Error', 'InProgress', and 'Unknown status'. + * @return the next definition stage. + */ + Update withStatus(String status); + } + + /** The stage of the UpdateRun update allowing to specify startTimeUtc. */ + interface WithStartTimeUtc { + /** + * Specifies the startTimeUtc property: When the step started, or empty if it has not started executing.. + * + * @param startTimeUtc When the step started, or empty if it has not started executing. + * @return the next definition stage. + */ + Update withStartTimeUtc(OffsetDateTime startTimeUtc); + } + + /** The stage of the UpdateRun update allowing to specify endTimeUtc. */ + interface WithEndTimeUtc { + /** + * Specifies the endTimeUtc property: When the step reached a terminal state.. + * + * @param endTimeUtc When the step reached a terminal state. + * @return the next definition stage. + */ + Update withEndTimeUtc(OffsetDateTime endTimeUtc); + } + + /** The stage of the UpdateRun update allowing to specify lastUpdatedTimeUtc. */ + interface WithLastUpdatedTimeUtc { + /** + * Specifies the lastUpdatedTimeUtc property: Completion time of this step or the last completed sub-step.. + * + * @param lastUpdatedTimeUtc Completion time of this step or the last completed sub-step. + * @return the next definition stage. + */ + Update withLastUpdatedTimeUtc(OffsetDateTime lastUpdatedTimeUtc); + } + + /** The stage of the UpdateRun update allowing to specify steps. */ + interface WithSteps { + /** + * Specifies the steps property: Recursive model for child steps of this step.. + * + * @param steps Recursive model for child steps of this step. + * @return the next definition stage. + */ + Update withSteps(List steps); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + UpdateRun refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + UpdateRun refresh(Context context); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateRunList.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateRunList.java new file mode 100644 index 0000000000000..381cfba509999 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateRunList.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurestackhci.fluent.models.UpdateRunInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of Update runs. */ +@Fluent +public final class UpdateRunList { + /* + * List of Update runs + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link to the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** Creates an instance of UpdateRunList class. */ + public UpdateRunList() { + } + + /** + * Get the value property: List of Update runs. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of Update runs. + * + * @param value the value value to set. + * @return the UpdateRunList object itself. + */ + public UpdateRunList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateRunPropertiesState.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateRunPropertiesState.java new file mode 100644 index 0000000000000..c9526ef9684c9 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateRunPropertiesState.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** State of the update run. */ +public final class UpdateRunPropertiesState extends ExpandableStringEnum { + /** Static value Unknown for UpdateRunPropertiesState. */ + public static final UpdateRunPropertiesState UNKNOWN = fromString("Unknown"); + + /** Static value Succeeded for UpdateRunPropertiesState. */ + public static final UpdateRunPropertiesState SUCCEEDED = fromString("Succeeded"); + + /** Static value InProgress for UpdateRunPropertiesState. */ + public static final UpdateRunPropertiesState IN_PROGRESS = fromString("InProgress"); + + /** Static value Failed for UpdateRunPropertiesState. */ + public static final UpdateRunPropertiesState FAILED = fromString("Failed"); + + /** + * Creates a new instance of UpdateRunPropertiesState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public UpdateRunPropertiesState() { + } + + /** + * Creates or finds a UpdateRunPropertiesState from its string representation. + * + * @param name a name to look for. + * @return the corresponding UpdateRunPropertiesState. + */ + @JsonCreator + public static UpdateRunPropertiesState fromString(String name) { + return fromString(name, UpdateRunPropertiesState.class); + } + + /** + * Gets known UpdateRunPropertiesState values. + * + * @return known UpdateRunPropertiesState values. + */ + public static Collection values() { + return values(UpdateRunPropertiesState.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateRuns.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateRuns.java new file mode 100644 index 0000000000000..ceb153877e08f --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateRuns.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of UpdateRuns. */ +public interface UpdateRuns { + /** + * List all Update runs for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Update runs as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String clusterName, String updateName); + + /** + * List all Update runs for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Update runs as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String clusterName, String updateName, Context context); + + /** + * Delete specified Update Run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String clusterName, String updateName, String updateRunName); + + /** + * Delete specified Update Run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String clusterName, String updateName, String updateRunName, Context context); + + /** + * Get the Update run for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Update run for a specified update along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String clusterName, String updateName, String updateRunName, Context context); + + /** + * Get the Update run for a specified update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param updateRunName The name of the Update Run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Update run for a specified update. + */ + UpdateRun get(String resourceGroupName, String clusterName, String updateName, String updateRunName); + + /** + * Get the Update run for a specified update. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Update run for a specified update along with {@link Response}. + */ + UpdateRun getById(String id); + + /** + * Get the Update run for a specified update. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Update run for a specified update along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete specified Update Run. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete specified Update Run. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new UpdateRun resource. + * + * @param name resource name. + * @return the first stage of the new UpdateRun definition. + */ + UpdateRun.DefinitionStages.Blank define(String name); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateSummaries.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateSummaries.java new file mode 100644 index 0000000000000..eabb6231bc944 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateSummaries.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.azurestackhci.fluent.models.UpdateSummariesInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** An immutable client-side representation of UpdateSummaries. */ +public interface UpdateSummaries { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: Provisioning state of the UpdateSummaries proxy resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the oemFamily property: OEM family name. + * + * @return the oemFamily value. + */ + String oemFamily(); + + /** + * Gets the hardwareModel property: Name of the hardware model. + * + * @return the hardwareModel value. + */ + String hardwareModel(); + + /** + * Gets the packageVersions property: Current version of each updatable component. + * + * @return the packageVersions value. + */ + List packageVersions(); + + /** + * Gets the currentVersion property: Current Solution Bundle version of the stamp. + * + * @return the currentVersion value. + */ + String currentVersion(); + + /** + * Gets the lastUpdated property: Last time an update installation completed successfully. + * + * @return the lastUpdated value. + */ + OffsetDateTime lastUpdated(); + + /** + * Gets the lastChecked property: Last time the update service successfully checked for updates. + * + * @return the lastChecked value. + */ + OffsetDateTime lastChecked(); + + /** + * Gets the healthState property: Overall health state for update-specific health checks. + * + * @return the healthState value. + */ + HealthState healthState(); + + /** + * Gets the healthCheckResult property: An array of pre-check result objects. + * + * @return the healthCheckResult value. + */ + List healthCheckResult(); + + /** + * Gets the healthCheckDate property: Last time the package-specific checks were run. + * + * @return the healthCheckDate value. + */ + OffsetDateTime healthCheckDate(); + + /** + * Gets the state property: Overall update state of the stamp. + * + * @return the state value. + */ + UpdateSummariesPropertiesState state(); + + /** + * Gets the inner com.azure.resourcemanager.azurestackhci.fluent.models.UpdateSummariesInner object. + * + * @return the inner object. + */ + UpdateSummariesInner innerModel(); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateSummariesList.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateSummariesList.java new file mode 100644 index 0000000000000..e3daf3ded1ce7 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateSummariesList.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurestackhci.fluent.models.UpdateSummariesInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of Update Summaries. */ +@Fluent +public final class UpdateSummariesList { + /* + * List of Update Summaries + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link to the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** Creates an instance of UpdateSummariesList class. */ + public UpdateSummariesList() { + } + + /** + * Get the value property: List of Update Summaries. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of Update Summaries. + * + * @param value the value value to set. + * @return the UpdateSummariesList object itself. + */ + public UpdateSummariesList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateSummariesOperations.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateSummariesOperations.java new file mode 100644 index 0000000000000..a4e2d89c5b676 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateSummariesOperations.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.fluent.models.UpdateSummariesInner; + +/** Resource collection API of UpdateSummariesOperations. */ +public interface UpdateSummariesOperations { + /** + * List all Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Update Summaries as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String clusterName); + + /** + * List all Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Update Summaries as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String clusterName, Context context); + + /** + * Delete Update Summaries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String clusterName); + + /** + * Delete Update Summaries. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String clusterName, Context context); + + /** + * Put Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateLocationProperties Properties of the UpdateSummaries resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return get the update summaries for the cluster along with {@link Response}. + */ + Response putWithResponse( + String resourceGroupName, String clusterName, UpdateSummariesInner updateLocationProperties, Context context); + + /** + * Put Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateLocationProperties Properties of the UpdateSummaries resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return get the update summaries for the cluster. + */ + UpdateSummaries put(String resourceGroupName, String clusterName, UpdateSummariesInner updateLocationProperties); + + /** + * Get all Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Update summaries under the HCI cluster along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String clusterName, Context context); + + /** + * Get all Update summaries under the HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Update summaries under the HCI cluster. + */ + UpdateSummaries get(String resourceGroupName, String clusterName); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateSummariesPropertiesState.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateSummariesPropertiesState.java new file mode 100644 index 0000000000000..3427aaae54e42 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UpdateSummariesPropertiesState.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Overall update state of the stamp. */ +public final class UpdateSummariesPropertiesState extends ExpandableStringEnum { + /** Static value Unknown for UpdateSummariesPropertiesState. */ + public static final UpdateSummariesPropertiesState UNKNOWN = fromString("Unknown"); + + /** Static value AppliedSuccessfully for UpdateSummariesPropertiesState. */ + public static final UpdateSummariesPropertiesState APPLIED_SUCCESSFULLY = fromString("AppliedSuccessfully"); + + /** Static value UpdateAvailable for UpdateSummariesPropertiesState. */ + public static final UpdateSummariesPropertiesState UPDATE_AVAILABLE = fromString("UpdateAvailable"); + + /** Static value UpdateInProgress for UpdateSummariesPropertiesState. */ + public static final UpdateSummariesPropertiesState UPDATE_IN_PROGRESS = fromString("UpdateInProgress"); + + /** Static value UpdateFailed for UpdateSummariesPropertiesState. */ + public static final UpdateSummariesPropertiesState UPDATE_FAILED = fromString("UpdateFailed"); + + /** Static value NeedsAttention for UpdateSummariesPropertiesState. */ + public static final UpdateSummariesPropertiesState NEEDS_ATTENTION = fromString("NeedsAttention"); + + /** Static value PreparationInProgress for UpdateSummariesPropertiesState. */ + public static final UpdateSummariesPropertiesState PREPARATION_IN_PROGRESS = fromString("PreparationInProgress"); + + /** Static value PreparationFailed for UpdateSummariesPropertiesState. */ + public static final UpdateSummariesPropertiesState PREPARATION_FAILED = fromString("PreparationFailed"); + + /** + * Creates a new instance of UpdateSummariesPropertiesState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public UpdateSummariesPropertiesState() { + } + + /** + * Creates or finds a UpdateSummariesPropertiesState from its string representation. + * + * @param name a name to look for. + * @return the corresponding UpdateSummariesPropertiesState. + */ + @JsonCreator + public static UpdateSummariesPropertiesState fromString(String name) { + return fromString(name, UpdateSummariesPropertiesState.class); + } + + /** + * Gets known UpdateSummariesPropertiesState values. + * + * @return known UpdateSummariesPropertiesState values. + */ + public static Collection values() { + return values(UpdateSummariesPropertiesState.class); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Updates.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Updates.java new file mode 100644 index 0000000000000..f98b961a70c05 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Updates.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Updates. */ +public interface Updates { + /** + * Apply Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void post(String resourceGroupName, String clusterName, String updateName); + + /** + * Apply Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void post(String resourceGroupName, String clusterName, String updateName, Context context); + + /** + * List all Updates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Updates as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String clusterName); + + /** + * List all Updates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Updates as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String clusterName, Context context); + + /** + * Delete specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String clusterName, String updateName); + + /** + * Delete specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String clusterName, String updateName, Context context); + + /** + * Get specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specified Update along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String clusterName, String updateName, Context context); + + /** + * Get specified Update. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param updateName The name of the Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specified Update. + */ + HciUpdate get(String resourceGroupName, String clusterName, String updateName); + + /** + * Get specified Update. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specified Update along with {@link Response}. + */ + HciUpdate getById(String id); + + /** + * Get specified Update. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specified Update along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete specified Update. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete specified Update. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new HciUpdate resource. + * + * @param name resource name. + * @return the first stage of the new HciUpdate definition. + */ + HciUpdate.DefinitionStages.Blank define(String name); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UploadCertificateRequest.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UploadCertificateRequest.java index 8fabb105a6622..341a6910ed1ce 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UploadCertificateRequest.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UploadCertificateRequest.java @@ -16,6 +16,10 @@ public final class UploadCertificateRequest { @JsonProperty(value = "properties") private RawCertificateData properties; + /** Creates an instance of UploadCertificateRequest class. */ + public UploadCertificateRequest() { + } + /** * Get the properties property: The properties property. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UserAssignedIdentity.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UserAssignedIdentity.java new file mode 100644 index 0000000000000..e26f8c943b83d --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UserAssignedIdentity.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.UUID; + +/** User assigned identity properties. */ +@Immutable +public final class UserAssignedIdentity { + /* + * The principal ID of the assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private UUID principalId; + + /* + * The client ID of the assigned identity. + */ + @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) + private UUID clientId; + + /** Creates an instance of UserAssignedIdentity class. */ + public UserAssignedIdentity() { + } + + /** + * Get the principalId property: The principal ID of the assigned identity. + * + * @return the principalId value. + */ + public UUID principalId() { + return this.principalId; + } + + /** + * Get the clientId property: The client ID of the assigned identity. + * + * @return the clientId value. + */ + public UUID clientId() { + return this.clientId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/WindowsServerSubscription.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/WindowsServerSubscription.java index 6d9da4e53ba78..ce8bdd4d0a877 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/WindowsServerSubscription.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/WindowsServerSubscription.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for WindowsServerSubscription. */ +/** Desired state of Windows Server Subscription. */ public final class WindowsServerSubscription extends ExpandableStringEnum { /** Static value Disabled for WindowsServerSubscription. */ public static final WindowsServerSubscription DISABLED = fromString("Disabled"); @@ -16,6 +16,15 @@ public final class WindowsServerSubscription extends ExpandableStringEnum Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersUploadCertificateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersUploadCertificateSamples.java index e0b951ddce12a..3844ed7bf3afe 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersUploadCertificateSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersUploadCertificateSamples.java @@ -4,7 +4,6 @@ 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; @@ -12,7 +11,7 @@ /** Samples for Clusters UploadCertificate. */ public final class ClustersUploadCertificateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/UploadCertificate.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/UploadCertificate.json */ /** * Sample code: Upload certificate. @@ -28,6 +27,6 @@ public static void uploadCertificate(com.azure.resourcemanager.azurestackhci.Azu new UploadCertificateRequest() .withProperties( new RawCertificateData().withCertificates(Arrays.asList("base64cert", "base64cert"))), - Context.NONE); + com.azure.core.util.Context.NONE); } } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsCreateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsCreateSamples.java index b25518c9e8777..adba35ad69efe 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsCreateSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsCreateSamples.java @@ -11,7 +11,7 @@ /** Samples for Extensions Create. */ public final class ExtensionsCreateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/PutExtension.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/PutExtension.json */ /** * Sample code: Create Arc Extension. @@ -35,6 +35,7 @@ public static void createArcExtension(com.azure.resourcemanager.azurestackhci.Az SerializerFactory .createDefaultManagementSerializerAdapter() .deserialize("{\"workspaceKey\":\"xx\"}", Object.class, SerializerEncoding.JSON)) + .withEnableAutomaticUpgrade(false) .create(); } } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsDeleteSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsDeleteSamples.java index e89be94c7633b..428dc3d9ee25e 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsDeleteSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsDeleteSamples.java @@ -4,12 +4,10 @@ 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-05-01/examples/DeleteExtension.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/DeleteExtension.json */ /** * Sample code: Delete Arc Extension. @@ -17,6 +15,8 @@ public final class ExtensionsDeleteSamples { * @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); + manager + .extensions() + .delete("test-rg", "myCluster", "default", "MicrosoftMonitoringAgent", com.azure.core.util.Context.NONE); } } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsGetSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsGetSamples.java index 6cf05532d2646..4d5ba31e24d6e 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsGetSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsGetSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.azurestackhci.generated; -import com.azure.core.util.Context; - /** Samples for Extensions Get. */ public final class ExtensionsGetSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/GetExtension.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/GetExtension.json */ /** * Sample code: Get ArcSettings Extension. @@ -19,6 +17,7 @@ public final class ExtensionsGetSamples { public static void getArcSettingsExtension(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { manager .extensions() - .getWithResponse("test-rg", "myCluster", "default", "MicrosoftMonitoringAgent", Context.NONE); + .getWithResponse( + "test-rg", "myCluster", "default", "MicrosoftMonitoringAgent", com.azure.core.util.Context.NONE); } } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsListByArcSettingSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsListByArcSettingSamples.java index 8206a6b61cd70..8788f119e5c18 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsListByArcSettingSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsListByArcSettingSamples.java @@ -4,12 +4,10 @@ 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-05-01/examples/ListExtensionsByArcSetting.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/ListExtensionsByArcSetting.json */ /** * Sample code: List Extensions under ArcSetting resource. @@ -18,6 +16,6 @@ public final class ExtensionsListByArcSettingSamples { */ public static void listExtensionsUnderArcSettingResource( com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.extensions().listByArcSetting("test-rg", "myCluster", "default", Context.NONE); + manager.extensions().listByArcSetting("test-rg", "myCluster", "default", com.azure.core.util.Context.NONE); } } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsUpdateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsUpdateSamples.java index 382bea80ca758..5e43fc292dd15 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsUpdateSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsUpdateSamples.java @@ -5,15 +5,15 @@ 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 com.azure.resourcemanager.azurestackhci.models.ExtensionPatchParameters; import java.io.IOException; /** Samples for Extensions Update. */ public final class ExtensionsUpdateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/PatchExtension.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/PatchExtension.json */ /** * Sample code: Update Arc Extension. @@ -25,17 +25,23 @@ public static void updateArcExtension(com.azure.resourcemanager.azurestackhci.Az Extension resource = manager .extensions() - .getWithResponse("test-rg", "myCluster", "default", "MicrosoftMonitoringAgent", Context.NONE) + .getWithResponse( + "test-rg", "myCluster", "default", "MicrosoftMonitoringAgent", com.azure.core.util.Context.NONE) .getValue(); resource .update() - .withPublisher("Microsoft.Compute") - .withTypePropertiesType("MicrosoftMonitoringAgent") - .withTypeHandlerVersion("1.10") - .withSettings( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize("{\"workspaceId\":\"xx\"}", Object.class, SerializerEncoding.JSON)) + .withExtensionParameters( + new ExtensionPatchParameters() + .withTypeHandlerVersion("1.10") + .withEnableAutomaticUpgrade(false) + .withSettings( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{\"workspaceId\":\"xx\"}", Object.class, SerializerEncoding.JSON)) + .withProtectedSettings( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{\"workspaceKey\":\"xx\"}", Object.class, SerializerEncoding.JSON))) .apply(); } } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsUpgradeSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsUpgradeSamples.java new file mode 100644 index 0000000000000..d39b31624865f --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsUpgradeSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +import com.azure.resourcemanager.azurestackhci.models.ExtensionUpgradeParameters; + +/** Samples for Extensions Upgrade. */ +public final class ExtensionsUpgradeSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/Extensions_Upgrade.json + */ + /** + * Sample code: Upgrade Machine Extensions. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void upgradeMachineExtensions(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .extensions() + .upgrade( + "test-rg", + "myCluster", + "default", + "MicrosoftMonitoringAgent", + new ExtensionUpgradeParameters().withTargetVersion("1.0.18062.0"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/OffersGetSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/OffersGetSamples.java new file mode 100644 index 0000000000000..95bbc0846674f --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/OffersGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +/** Samples for Offers Get. */ +public final class OffersGetSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/GetOffer.json + */ + /** + * Sample code: Get Offer. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getOffer(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .offers() + .getWithResponse("test-rg", "myCluster", "publisher1", "offer1", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/OffersListByClusterSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/OffersListByClusterSamples.java new file mode 100644 index 0000000000000..4d4ab43afbf55 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/OffersListByClusterSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +/** Samples for Offers ListByCluster. */ +public final class OffersListByClusterSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/ListOffersByCluster.json + */ + /** + * Sample code: List Offer resources by HCI Cluster. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listOfferResourcesByHCICluster( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.offers().listByCluster("test-rg", "myCluster", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/OffersListByPublisherSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/OffersListByPublisherSamples.java new file mode 100644 index 0000000000000..a62fbd0d52ad6 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/OffersListByPublisherSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +/** Samples for Offers ListByPublisher. */ +public final class OffersListByPublisherSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/ListOffersByPublisher.json + */ + /** + * Sample code: List Offer resources by publisher for the HCI Cluster. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listOfferResourcesByPublisherForTheHCICluster( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.offers().listByPublisher("test-rg", "myCluster", "publisher1", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/OperationsListSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/OperationsListSamples.java index 7dc158cda4c3c..63b541238440b 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/OperationsListSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/OperationsListSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.azurestackhci.generated; -import com.azure.core.util.Context; - /** Samples for Operations List. */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/ListOperations.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/ListOperations.json */ /** * Sample code: Create cluster. @@ -17,6 +15,6 @@ public final class OperationsListSamples { * @param manager Entry point to AzureStackHciManager. */ public static void createCluster(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.operations().listWithResponse(Context.NONE); + manager.operations().listWithResponse(com.azure.core.util.Context.NONE); } } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/PublishersGetSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/PublishersGetSamples.java new file mode 100644 index 0000000000000..a62b45a312090 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/PublishersGetSamples.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 Publishers Get. */ +public final class PublishersGetSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/GetPublisher.json + */ + /** + * Sample code: Get Publisher. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getPublisher(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.publishers().getWithResponse("test-rg", "myCluster", "publisher1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/PublishersListByClusterSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/PublishersListByClusterSamples.java new file mode 100644 index 0000000000000..3ed27f05fde9a --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/PublishersListByClusterSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +/** Samples for Publishers ListByCluster. */ +public final class PublishersListByClusterSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/ListPublishersByCluster.json + */ + /** + * Sample code: List Publisher resources by HCI Cluster. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listPublisherResourcesByHCICluster( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.publishers().listByCluster("test-rg", "myCluster", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/SkusGetSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/SkusGetSamples.java new file mode 100644 index 0000000000000..aca4537745b73 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/SkusGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +/** Samples for Skus Get. */ +public final class SkusGetSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/GetSku.json + */ + /** + * Sample code: Get Sku. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getSku(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .skus() + .getWithResponse( + "test-rg", "myCluster", "publisher1", "offer1", "sku1", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/SkusListByOfferSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/SkusListByOfferSamples.java new file mode 100644 index 0000000000000..065e9307d8cfb --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/SkusListByOfferSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +/** Samples for Skus ListByOffer. */ +public final class SkusListByOfferSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/ListSkusByOffer.json + */ + /** + * Sample code: List SKU resources by offer for the HCI Cluster. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listSKUResourcesByOfferForTheHCICluster( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .skus() + .listByOffer("test-rg", "myCluster", "publisher1", "offer1", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunsDeleteSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunsDeleteSamples.java new file mode 100644 index 0000000000000..a77142a4e6f1c --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunsDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +/** Samples for UpdateRuns Delete. */ +public final class UpdateRunsDeleteSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/DeleteUpdateRuns.json + */ + /** + * Sample code: Delete an Update. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void deleteAnUpdate(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .updateRuns() + .delete( + "testrg", + "testcluster", + "Microsoft4.2203.2.32", + "23b779ba-0d52-4a80-8571-45ca74664ec3", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunsGetSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunsGetSamples.java new file mode 100644 index 0000000000000..f07e9acff7985 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunsGetSamples.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 UpdateRuns Get. */ +public final class UpdateRunsGetSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/GetUpdateRuns.json + */ + /** + * Sample code: Get Update runs under cluster resource. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getUpdateRunsUnderClusterResource( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .updateRuns() + .getWithResponse( + "testrg", + "testcluster", + "Microsoft4.2203.2.32", + "23b779ba-0d52-4a80-8571-45ca74664ec3", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunsListSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunsListSamples.java new file mode 100644 index 0000000000000..7db87bab99594 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunsListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +/** Samples for UpdateRuns List. */ +public final class UpdateRunsListSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/ListUpdateRuns.json + */ + /** + * Sample code: List Update runs under cluster resource. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listUpdateRunsUnderClusterResource( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.updateRuns().list("testrg", "testcluster", "Microsoft4.2203.2.32", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunsPutSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunsPutSamples.java new file mode 100644 index 0000000000000..00296864adcfd --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateRunsPutSamples.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +import com.azure.resourcemanager.azurestackhci.fluent.models.Step; +import com.azure.resourcemanager.azurestackhci.models.UpdateRun; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** Samples for UpdateRuns Put. */ +public final class UpdateRunsPutSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/PutUpdateRuns.json + */ + /** + * Sample code: Get Update runs under cluster resource. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getUpdateRunsUnderClusterResource( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + UpdateRun resource = + manager + .updateRuns() + .getWithResponse( + "testrg", + "testcluster", + "Microsoft4.2203.2.32", + "23b779ba-0d52-4a80-8571-45ca74664ec3", + com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withNamePropertiesName("Unnamed step") + .withDescription("Update Azure Stack.") + .withErrorMessage("") + .withStatus("Success") + .withStartTimeUtc(OffsetDateTime.parse("2022-04-06T01:36:33.3876751+00:00")) + .withEndTimeUtc(OffsetDateTime.parse("2022-04-06T13:58:42.969006+00:00")) + .withLastUpdatedTimeUtc(OffsetDateTime.parse("2022-04-06T13:58:42.969006+00:00")) + .withSteps( + Arrays + .asList( + new Step() + .withName("PreUpdate Cloud") + .withDescription("Prepare for SSU update") + .withErrorMessage("") + .withStatus("Success") + .withStartTimeUtc(OffsetDateTime.parse("2022-04-06T01:36:33.3876751+00:00")) + .withEndTimeUtc(OffsetDateTime.parse("2022-04-06T01:37:16.8728314+00:00")) + .withLastUpdatedTimeUtc(OffsetDateTime.parse("2022-04-06T01:37:16.8728314+00:00")) + .withSteps(Arrays.asList()))) + .apply(); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateSummariesOperationDeleteSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateSummariesOperationDeleteSamples.java new file mode 100644 index 0000000000000..872b98d008503 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateSummariesOperationDeleteSamples.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 UpdateSummariesOperation Delete. */ +public final class UpdateSummariesOperationDeleteSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/DeleteUpdateSummaries.json + */ + /** + * Sample code: Delete an Update. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void deleteAnUpdate(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.updateSummariesOperations().delete("testrg", "testcluster", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateSummariesOperationGetSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateSummariesOperationGetSamples.java new file mode 100644 index 0000000000000..eae43aca23d8e --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateSummariesOperationGetSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +/** Samples for UpdateSummariesOperation Get. */ +public final class UpdateSummariesOperationGetSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/GetUpdateSummaries.json + */ + /** + * Sample code: Get Update summaries under cluster resource. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getUpdateSummariesUnderClusterResource( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.updateSummariesOperations().getWithResponse("testrg", "testcluster", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateSummariesOperationListSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateSummariesOperationListSamples.java new file mode 100644 index 0000000000000..ee4878eb04609 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateSummariesOperationListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +/** Samples for UpdateSummariesOperation List. */ +public final class UpdateSummariesOperationListSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/ListUpdateSummaries.json + */ + /** + * Sample code: Get Update summaries under cluster resource. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getUpdateSummariesUnderClusterResource( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.updateSummariesOperations().list("testrg", "testcluster", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateSummariesOperationPutSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateSummariesOperationPutSamples.java new file mode 100644 index 0000000000000..6f34345e3a23f --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdateSummariesOperationPutSamples.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +import com.azure.resourcemanager.azurestackhci.fluent.models.UpdateSummariesInner; +import com.azure.resourcemanager.azurestackhci.models.UpdateSummariesPropertiesState; +import java.time.OffsetDateTime; + +/** Samples for UpdateSummariesOperation Put. */ +public final class UpdateSummariesOperationPutSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/PutUpdateSummaries.json + */ + /** + * Sample code: Put Update summaries under cluster resource. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void putUpdateSummariesUnderClusterResource( + com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .updateSummariesOperations() + .putWithResponse( + "testrg", + "testcluster", + new UpdateSummariesInner() + .withOemFamily("DellEMC") + .withHardwareModel("PowerEdge R730xd") + .withCurrentVersion("4.2203.2.32") + .withLastUpdated(OffsetDateTime.parse("2022-04-06T14:08:18.254Z")) + .withLastChecked(OffsetDateTime.parse("2022-04-07T18:04:07Z")) + .withState(UpdateSummariesPropertiesState.APPLIED_SUCCESSFULLY), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesDeleteSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesDeleteSamples.java new file mode 100644 index 0000000000000..f95cc7f9bf467 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesDeleteSamples.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 Updates Delete. */ +public final class UpdatesDeleteSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/DeleteUpdates.json + */ + /** + * Sample code: Delete an Update. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void deleteAnUpdate(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.updates().delete("testrg", "testcluster", "Microsoft4.2203.2.32", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesGetSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesGetSamples.java new file mode 100644 index 0000000000000..c4c3bf176dff4 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.generated; + +/** Samples for Updates Get. */ +public final class UpdatesGetSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/GetUpdates.json + */ + /** + * Sample code: Get a specific update. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void getASpecificUpdate(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .updates() + .getWithResponse("testrg", "testcluster", "Microsoft4.2203.2.32", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesListSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesListSamples.java new file mode 100644 index 0000000000000..38c4daadddd53 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesListSamples.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 Updates List. */ +public final class UpdatesListSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/ListUpdates.json + */ + /** + * Sample code: List available updates. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listAvailableUpdates(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.updates().list("testrg", "testcluster", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesPostSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesPostSamples.java new file mode 100644 index 0000000000000..f8900a986ced1 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesPostSamples.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 Updates Post. */ +public final class UpdatesPostSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/PostUpdates.json + */ + /** + * Sample code: List available updates. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void listAvailableUpdates(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.updates().post("testrg", "testcluster", "Microsoft4.2203.2.32", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesPutSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesPutSamples.java new file mode 100644 index 0000000000000..156b884d6b2de --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/UpdatesPutSamples.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.generated; + +import com.azure.resourcemanager.azurestackhci.models.AvailabilityType; +import com.azure.resourcemanager.azurestackhci.models.HciUpdate; +import com.azure.resourcemanager.azurestackhci.models.State; +import com.azure.resourcemanager.azurestackhci.models.UpdatePrerequisite; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** Samples for Updates Put. */ +public final class UpdatesPutSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2023-08-01/examples/PutUpdates.json + */ + /** + * Sample code: Put a specific update. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void putASpecificUpdate(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + HciUpdate resource = + manager + .updates() + .getWithResponse("testrg", "testcluster", "Microsoft4.2203.2.32", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withInstalledDate(OffsetDateTime.parse("2022-04-06T14:08:18.254Z")) + .withDescription("AzS Update 4.2203.2.32") + .withState(State.INSTALLED) + .withPrerequisites( + Arrays + .asList( + new UpdatePrerequisite() + .withUpdateType("update type") + .withVersion("prerequisite version") + .withPackageName("update package name"))) + .withPackagePath("\\\\SU1FileServer\\SU1_Infrastructure_2\\Updates\\Packages\\Microsoft4.2203.2.32") + .withPackageSizeInMb(18858.0F) + .withDisplayName("AzS Update - 4.2203.2.32") + .withVersion("4.2203.2.32") + .withPublisher("Microsoft") + .withReleaseLink("https://docs.microsoft.com/azure-stack/operator/release-notes?view=azs-2203") + .withAvailabilityType(AvailabilityType.LOCAL) + .withPackageType("Infrastructure") + .withAdditionalProperties("additional properties") + .withProgressPercentage(0.0F) + .withNotifyMessage("Brief message with instructions for updates of AvailabilityType Notify") + .apply(); + } +}