From 9a4a18eefe40d1b71c916c3e4f8e4b8535378dd9 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 23 Aug 2023 06:16:36 +0000 Subject: [PATCH] CodeGen from PR 25004 in Azure/azure-rest-api-specs Merge 12b3503d879ad442d01322458339c2f4a2ef8d09 into c942bdc449fb746c3aae3a179639de903212b6d8 --- .../armazurestackhci/CHANGELOG.md | 110 ++ .../armazurestackhci/arcsettings_client.go | 256 ++- .../arcsettings_client_example_test.go | 309 ---- .../armazurestackhci/autorest.md | 6 +- .../armazurestackhci/client_factory.go | 33 +- .../armazurestackhci/clusters_client.go | 202 ++- .../clusters_client_example_test.go | 645 ------- .../armazurestackhci/constants.go | 468 ++++- .../armazurestackhci/extensions_client.go | 172 +- .../extensions_client_example_test.go | 346 ---- .../azurestackhci/armazurestackhci/go.mod | 20 +- .../azurestackhci/armazurestackhci/go.sum | 38 +- .../azurestackhci/armazurestackhci/models.go | 733 ++++++-- .../armazurestackhci/models_serde.go | 1612 ++++++++++++++++- .../armazurestackhci/offers_client.go | 268 +++ .../armazurestackhci/operations_client.go | 18 +- .../operations_client_example_test.go | 381 ---- .../azurestackhci/armazurestackhci/options.go | 263 +++ .../armazurestackhci/publishers_client.go | 179 ++ .../armazurestackhci/response_types.go | 157 +- .../armazurestackhci/skus_client.go | 204 +++ .../armazurestackhci/time_rfc3339.go | 3 +- .../armazurestackhci/updateruns_client.go | 341 ++++ .../armazurestackhci/updates_client.go | 395 ++++ .../updatesummaries_client.go | 308 ++++ 25 files changed, 5384 insertions(+), 2083 deletions(-) delete mode 100644 sdk/resourcemanager/azurestackhci/armazurestackhci/arcsettings_client_example_test.go delete mode 100644 sdk/resourcemanager/azurestackhci/armazurestackhci/clusters_client_example_test.go delete mode 100644 sdk/resourcemanager/azurestackhci/armazurestackhci/extensions_client_example_test.go create mode 100644 sdk/resourcemanager/azurestackhci/armazurestackhci/offers_client.go delete mode 100644 sdk/resourcemanager/azurestackhci/armazurestackhci/operations_client_example_test.go create mode 100644 sdk/resourcemanager/azurestackhci/armazurestackhci/options.go create mode 100644 sdk/resourcemanager/azurestackhci/armazurestackhci/publishers_client.go create mode 100644 sdk/resourcemanager/azurestackhci/armazurestackhci/skus_client.go create mode 100644 sdk/resourcemanager/azurestackhci/armazurestackhci/updateruns_client.go create mode 100644 sdk/resourcemanager/azurestackhci/armazurestackhci/updates_client.go create mode 100644 sdk/resourcemanager/azurestackhci/armazurestackhci/updatesummaries_client.go diff --git a/sdk/resourcemanager/azurestackhci/armazurestackhci/CHANGELOG.md b/sdk/resourcemanager/azurestackhci/armazurestackhci/CHANGELOG.md index c40d6c19337c..f5215b88ffdb 100644 --- a/sdk/resourcemanager/azurestackhci/armazurestackhci/CHANGELOG.md +++ b/sdk/resourcemanager/azurestackhci/armazurestackhci/CHANGELOG.md @@ -1,5 +1,115 @@ # Release History +## 1.2.0 (2023-08-23) +### Features Added + +- New value `ArcSettingAggregateStateAccepted`, `ArcSettingAggregateStateDisableInProgress`, `ArcSettingAggregateStateProvisioning` added to enum type `ArcSettingAggregateState` +- New value `ExtensionAggregateStateAccepted`, `ExtensionAggregateStateProvisioning`, `ExtensionAggregateStateUpgradeFailedRollbackSucceeded` added to enum type `ExtensionAggregateState` +- New value `NodeArcStateAccepted`, `NodeArcStateDisableInProgress`, `NodeArcStateInProgress`, `NodeArcStatePartiallyConnected`, `NodeArcStatePartiallySucceeded`, `NodeArcStateProvisioning` added to enum type `NodeArcState` +- New value `NodeExtensionStateAccepted`, `NodeExtensionStateInProgress`, `NodeExtensionStatePartiallyConnected`, `NodeExtensionStatePartiallySucceeded`, `NodeExtensionStateProvisioning` added to enum type `NodeExtensionState` +- New value `ProvisioningStateConnected`, `ProvisioningStateCreating`, `ProvisioningStateDeleted`, `ProvisioningStateDeleting`, `ProvisioningStateDisableInProgress`, `ProvisioningStateDisconnected`, `ProvisioningStateError`, `ProvisioningStateInProgress`, `ProvisioningStateMoving`, `ProvisioningStateNotSpecified`, `ProvisioningStatePartiallyConnected`, `ProvisioningStatePartiallySucceeded`, `ProvisioningStateUpdating` added to enum type `ProvisioningState` +- New value `StatusFailed`, `StatusInProgress`, `StatusNotSpecified`, `StatusSucceeded` added to enum type `Status` +- New enum type `AvailabilityType` with values `AvailabilityTypeLocal`, `AvailabilityTypeNotify`, `AvailabilityTypeOnline` +- New enum type `ClusterNodeType` with values `ClusterNodeTypeFirstParty`, `ClusterNodeTypeThirdParty` +- New enum type `ExtensionManagedBy` with values `ExtensionManagedByAzure`, `ExtensionManagedByUser` +- New enum type `HealthState` with values `HealthStateError`, `HealthStateFailure`, `HealthStateInProgress`, `HealthStateSuccess`, `HealthStateUnknown`, `HealthStateWarning` +- New enum type `ManagedServiceIdentityType` with values `ManagedServiceIdentityTypeNone`, `ManagedServiceIdentityTypeSystemAssigned`, `ManagedServiceIdentityTypeSystemAssignedUserAssigned`, `ManagedServiceIdentityTypeUserAssigned` +- New enum type `OemActivation` with values `OemActivationDisabled`, `OemActivationEnabled` +- New enum type `RebootRequirement` with values `RebootRequirementFalse`, `RebootRequirementTrue`, `RebootRequirementUnknown` +- New enum type `ServiceName` with values `ServiceNameWAC` +- New enum type `Severity` with values `SeverityCritical`, `SeverityHidden`, `SeverityInformational`, `SeverityWarning` +- New enum type `SoftwareAssuranceIntent` with values `SoftwareAssuranceIntentDisable`, `SoftwareAssuranceIntentEnable` +- New enum type `SoftwareAssuranceStatus` with values `SoftwareAssuranceStatusDisabled`, `SoftwareAssuranceStatusEnabled` +- New enum type `State` with values `StateDownloadFailed`, `StateDownloading`, `StateHasPrerequisite`, `StateHealthCheckFailed`, `StateHealthChecking`, `StateInstallationFailed`, `StateInstalled`, `StateInstalling`, `StateInvalid`, `StateNotApplicableBecauseAnotherUpdateIsInProgress`, `StateObsolete`, `StatePreparationFailed`, `StatePreparing`, `StateReady`, `StateReadyToInstall`, `StateRecalled`, `StateScanFailed`, `StateScanInProgress` +- New enum type `StatusLevelTypes` with values `StatusLevelTypesError`, `StatusLevelTypesInfo`, `StatusLevelTypesWarning` +- New enum type `UpdateRunPropertiesState` with values `UpdateRunPropertiesStateFailed`, `UpdateRunPropertiesStateInProgress`, `UpdateRunPropertiesStateSucceeded`, `UpdateRunPropertiesStateUnknown` +- New enum type `UpdateSummariesPropertiesState` with values `UpdateSummariesPropertiesStateAppliedSuccessfully`, `UpdateSummariesPropertiesStateNeedsAttention`, `UpdateSummariesPropertiesStatePreparationFailed`, `UpdateSummariesPropertiesStatePreparationInProgress`, `UpdateSummariesPropertiesStateUnknown`, `UpdateSummariesPropertiesStateUpdateAvailable`, `UpdateSummariesPropertiesStateUpdateFailed`, `UpdateSummariesPropertiesStateUpdateInProgress` +- New function `*ArcSettingsClient.ConsentAndInstallDefaultExtensions(context.Context, string, string, string, *ArcSettingsClientConsentAndInstallDefaultExtensionsOptions) (ArcSettingsClientConsentAndInstallDefaultExtensionsResponse, error)` +- New function `*ArcSettingsClient.BeginInitializeDisableProcess(context.Context, string, string, string, *ArcSettingsClientBeginInitializeDisableProcessOptions) (*runtime.Poller[ArcSettingsClientInitializeDisableProcessResponse], error)` +- New function `*ClientFactory.NewOffersClient() *OffersClient` +- New function `*ClientFactory.NewPublishersClient() *PublishersClient` +- New function `*ClientFactory.NewSKUsClient() *SKUsClient` +- New function `*ClientFactory.NewUpdateRunsClient() *UpdateRunsClient` +- New function `*ClientFactory.NewUpdateSummariesClient() *UpdateSummariesClient` +- New function `*ClientFactory.NewUpdatesClient() *UpdatesClient` +- New function `*ClustersClient.BeginExtendSoftwareAssuranceBenefit(context.Context, string, string, SoftwareAssuranceChangeRequest, *ClustersClientBeginExtendSoftwareAssuranceBenefitOptions) (*runtime.Poller[ClustersClientExtendSoftwareAssuranceBenefitResponse], error)` +- New function `*ExtensionsClient.BeginUpgrade(context.Context, string, string, string, string, ExtensionUpgradeParameters, *ExtensionsClientBeginUpgradeOptions) (*runtime.Poller[ExtensionsClientUpgradeResponse], error)` +- New function `NewOffersClient(string, azcore.TokenCredential, *arm.ClientOptions) (*OffersClient, error)` +- New function `*OffersClient.Get(context.Context, string, string, string, string, *OffersClientGetOptions) (OffersClientGetResponse, error)` +- New function `*OffersClient.NewListByClusterPager(string, string, *OffersClientListByClusterOptions) *runtime.Pager[OffersClientListByClusterResponse]` +- New function `*OffersClient.NewListByPublisherPager(string, string, string, *OffersClientListByPublisherOptions) *runtime.Pager[OffersClientListByPublisherResponse]` +- New function `NewPublishersClient(string, azcore.TokenCredential, *arm.ClientOptions) (*PublishersClient, error)` +- New function `*PublishersClient.Get(context.Context, string, string, string, *PublishersClientGetOptions) (PublishersClientGetResponse, error)` +- New function `*PublishersClient.NewListByClusterPager(string, string, *PublishersClientListByClusterOptions) *runtime.Pager[PublishersClientListByClusterResponse]` +- New function `NewSKUsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*SKUsClient, error)` +- New function `*SKUsClient.Get(context.Context, string, string, string, string, string, *SKUsClientGetOptions) (SKUsClientGetResponse, error)` +- New function `*SKUsClient.NewListByOfferPager(string, string, string, string, *SKUsClientListByOfferOptions) *runtime.Pager[SKUsClientListByOfferResponse]` +- New function `NewUpdateRunsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*UpdateRunsClient, error)` +- New function `*UpdateRunsClient.BeginDelete(context.Context, string, string, string, string, *UpdateRunsClientBeginDeleteOptions) (*runtime.Poller[UpdateRunsClientDeleteResponse], error)` +- New function `*UpdateRunsClient.Get(context.Context, string, string, string, string, *UpdateRunsClientGetOptions) (UpdateRunsClientGetResponse, error)` +- New function `*UpdateRunsClient.NewListPager(string, string, string, *UpdateRunsClientListOptions) *runtime.Pager[UpdateRunsClientListResponse]` +- New function `*UpdateRunsClient.Put(context.Context, string, string, string, string, UpdateRun, *UpdateRunsClientPutOptions) (UpdateRunsClientPutResponse, error)` +- New function `NewUpdateSummariesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*UpdateSummariesClient, error)` +- New function `*UpdateSummariesClient.BeginDelete(context.Context, string, string, *UpdateSummariesClientBeginDeleteOptions) (*runtime.Poller[UpdateSummariesClientDeleteResponse], error)` +- New function `*UpdateSummariesClient.Get(context.Context, string, string, *UpdateSummariesClientGetOptions) (UpdateSummariesClientGetResponse, error)` +- New function `*UpdateSummariesClient.NewListPager(string, string, *UpdateSummariesClientListOptions) *runtime.Pager[UpdateSummariesClientListResponse]` +- New function `*UpdateSummariesClient.Put(context.Context, string, string, UpdateSummaries, *UpdateSummariesClientPutOptions) (UpdateSummariesClientPutResponse, error)` +- New function `NewUpdatesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*UpdatesClient, error)` +- New function `*UpdatesClient.BeginDelete(context.Context, string, string, string, *UpdatesClientBeginDeleteOptions) (*runtime.Poller[UpdatesClientDeleteResponse], error)` +- New function `*UpdatesClient.Get(context.Context, string, string, string, *UpdatesClientGetOptions) (UpdatesClientGetResponse, error)` +- New function `*UpdatesClient.NewListPager(string, string, *UpdatesClientListOptions) *runtime.Pager[UpdatesClientListResponse]` +- New function `*UpdatesClient.BeginPost(context.Context, string, string, string, *UpdatesClientBeginPostOptions) (*runtime.Poller[UpdatesClientPostResponse], error)` +- New function `*UpdatesClient.Put(context.Context, string, string, string, Update, *UpdatesClientPutOptions) (UpdatesClientPutResponse, error)` +- New struct `DefaultExtensionDetails` +- New struct `ExtensionInstanceView` +- New struct `ExtensionInstanceViewStatus` +- New struct `ExtensionUpgradeParameters` +- New struct `ManagedServiceIdentity` +- New struct `Offer` +- New struct `OfferList` +- New struct `OfferProperties` +- New struct `PackageVersionInfo` +- New struct `PrecheckResult` +- New struct `PrecheckResultTags` +- New struct `Publisher` +- New struct `PublisherList` +- New struct `PublisherProperties` +- New struct `SKU` +- New struct `SKUList` +- New struct `SKUMappings` +- New struct `SKUProperties` +- New struct `ServiceConfiguration` +- New struct `SoftwareAssuranceChangeRequest` +- New struct `SoftwareAssuranceChangeRequestProperties` +- New struct `SoftwareAssuranceProperties` +- New struct `Step` +- New struct `Update` +- New struct `UpdateList` +- New struct `UpdatePrerequisite` +- New struct `UpdateProperties` +- New struct `UpdateRun` +- New struct `UpdateRunList` +- New struct `UpdateRunProperties` +- New struct `UpdateStateProperties` +- New struct `UpdateSummaries` +- New struct `UpdateSummariesList` +- New struct `UpdateSummariesProperties` +- New struct `UserAssignedIdentity` +- New field `ServiceConfigurations` in struct `ArcConnectivityProperties` +- New field `DefaultExtensions` in struct `ArcSettingProperties` +- New field `Identity` in struct `Cluster` +- New field `EhcResourceID`, `LastLicensingTimestamp`, `NodeType`, `OSDisplayVersion`, `OemActivation` in struct `ClusterNode` +- New field `Identity` in struct `ClusterPatch` +- New field `ResourceProviderObjectID`, `SoftwareAssuranceProperties` in struct `ClusterProperties` +- New field `ClusterType`, `Manufacturer`, `OemActivation`, `SupportedCapabilities` in struct `ClusterReportedProperties` +- New field `EnableAutomaticUpgrade` in struct `ExtensionParameters` +- New field `ManagedBy` in struct `ExtensionProperties` +- New field `InstanceView`, `TypeHandlerVersion` in struct `PerNodeExtensionState` +- New field `SystemData` in struct `ProxyResource` +- New field `SystemData` in struct `Resource` +- New field `SystemData` in struct `TrackedResource` + + ## 1.1.1 (2023-04-14) ### Bug Fixes diff --git a/sdk/resourcemanager/azurestackhci/armazurestackhci/arcsettings_client.go b/sdk/resourcemanager/azurestackhci/armazurestackhci/arcsettings_client.go index c45d79b0cbac..066c961db265 100644 --- a/sdk/resourcemanager/azurestackhci/armazurestackhci/arcsettings_client.go +++ b/sdk/resourcemanager/azurestackhci/armazurestackhci/arcsettings_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armazurestackhci @@ -44,28 +43,97 @@ func NewArcSettingsClient(subscriptionID string, credential azcore.TokenCredenti return client, nil } +// ConsentAndInstallDefaultExtensions - Add consent time for default extensions and initiate extensions installation +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - clusterName - The name of the cluster. +// - arcSettingName - The name of the proxy resource holding details of HCI ArcSetting information. +// - options - ArcSettingsClientConsentAndInstallDefaultExtensionsOptions contains the optional parameters for the ArcSettingsClient.ConsentAndInstallDefaultExtensions +// method. +func (client *ArcSettingsClient) ConsentAndInstallDefaultExtensions(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string, options *ArcSettingsClientConsentAndInstallDefaultExtensionsOptions) (ArcSettingsClientConsentAndInstallDefaultExtensionsResponse, error) { + var err error + req, err := client.consentAndInstallDefaultExtensionsCreateRequest(ctx, resourceGroupName, clusterName, arcSettingName, options) + if err != nil { + return ArcSettingsClientConsentAndInstallDefaultExtensionsResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ArcSettingsClientConsentAndInstallDefaultExtensionsResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ArcSettingsClientConsentAndInstallDefaultExtensionsResponse{}, err + } + resp, err := client.consentAndInstallDefaultExtensionsHandleResponse(httpResp) + return resp, err +} + +// consentAndInstallDefaultExtensionsCreateRequest creates the ConsentAndInstallDefaultExtensions request. +func (client *ArcSettingsClient) consentAndInstallDefaultExtensionsCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string, options *ArcSettingsClientConsentAndInstallDefaultExtensionsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/consentAndInstallDefaultExtensions" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if clusterName == "" { + return nil, errors.New("parameter clusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) + if arcSettingName == "" { + return nil, errors.New("parameter arcSettingName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{arcSettingName}", url.PathEscape(arcSettingName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// consentAndInstallDefaultExtensionsHandleResponse handles the ConsentAndInstallDefaultExtensions response. +func (client *ArcSettingsClient) consentAndInstallDefaultExtensionsHandleResponse(resp *http.Response) (ArcSettingsClientConsentAndInstallDefaultExtensionsResponse, error) { + result := ArcSettingsClientConsentAndInstallDefaultExtensionsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ArcSetting); err != nil { + return ArcSettingsClientConsentAndInstallDefaultExtensionsResponse{}, err + } + return result, nil +} + // Create - Create ArcSetting for HCI cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01 +// Generated from API version 2023-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - arcSettingName - The name of the proxy resource holding details of HCI ArcSetting information. // - arcSetting - Parameters supplied to the Create ArcSetting resource for this HCI cluster. // - options - ArcSettingsClientCreateOptions contains the optional parameters for the ArcSettingsClient.Create method. func (client *ArcSettingsClient) Create(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string, arcSetting ArcSetting, options *ArcSettingsClientCreateOptions) (ArcSettingsClientCreateResponse, error) { + var err error req, err := client.createCreateRequest(ctx, resourceGroupName, clusterName, arcSettingName, arcSetting, options) if err != nil { return ArcSettingsClientCreateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ArcSettingsClientCreateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ArcSettingsClientCreateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ArcSettingsClientCreateResponse{}, err } - return client.createHandleResponse(resp) + resp, err := client.createHandleResponse(httpResp) + return resp, err } // createCreateRequest creates the Create request. @@ -92,10 +160,13 @@ func (client *ArcSettingsClient) createCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, arcSetting) + if err := runtime.MarshalAsJSON(req, arcSetting); err != nil { + return nil, err + } + return req, nil } // createHandleResponse handles the Create response. @@ -110,7 +181,7 @@ func (client *ArcSettingsClient) createHandleResponse(resp *http.Response) (ArcS // BeginCreateIdentity - Create Aad identity for arc settings. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01 +// Generated from API version 2023-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - arcSettingName - The name of the proxy resource holding details of HCI ArcSetting information. @@ -122,9 +193,10 @@ func (client *ArcSettingsClient) BeginCreateIdentity(ctx context.Context, resour if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ArcSettingsClientCreateIdentityResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ArcSettingsClientCreateIdentityResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[ArcSettingsClientCreateIdentityResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -133,20 +205,22 @@ func (client *ArcSettingsClient) BeginCreateIdentity(ctx context.Context, resour // CreateIdentity - Create Aad identity for arc settings. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01 +// Generated from API version 2023-06-01 func (client *ArcSettingsClient) createIdentity(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string, options *ArcSettingsClientBeginCreateIdentityOptions) (*http.Response, error) { + var err error req, err := client.createIdentityCreateRequest(ctx, resourceGroupName, clusterName, arcSettingName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createIdentityCreateRequest creates the CreateIdentity request. @@ -173,7 +247,7 @@ func (client *ArcSettingsClient) createIdentityCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -182,7 +256,7 @@ func (client *ArcSettingsClient) createIdentityCreateRequest(ctx context.Context // BeginDelete - Delete ArcSetting resource details of HCI Cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01 +// Generated from API version 2023-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - arcSettingName - The name of the proxy resource holding details of HCI ArcSetting information. @@ -193,9 +267,10 @@ func (client *ArcSettingsClient) BeginDelete(ctx context.Context, resourceGroupN if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ArcSettingsClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ArcSettingsClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[ArcSettingsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -204,20 +279,22 @@ func (client *ArcSettingsClient) BeginDelete(ctx context.Context, resourceGroupN // Delete - Delete ArcSetting resource details of HCI Cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01 +// Generated from API version 2023-06-01 func (client *ArcSettingsClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string, options *ArcSettingsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, clusterName, arcSettingName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -244,7 +321,7 @@ func (client *ArcSettingsClient) deleteCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -253,25 +330,28 @@ func (client *ArcSettingsClient) deleteCreateRequest(ctx context.Context, resour // GeneratePassword - Generate password for arc settings. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01 +// Generated from API version 2023-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - arcSettingName - The name of the proxy resource holding details of HCI ArcSetting information. // - options - ArcSettingsClientGeneratePasswordOptions contains the optional parameters for the ArcSettingsClient.GeneratePassword // method. func (client *ArcSettingsClient) GeneratePassword(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string, options *ArcSettingsClientGeneratePasswordOptions) (ArcSettingsClientGeneratePasswordResponse, error) { + var err error req, err := client.generatePasswordCreateRequest(ctx, resourceGroupName, clusterName, arcSettingName, options) if err != nil { return ArcSettingsClientGeneratePasswordResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ArcSettingsClientGeneratePasswordResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ArcSettingsClientGeneratePasswordResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ArcSettingsClientGeneratePasswordResponse{}, err } - return client.generatePasswordHandleResponse(resp) + resp, err := client.generatePasswordHandleResponse(httpResp) + return resp, err } // generatePasswordCreateRequest creates the GeneratePassword request. @@ -298,7 +378,7 @@ func (client *ArcSettingsClient) generatePasswordCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -316,24 +396,27 @@ func (client *ArcSettingsClient) generatePasswordHandleResponse(resp *http.Respo // Get - Get ArcSetting resource details of HCI Cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01 +// Generated from API version 2023-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - arcSettingName - The name of the proxy resource holding details of HCI ArcSetting information. // - options - ArcSettingsClientGetOptions contains the optional parameters for the ArcSettingsClient.Get method. func (client *ArcSettingsClient) Get(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string, options *ArcSettingsClientGetOptions) (ArcSettingsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, clusterName, arcSettingName, options) if err != nil { return ArcSettingsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ArcSettingsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ArcSettingsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ArcSettingsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -360,7 +443,7 @@ func (client *ArcSettingsClient) getCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -375,9 +458,84 @@ func (client *ArcSettingsClient) getHandleResponse(resp *http.Response) (ArcSett return result, nil } +// BeginInitializeDisableProcess - Initializes ARC Disable process on the cluster +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - clusterName - The name of the cluster. +// - arcSettingName - The name of the proxy resource holding details of HCI ArcSetting information. +// - options - ArcSettingsClientBeginInitializeDisableProcessOptions contains the optional parameters for the ArcSettingsClient.BeginInitializeDisableProcess +// method. +func (client *ArcSettingsClient) BeginInitializeDisableProcess(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string, options *ArcSettingsClientBeginInitializeDisableProcessOptions) (*runtime.Poller[ArcSettingsClientInitializeDisableProcessResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.initializeDisableProcess(ctx, resourceGroupName, clusterName, arcSettingName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ArcSettingsClientInitializeDisableProcessResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[ArcSettingsClientInitializeDisableProcessResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// InitializeDisableProcess - Initializes ARC Disable process on the cluster +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01 +func (client *ArcSettingsClient) initializeDisableProcess(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string, options *ArcSettingsClientBeginInitializeDisableProcessOptions) (*http.Response, error) { + var err error + req, err := client.initializeDisableProcessCreateRequest(ctx, resourceGroupName, clusterName, arcSettingName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// initializeDisableProcessCreateRequest creates the InitializeDisableProcess request. +func (client *ArcSettingsClient) initializeDisableProcessCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string, options *ArcSettingsClientBeginInitializeDisableProcessOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/initializeDisableProcess" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if clusterName == "" { + return nil, errors.New("parameter clusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) + if arcSettingName == "" { + return nil, errors.New("parameter arcSettingName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{arcSettingName}", url.PathEscape(arcSettingName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + // NewListByClusterPager - Get ArcSetting resources of HCI Cluster. // -// Generated from API version 2022-05-01 +// Generated from API version 2023-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - options - ArcSettingsClientListByClusterOptions contains the optional parameters for the ArcSettingsClient.NewListByClusterPager @@ -430,7 +588,7 @@ func (client *ArcSettingsClient) listByClusterCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -448,25 +606,28 @@ func (client *ArcSettingsClient) listByClusterHandleResponse(resp *http.Response // Update - Update ArcSettings for HCI cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01 +// Generated from API version 2023-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - arcSettingName - The name of the proxy resource holding details of HCI ArcSetting information. // - arcSetting - ArcSettings parameters that needs to be updated // - options - ArcSettingsClientUpdateOptions contains the optional parameters for the ArcSettingsClient.Update method. func (client *ArcSettingsClient) Update(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string, arcSetting ArcSettingsPatch, options *ArcSettingsClientUpdateOptions) (ArcSettingsClientUpdateResponse, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, clusterName, arcSettingName, arcSetting, options) if err != nil { return ArcSettingsClientUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ArcSettingsClientUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ArcSettingsClientUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ArcSettingsClientUpdateResponse{}, err } - return client.updateHandleResponse(resp) + resp, err := client.updateHandleResponse(httpResp) + return resp, err } // updateCreateRequest creates the Update request. @@ -493,10 +654,13 @@ func (client *ArcSettingsClient) updateCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, arcSetting) + if err := runtime.MarshalAsJSON(req, arcSetting); err != nil { + return nil, err + } + return req, nil } // updateHandleResponse handles the Update response. diff --git a/sdk/resourcemanager/azurestackhci/armazurestackhci/arcsettings_client_example_test.go b/sdk/resourcemanager/azurestackhci/armazurestackhci/arcsettings_client_example_test.go deleted file mode 100644 index 6d87f6635511..000000000000 --- a/sdk/resourcemanager/azurestackhci/armazurestackhci/arcsettings_client_example_test.go +++ /dev/null @@ -1,309 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armazurestackhci_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/azurestackhci/armazurestackhci" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/ListArcSettingsByCluster.json -func ExampleArcSettingsClient_NewListByClusterPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewArcSettingsClient().NewListByClusterPager("test-rg", "myCluster", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ArcSettingList = armazurestackhci.ArcSettingList{ - // Value: []*armazurestackhci.ArcSetting{ - // { - // Type: to.Ptr("Microsoft.AzureStackHCI/clusters/arcSettings"), - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/test-rg/providers/Microsoft.AzureStackHCI/clusters/myCluster/arcSettings/default"), - // Properties: &armazurestackhci.ArcSettingProperties{ - // AggregateState: to.Ptr(armazurestackhci.ArcSettingAggregateStatePartiallyConnected), - // ArcInstanceResourceGroup: to.Ptr("ArcInstance-rg"), - // PerNodeDetails: []*armazurestackhci.PerNodeState{ - // { - // Name: to.Ptr("Node-1"), - // ArcInstance: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-1"), - // State: to.Ptr(armazurestackhci.NodeArcStateConnected), - // }, - // { - // Name: to.Ptr("Node-2"), - // ArcInstance: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-2"), - // State: to.Ptr(armazurestackhci.NodeArcStateDisconnected), - // }}, - // ProvisioningState: to.Ptr(armazurestackhci.ProvisioningStateSucceeded), - // }, - // SystemData: &armazurestackhci.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-01T17:18:19.1234567Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armazurestackhci.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-02T17:18:19.1234567Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armazurestackhci.CreatedByTypeUser), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/GetArcSetting.json -func ExampleArcSettingsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewArcSettingsClient().Get(ctx, "test-rg", "myCluster", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ArcSetting = armazurestackhci.ArcSetting{ - // Type: to.Ptr("Microsoft.AzureStackHCI/clusters/arcSettings"), - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/test-rg/providers/Microsoft.AzureStackHCI/clusters/myCluster/arcSettings/default"), - // Properties: &armazurestackhci.ArcSettingProperties{ - // AggregateState: to.Ptr(armazurestackhci.ArcSettingAggregateStatePartiallyConnected), - // ArcInstanceResourceGroup: to.Ptr("ArcInstance-rg"), - // PerNodeDetails: []*armazurestackhci.PerNodeState{ - // { - // Name: to.Ptr("Node-1"), - // ArcInstance: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-1"), - // State: to.Ptr(armazurestackhci.NodeArcStateConnected), - // }, - // { - // Name: to.Ptr("Node-2"), - // ArcInstance: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-2"), - // State: to.Ptr(armazurestackhci.NodeArcStateDisconnected), - // }}, - // ProvisioningState: to.Ptr(armazurestackhci.ProvisioningStateSucceeded), - // }, - // SystemData: &armazurestackhci.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-01T17:18:19.1234567Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armazurestackhci.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-02T17:18:19.1234567Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armazurestackhci.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/PutArcSetting.json -func ExampleArcSettingsClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewArcSettingsClient().Create(ctx, "test-rg", "myCluster", "default", armazurestackhci.ArcSetting{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ArcSetting = armazurestackhci.ArcSetting{ - // Type: to.Ptr("Microsoft.AzureStackHCI/clusters/arcSettings"), - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/test-rg/providers/Microsoft.AzureStackHCI/clusters/myCluster/arcSettings/default"), - // Properties: &armazurestackhci.ArcSettingProperties{ - // AggregateState: to.Ptr(armazurestackhci.ArcSettingAggregateStateCreating), - // ArcInstanceResourceGroup: to.Ptr("ArcInstance-rg"), - // ConnectivityProperties: map[string]any{ - // "enabled": false, - // }, - // PerNodeDetails: []*armazurestackhci.PerNodeState{ - // { - // Name: to.Ptr("Node-1"), - // ArcInstance: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-1"), - // State: to.Ptr(armazurestackhci.NodeArcStateCreating), - // }, - // { - // Name: to.Ptr("Node-2"), - // ArcInstance: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-2"), - // State: to.Ptr(armazurestackhci.NodeArcStateCreating), - // }}, - // ProvisioningState: to.Ptr(armazurestackhci.ProvisioningStateSucceeded), - // }, - // SystemData: &armazurestackhci.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-01T17:18:19.1234567Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armazurestackhci.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-02T17:18:19.1234567Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armazurestackhci.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/PatchArcSetting.json -func ExampleArcSettingsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewArcSettingsClient().Update(ctx, "test-rg", "myCluster", "default", armazurestackhci.ArcSettingsPatch{ - Properties: &armazurestackhci.ArcSettingsPatchProperties{ - ConnectivityProperties: map[string]any{ - "enabled": true, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ArcSetting = armazurestackhci.ArcSetting{ - // Type: to.Ptr("Microsoft.AzureStackHCI/clusters/arcSettings"), - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/test-rg/providers/Microsoft.AzureStackHCI/clusters/myCluster/arcSettings/default"), - // Properties: &armazurestackhci.ArcSettingProperties{ - // AggregateState: to.Ptr(armazurestackhci.ArcSettingAggregateStateCreating), - // ArcInstanceResourceGroup: to.Ptr("ArcInstance-rg"), - // ConnectivityProperties: map[string]any{ - // "enabled": true, - // }, - // PerNodeDetails: []*armazurestackhci.PerNodeState{ - // { - // Name: to.Ptr("Node-1"), - // ArcInstance: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-1"), - // State: to.Ptr(armazurestackhci.NodeArcStateCreating), - // }, - // { - // Name: to.Ptr("Node-2"), - // ArcInstance: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-2"), - // State: to.Ptr(armazurestackhci.NodeArcStateCreating), - // }}, - // ProvisioningState: to.Ptr(armazurestackhci.ProvisioningStateSucceeded), - // }, - // SystemData: &armazurestackhci.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-01T17:18:19.1234567Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armazurestackhci.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-02T17:18:19.1234567Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armazurestackhci.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/DeleteArcSetting.json -func ExampleArcSettingsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewArcSettingsClient().BeginDelete(ctx, "test-rg", "myCluster", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/GeneratePassword.json -func ExampleArcSettingsClient_GeneratePassword() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewArcSettingsClient().GeneratePassword(ctx, "test-rg", "myCluster", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PasswordCredential = armazurestackhci.PasswordCredential{ - // EndDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2121-02-17T16:24:23.6264377+05:30"); return t}()), - // KeyID: to.Ptr("00000000-2d47-4fb2-8ed2-fed71a5c197b"), - // SecretText: to.Ptr("secretText"), - // StartDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-02-17T16:24:23.6264005+05:30"); return t}()), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/CreateArcIdentity.json -func ExampleArcSettingsClient_BeginCreateIdentity() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewArcSettingsClient().BeginCreateIdentity(ctx, "test-rg", "myCluster", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ArcIdentityResponse = armazurestackhci.ArcIdentityResponse{ - // Properties: &armazurestackhci.ArcIdentityResponseProperties{ - // ArcApplicationClientID: to.Ptr("7b93bf67-60ac-4909-a987-ac438e69f9ba"), - // ArcApplicationObjectID: to.Ptr("400bd05f-395f-45a6-ba75-72601df80107"), - // ArcApplicationTenantID: to.Ptr("bdb2c88c-9cfd-4e19-927d-51e875f6912b"), - // ArcServicePrincipalObjectID: to.Ptr("00cc4014-482e-4de9-9932-83415cc75f45"), - // }, - // } -} diff --git a/sdk/resourcemanager/azurestackhci/armazurestackhci/autorest.md b/sdk/resourcemanager/azurestackhci/armazurestackhci/autorest.md index e36159615fc2..d02d6fe303f6 100644 --- a/sdk/resourcemanager/azurestackhci/armazurestackhci/autorest.md +++ b/sdk/resourcemanager/azurestackhci/armazurestackhci/autorest.md @@ -5,9 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/azurestackhci/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/azurestackhci/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/azurestackhci/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/azurestackhci/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.1.1 +module-version: 1.2.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/azurestackhci/armazurestackhci/client_factory.go b/sdk/resourcemanager/azurestackhci/armazurestackhci/client_factory.go index 67a132004c3f..1ea3a621fa0d 100644 --- a/sdk/resourcemanager/azurestackhci/armazurestackhci/client_factory.go +++ b/sdk/resourcemanager/azurestackhci/armazurestackhci/client_factory.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armazurestackhci @@ -53,7 +52,37 @@ func (c *ClientFactory) NewExtensionsClient() *ExtensionsClient { return subClient } +func (c *ClientFactory) NewOffersClient() *OffersClient { + subClient, _ := NewOffersClient(c.subscriptionID, c.credential, c.options) + return subClient +} + func (c *ClientFactory) NewOperationsClient() *OperationsClient { subClient, _ := NewOperationsClient(c.credential, c.options) return subClient } + +func (c *ClientFactory) NewPublishersClient() *PublishersClient { + subClient, _ := NewPublishersClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewSKUsClient() *SKUsClient { + subClient, _ := NewSKUsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewUpdateRunsClient() *UpdateRunsClient { + subClient, _ := NewUpdateRunsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewUpdateSummariesClient() *UpdateSummariesClient { + subClient, _ := NewUpdateSummariesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewUpdatesClient() *UpdatesClient { + subClient, _ := NewUpdatesClient(c.subscriptionID, c.credential, c.options) + return subClient +} diff --git a/sdk/resourcemanager/azurestackhci/armazurestackhci/clusters_client.go b/sdk/resourcemanager/azurestackhci/armazurestackhci/clusters_client.go index 218f4eb9a9a0..47840f034b64 100644 --- a/sdk/resourcemanager/azurestackhci/armazurestackhci/clusters_client.go +++ b/sdk/resourcemanager/azurestackhci/armazurestackhci/clusters_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armazurestackhci @@ -47,24 +46,27 @@ func NewClustersClient(subscriptionID string, credential azcore.TokenCredential, // Create - Create an HCI cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01 +// Generated from API version 2023-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - cluster - Details of the HCI cluster. // - options - ClustersClientCreateOptions contains the optional parameters for the ClustersClient.Create method. func (client *ClustersClient) Create(ctx context.Context, resourceGroupName string, clusterName string, cluster Cluster, options *ClustersClientCreateOptions) (ClustersClientCreateResponse, error) { + var err error req, err := client.createCreateRequest(ctx, resourceGroupName, clusterName, cluster, options) if err != nil { return ClustersClientCreateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ClustersClientCreateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ClustersClientCreateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ClustersClientCreateResponse{}, err } - return client.createHandleResponse(resp) + resp, err := client.createHandleResponse(httpResp) + return resp, err } // createCreateRequest creates the Create request. @@ -87,10 +89,13 @@ func (client *ClustersClient) createCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, cluster) + if err := runtime.MarshalAsJSON(req, cluster); err != nil { + return nil, err + } + return req, nil } // createHandleResponse handles the Create response. @@ -105,7 +110,7 @@ func (client *ClustersClient) createHandleResponse(resp *http.Response) (Cluster // BeginCreateIdentity - Create cluster identity. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01 +// Generated from API version 2023-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - options - ClustersClientBeginCreateIdentityOptions contains the optional parameters for the ClustersClient.BeginCreateIdentity @@ -116,9 +121,10 @@ func (client *ClustersClient) BeginCreateIdentity(ctx context.Context, resourceG if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ClustersClientCreateIdentityResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ClustersClientCreateIdentityResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[ClustersClientCreateIdentityResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -127,20 +133,22 @@ func (client *ClustersClient) BeginCreateIdentity(ctx context.Context, resourceG // CreateIdentity - Create cluster identity. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01 +// Generated from API version 2023-06-01 func (client *ClustersClient) createIdentity(ctx context.Context, resourceGroupName string, clusterName string, options *ClustersClientBeginCreateIdentityOptions) (*http.Response, error) { + var err error req, err := client.createIdentityCreateRequest(ctx, resourceGroupName, clusterName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createIdentityCreateRequest creates the CreateIdentity request. @@ -163,7 +171,7 @@ func (client *ClustersClient) createIdentityCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -172,7 +180,7 @@ func (client *ClustersClient) createIdentityCreateRequest(ctx context.Context, r // BeginDelete - Delete an HCI cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01 +// Generated from API version 2023-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - options - ClustersClientBeginDeleteOptions contains the optional parameters for the ClustersClient.BeginDelete method. @@ -182,7 +190,8 @@ func (client *ClustersClient) BeginDelete(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller[ClustersClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ClustersClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ClustersClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -191,20 +200,22 @@ func (client *ClustersClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Delete an HCI cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01 +// Generated from API version 2023-06-01 func (client *ClustersClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, options *ClustersClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, clusterName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -227,32 +238,109 @@ func (client *ClustersClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } +// BeginExtendSoftwareAssuranceBenefit - Extends Software Assurance Benefit to a cluster +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - clusterName - The name of the cluster. +// - softwareAssuranceChangeRequest - Software Assurance Change Request Payload +// - options - ClustersClientBeginExtendSoftwareAssuranceBenefitOptions contains the optional parameters for the ClustersClient.BeginExtendSoftwareAssuranceBenefit +// method. +func (client *ClustersClient) BeginExtendSoftwareAssuranceBenefit(ctx context.Context, resourceGroupName string, clusterName string, softwareAssuranceChangeRequest SoftwareAssuranceChangeRequest, options *ClustersClientBeginExtendSoftwareAssuranceBenefitOptions) (*runtime.Poller[ClustersClientExtendSoftwareAssuranceBenefitResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.extendSoftwareAssuranceBenefit(ctx, resourceGroupName, clusterName, softwareAssuranceChangeRequest, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ClustersClientExtendSoftwareAssuranceBenefitResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[ClustersClientExtendSoftwareAssuranceBenefitResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// ExtendSoftwareAssuranceBenefit - Extends Software Assurance Benefit to a cluster +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01 +func (client *ClustersClient) extendSoftwareAssuranceBenefit(ctx context.Context, resourceGroupName string, clusterName string, softwareAssuranceChangeRequest SoftwareAssuranceChangeRequest, options *ClustersClientBeginExtendSoftwareAssuranceBenefitOptions) (*http.Response, error) { + var err error + req, err := client.extendSoftwareAssuranceBenefitCreateRequest(ctx, resourceGroupName, clusterName, softwareAssuranceChangeRequest, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// extendSoftwareAssuranceBenefitCreateRequest creates the ExtendSoftwareAssuranceBenefit request. +func (client *ClustersClient) extendSoftwareAssuranceBenefitCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, softwareAssuranceChangeRequest SoftwareAssuranceChangeRequest, options *ClustersClientBeginExtendSoftwareAssuranceBenefitOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/extendSoftwareAssuranceBenefit" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if clusterName == "" { + return nil, errors.New("parameter clusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, softwareAssuranceChangeRequest); err != nil { + return nil, err + } + return req, nil +} + // Get - Get HCI cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01 +// Generated from API version 2023-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - options - ClustersClientGetOptions contains the optional parameters for the ClustersClient.Get method. func (client *ClustersClient) Get(ctx context.Context, resourceGroupName string, clusterName string, options *ClustersClientGetOptions) (ClustersClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, clusterName, options) if err != nil { return ClustersClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ClustersClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ClustersClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ClustersClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -275,7 +363,7 @@ func (client *ClustersClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -292,7 +380,7 @@ func (client *ClustersClient) getHandleResponse(resp *http.Response) (ClustersCl // NewListByResourceGroupPager - List all HCI clusters in a resource group. // -// Generated from API version 2022-05-01 +// Generated from API version 2023-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - ClustersClientListByResourceGroupOptions contains the optional parameters for the ClustersClient.NewListByResourceGroupPager // method. @@ -340,7 +428,7 @@ func (client *ClustersClient) listByResourceGroupCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -357,7 +445,7 @@ func (client *ClustersClient) listByResourceGroupHandleResponse(resp *http.Respo // NewListBySubscriptionPager - List all HCI clusters in a subscription. // -// Generated from API version 2022-05-01 +// Generated from API version 2023-06-01 // - options - ClustersClientListBySubscriptionOptions contains the optional parameters for the ClustersClient.NewListBySubscriptionPager // method. func (client *ClustersClient) NewListBySubscriptionPager(options *ClustersClientListBySubscriptionOptions) *runtime.Pager[ClustersClientListBySubscriptionResponse] { @@ -400,7 +488,7 @@ func (client *ClustersClient) listBySubscriptionCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -418,24 +506,27 @@ func (client *ClustersClient) listBySubscriptionHandleResponse(resp *http.Respon // Update - Update an HCI cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01 +// Generated from API version 2023-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - cluster - Details of the HCI cluster. // - options - ClustersClientUpdateOptions contains the optional parameters for the ClustersClient.Update method. func (client *ClustersClient) Update(ctx context.Context, resourceGroupName string, clusterName string, cluster ClusterPatch, options *ClustersClientUpdateOptions) (ClustersClientUpdateResponse, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, clusterName, cluster, options) if err != nil { return ClustersClientUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ClustersClientUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ClustersClientUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ClustersClientUpdateResponse{}, err } - return client.updateHandleResponse(resp) + resp, err := client.updateHandleResponse(httpResp) + return resp, err } // updateCreateRequest creates the Update request. @@ -458,10 +549,13 @@ func (client *ClustersClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, cluster) + if err := runtime.MarshalAsJSON(req, cluster); err != nil { + return nil, err + } + return req, nil } // updateHandleResponse handles the Update response. @@ -476,7 +570,7 @@ func (client *ClustersClient) updateHandleResponse(resp *http.Response) (Cluster // BeginUploadCertificate - Upload certificate. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01 +// Generated from API version 2023-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - uploadCertificateRequest - Upload certificate request. @@ -488,9 +582,10 @@ func (client *ClustersClient) BeginUploadCertificate(ctx context.Context, resour if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ClustersClientUploadCertificateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ClustersClientUploadCertificateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[ClustersClientUploadCertificateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -499,20 +594,22 @@ func (client *ClustersClient) BeginUploadCertificate(ctx context.Context, resour // UploadCertificate - Upload certificate. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01 +// Generated from API version 2023-06-01 func (client *ClustersClient) uploadCertificate(ctx context.Context, resourceGroupName string, clusterName string, uploadCertificateRequest UploadCertificateRequest, options *ClustersClientBeginUploadCertificateOptions) (*http.Response, error) { + var err error req, err := client.uploadCertificateCreateRequest(ctx, resourceGroupName, clusterName, uploadCertificateRequest, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // uploadCertificateCreateRequest creates the UploadCertificate request. @@ -535,8 +632,11 @@ func (client *ClustersClient) uploadCertificateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, uploadCertificateRequest) + if err := runtime.MarshalAsJSON(req, uploadCertificateRequest); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/azurestackhci/armazurestackhci/clusters_client_example_test.go b/sdk/resourcemanager/azurestackhci/armazurestackhci/clusters_client_example_test.go deleted file mode 100644 index 11909f673108..000000000000 --- a/sdk/resourcemanager/azurestackhci/armazurestackhci/clusters_client_example_test.go +++ /dev/null @@ -1,645 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armazurestackhci_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/azurestackhci/armazurestackhci" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/ListClustersBySubscription.json -func ExampleClustersClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewClustersClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ClusterList = armazurestackhci.ClusterList{ - // Value: []*armazurestackhci.Cluster{ - // { - // Name: to.Ptr("myCluster1"), - // Type: to.Ptr("Microsoft.AzureStackHCI/clusters"), - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/test-rg1/providers/Microsoft.AzureStackHCI/clusters/myCluster1"), - // Location: to.Ptr("East US"), - // Tags: map[string]*string{ - // }, - // Properties: &armazurestackhci.ClusterProperties{ - // AADClientID: to.Ptr("515da1c2-379e-49b4-9975-09e3e40c86be"), - // AADTenantID: to.Ptr("7e589cc1-a8b6-4dff-91bd-5ec0fa18db94"), - // BillingModel: to.Ptr("Trial"), - // CloudID: to.Ptr("91c2b355-4826-4e96-9164-e3f26dcf1cdd"), - // CloudManagementEndpoint: to.Ptr("https://98294836-31be-4668-aeae-698667faf99b.waconazure.com"), - // DesiredProperties: &armazurestackhci.ClusterDesiredProperties{ - // DiagnosticLevel: to.Ptr(armazurestackhci.DiagnosticLevelBasic), - // WindowsServerSubscription: to.Ptr(armazurestackhci.WindowsServerSubscriptionEnabled), - // }, - // ProvisioningState: to.Ptr(armazurestackhci.ProvisioningStateSucceeded), - // ReportedProperties: &armazurestackhci.ClusterReportedProperties{ - // }, - // Status: to.Ptr(armazurestackhci.StatusNotYetRegistered), - // TrialDaysRemaining: to.Ptr[float32](29), - // }, - // SystemData: &armazurestackhci.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armazurestackhci.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armazurestackhci.CreatedByTypeUser), - // }, - // }, - // { - // Name: to.Ptr("myCluster2"), - // Type: to.Ptr("Microsoft.AzureStackHCI/clusters"), - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/test-rg2/providers/Microsoft.AzureStackHCI/clusters/myCluster2"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Properties: &armazurestackhci.ClusterProperties{ - // AADClientID: to.Ptr("24a6e53d-04e5-44d2-b7cc-1b732a847dfc"), - // AADTenantID: to.Ptr("7e589cc1-a8b6-4dff-91bd-5ec0fa18db94"), - // BillingModel: to.Ptr("Trial"), - // CloudID: to.Ptr("a3c0468f-e38e-4dda-ac48-817f620536f0"), - // CloudManagementEndpoint: to.Ptr("https://98294836-31be-4668-aeae-698667faf99b.waconazure.com"), - // DesiredProperties: &armazurestackhci.ClusterDesiredProperties{ - // DiagnosticLevel: to.Ptr(armazurestackhci.DiagnosticLevelBasic), - // WindowsServerSubscription: to.Ptr(armazurestackhci.WindowsServerSubscriptionEnabled), - // }, - // LastBillingTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-12T08:12:55.2312022Z"); return t}()), - // LastSyncTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-11T20:44:32.5625121Z"); return t}()), - // ProvisioningState: to.Ptr(armazurestackhci.ProvisioningStateSucceeded), - // RegistrationTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-11T20:44:32.5625121Z"); return t}()), - // ReportedProperties: &armazurestackhci.ClusterReportedProperties{ - // ClusterID: to.Ptr("a76ac23a-1819-4e82-9410-e3e4ec3d1425"), - // ClusterName: to.Ptr("cluster1"), - // ClusterVersion: to.Ptr("10.0.17777"), - // DiagnosticLevel: to.Ptr(armazurestackhci.DiagnosticLevelBasic), - // ImdsAttestation: to.Ptr(armazurestackhci.ImdsAttestationDisabled), - // LastUpdated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-11T19:24:42.1946017Z"); return t}()), - // Nodes: []*armazurestackhci.ClusterNode{ - // { - // Name: to.Ptr("Node1"), - // CoreCount: to.Ptr[float32](8), - // ID: to.Ptr[float32](0), - // Manufacturer: to.Ptr("Dell Inc."), - // MemoryInGiB: to.Ptr[float32](128), - // Model: to.Ptr("EMC AX740"), - // OSName: to.Ptr("Azure Stack HCI"), - // OSVersion: to.Ptr("10.0.17777.1061"), - // SerialNumber: to.Ptr("Q45CZC3"), - // WindowsServerSubscription: to.Ptr(armazurestackhci.WindowsServerSubscriptionEnabled), - // }, - // { - // Name: to.Ptr("Node2"), - // CoreCount: to.Ptr[float32](8), - // ID: to.Ptr[float32](1), - // Manufacturer: to.Ptr("Dell Inc."), - // MemoryInGiB: to.Ptr[float32](128), - // Model: to.Ptr("EMC AX740"), - // OSName: to.Ptr("Azure Stack HCI"), - // OSVersion: to.Ptr("10.0.17777.1061"), - // SerialNumber: to.Ptr("Q44BSC3"), - // WindowsServerSubscription: to.Ptr(armazurestackhci.WindowsServerSubscriptionEnabled), - // }, - // { - // Name: to.Ptr("Node3"), - // CoreCount: to.Ptr[float32](16), - // ID: to.Ptr[float32](2), - // Manufacturer: to.Ptr("Dell Inc."), - // MemoryInGiB: to.Ptr[float32](256), - // Model: to.Ptr("EMC AX740"), - // OSName: to.Ptr("Azure Stack HCI"), - // OSVersion: to.Ptr("10.0.17777.1061"), - // SerialNumber: to.Ptr("Q44RFC3"), - // WindowsServerSubscription: to.Ptr(armazurestackhci.WindowsServerSubscriptionEnabled), - // }}, - // }, - // Status: to.Ptr(armazurestackhci.StatusConnectedRecently), - // TrialDaysRemaining: to.Ptr[float32](30), - // }, - // SystemData: &armazurestackhci.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armazurestackhci.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armazurestackhci.CreatedByTypeUser), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/ListClustersByResourceGroup.json -func ExampleClustersClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewClustersClient().NewListByResourceGroupPager("test-rg", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ClusterList = armazurestackhci.ClusterList{ - // Value: []*armazurestackhci.Cluster{ - // { - // Name: to.Ptr("myCluster1"), - // Type: to.Ptr("Microsoft.AzureStackHCI/clusters"), - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/test-rg/providers/Microsoft.AzureStackHCI/clusters/myCluster1"), - // Location: to.Ptr("East US"), - // Tags: map[string]*string{ - // }, - // Properties: &armazurestackhci.ClusterProperties{ - // AADClientID: to.Ptr("515da1c2-379e-49b4-9975-09e3e40c86be"), - // AADTenantID: to.Ptr("7e589cc1-a8b6-4dff-91bd-5ec0fa18db94"), - // BillingModel: to.Ptr("Trial"), - // CloudID: to.Ptr("91c2b355-4826-4e96-9164-e3f26dcf1cdd"), - // CloudManagementEndpoint: to.Ptr("https://98294836-31be-4668-aeae-698667faf99b.waconazure.com"), - // DesiredProperties: &armazurestackhci.ClusterDesiredProperties{ - // DiagnosticLevel: to.Ptr(armazurestackhci.DiagnosticLevelBasic), - // WindowsServerSubscription: to.Ptr(armazurestackhci.WindowsServerSubscriptionEnabled), - // }, - // ProvisioningState: to.Ptr(armazurestackhci.ProvisioningStateSucceeded), - // ReportedProperties: &armazurestackhci.ClusterReportedProperties{ - // }, - // Status: to.Ptr(armazurestackhci.StatusNotYetRegistered), - // TrialDaysRemaining: to.Ptr[float32](29), - // }, - // SystemData: &armazurestackhci.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armazurestackhci.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armazurestackhci.CreatedByTypeUser), - // }, - // }, - // { - // Name: to.Ptr("myCluster2"), - // Type: to.Ptr("Microsoft.AzureStackHCI/clusters"), - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/test-rg/providers/Microsoft.AzureStackHCI/clusters/myCluster2"), - // Location: to.Ptr("East US"), - // Tags: map[string]*string{ - // }, - // Properties: &armazurestackhci.ClusterProperties{ - // AADClientID: to.Ptr("24a6e53d-04e5-44d2-b7cc-1b732a847dfc"), - // AADTenantID: to.Ptr("7e589cc1-a8b6-4dff-91bd-5ec0fa18db94"), - // BillingModel: to.Ptr("Trial"), - // CloudID: to.Ptr("a3c0468f-e38e-4dda-ac48-817f620536f0"), - // CloudManagementEndpoint: to.Ptr("https://98294836-31be-4668-aeae-698667faf99b.waconazure.com"), - // DesiredProperties: &armazurestackhci.ClusterDesiredProperties{ - // DiagnosticLevel: to.Ptr(armazurestackhci.DiagnosticLevelBasic), - // WindowsServerSubscription: to.Ptr(armazurestackhci.WindowsServerSubscriptionEnabled), - // }, - // LastBillingTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-12T08:12:55.2312022Z"); return t}()), - // LastSyncTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-11T20:44:32.5625121Z"); return t}()), - // ProvisioningState: to.Ptr(armazurestackhci.ProvisioningStateSucceeded), - // RegistrationTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-11T20:44:32.5625121Z"); return t}()), - // ReportedProperties: &armazurestackhci.ClusterReportedProperties{ - // ClusterID: to.Ptr("a76ac23a-1819-4e82-9410-e3e4ec3d1425"), - // ClusterName: to.Ptr("cluster1"), - // ClusterVersion: to.Ptr("10.0.17777"), - // DiagnosticLevel: to.Ptr(armazurestackhci.DiagnosticLevelBasic), - // ImdsAttestation: to.Ptr(armazurestackhci.ImdsAttestationDisabled), - // LastUpdated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-11T19:24:42.1946017Z"); return t}()), - // Nodes: []*armazurestackhci.ClusterNode{ - // { - // Name: to.Ptr("Node1"), - // CoreCount: to.Ptr[float32](8), - // ID: to.Ptr[float32](0), - // Manufacturer: to.Ptr("Dell Inc."), - // MemoryInGiB: to.Ptr[float32](128), - // Model: to.Ptr("EMC AX740"), - // OSName: to.Ptr("Azure Stack HCI"), - // OSVersion: to.Ptr("10.0.17777.1061"), - // SerialNumber: to.Ptr("Q45CZC3"), - // WindowsServerSubscription: to.Ptr(armazurestackhci.WindowsServerSubscriptionEnabled), - // }, - // { - // Name: to.Ptr("Node2"), - // CoreCount: to.Ptr[float32](8), - // ID: to.Ptr[float32](1), - // Manufacturer: to.Ptr("Dell Inc."), - // MemoryInGiB: to.Ptr[float32](128), - // Model: to.Ptr("EMC AX740"), - // OSName: to.Ptr("Azure Stack HCI"), - // OSVersion: to.Ptr("10.0.17777.1061"), - // SerialNumber: to.Ptr("Q44BSC3"), - // WindowsServerSubscription: to.Ptr(armazurestackhci.WindowsServerSubscriptionEnabled), - // }, - // { - // Name: to.Ptr("Node3"), - // CoreCount: to.Ptr[float32](16), - // ID: to.Ptr[float32](2), - // Manufacturer: to.Ptr("Dell Inc."), - // MemoryInGiB: to.Ptr[float32](256), - // Model: to.Ptr("EMC AX740"), - // OSName: to.Ptr("Azure Stack HCI"), - // OSVersion: to.Ptr("10.0.17777.1061"), - // SerialNumber: to.Ptr("Q44RFC3"), - // WindowsServerSubscription: to.Ptr(armazurestackhci.WindowsServerSubscriptionEnabled), - // }}, - // }, - // Status: to.Ptr(armazurestackhci.StatusConnectedRecently), - // TrialDaysRemaining: to.Ptr[float32](30), - // }, - // SystemData: &armazurestackhci.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armazurestackhci.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armazurestackhci.CreatedByTypeUser), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/GetCluster.json -func ExampleClustersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewClustersClient().Get(ctx, "test-rg", "myCluster", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Cluster = armazurestackhci.Cluster{ - // Name: to.Ptr("myCluster"), - // Type: to.Ptr("Microsoft.AzureStackHCI/clusters"), - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/test-rg/providers/Microsoft.AzureStackHCI/clusters/myCluster"), - // Location: to.Ptr("East US"), - // Tags: map[string]*string{ - // }, - // Properties: &armazurestackhci.ClusterProperties{ - // AADClientID: to.Ptr("24a6e53d-04e5-44d2-b7cc-1b732a847dfc"), - // AADTenantID: to.Ptr("7e589cc1-a8b6-4dff-91bd-5ec0fa18db94"), - // BillingModel: to.Ptr("Trial"), - // CloudID: to.Ptr("a3c0468f-e38e-4dda-ac48-817f620536f0"), - // CloudManagementEndpoint: to.Ptr("https://98294836-31be-4668-aeae-698667faf99b.waconazure.com"), - // DesiredProperties: &armazurestackhci.ClusterDesiredProperties{ - // DiagnosticLevel: to.Ptr(armazurestackhci.DiagnosticLevelBasic), - // WindowsServerSubscription: to.Ptr(armazurestackhci.WindowsServerSubscriptionEnabled), - // }, - // LastBillingTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-12T08:12:55.2312022Z"); return t}()), - // LastSyncTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-11T20:44:32.5625121Z"); return t}()), - // ProvisioningState: to.Ptr(armazurestackhci.ProvisioningStateSucceeded), - // RegistrationTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-11T20:44:32.5625121Z"); return t}()), - // ReportedProperties: &armazurestackhci.ClusterReportedProperties{ - // ClusterID: to.Ptr("a76ac23a-1819-4e82-9410-e3e4ec3d1425"), - // ClusterName: to.Ptr("cluster1"), - // ClusterVersion: to.Ptr("10.0.17777"), - // DiagnosticLevel: to.Ptr(armazurestackhci.DiagnosticLevelBasic), - // ImdsAttestation: to.Ptr(armazurestackhci.ImdsAttestationDisabled), - // LastUpdated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-11T19:24:42.1946017Z"); return t}()), - // Nodes: []*armazurestackhci.ClusterNode{ - // { - // Name: to.Ptr("Node1"), - // CoreCount: to.Ptr[float32](8), - // ID: to.Ptr[float32](1), - // Manufacturer: to.Ptr("Dell Inc."), - // MemoryInGiB: to.Ptr[float32](128), - // Model: to.Ptr("EMC AX740"), - // OSName: to.Ptr("Azure Stack HCI"), - // OSVersion: to.Ptr("10.0.17777.1061"), - // SerialNumber: to.Ptr("Q45CZC3"), - // WindowsServerSubscription: to.Ptr(armazurestackhci.WindowsServerSubscriptionEnabled), - // }, - // { - // Name: to.Ptr("Node2"), - // CoreCount: to.Ptr[float32](8), - // ID: to.Ptr[float32](2), - // Manufacturer: to.Ptr("Dell Inc."), - // MemoryInGiB: to.Ptr[float32](128), - // Model: to.Ptr("EMC AX740"), - // OSName: to.Ptr("Azure Stack HCI"), - // OSVersion: to.Ptr("10.0.17777.1061"), - // SerialNumber: to.Ptr("Q44BSC3"), - // WindowsServerSubscription: to.Ptr(armazurestackhci.WindowsServerSubscriptionEnabled), - // }, - // { - // Name: to.Ptr("Node3"), - // CoreCount: to.Ptr[float32](16), - // ID: to.Ptr[float32](3), - // Manufacturer: to.Ptr("Dell Inc."), - // MemoryInGiB: to.Ptr[float32](256), - // Model: to.Ptr("EMC AX740"), - // OSName: to.Ptr("Azure Stack HCI"), - // OSVersion: to.Ptr("10.0.17777.1061"), - // SerialNumber: to.Ptr("Q44RFC3"), - // WindowsServerSubscription: to.Ptr(armazurestackhci.WindowsServerSubscriptionEnabled), - // }}, - // }, - // Status: to.Ptr(armazurestackhci.StatusConnectedRecently), - // TrialDaysRemaining: to.Ptr[float32](30), - // }, - // SystemData: &armazurestackhci.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armazurestackhci.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armazurestackhci.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/CreateCluster.json -func ExampleClustersClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewClustersClient().Create(ctx, "test-rg", "myCluster", armazurestackhci.Cluster{ - Location: to.Ptr("East US"), - Properties: &armazurestackhci.ClusterProperties{ - AADClientID: to.Ptr("24a6e53d-04e5-44d2-b7cc-1b732a847dfc"), - AADTenantID: to.Ptr("7e589cc1-a8b6-4dff-91bd-5ec0fa18db94"), - CloudManagementEndpoint: to.Ptr("https://98294836-31be-4668-aeae-698667faf99b.waconazure.com"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Cluster = armazurestackhci.Cluster{ - // Name: to.Ptr("myCluster"), - // Type: to.Ptr("Microsoft.AzureStackHCI/clusters"), - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/test-rg/providers/Microsoft.AzureStackHCI/clusters/myCluster"), - // Location: to.Ptr("East US"), - // Tags: map[string]*string{ - // }, - // Properties: &armazurestackhci.ClusterProperties{ - // AADClientID: to.Ptr("24a6e53d-04e5-44d2-b7cc-1b732a847dfc"), - // AADTenantID: to.Ptr("7e589cc1-a8b6-4dff-91bd-5ec0fa18db94"), - // BillingModel: to.Ptr("Trial"), - // CloudID: to.Ptr("a3c0468f-e38e-4dda-ac48-817f620536f0"), - // CloudManagementEndpoint: to.Ptr("https://98294836-31be-4668-aeae-698667faf99b.waconazure.com"), - // DesiredProperties: &armazurestackhci.ClusterDesiredProperties{ - // DiagnosticLevel: to.Ptr(armazurestackhci.DiagnosticLevelBasic), - // WindowsServerSubscription: to.Ptr(armazurestackhci.WindowsServerSubscriptionDisabled), - // }, - // ProvisioningState: to.Ptr(armazurestackhci.ProvisioningStateSucceeded), - // ReportedProperties: &armazurestackhci.ClusterReportedProperties{ - // }, - // ServiceEndpoint: to.Ptr("https://azurestackhci.azurefd.net/eastus"), - // Status: to.Ptr(armazurestackhci.StatusNotYetRegistered), - // TrialDaysRemaining: to.Ptr[float32](30), - // }, - // SystemData: &armazurestackhci.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armazurestackhci.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armazurestackhci.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/UpdateCluster.json -func ExampleClustersClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewClustersClient().Update(ctx, "test-rg", "myCluster", armazurestackhci.ClusterPatch{ - Properties: &armazurestackhci.ClusterPatchProperties{ - CloudManagementEndpoint: to.Ptr("https://98294836-31be-4668-aeae-698667faf99b.waconazure.com"), - DesiredProperties: &armazurestackhci.ClusterDesiredProperties{ - DiagnosticLevel: to.Ptr(armazurestackhci.DiagnosticLevelBasic), - WindowsServerSubscription: to.Ptr(armazurestackhci.WindowsServerSubscriptionEnabled), - }, - }, - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Cluster = armazurestackhci.Cluster{ - // Name: to.Ptr("myCluster"), - // Type: to.Ptr("Microsoft.AzureStackHCI/clusters"), - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/test-rg/providers/Microsoft.AzureStackHCI/clusters/myCluster"), - // Location: to.Ptr("East US"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armazurestackhci.ClusterProperties{ - // AADClientID: to.Ptr("515da1c2-379e-49b4-9975-09e3e40c86be"), - // AADTenantID: to.Ptr("7e589cc1-a8b6-4dff-91bd-5ec0fa18db94"), - // BillingModel: to.Ptr("Trial"), - // CloudID: to.Ptr("91c2b355-4826-4e96-9164-e3f26dcf1cdd"), - // CloudManagementEndpoint: to.Ptr("https://98294836-31be-4668-aeae-698667faf99b.waconazure.com"), - // DesiredProperties: &armazurestackhci.ClusterDesiredProperties{ - // DiagnosticLevel: to.Ptr(armazurestackhci.DiagnosticLevelBasic), - // WindowsServerSubscription: to.Ptr(armazurestackhci.WindowsServerSubscriptionEnabled), - // }, - // LastBillingTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-12T08:12:55.2312022Z"); return t}()), - // LastSyncTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-11T20:44:32.5625121Z"); return t}()), - // ProvisioningState: to.Ptr(armazurestackhci.ProvisioningStateSucceeded), - // RegistrationTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-11T20:44:32.5625121Z"); return t}()), - // ReportedProperties: &armazurestackhci.ClusterReportedProperties{ - // ClusterID: to.Ptr("a76ac23a-1819-4e82-9410-e3e4ec3d1425"), - // ClusterName: to.Ptr("cluster1"), - // ClusterVersion: to.Ptr("10.0.17777"), - // DiagnosticLevel: to.Ptr(armazurestackhci.DiagnosticLevelBasic), - // ImdsAttestation: to.Ptr(armazurestackhci.ImdsAttestationDisabled), - // LastUpdated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-11T19:24:42.1946017Z"); return t}()), - // Nodes: []*armazurestackhci.ClusterNode{ - // { - // Name: to.Ptr("Node1"), - // CoreCount: to.Ptr[float32](8), - // ID: to.Ptr[float32](1), - // Manufacturer: to.Ptr("Dell Inc."), - // MemoryInGiB: to.Ptr[float32](128), - // Model: to.Ptr("EMC AX740"), - // OSName: to.Ptr("Azure Stack HCI"), - // OSVersion: to.Ptr("10.0.17777.1061"), - // SerialNumber: to.Ptr("Q45CZC3"), - // WindowsServerSubscription: to.Ptr(armazurestackhci.WindowsServerSubscriptionEnabled), - // }, - // { - // Name: to.Ptr("Node2"), - // CoreCount: to.Ptr[float32](8), - // ID: to.Ptr[float32](2), - // Manufacturer: to.Ptr("Dell Inc."), - // MemoryInGiB: to.Ptr[float32](128), - // Model: to.Ptr("EMC AX740"), - // OSName: to.Ptr("Azure Stack HCI"), - // OSVersion: to.Ptr("10.0.17777.1061"), - // SerialNumber: to.Ptr("Q44BSC3"), - // WindowsServerSubscription: to.Ptr(armazurestackhci.WindowsServerSubscriptionEnabled), - // }, - // { - // Name: to.Ptr("Node3"), - // CoreCount: to.Ptr[float32](16), - // ID: to.Ptr[float32](3), - // Manufacturer: to.Ptr("Dell Inc."), - // MemoryInGiB: to.Ptr[float32](256), - // Model: to.Ptr("EMC AX740"), - // OSName: to.Ptr("Azure Stack HCI"), - // OSVersion: to.Ptr("10.0.17777.1061"), - // SerialNumber: to.Ptr("Q44RFC3"), - // WindowsServerSubscription: to.Ptr(armazurestackhci.WindowsServerSubscriptionEnabled), - // }}, - // }, - // Status: to.Ptr(armazurestackhci.StatusConnectedRecently), - // TrialDaysRemaining: to.Ptr[float32](30), - // }, - // SystemData: &armazurestackhci.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armazurestackhci.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armazurestackhci.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/DeleteCluster.json -func ExampleClustersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClustersClient().BeginDelete(ctx, "test-rg", "myCluster", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/UploadCertificate.json -func ExampleClustersClient_BeginUploadCertificate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClustersClient().BeginUploadCertificate(ctx, "test-rg", "myCluster", armazurestackhci.UploadCertificateRequest{ - Properties: &armazurestackhci.RawCertificateData{ - Certificates: []*string{ - to.Ptr("base64cert"), - to.Ptr("base64cert")}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/CreateClusterIdentity.json -func ExampleClustersClient_BeginCreateIdentity() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClustersClient().BeginCreateIdentity(ctx, "test-rg", "myCluster", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ClusterIdentityResponse = armazurestackhci.ClusterIdentityResponse{ - // Properties: &armazurestackhci.ClusterIdentityResponseProperties{ - // AADApplicationObjectID: to.Ptr("00cc4014-482e-4de9-9932-83415cc75f45"), - // AADClientID: to.Ptr("7b93bf67-60ac-4909-a987-ac438e69f9ba"), - // AADServicePrincipalObjectID: to.Ptr("400bd05f-395f-45a6-ba75-72601df80107"), - // AADTenantID: to.Ptr("bdb2c88c-9cfd-4e19-927d-51e875f6912b"), - // }, - // } -} diff --git a/sdk/resourcemanager/azurestackhci/armazurestackhci/constants.go b/sdk/resourcemanager/azurestackhci/armazurestackhci/constants.go index 727647d04066..6cb0386398f9 100644 --- a/sdk/resourcemanager/azurestackhci/armazurestackhci/constants.go +++ b/sdk/resourcemanager/azurestackhci/armazurestackhci/constants.go @@ -3,15 +3,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armazurestackhci const ( moduleName = "armazurestackhci" - moduleVersion = "v1.1.1" + moduleVersion = "v1.2.0" ) // ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. @@ -32,11 +31,13 @@ func PossibleActionTypeValues() []ActionType { type ArcSettingAggregateState string const ( + ArcSettingAggregateStateAccepted ArcSettingAggregateState = "Accepted" ArcSettingAggregateStateCanceled ArcSettingAggregateState = "Canceled" ArcSettingAggregateStateConnected ArcSettingAggregateState = "Connected" ArcSettingAggregateStateCreating ArcSettingAggregateState = "Creating" ArcSettingAggregateStateDeleted ArcSettingAggregateState = "Deleted" ArcSettingAggregateStateDeleting ArcSettingAggregateState = "Deleting" + ArcSettingAggregateStateDisableInProgress ArcSettingAggregateState = "DisableInProgress" ArcSettingAggregateStateDisconnected ArcSettingAggregateState = "Disconnected" ArcSettingAggregateStateError ArcSettingAggregateState = "Error" ArcSettingAggregateStateFailed ArcSettingAggregateState = "Failed" @@ -45,6 +46,7 @@ const ( ArcSettingAggregateStateNotSpecified ArcSettingAggregateState = "NotSpecified" ArcSettingAggregateStatePartiallyConnected ArcSettingAggregateState = "PartiallyConnected" ArcSettingAggregateStatePartiallySucceeded ArcSettingAggregateState = "PartiallySucceeded" + ArcSettingAggregateStateProvisioning ArcSettingAggregateState = "Provisioning" ArcSettingAggregateStateSucceeded ArcSettingAggregateState = "Succeeded" ArcSettingAggregateStateUpdating ArcSettingAggregateState = "Updating" ) @@ -52,11 +54,13 @@ const ( // PossibleArcSettingAggregateStateValues returns the possible values for the ArcSettingAggregateState const type. func PossibleArcSettingAggregateStateValues() []ArcSettingAggregateState { return []ArcSettingAggregateState{ + ArcSettingAggregateStateAccepted, ArcSettingAggregateStateCanceled, ArcSettingAggregateStateConnected, ArcSettingAggregateStateCreating, ArcSettingAggregateStateDeleted, ArcSettingAggregateStateDeleting, + ArcSettingAggregateStateDisableInProgress, ArcSettingAggregateStateDisconnected, ArcSettingAggregateStateError, ArcSettingAggregateStateFailed, @@ -65,11 +69,46 @@ func PossibleArcSettingAggregateStateValues() []ArcSettingAggregateState { ArcSettingAggregateStateNotSpecified, ArcSettingAggregateStatePartiallyConnected, ArcSettingAggregateStatePartiallySucceeded, + ArcSettingAggregateStateProvisioning, ArcSettingAggregateStateSucceeded, ArcSettingAggregateStateUpdating, } } +// AvailabilityType - Indicates the way the update content can be downloaded. +type AvailabilityType string + +const ( + AvailabilityTypeLocal AvailabilityType = "Local" + AvailabilityTypeNotify AvailabilityType = "Notify" + AvailabilityTypeOnline AvailabilityType = "Online" +) + +// PossibleAvailabilityTypeValues returns the possible values for the AvailabilityType const type. +func PossibleAvailabilityTypeValues() []AvailabilityType { + return []AvailabilityType{ + AvailabilityTypeLocal, + AvailabilityTypeNotify, + AvailabilityTypeOnline, + } +} + +// ClusterNodeType - The node type of all the nodes of the cluster. +type ClusterNodeType string + +const ( + ClusterNodeTypeFirstParty ClusterNodeType = "FirstParty" + ClusterNodeTypeThirdParty ClusterNodeType = "ThirdParty" +) + +// PossibleClusterNodeTypeValues returns the possible values for the ClusterNodeType const type. +func PossibleClusterNodeTypeValues() []ClusterNodeType { + return []ClusterNodeType{ + ClusterNodeTypeFirstParty, + ClusterNodeTypeThirdParty, + } +} + // CreatedByType - The type of identity that created the resource. type CreatedByType string @@ -112,26 +151,30 @@ func PossibleDiagnosticLevelValues() []DiagnosticLevel { type ExtensionAggregateState string const ( - ExtensionAggregateStateCanceled ExtensionAggregateState = "Canceled" - ExtensionAggregateStateConnected ExtensionAggregateState = "Connected" - ExtensionAggregateStateCreating ExtensionAggregateState = "Creating" - ExtensionAggregateStateDeleted ExtensionAggregateState = "Deleted" - ExtensionAggregateStateDeleting ExtensionAggregateState = "Deleting" - ExtensionAggregateStateDisconnected ExtensionAggregateState = "Disconnected" - ExtensionAggregateStateError ExtensionAggregateState = "Error" - ExtensionAggregateStateFailed ExtensionAggregateState = "Failed" - ExtensionAggregateStateInProgress ExtensionAggregateState = "InProgress" - ExtensionAggregateStateMoving ExtensionAggregateState = "Moving" - ExtensionAggregateStateNotSpecified ExtensionAggregateState = "NotSpecified" - ExtensionAggregateStatePartiallyConnected ExtensionAggregateState = "PartiallyConnected" - ExtensionAggregateStatePartiallySucceeded ExtensionAggregateState = "PartiallySucceeded" - ExtensionAggregateStateSucceeded ExtensionAggregateState = "Succeeded" - ExtensionAggregateStateUpdating ExtensionAggregateState = "Updating" + ExtensionAggregateStateAccepted ExtensionAggregateState = "Accepted" + ExtensionAggregateStateCanceled ExtensionAggregateState = "Canceled" + ExtensionAggregateStateConnected ExtensionAggregateState = "Connected" + ExtensionAggregateStateCreating ExtensionAggregateState = "Creating" + ExtensionAggregateStateDeleted ExtensionAggregateState = "Deleted" + ExtensionAggregateStateDeleting ExtensionAggregateState = "Deleting" + ExtensionAggregateStateDisconnected ExtensionAggregateState = "Disconnected" + ExtensionAggregateStateError ExtensionAggregateState = "Error" + ExtensionAggregateStateFailed ExtensionAggregateState = "Failed" + ExtensionAggregateStateInProgress ExtensionAggregateState = "InProgress" + ExtensionAggregateStateMoving ExtensionAggregateState = "Moving" + ExtensionAggregateStateNotSpecified ExtensionAggregateState = "NotSpecified" + ExtensionAggregateStatePartiallyConnected ExtensionAggregateState = "PartiallyConnected" + ExtensionAggregateStatePartiallySucceeded ExtensionAggregateState = "PartiallySucceeded" + ExtensionAggregateStateProvisioning ExtensionAggregateState = "Provisioning" + ExtensionAggregateStateSucceeded ExtensionAggregateState = "Succeeded" + ExtensionAggregateStateUpdating ExtensionAggregateState = "Updating" + ExtensionAggregateStateUpgradeFailedRollbackSucceeded ExtensionAggregateState = "UpgradeFailedRollbackSucceeded" ) // PossibleExtensionAggregateStateValues returns the possible values for the ExtensionAggregateState const type. func PossibleExtensionAggregateStateValues() []ExtensionAggregateState { return []ExtensionAggregateState{ + ExtensionAggregateStateAccepted, ExtensionAggregateStateCanceled, ExtensionAggregateStateConnected, ExtensionAggregateStateCreating, @@ -145,8 +188,49 @@ func PossibleExtensionAggregateStateValues() []ExtensionAggregateState { ExtensionAggregateStateNotSpecified, ExtensionAggregateStatePartiallyConnected, ExtensionAggregateStatePartiallySucceeded, + ExtensionAggregateStateProvisioning, ExtensionAggregateStateSucceeded, ExtensionAggregateStateUpdating, + ExtensionAggregateStateUpgradeFailedRollbackSucceeded, + } +} + +// ExtensionManagedBy - Indicates if the extension is managed by azure or the user. +type ExtensionManagedBy string + +const ( + ExtensionManagedByAzure ExtensionManagedBy = "Azure" + ExtensionManagedByUser ExtensionManagedBy = "User" +) + +// PossibleExtensionManagedByValues returns the possible values for the ExtensionManagedBy const type. +func PossibleExtensionManagedByValues() []ExtensionManagedBy { + return []ExtensionManagedBy{ + ExtensionManagedByAzure, + ExtensionManagedByUser, + } +} + +type HealthState string + +const ( + HealthStateError HealthState = "Error" + HealthStateFailure HealthState = "Failure" + HealthStateInProgress HealthState = "InProgress" + HealthStateSuccess HealthState = "Success" + HealthStateUnknown HealthState = "Unknown" + HealthStateWarning HealthState = "Warning" +) + +// PossibleHealthStateValues returns the possible values for the HealthState const type. +func PossibleHealthStateValues() []HealthState { + return []HealthState{ + HealthStateError, + HealthStateFailure, + HealthStateInProgress, + HealthStateSuccess, + HealthStateUnknown, + HealthStateWarning, } } @@ -166,37 +250,69 @@ func PossibleImdsAttestationValues() []ImdsAttestation { } } +// ManagedServiceIdentityType - Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). +type ManagedServiceIdentityType string + +const ( + ManagedServiceIdentityTypeNone ManagedServiceIdentityType = "None" + ManagedServiceIdentityTypeSystemAssigned ManagedServiceIdentityType = "SystemAssigned" + ManagedServiceIdentityTypeSystemAssignedUserAssigned ManagedServiceIdentityType = "SystemAssigned, UserAssigned" + ManagedServiceIdentityTypeUserAssigned ManagedServiceIdentityType = "UserAssigned" +) + +// PossibleManagedServiceIdentityTypeValues returns the possible values for the ManagedServiceIdentityType const type. +func PossibleManagedServiceIdentityTypeValues() []ManagedServiceIdentityType { + return []ManagedServiceIdentityType{ + ManagedServiceIdentityTypeNone, + ManagedServiceIdentityTypeSystemAssigned, + ManagedServiceIdentityTypeSystemAssignedUserAssigned, + ManagedServiceIdentityTypeUserAssigned, + } +} + // NodeArcState - State of Arc agent in this node. type NodeArcState string const ( - NodeArcStateCanceled NodeArcState = "Canceled" - NodeArcStateConnected NodeArcState = "Connected" - NodeArcStateCreating NodeArcState = "Creating" - NodeArcStateDeleted NodeArcState = "Deleted" - NodeArcStateDeleting NodeArcState = "Deleting" - NodeArcStateDisconnected NodeArcState = "Disconnected" - NodeArcStateError NodeArcState = "Error" - NodeArcStateFailed NodeArcState = "Failed" - NodeArcStateMoving NodeArcState = "Moving" - NodeArcStateNotSpecified NodeArcState = "NotSpecified" - NodeArcStateSucceeded NodeArcState = "Succeeded" - NodeArcStateUpdating NodeArcState = "Updating" + NodeArcStateAccepted NodeArcState = "Accepted" + NodeArcStateCanceled NodeArcState = "Canceled" + NodeArcStateConnected NodeArcState = "Connected" + NodeArcStateCreating NodeArcState = "Creating" + NodeArcStateDeleted NodeArcState = "Deleted" + NodeArcStateDeleting NodeArcState = "Deleting" + NodeArcStateDisableInProgress NodeArcState = "DisableInProgress" + NodeArcStateDisconnected NodeArcState = "Disconnected" + NodeArcStateError NodeArcState = "Error" + NodeArcStateFailed NodeArcState = "Failed" + NodeArcStateInProgress NodeArcState = "InProgress" + NodeArcStateMoving NodeArcState = "Moving" + NodeArcStateNotSpecified NodeArcState = "NotSpecified" + NodeArcStatePartiallyConnected NodeArcState = "PartiallyConnected" + NodeArcStatePartiallySucceeded NodeArcState = "PartiallySucceeded" + NodeArcStateProvisioning NodeArcState = "Provisioning" + NodeArcStateSucceeded NodeArcState = "Succeeded" + NodeArcStateUpdating NodeArcState = "Updating" ) // PossibleNodeArcStateValues returns the possible values for the NodeArcState const type. func PossibleNodeArcStateValues() []NodeArcState { return []NodeArcState{ + NodeArcStateAccepted, NodeArcStateCanceled, NodeArcStateConnected, NodeArcStateCreating, NodeArcStateDeleted, NodeArcStateDeleting, + NodeArcStateDisableInProgress, NodeArcStateDisconnected, NodeArcStateError, NodeArcStateFailed, + NodeArcStateInProgress, NodeArcStateMoving, NodeArcStateNotSpecified, + NodeArcStatePartiallyConnected, + NodeArcStatePartiallySucceeded, + NodeArcStateProvisioning, NodeArcStateSucceeded, NodeArcStateUpdating, } @@ -206,23 +322,29 @@ func PossibleNodeArcStateValues() []NodeArcState { type NodeExtensionState string const ( - NodeExtensionStateCanceled NodeExtensionState = "Canceled" - NodeExtensionStateConnected NodeExtensionState = "Connected" - NodeExtensionStateCreating NodeExtensionState = "Creating" - NodeExtensionStateDeleted NodeExtensionState = "Deleted" - NodeExtensionStateDeleting NodeExtensionState = "Deleting" - NodeExtensionStateDisconnected NodeExtensionState = "Disconnected" - NodeExtensionStateError NodeExtensionState = "Error" - NodeExtensionStateFailed NodeExtensionState = "Failed" - NodeExtensionStateMoving NodeExtensionState = "Moving" - NodeExtensionStateNotSpecified NodeExtensionState = "NotSpecified" - NodeExtensionStateSucceeded NodeExtensionState = "Succeeded" - NodeExtensionStateUpdating NodeExtensionState = "Updating" + NodeExtensionStateAccepted NodeExtensionState = "Accepted" + NodeExtensionStateCanceled NodeExtensionState = "Canceled" + NodeExtensionStateConnected NodeExtensionState = "Connected" + NodeExtensionStateCreating NodeExtensionState = "Creating" + NodeExtensionStateDeleted NodeExtensionState = "Deleted" + NodeExtensionStateDeleting NodeExtensionState = "Deleting" + NodeExtensionStateDisconnected NodeExtensionState = "Disconnected" + NodeExtensionStateError NodeExtensionState = "Error" + NodeExtensionStateFailed NodeExtensionState = "Failed" + NodeExtensionStateInProgress NodeExtensionState = "InProgress" + NodeExtensionStateMoving NodeExtensionState = "Moving" + NodeExtensionStateNotSpecified NodeExtensionState = "NotSpecified" + NodeExtensionStatePartiallyConnected NodeExtensionState = "PartiallyConnected" + NodeExtensionStatePartiallySucceeded NodeExtensionState = "PartiallySucceeded" + NodeExtensionStateProvisioning NodeExtensionState = "Provisioning" + NodeExtensionStateSucceeded NodeExtensionState = "Succeeded" + NodeExtensionStateUpdating NodeExtensionState = "Updating" ) // PossibleNodeExtensionStateValues returns the possible values for the NodeExtensionState const type. func PossibleNodeExtensionStateValues() []NodeExtensionState { return []NodeExtensionState{ + NodeExtensionStateAccepted, NodeExtensionStateCanceled, NodeExtensionStateConnected, NodeExtensionStateCreating, @@ -231,13 +353,33 @@ func PossibleNodeExtensionStateValues() []NodeExtensionState { NodeExtensionStateDisconnected, NodeExtensionStateError, NodeExtensionStateFailed, + NodeExtensionStateInProgress, NodeExtensionStateMoving, NodeExtensionStateNotSpecified, + NodeExtensionStatePartiallyConnected, + NodeExtensionStatePartiallySucceeded, + NodeExtensionStateProvisioning, NodeExtensionStateSucceeded, NodeExtensionStateUpdating, } } +// OemActivation - OEM activation status of the cluster. +type OemActivation string + +const ( + OemActivationDisabled OemActivation = "Disabled" + OemActivationEnabled OemActivation = "Enabled" +) + +// PossibleOemActivationValues returns the possible values for the OemActivation const type. +func PossibleOemActivationValues() []OemActivation { + return []OemActivation{ + OemActivationDisabled, + OemActivationEnabled, + } +} + // Origin - The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default // value is "user,system" type Origin string @@ -261,11 +403,24 @@ func PossibleOriginValues() []Origin { type ProvisioningState string const ( - ProvisioningStateAccepted ProvisioningState = "Accepted" - ProvisioningStateCanceled ProvisioningState = "Canceled" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateProvisioning ProvisioningState = "Provisioning" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateAccepted ProvisioningState = "Accepted" + ProvisioningStateCanceled ProvisioningState = "Canceled" + ProvisioningStateConnected ProvisioningState = "Connected" + ProvisioningStateCreating ProvisioningState = "Creating" + ProvisioningStateDeleted ProvisioningState = "Deleted" + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateDisableInProgress ProvisioningState = "DisableInProgress" + ProvisioningStateDisconnected ProvisioningState = "Disconnected" + ProvisioningStateError ProvisioningState = "Error" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateInProgress ProvisioningState = "InProgress" + ProvisioningStateMoving ProvisioningState = "Moving" + ProvisioningStateNotSpecified ProvisioningState = "NotSpecified" + ProvisioningStatePartiallyConnected ProvisioningState = "PartiallyConnected" + ProvisioningStatePartiallySucceeded ProvisioningState = "PartiallySucceeded" + ProvisioningStateProvisioning ProvisioningState = "Provisioning" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" ) // PossibleProvisioningStateValues returns the possible values for the ProvisioningState const type. @@ -273,9 +428,154 @@ func PossibleProvisioningStateValues() []ProvisioningState { return []ProvisioningState{ ProvisioningStateAccepted, ProvisioningStateCanceled, + ProvisioningStateConnected, + ProvisioningStateCreating, + ProvisioningStateDeleted, + ProvisioningStateDeleting, + ProvisioningStateDisableInProgress, + ProvisioningStateDisconnected, + ProvisioningStateError, ProvisioningStateFailed, + ProvisioningStateInProgress, + ProvisioningStateMoving, + ProvisioningStateNotSpecified, + ProvisioningStatePartiallyConnected, + ProvisioningStatePartiallySucceeded, ProvisioningStateProvisioning, ProvisioningStateSucceeded, + ProvisioningStateUpdating, + } +} + +type RebootRequirement string + +const ( + RebootRequirementFalse RebootRequirement = "False" + RebootRequirementTrue RebootRequirement = "True" + RebootRequirementUnknown RebootRequirement = "Unknown" +) + +// PossibleRebootRequirementValues returns the possible values for the RebootRequirement const type. +func PossibleRebootRequirementValues() []RebootRequirement { + return []RebootRequirement{ + RebootRequirementFalse, + RebootRequirementTrue, + RebootRequirementUnknown, + } +} + +// ServiceName - Name of the service. +type ServiceName string + +const ( + ServiceNameWAC ServiceName = "WAC" +) + +// PossibleServiceNameValues returns the possible values for the ServiceName const type. +func PossibleServiceNameValues() []ServiceName { + return []ServiceName{ + ServiceNameWAC, + } +} + +// Severity - Severity of the result (Critical, Warning, Informational, Hidden). This answers how important the result is. +// Critical is the only update-blocking severity. +type Severity string + +const ( + SeverityCritical Severity = "Critical" + SeverityHidden Severity = "Hidden" + SeverityInformational Severity = "Informational" + SeverityWarning Severity = "Warning" +) + +// PossibleSeverityValues returns the possible values for the Severity const type. +func PossibleSeverityValues() []Severity { + return []Severity{ + SeverityCritical, + SeverityHidden, + SeverityInformational, + SeverityWarning, + } +} + +// SoftwareAssuranceIntent - Customer Intent for Software Assurance Benefit. +type SoftwareAssuranceIntent string + +const ( + SoftwareAssuranceIntentDisable SoftwareAssuranceIntent = "Disable" + SoftwareAssuranceIntentEnable SoftwareAssuranceIntent = "Enable" +) + +// PossibleSoftwareAssuranceIntentValues returns the possible values for the SoftwareAssuranceIntent const type. +func PossibleSoftwareAssuranceIntentValues() []SoftwareAssuranceIntent { + return []SoftwareAssuranceIntent{ + SoftwareAssuranceIntentDisable, + SoftwareAssuranceIntentEnable, + } +} + +// SoftwareAssuranceStatus - Status of the Software Assurance for the cluster. +type SoftwareAssuranceStatus string + +const ( + SoftwareAssuranceStatusDisabled SoftwareAssuranceStatus = "Disabled" + SoftwareAssuranceStatusEnabled SoftwareAssuranceStatus = "Enabled" +) + +// PossibleSoftwareAssuranceStatusValues returns the possible values for the SoftwareAssuranceStatus const type. +func PossibleSoftwareAssuranceStatusValues() []SoftwareAssuranceStatus { + return []SoftwareAssuranceStatus{ + SoftwareAssuranceStatusDisabled, + SoftwareAssuranceStatusEnabled, + } +} + +// State - State of the update as it relates to this stamp. +type State string + +const ( + StateDownloadFailed State = "DownloadFailed" + StateDownloading State = "Downloading" + StateHasPrerequisite State = "HasPrerequisite" + StateHealthCheckFailed State = "HealthCheckFailed" + StateHealthChecking State = "HealthChecking" + StateInstallationFailed State = "InstallationFailed" + StateInstalled State = "Installed" + StateInstalling State = "Installing" + StateInvalid State = "Invalid" + StateNotApplicableBecauseAnotherUpdateIsInProgress State = "NotApplicableBecauseAnotherUpdateIsInProgress" + StateObsolete State = "Obsolete" + StatePreparationFailed State = "PreparationFailed" + StatePreparing State = "Preparing" + StateReady State = "Ready" + StateReadyToInstall State = "ReadyToInstall" + StateRecalled State = "Recalled" + StateScanFailed State = "ScanFailed" + StateScanInProgress State = "ScanInProgress" +) + +// PossibleStateValues returns the possible values for the State const type. +func PossibleStateValues() []State { + return []State{ + StateDownloadFailed, + StateDownloading, + StateHasPrerequisite, + StateHealthCheckFailed, + StateHealthChecking, + StateInstallationFailed, + StateInstalled, + StateInstalling, + StateInvalid, + StateNotApplicableBecauseAnotherUpdateIsInProgress, + StateObsolete, + StatePreparationFailed, + StatePreparing, + StateReady, + StateReadyToInstall, + StateRecalled, + StateScanFailed, + StateScanInProgress, } } @@ -286,8 +586,12 @@ const ( StatusConnectedRecently Status = "ConnectedRecently" StatusDisconnected Status = "Disconnected" StatusError Status = "Error" + StatusFailed Status = "Failed" + StatusInProgress Status = "InProgress" StatusNotConnectedRecently Status = "NotConnectedRecently" + StatusNotSpecified Status = "NotSpecified" StatusNotYetRegistered Status = "NotYetRegistered" + StatusSucceeded Status = "Succeeded" ) // PossibleStatusValues returns the possible values for the Status const type. @@ -296,8 +600,78 @@ func PossibleStatusValues() []Status { StatusConnectedRecently, StatusDisconnected, StatusError, + StatusFailed, + StatusInProgress, StatusNotConnectedRecently, + StatusNotSpecified, StatusNotYetRegistered, + StatusSucceeded, + } +} + +// StatusLevelTypes - The level code. +type StatusLevelTypes string + +const ( + StatusLevelTypesError StatusLevelTypes = "Error" + StatusLevelTypesInfo StatusLevelTypes = "Info" + StatusLevelTypesWarning StatusLevelTypes = "Warning" +) + +// PossibleStatusLevelTypesValues returns the possible values for the StatusLevelTypes const type. +func PossibleStatusLevelTypesValues() []StatusLevelTypes { + return []StatusLevelTypes{ + StatusLevelTypesError, + StatusLevelTypesInfo, + StatusLevelTypesWarning, + } +} + +// UpdateRunPropertiesState - State of the update run. +type UpdateRunPropertiesState string + +const ( + UpdateRunPropertiesStateFailed UpdateRunPropertiesState = "Failed" + UpdateRunPropertiesStateInProgress UpdateRunPropertiesState = "InProgress" + UpdateRunPropertiesStateSucceeded UpdateRunPropertiesState = "Succeeded" + UpdateRunPropertiesStateUnknown UpdateRunPropertiesState = "Unknown" +) + +// PossibleUpdateRunPropertiesStateValues returns the possible values for the UpdateRunPropertiesState const type. +func PossibleUpdateRunPropertiesStateValues() []UpdateRunPropertiesState { + return []UpdateRunPropertiesState{ + UpdateRunPropertiesStateFailed, + UpdateRunPropertiesStateInProgress, + UpdateRunPropertiesStateSucceeded, + UpdateRunPropertiesStateUnknown, + } +} + +// UpdateSummariesPropertiesState - Overall update state of the stamp. +type UpdateSummariesPropertiesState string + +const ( + UpdateSummariesPropertiesStateAppliedSuccessfully UpdateSummariesPropertiesState = "AppliedSuccessfully" + UpdateSummariesPropertiesStateNeedsAttention UpdateSummariesPropertiesState = "NeedsAttention" + UpdateSummariesPropertiesStatePreparationFailed UpdateSummariesPropertiesState = "PreparationFailed" + UpdateSummariesPropertiesStatePreparationInProgress UpdateSummariesPropertiesState = "PreparationInProgress" + UpdateSummariesPropertiesStateUnknown UpdateSummariesPropertiesState = "Unknown" + UpdateSummariesPropertiesStateUpdateAvailable UpdateSummariesPropertiesState = "UpdateAvailable" + UpdateSummariesPropertiesStateUpdateFailed UpdateSummariesPropertiesState = "UpdateFailed" + UpdateSummariesPropertiesStateUpdateInProgress UpdateSummariesPropertiesState = "UpdateInProgress" +) + +// PossibleUpdateSummariesPropertiesStateValues returns the possible values for the UpdateSummariesPropertiesState const type. +func PossibleUpdateSummariesPropertiesStateValues() []UpdateSummariesPropertiesState { + return []UpdateSummariesPropertiesState{ + UpdateSummariesPropertiesStateAppliedSuccessfully, + UpdateSummariesPropertiesStateNeedsAttention, + UpdateSummariesPropertiesStatePreparationFailed, + UpdateSummariesPropertiesStatePreparationInProgress, + UpdateSummariesPropertiesStateUnknown, + UpdateSummariesPropertiesStateUpdateAvailable, + UpdateSummariesPropertiesStateUpdateFailed, + UpdateSummariesPropertiesStateUpdateInProgress, } } diff --git a/sdk/resourcemanager/azurestackhci/armazurestackhci/extensions_client.go b/sdk/resourcemanager/azurestackhci/armazurestackhci/extensions_client.go index 169d0214fe33..61077c84e77e 100644 --- a/sdk/resourcemanager/azurestackhci/armazurestackhci/extensions_client.go +++ b/sdk/resourcemanager/azurestackhci/armazurestackhci/extensions_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armazurestackhci @@ -47,7 +46,7 @@ func NewExtensionsClient(subscriptionID string, credential azcore.TokenCredentia // BeginCreate - Create Extension for HCI cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01 +// Generated from API version 2023-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - arcSettingName - The name of the proxy resource holding details of HCI ArcSetting information. @@ -60,9 +59,10 @@ func (client *ExtensionsClient) BeginCreate(ctx context.Context, resourceGroupNa if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExtensionsClientCreateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExtensionsClientCreateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[ExtensionsClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -71,20 +71,22 @@ func (client *ExtensionsClient) BeginCreate(ctx context.Context, resourceGroupNa // Create - Create Extension for HCI cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01 +// Generated from API version 2023-06-01 func (client *ExtensionsClient) create(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string, extensionName string, extension Extension, options *ExtensionsClientBeginCreateOptions) (*http.Response, error) { + var err error req, err := client.createCreateRequest(ctx, resourceGroupName, clusterName, arcSettingName, extensionName, extension, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createCreateRequest creates the Create request. @@ -115,16 +117,19 @@ func (client *ExtensionsClient) createCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, extension) + if err := runtime.MarshalAsJSON(req, extension); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Delete particular Arc Extension of HCI Cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01 +// Generated from API version 2023-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - arcSettingName - The name of the proxy resource holding details of HCI ArcSetting information. @@ -136,9 +141,10 @@ func (client *ExtensionsClient) BeginDelete(ctx context.Context, resourceGroupNa if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExtensionsClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExtensionsClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[ExtensionsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -147,20 +153,22 @@ func (client *ExtensionsClient) BeginDelete(ctx context.Context, resourceGroupNa // Delete - Delete particular Arc Extension of HCI Cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01 +// Generated from API version 2023-06-01 func (client *ExtensionsClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string, extensionName string, options *ExtensionsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, clusterName, arcSettingName, extensionName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -191,7 +199,7 @@ func (client *ExtensionsClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -200,25 +208,28 @@ func (client *ExtensionsClient) deleteCreateRequest(ctx context.Context, resourc // Get - Get particular Arc Extension of HCI Cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01 +// Generated from API version 2023-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - arcSettingName - The name of the proxy resource holding details of HCI ArcSetting information. // - extensionName - The name of the machine extension. // - options - ExtensionsClientGetOptions contains the optional parameters for the ExtensionsClient.Get method. func (client *ExtensionsClient) Get(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string, extensionName string, options *ExtensionsClientGetOptions) (ExtensionsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, clusterName, arcSettingName, extensionName, options) if err != nil { return ExtensionsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ExtensionsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ExtensionsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ExtensionsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -249,7 +260,7 @@ func (client *ExtensionsClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -266,7 +277,7 @@ func (client *ExtensionsClient) getHandleResponse(resp *http.Response) (Extensio // NewListByArcSettingPager - List all Extensions under ArcSetting resource. // -// Generated from API version 2022-05-01 +// Generated from API version 2023-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - arcSettingName - The name of the proxy resource holding details of HCI ArcSetting information. @@ -324,7 +335,7 @@ func (client *ExtensionsClient) listByArcSettingCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -342,7 +353,7 @@ func (client *ExtensionsClient) listByArcSettingHandleResponse(resp *http.Respon // BeginUpdate - Update Extension for HCI cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01 +// Generated from API version 2023-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - arcSettingName - The name of the proxy resource holding details of HCI ArcSetting information. @@ -355,9 +366,10 @@ func (client *ExtensionsClient) BeginUpdate(ctx context.Context, resourceGroupNa if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExtensionsClientUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExtensionsClientUpdateResponse]{ FinalStateVia: runtime.FinalStateViaOriginalURI, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[ExtensionsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -366,20 +378,22 @@ func (client *ExtensionsClient) BeginUpdate(ctx context.Context, resourceGroupNa // Update - Update Extension for HCI cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01 +// Generated from API version 2023-06-01 func (client *ExtensionsClient) update(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string, extensionName string, extension Extension, options *ExtensionsClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, clusterName, arcSettingName, extensionName, extension, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -410,8 +424,94 @@ func (client *ExtensionsClient) updateCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, extension) + if err := runtime.MarshalAsJSON(req, extension); err != nil { + return nil, err + } + return req, nil +} + +// BeginUpgrade - Upgrade a particular Arc Extension of HCI Cluster. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - clusterName - The name of the cluster. +// - arcSettingName - The name of the proxy resource holding details of HCI ArcSetting information. +// - extensionName - The name of the machine extension. +// - extensionUpgradeParameters - Parameters supplied to the Upgrade Extensions operation. +// - options - ExtensionsClientBeginUpgradeOptions contains the optional parameters for the ExtensionsClient.BeginUpgrade method. +func (client *ExtensionsClient) BeginUpgrade(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string, extensionName string, extensionUpgradeParameters ExtensionUpgradeParameters, options *ExtensionsClientBeginUpgradeOptions) (*runtime.Poller[ExtensionsClientUpgradeResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.upgrade(ctx, resourceGroupName, clusterName, arcSettingName, extensionName, extensionUpgradeParameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExtensionsClientUpgradeResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[ExtensionsClientUpgradeResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Upgrade - Upgrade a particular Arc Extension of HCI Cluster. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01 +func (client *ExtensionsClient) upgrade(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string, extensionName string, extensionUpgradeParameters ExtensionUpgradeParameters, options *ExtensionsClientBeginUpgradeOptions) (*http.Response, error) { + var err error + req, err := client.upgradeCreateRequest(ctx, resourceGroupName, clusterName, arcSettingName, extensionName, extensionUpgradeParameters, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// upgradeCreateRequest creates the Upgrade request. +func (client *ExtensionsClient) upgradeCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string, extensionName string, extensionUpgradeParameters ExtensionUpgradeParameters, options *ExtensionsClientBeginUpgradeOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}/upgrade" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if clusterName == "" { + return nil, errors.New("parameter clusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) + if arcSettingName == "" { + return nil, errors.New("parameter arcSettingName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{arcSettingName}", url.PathEscape(arcSettingName)) + if extensionName == "" { + return nil, errors.New("parameter extensionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{extensionName}", url.PathEscape(extensionName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, extensionUpgradeParameters); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/azurestackhci/armazurestackhci/extensions_client_example_test.go b/sdk/resourcemanager/azurestackhci/armazurestackhci/extensions_client_example_test.go deleted file mode 100644 index d377e41b8e94..000000000000 --- a/sdk/resourcemanager/azurestackhci/armazurestackhci/extensions_client_example_test.go +++ /dev/null @@ -1,346 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armazurestackhci_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/azurestackhci/armazurestackhci" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/ListExtensionsByArcSetting.json -func ExampleExtensionsClient_NewListByArcSettingPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewExtensionsClient().NewListByArcSettingPager("test-rg", "myCluster", "default", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ExtensionList = armazurestackhci.ExtensionList{ - // Value: []*armazurestackhci.Extension{ - // { - // Name: to.Ptr("MicrosoftMonitoringAgent"), - // Type: to.Ptr("Microsoft.AzureStackHCI/clusters/arcSettings/extensions"), - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/test-rg/providers/Microsoft.AzureStackHCI/clusters/myCluster/arcSettings/default/extensions/MicrosoftMonitoringAgent"), - // Properties: &armazurestackhci.ExtensionProperties{ - // AggregateState: to.Ptr(armazurestackhci.ExtensionAggregateStatePartiallyConnected), - // ExtensionParameters: &armazurestackhci.ExtensionParameters{ - // Type: to.Ptr("string"), - // AutoUpgradeMinorVersion: to.Ptr(false), - // Publisher: to.Ptr("Microsoft.Compute"), - // Settings: map[string]any{ - // "workspaceId": "xx", - // }, - // TypeHandlerVersion: to.Ptr("1.10.3"), - // }, - // PerNodeExtensionDetails: []*armazurestackhci.PerNodeExtensionState{ - // { - // Name: to.Ptr("Node-1"), - // Extension: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-1/Extensions/MicrosoftMonitoringAgent"), - // State: to.Ptr(armazurestackhci.NodeExtensionStateConnected), - // }, - // { - // Name: to.Ptr("Node-2"), - // Extension: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-2/Extensions/MicrosoftMonitoringAgent"), - // State: to.Ptr(armazurestackhci.NodeExtensionStateDisconnected), - // }}, - // ProvisioningState: to.Ptr(armazurestackhci.ProvisioningStateSucceeded), - // }, - // SystemData: &armazurestackhci.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-01T17:18:19.1234567Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armazurestackhci.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-02T17:18:19.1234567Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armazurestackhci.CreatedByTypeUser), - // }, - // }, - // { - // Name: to.Ptr("CustomScriptExtension"), - // Type: to.Ptr("Microsoft.AzureStackHCI/clusters/arcSettings/extensions"), - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/test-rg/providers/Microsoft.AzureStackHCI/clusters/myCluster/arcSettings/default/Extensions/SecurityExtension"), - // Properties: &armazurestackhci.ExtensionProperties{ - // AggregateState: to.Ptr(armazurestackhci.ExtensionAggregateStatePartiallySucceeded), - // ExtensionParameters: &armazurestackhci.ExtensionParameters{ - // Type: to.Ptr("string"), - // AutoUpgradeMinorVersion: to.Ptr(false), - // Publisher: to.Ptr("Microsoft.CustomScriptExtension"), - // Settings: map[string]any{ - // "scriptLocation": "xx", - // }, - // TypeHandlerVersion: to.Ptr("1.10.3"), - // }, - // PerNodeExtensionDetails: []*armazurestackhci.PerNodeExtensionState{ - // { - // Name: to.Ptr("Node-1"), - // Extension: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-1/Extensions/SecurityExtension"), - // State: to.Ptr(armazurestackhci.NodeExtensionStateSucceeded), - // }, - // { - // Name: to.Ptr("Node-2"), - // Extension: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-2/Extensions/SecurityExtension"), - // State: to.Ptr(armazurestackhci.NodeExtensionStateFailed), - // }}, - // ProvisioningState: to.Ptr(armazurestackhci.ProvisioningStateSucceeded), - // }, - // SystemData: &armazurestackhci.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-01T17:18:19.1234567Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armazurestackhci.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-02T17:18:19.1234567Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armazurestackhci.CreatedByTypeUser), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/GetExtension.json -func ExampleExtensionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewExtensionsClient().Get(ctx, "test-rg", "myCluster", "default", "MicrosoftMonitoringAgent", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Extension = armazurestackhci.Extension{ - // Name: to.Ptr("MicrosoftMonitoringAgent"), - // Type: to.Ptr("Microsoft.AzureStackHCI/clusters/arcSettings/extensions"), - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/test-rg/providers/Microsoft.AzureStackHCI/clusters/myCluster/arcSettings/default/extensions/MicrosoftMonitoringAgent"), - // Properties: &armazurestackhci.ExtensionProperties{ - // AggregateState: to.Ptr(armazurestackhci.ExtensionAggregateStatePartiallySucceeded), - // ExtensionParameters: &armazurestackhci.ExtensionParameters{ - // Type: to.Ptr("string"), - // AutoUpgradeMinorVersion: to.Ptr(false), - // Publisher: to.Ptr("Microsoft.Compute"), - // Settings: map[string]any{ - // "workspaceId": "xx", - // }, - // TypeHandlerVersion: to.Ptr("1.10.3"), - // }, - // PerNodeExtensionDetails: []*armazurestackhci.PerNodeExtensionState{ - // { - // Name: to.Ptr("Node-1"), - // Extension: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-1/Extensions/MicrosoftMonitoringAgent"), - // State: to.Ptr(armazurestackhci.NodeExtensionStateSucceeded), - // }, - // { - // Name: to.Ptr("Node-2"), - // Extension: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-2/Extensions/MicrosoftMonitoringAgent"), - // State: to.Ptr(armazurestackhci.NodeExtensionStateFailed), - // }}, - // ProvisioningState: to.Ptr(armazurestackhci.ProvisioningStateSucceeded), - // }, - // SystemData: &armazurestackhci.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-01T17:18:19.1234567Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armazurestackhci.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-02T17:18:19.1234567Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armazurestackhci.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/PutExtension.json -func ExampleExtensionsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewExtensionsClient().BeginCreate(ctx, "test-rg", "myCluster", "default", "MicrosoftMonitoringAgent", armazurestackhci.Extension{ - Properties: &armazurestackhci.ExtensionProperties{ - ExtensionParameters: &armazurestackhci.ExtensionParameters{ - Type: to.Ptr("MicrosoftMonitoringAgent"), - ProtectedSettings: map[string]any{ - "workspaceKey": "xx", - }, - Publisher: to.Ptr("Microsoft.Compute"), - Settings: map[string]any{ - "workspaceId": "xx", - }, - TypeHandlerVersion: to.Ptr("1.10"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Extension = armazurestackhci.Extension{ - // Name: to.Ptr("MicrosoftMonitoringAgent"), - // Type: to.Ptr("Microsoft.AzureStackHCI/clusters/arcSettings/extensions"), - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/test-rg/providers/Microsoft.AzureStackHCI/clusters/myCluster/arcSettings/default/extensions/MicrosoftMonitoringAgent"), - // Properties: &armazurestackhci.ExtensionProperties{ - // AggregateState: to.Ptr(armazurestackhci.ExtensionAggregateStatePartiallySucceeded), - // ExtensionParameters: &armazurestackhci.ExtensionParameters{ - // Type: to.Ptr("string"), - // AutoUpgradeMinorVersion: to.Ptr(false), - // Publisher: to.Ptr("Microsoft.Compute"), - // Settings: map[string]any{ - // "workspaceId": "xx", - // }, - // TypeHandlerVersion: to.Ptr("1.10.3"), - // }, - // PerNodeExtensionDetails: []*armazurestackhci.PerNodeExtensionState{ - // { - // Name: to.Ptr("Node-1"), - // Extension: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-1/Extensions/MicrosoftMonitoringAgent"), - // State: to.Ptr(armazurestackhci.NodeExtensionStateSucceeded), - // }, - // { - // Name: to.Ptr("Node-2"), - // Extension: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-2/Extensions/MicrosoftMonitoringAgent"), - // State: to.Ptr(armazurestackhci.NodeExtensionStateFailed), - // }}, - // ProvisioningState: to.Ptr(armazurestackhci.ProvisioningStateSucceeded), - // }, - // SystemData: &armazurestackhci.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-01T17:18:19.1234567Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armazurestackhci.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-02T17:18:19.1234567Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armazurestackhci.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/PatchExtension.json -func ExampleExtensionsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewExtensionsClient().BeginUpdate(ctx, "test-rg", "myCluster", "default", "MicrosoftMonitoringAgent", armazurestackhci.Extension{ - Properties: &armazurestackhci.ExtensionProperties{ - ExtensionParameters: &armazurestackhci.ExtensionParameters{ - Type: to.Ptr("MicrosoftMonitoringAgent"), - Publisher: to.Ptr("Microsoft.Compute"), - Settings: map[string]any{ - "workspaceId": "xx", - }, - TypeHandlerVersion: to.Ptr("1.10"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Extension = armazurestackhci.Extension{ - // Name: to.Ptr("MicrosoftMonitoringAgent"), - // Type: to.Ptr("Microsoft.AzureStackHCI/clusters/arcSettings/extensions"), - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/test-rg/providers/Microsoft.AzureStackHCI/clusters/myCluster/arcSettings/default/extensions/MicrosoftMonitoringAgent"), - // Properties: &armazurestackhci.ExtensionProperties{ - // AggregateState: to.Ptr(armazurestackhci.ExtensionAggregateStatePartiallyConnected), - // ExtensionParameters: &armazurestackhci.ExtensionParameters{ - // Type: to.Ptr("string"), - // AutoUpgradeMinorVersion: to.Ptr(false), - // Publisher: to.Ptr("Microsoft.Compute"), - // Settings: map[string]any{ - // "workspaceId": "xx", - // }, - // TypeHandlerVersion: to.Ptr("1.10.3"), - // }, - // PerNodeExtensionDetails: []*armazurestackhci.PerNodeExtensionState{ - // { - // Name: to.Ptr("Node-1"), - // Extension: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-1/Extensions/MicrosoftMonitoringAgent"), - // State: to.Ptr(armazurestackhci.NodeExtensionStateConnected), - // }, - // { - // Name: to.Ptr("Node-2"), - // Extension: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-2/Extensions/MicrosoftMonitoringAgent"), - // State: to.Ptr(armazurestackhci.NodeExtensionStateDisconnected), - // }}, - // ProvisioningState: to.Ptr(armazurestackhci.ProvisioningStateSucceeded), - // }, - // SystemData: &armazurestackhci.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-01T17:18:19.1234567Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armazurestackhci.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-02T17:18:19.1234567Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armazurestackhci.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/DeleteExtension.json -func ExampleExtensionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewExtensionsClient().BeginDelete(ctx, "test-rg", "myCluster", "default", "MicrosoftMonitoringAgent", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/azurestackhci/armazurestackhci/go.mod b/sdk/resourcemanager/azurestackhci/armazurestackhci/go.mod index aaebf13316f1..68bd004f8325 100644 --- a/sdk/resourcemanager/azurestackhci/armazurestackhci/go.mod +++ b/sdk/resourcemanager/azurestackhci/armazurestackhci/go.mod @@ -2,20 +2,12 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/azurestackhci/armaz go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1 require ( - github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 // indirect - github.com/golang-jwt/jwt/v4 v4.5.0 // indirect - github.com/google/uuid v1.3.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect - golang.org/x/crypto v0.6.0 // indirect - golang.org/x/net v0.7.0 // indirect - golang.org/x/sys v0.5.0 // indirect - golang.org/x/text v0.7.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + golang.org/x/net v0.8.0 // indirect + golang.org/x/text v0.8.0 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/sdk/resourcemanager/azurestackhci/armazurestackhci/go.sum b/sdk/resourcemanager/azurestackhci/armazurestackhci/go.sum index 8ba445a8c4da..5c6bee428364 100644 --- a/sdk/resourcemanager/azurestackhci/armazurestackhci/go.sum +++ b/sdk/resourcemanager/azurestackhci/armazurestackhci/go.sum @@ -1,31 +1,15 @@ -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 h1:rTnT/Jrcm+figWlYz4Ixzt0SJVR2cMC8lvZcimipiEY= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0/go.mod h1:ON4tFdPTwRcgWEaVDrN3584Ef+b7GgSJaXxe5fW9t4M= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 h1:uqM+VoHjVH6zdlkLF2b6O0ZANcHoj3rO0PoQ3jglUJA= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2/go.mod h1:twTKAa1E6hLmSDjLhaCkbTMQKc7p/rNLU40rLxGEOCI= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 h1:leh5DwKv6Ihwi+h60uHtn6UWAxBbZ0q8DwQVMzf61zw= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 h1:UE9n9rkJF62ArLb1F3DEjRt8O3jLwMWdSoypKV4f3MU= -github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0/go.mod h1:kgDmCTgBzIEPFElEF+FK0SdjAor06dRq2Go927dnQ6o= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1 h1:SEy2xmstIphdPwNBUi7uhvjyjhVKISfwjfOJmuy7kg4= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1/go.mod h1:bjGvMhVMb+EEm3VRNQawDMUyMMjo+S5ewNjflkep/0Q= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 h1:sXr+ck84g/ZlZUOZiNELInmMgOsuGwdjjVkEIde0OtY= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0/go.mod h1:okt5dMMTOFjX/aovMlrjvvXoPMBVSPzk9185BT0+eZM= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= -github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= -github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc= -golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= -golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= -golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= +golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= +golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/azurestackhci/armazurestackhci/models.go b/sdk/resourcemanager/azurestackhci/armazurestackhci/models.go index 722e8d71fe48..f6bb1a977434 100644 --- a/sdk/resourcemanager/azurestackhci/armazurestackhci/models.go +++ b/sdk/resourcemanager/azurestackhci/armazurestackhci/models.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armazurestackhci @@ -15,6 +14,10 @@ import "time" type ArcConnectivityProperties struct { // True indicates ARC connectivity is enabled Enabled *bool + + // Service configurations associated with the connectivity resource. They are only processed by the server if 'enabled' property + // is set to 'true'. + ServiceConfigurations []*ServiceConfiguration } // ArcIdentityResponse - ArcIdentity details. @@ -41,7 +44,7 @@ type ArcSetting struct { // READ-ONLY; The name of the resource Name *string - // READ-ONLY; System data of ArcSetting resource + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" @@ -80,6 +83,9 @@ type ArcSettingProperties struct { // READ-ONLY; Aggregate state of Arc agent across the nodes in this HCI cluster. AggregateState *ArcSettingAggregateState + // READ-ONLY; Properties for each of the default extensions category + DefaultExtensions []*DefaultExtensionDetails + // READ-ONLY; State of Arc agent in each of the nodes. PerNodeDetails []*PerNodeState @@ -87,45 +93,6 @@ type ArcSettingProperties struct { ProvisioningState *ProvisioningState } -// ArcSettingsClientBeginCreateIdentityOptions contains the optional parameters for the ArcSettingsClient.BeginCreateIdentity -// method. -type ArcSettingsClientBeginCreateIdentityOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ArcSettingsClientBeginDeleteOptions contains the optional parameters for the ArcSettingsClient.BeginDelete method. -type ArcSettingsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ArcSettingsClientCreateOptions contains the optional parameters for the ArcSettingsClient.Create method. -type ArcSettingsClientCreateOptions struct { - // placeholder for future optional parameters -} - -// ArcSettingsClientGeneratePasswordOptions contains the optional parameters for the ArcSettingsClient.GeneratePassword method. -type ArcSettingsClientGeneratePasswordOptions struct { - // placeholder for future optional parameters -} - -// ArcSettingsClientGetOptions contains the optional parameters for the ArcSettingsClient.Get method. -type ArcSettingsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ArcSettingsClientListByClusterOptions contains the optional parameters for the ArcSettingsClient.NewListByClusterPager -// method. -type ArcSettingsClientListByClusterOptions struct { - // placeholder for future optional parameters -} - -// ArcSettingsClientUpdateOptions contains the optional parameters for the ArcSettingsClient.Update method. -type ArcSettingsClientUpdateOptions struct { - // placeholder for future optional parameters -} - // ArcSettingsPatch - ArcSetting details to update. type ArcSettingsPatch struct { // ArcSettings properties. @@ -146,6 +113,9 @@ type Cluster struct { // REQUIRED; The geo-location where the resource lives Location *string + // Identity of Cluster resource + Identity *ManagedServiceIdentity + // Cluster properties. Properties *ClusterProperties @@ -158,7 +128,7 @@ type Cluster struct { // READ-ONLY; The name of the resource Name *string - // READ-ONLY; System data of Cluster resource + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" @@ -201,9 +171,15 @@ type ClusterNode struct { // READ-ONLY; Number of physical cores on the cluster node. CoreCount *float32 + // READ-ONLY; Edge Hardware Center Resource Id + EhcResourceID *string + // READ-ONLY; Id of the node in the cluster. ID *float32 + // READ-ONLY; Most recent licensing timestamp. + LastLicensingTimestamp *time.Time + // READ-ONLY; Manufacturer of the cluster node hardware. Manufacturer *string @@ -216,12 +192,21 @@ type ClusterNode struct { // READ-ONLY; Name of the cluster node. Name *string + // READ-ONLY; Type of the cluster node hardware. + NodeType *ClusterNodeType + + // READ-ONLY; Display version of the operating system running on the cluster node. + OSDisplayVersion *string + // READ-ONLY; Operating system running on the cluster node. OSName *string // READ-ONLY; Version of the operating system running on the cluster node. OSVersion *string + // READ-ONLY; OEM activation status of the node. + OemActivation *OemActivation + // READ-ONLY; Immutable id of the cluster node. SerialNumber *string @@ -231,6 +216,9 @@ type ClusterNode struct { // ClusterPatch - Cluster details to update. type ClusterPatch struct { + // Identity of Cluster resource + Identity *ManagedServiceIdentity + // Cluster properties. Properties *ClusterPatchProperties @@ -273,6 +261,9 @@ type ClusterProperties struct { // Desired properties of the cluster. DesiredProperties *ClusterDesiredProperties + // Software Assurance properties of the cluster. + SoftwareAssuranceProperties *SoftwareAssuranceProperties + // READ-ONLY; Type of billing applied to the resource. BillingModel *string @@ -294,6 +285,9 @@ type ClusterProperties struct { // READ-ONLY; Properties reported by cluster agent. ReportedProperties *ClusterReportedProperties + // READ-ONLY; Object id of RP Service Principal + ResourceProviderObjectID *string + // READ-ONLY; Region specific DataPath Endpoint of the cluster. ServiceEndpoint *string @@ -315,6 +309,9 @@ type ClusterReportedProperties struct { // READ-ONLY; Name of the on-prem cluster connected to this resource. ClusterName *string + // READ-ONLY; The node type of all the nodes of the cluster. + ClusterType *ClusterNodeType + // READ-ONLY; Version of the cluster software. ClusterVersion *string @@ -324,54 +321,26 @@ type ClusterReportedProperties struct { // READ-ONLY; Last time the cluster reported the data. LastUpdated *time.Time + // READ-ONLY; The manufacturer of all the nodes of the cluster. + Manufacturer *string + // READ-ONLY; List of nodes reported by the cluster. Nodes []*ClusterNode -} -// ClustersClientBeginCreateIdentityOptions contains the optional parameters for the ClustersClient.BeginCreateIdentity method. -type ClustersClientBeginCreateIdentityOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} + // READ-ONLY; OEM activation status of the cluster. + OemActivation *OemActivation -// ClustersClientBeginDeleteOptions contains the optional parameters for the ClustersClient.BeginDelete method. -type ClustersClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string + // READ-ONLY; Capabilities supported by the cluster. + SupportedCapabilities []*string } -// ClustersClientBeginUploadCertificateOptions contains the optional parameters for the ClustersClient.BeginUploadCertificate -// method. -type ClustersClientBeginUploadCertificateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} +// DefaultExtensionDetails - Properties for a particular default extension category. +type DefaultExtensionDetails struct { + // READ-ONLY; Default extension category + Category *string -// ClustersClientCreateOptions contains the optional parameters for the ClustersClient.Create method. -type ClustersClientCreateOptions struct { - // placeholder for future optional parameters -} - -// ClustersClientGetOptions contains the optional parameters for the ClustersClient.Get method. -type ClustersClientGetOptions struct { - // placeholder for future optional parameters -} - -// ClustersClientListByResourceGroupOptions contains the optional parameters for the ClustersClient.NewListByResourceGroupPager -// method. -type ClustersClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// ClustersClientListBySubscriptionOptions contains the optional parameters for the ClustersClient.NewListBySubscriptionPager -// method. -type ClustersClientListBySubscriptionOptions struct { - // placeholder for future optional parameters -} - -// ClustersClientUpdateOptions contains the optional parameters for the ClustersClient.Update method. -type ClustersClientUpdateOptions struct { - // placeholder for future optional parameters + // READ-ONLY; Consent time for extension category + ConsentTime *time.Time } // ErrorAdditionalInfo - The resource management error additional info. @@ -419,13 +388,46 @@ type Extension struct { // READ-ONLY; The name of the resource Name *string - // READ-ONLY; System data of Extension resource. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } +// ExtensionInstanceView - Describes the Extension Instance View. +type ExtensionInstanceView struct { + // The extension name. + Name *string + + // Instance view status. + Status *ExtensionInstanceViewStatus + + // Specifies the type of the extension; an example is "MicrosoftMonitoringAgent". + Type *string + + // Specifies the version of the script handler. + TypeHandlerVersion *string +} + +// ExtensionInstanceViewStatus - Instance view status. +type ExtensionInstanceViewStatus struct { + // The status code. + Code *string + + // The short localizable label for the status. + DisplayStatus *string + + // The level code. + Level *StatusLevelTypes + + // The detailed status message, including for alerts and error messages. + Message *string + + // The time of the status. + Time *time.Time +} + // ExtensionList - List of Extensions in HCI cluster. type ExtensionList struct { // READ-ONLY; Link to the next set of results. @@ -442,6 +444,9 @@ type ExtensionParameters struct { // with this property set to true. AutoUpgradeMinorVersion *bool + // Indicates whether the extension should be automatically upgraded by the platform if there is a newer version available. + EnableAutomaticUpgrade *bool + // How the extension handler should be forced to update even if the extension configuration has not changed. ForceUpdateTag *string @@ -457,7 +462,7 @@ type ExtensionParameters struct { // Specifies the type of the extension; an example is "CustomScriptExtension". Type *string - // Specifies the version of the script handler. + // Specifies the version of the script handler. Latest version would be used if not specified. TypeHandlerVersion *string } @@ -469,6 +474,9 @@ type ExtensionProperties struct { // READ-ONLY; Aggregate state of Arc Extensions across the nodes in this HCI cluster. AggregateState *ExtensionAggregateState + // READ-ONLY; Indicates if the extension is managed by azure or the user. + ManagedBy *ExtensionManagedBy + // READ-ONLY; State of Arc Extension in each of the nodes. PerNodeExtensionDetails []*PerNodeExtensionState @@ -476,33 +484,75 @@ type ExtensionProperties struct { ProvisioningState *ProvisioningState } -// ExtensionsClientBeginCreateOptions contains the optional parameters for the ExtensionsClient.BeginCreate method. -type ExtensionsClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string +// ExtensionUpgradeParameters - Describes the parameters for Extension upgrade. +type ExtensionUpgradeParameters struct { + // Extension Upgrade Target Version. + TargetVersion *string } -// ExtensionsClientBeginDeleteOptions contains the optional parameters for the ExtensionsClient.BeginDelete method. -type ExtensionsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string +// ManagedServiceIdentity - Managed service identity (system assigned and/or user assigned identities) +type ManagedServiceIdentity struct { + // REQUIRED; Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + Type *ManagedServiceIdentityType + + // 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. + UserAssignedIdentities map[string]*UserAssignedIdentity + + // READ-ONLY; The service principal ID of the system assigned identity. This property will only be provided for a system assigned + // identity. + PrincipalID *string + + // READ-ONLY; The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. + TenantID *string } -// ExtensionsClientBeginUpdateOptions contains the optional parameters for the ExtensionsClient.BeginUpdate method. -type ExtensionsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string +// Offer details. +type Offer struct { + // Offer properties. + Properties *OfferProperties + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string } -// ExtensionsClientGetOptions contains the optional parameters for the ExtensionsClient.Get method. -type ExtensionsClientGetOptions struct { - // placeholder for future optional parameters +// OfferList - List of Offer proxy resources for the HCI cluster. +type OfferList struct { + // READ-ONLY; Link to the next set of results. + NextLink *string + + // READ-ONLY; List of Offer proxy resources. + Value []*Offer } -// ExtensionsClientListByArcSettingOptions contains the optional parameters for the ExtensionsClient.NewListByArcSettingPager -// method. -type ExtensionsClientListByArcSettingOptions struct { - // placeholder for future optional parameters +// OfferProperties - Publisher properties. +type OfferProperties struct { + // JSON serialized catalog content of the offer + Content *string + + // The API version of the catalog service used to serve the catalog content + ContentVersion *string + + // Identifier of the Publisher for the offer + PublisherID *string + + // Array of SKU mappings + SKUMappings []*SKUMappings + + // READ-ONLY; Provisioning State + ProvisioningState *string } // Operation - Details of a REST API operation, returned from the Resource Provider Operations API @@ -554,9 +604,16 @@ type OperationListResult struct { Value []*Operation } -// OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. -type OperationsClientListOptions struct { - // placeholder for future optional parameters +// PackageVersionInfo - Current version of each updatable component. +type PackageVersionInfo struct { + // Last time this component was updated. + LastUpdated *time.Time + + // Package type + PackageType *string + + // Package version + Version *string } type PasswordCredential struct { @@ -571,11 +628,17 @@ type PerNodeExtensionState struct { // READ-ONLY; Fully qualified resource ID for the particular Arc Extension on this node. Extension *string + // READ-ONLY; The extension instance view. + InstanceView *ExtensionInstanceView + // READ-ONLY; Name of the node in HCI Cluster. Name *string // READ-ONLY; State of Arc Extension in this node. State *NodeExtensionState + + // READ-ONLY; Specifies the version of the script handler. + TypeHandlerVersion *string } // PerNodeState - Status of Arc agent for a particular node in HCI Cluster. @@ -590,6 +653,55 @@ type PerNodeState struct { State *NodeArcState } +type PrecheckResult struct { + // Property bag of key value pairs for additional information. + AdditionalData *string + + // Detailed overview of the issue and what impact the issue has on the stamp. + Description *string + + // The name of the services called for the HealthCheck (I.E. Test-AzureStack, Test-Cluster). + HealthCheckSource *string + + // Name of the individual test/rule/alert that was executed. Unique, not exposed to the customer. + Name *string + + // Set of steps that can be taken to resolve the issue found. + Remediation *string + + // Severity of the result (Critical, Warning, Informational, Hidden). This answers how important the result is. Critical is + // the only update-blocking severity. + Severity *Severity + + // The status of the check running (i.e. Failed, Succeeded, In Progress). This answers whether the check ran, and passed or + // failed. + Status *Status + + // Key-value pairs that allow grouping/filtering individual tests. + Tags *PrecheckResultTags + + // The unique identifier for the affected resource (such as a node or drive). + TargetResourceID *string + + // The name of the affected resource. + TargetResourceName *string + + // The Time in which the HealthCheck was called. + Timestamp *time.Time + + // User-facing name; one or more sentences indicating the direct issue. + Title *string +} + +// PrecheckResultTags - Key-value pairs that allow grouping/filtering individual tests. +type PrecheckResultTags struct { + // Key that allow grouping/filtering individual tests. + Key *string + + // Value of the key that allow grouping/filtering individual tests. + Value *string +} + // ProxyResource - The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a // location type ProxyResource struct { @@ -599,10 +711,46 @@ type ProxyResource struct { // READ-ONLY; The name of the resource Name *string + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// Publisher details. +type Publisher struct { + // Publisher properties. + Properties *PublisherProperties + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } +// PublisherList - List of Publisher proxy resources for the HCI cluster. +type PublisherList struct { + // READ-ONLY; Link to the next set of results. + NextLink *string + + // READ-ONLY; List of Publisher proxy resources. + Value []*Publisher +} + +// PublisherProperties - Publisher properties. +type PublisherProperties struct { + // READ-ONLY; Provisioning State + ProvisioningState *string +} + type RawCertificateData struct { Certificates []*string } @@ -615,10 +763,131 @@ type Resource struct { // READ-ONLY; The name of the resource Name *string + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } +// SKU - Sku details. +type SKU struct { + // SKU properties. + Properties *SKUProperties + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// SKUList - List of SKU proxy resources for the HCI cluster. +type SKUList struct { + // READ-ONLY; Link to the next set of results. + NextLink *string + + // READ-ONLY; List of SKU proxy resources. + Value []*SKU +} + +// SKUMappings - SKU Mapping details. +type SKUMappings struct { + // Identifier of the CatalogPlan for the sku + CatalogPlanID *string + + // Identifier for the sku + MarketplaceSKUID *string + + // Array of SKU versions available + MarketplaceSKUVersions []*string +} + +// SKUProperties - SKU properties. +type SKUProperties struct { + // JSON serialized catalog content of the sku offer + Content *string + + // The API version of the catalog service used to serve the catalog content + ContentVersion *string + + // Identifier of the Offer for the sku + OfferID *string + + // Identifier of the Publisher for the offer + PublisherID *string + + // Array of SKU mappings + SKUMappings []*SKUMappings + + // READ-ONLY; Provisioning State + ProvisioningState *string +} + +// ServiceConfiguration - Service configuration details +type ServiceConfiguration struct { + // REQUIRED; The port on which service is enabled. + Port *int64 + + // REQUIRED; Name of the service. + ServiceName *ServiceName +} + +type SoftwareAssuranceChangeRequest struct { + Properties *SoftwareAssuranceChangeRequestProperties +} + +type SoftwareAssuranceChangeRequestProperties struct { + // Customer Intent for Software Assurance Benefit. + SoftwareAssuranceIntent *SoftwareAssuranceIntent +} + +// SoftwareAssuranceProperties - Software Assurance properties of the cluster. +type SoftwareAssuranceProperties struct { + // Customer Intent for Software Assurance Benefit. + SoftwareAssuranceIntent *SoftwareAssuranceIntent + + // Status of the Software Assurance for the cluster. + SoftwareAssuranceStatus *SoftwareAssuranceStatus + + // READ-ONLY; TimeStamp denoting the latest SA benefit applicability is validated. + LastUpdated *time.Time +} + +// Step - Progress representation of the update run steps. +type Step struct { + // More detailed description of the step. + Description *string + + // When the step reached a terminal state. + EndTimeUTC *time.Time + + // Error message, specified if the step is in a failed state. + ErrorMessage *string + + // Completion time of this step or the last completed sub-step. + LastUpdatedTimeUTC *time.Time + + // Name of the step. + Name *string + + // When the step started, or empty if it has not started executing. + StartTimeUTC *time.Time + + // Status of the step, bubbled up from the ECE action plan for installation attempts. Values are: 'Success', 'Error', 'InProgress', + // and 'Unknown status'. + Status *string + + // Recursive model for child steps of this step. + Steps []*Step +} + // SystemData - Metadata pertaining to creation and last modification of the resource. type SystemData struct { // The timestamp of resource creation (UTC). @@ -655,10 +924,258 @@ type TrackedResource struct { // READ-ONLY; The name of the resource Name *string + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// Update details +type Update struct { + // The geo-location where the resource lives + Location *string + + // Update properties + Properties *UpdateProperties + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// UpdateList - List of Updates +type UpdateList struct { + // List of Updates + Value []*Update + + // READ-ONLY; Link to the next set of results. + NextLink *string +} + +// UpdatePrerequisite - If update State is HasPrerequisite, this property contains an array of objects describing prerequisite +// updates before installing this update. Otherwise, it is empty. +type UpdatePrerequisite struct { + // Friendly name of the prerequisite. + PackageName *string + + // Updatable component type. + UpdateType *string + + // Version of the prerequisite. + Version *string +} + +// UpdateProperties - Details of a singular Update in HCI Cluster +type UpdateProperties struct { + // 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. + AdditionalProperties *string + + // Indicates the way the update content can be downloaded. + AvailabilityType *AvailabilityType + + // An array of component versions for a Solution Bundle update, and an empty array otherwise. + ComponentVersions []*PackageVersionInfo + + // Description of the update. + Description *string + + // Display name of the Update + DisplayName *string + + // Last time the package-specific checks were run. + HealthCheckDate *time.Time + + // An array of PrecheckResult objects. + HealthCheckResult []*PrecheckResult + + // Overall health state for update-specific health checks. + HealthState *HealthState + + // Date that the update was installed. + InstalledDate *time.Time + + // Path where the update package is available. + PackagePath *string + + // 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. + PackageSizeInMb *float32 + + // Customer-visible type of the update. + PackageType *string + + // If update State is HasPrerequisite, this property contains an array of objects describing prerequisite updates before installing + // this update. Otherwise, it is empty. + Prerequisites []*UpdatePrerequisite + + // Publisher of the update package. + Publisher *string + RebootRequired *RebootRequirement + + // Link to release notes for the update. + ReleaseLink *string + + // State of the update as it relates to this stamp. + State *State + + // Additional information regarding the state of the update. See definition of UpdateStateProperties type below for more details + // on this property. + UpdateStateProperties *UpdateStateProperties + + // Version of the update. + Version *string + + // READ-ONLY; Provisioning state of the Updates proxy resource. + ProvisioningState *ProvisioningState +} + +// UpdateRun - Details of an Update run +type UpdateRun struct { + // The geo-location where the resource lives + Location *string + + // Describes Update Run Properties. + Properties *UpdateRunProperties + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// UpdateRunList - List of Update runs +type UpdateRunList struct { + // List of Update runs + Value []*UpdateRun + + // READ-ONLY; Link to the next set of results. + NextLink *string +} + +// UpdateRunProperties - Details of an Update run +type UpdateRunProperties struct { + // Duration of the update run. + Duration *string + + // Timestamp of the most recently completed step in the update run. + LastUpdatedTime *time.Time + + // Progress representation of the update run steps. + Progress *Step + + // State of the update run. + State *UpdateRunPropertiesState + + // Timestamp of the update run was started. + TimeStarted *time.Time + + // READ-ONLY; Provisioning state of the UpdateRuns proxy resource. + ProvisioningState *ProvisioningState +} + +// UpdateStateProperties - Additional information regarding the state of the update. See definition of UpdateStateProperties +// type below for more details on this property. +type UpdateStateProperties struct { + // Brief message with instructions for updates of AvailabilityType Notify. + NotifyMessage *string + + // 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. + ProgressPercentage *float32 +} + +// UpdateSummaries - Get the update summaries for the cluster +type UpdateSummaries struct { + // The geo-location where the resource lives + Location *string + + // Update summaries properties + Properties *UpdateSummariesProperties + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } +// UpdateSummariesList - List of Update Summaries +type UpdateSummariesList struct { + // List of Update Summaries + Value []*UpdateSummaries + + // READ-ONLY; Link to the next set of results. + NextLink *string +} + +// UpdateSummariesProperties - Properties of Update summaries +type UpdateSummariesProperties struct { + // Current Solution Bundle version of the stamp. + CurrentVersion *string + + // Name of the hardware model. + HardwareModel *string + + // Last time the package-specific checks were run. + HealthCheckDate *time.Time + + // An array of pre-check result objects. + HealthCheckResult []*PrecheckResult + + // Overall health state for update-specific health checks. + HealthState *HealthState + + // Last time the update service successfully checked for updates + LastChecked *time.Time + + // Last time an update installation completed successfully. + LastUpdated *time.Time + + // OEM family name. + OemFamily *string + + // Current version of each updatable component. + PackageVersions []*PackageVersionInfo + + // Overall update state of the stamp. + State *UpdateSummariesPropertiesState + + // READ-ONLY; Provisioning state of the UpdateSummaries proxy resource. + ProvisioningState *ProvisioningState +} + type UploadCertificateRequest struct { Properties *RawCertificateData } + +// UserAssignedIdentity - User assigned identity properties +type UserAssignedIdentity struct { + // READ-ONLY; The client ID of the assigned identity. + ClientID *string + + // READ-ONLY; The principal ID of the assigned identity. + PrincipalID *string +} diff --git a/sdk/resourcemanager/azurestackhci/armazurestackhci/models_serde.go b/sdk/resourcemanager/azurestackhci/armazurestackhci/models_serde.go index 9ec0dc773d5d..73ca5c498cc4 100644 --- a/sdk/resourcemanager/azurestackhci/armazurestackhci/models_serde.go +++ b/sdk/resourcemanager/azurestackhci/armazurestackhci/models_serde.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armazurestackhci @@ -20,6 +19,7 @@ import ( func (a ArcConnectivityProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "enabled", a.Enabled) + populate(objectMap, "serviceConfigurations", a.ServiceConfigurations) return json.Marshal(objectMap) } @@ -35,6 +35,9 @@ func (a *ArcConnectivityProperties) UnmarshalJSON(data []byte) error { case "enabled": err = unpopulate(val, "Enabled", &a.Enabled) delete(rawMsg, key) + case "serviceConfigurations": + err = unpopulate(val, "ServiceConfigurations", &a.ServiceConfigurations) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) @@ -193,6 +196,7 @@ func (a ArcSettingProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "arcInstanceResourceGroup", a.ArcInstanceResourceGroup) populate(objectMap, "arcServicePrincipalObjectId", a.ArcServicePrincipalObjectID) populateAny(objectMap, "connectivityProperties", a.ConnectivityProperties) + populate(objectMap, "defaultExtensions", a.DefaultExtensions) populate(objectMap, "perNodeDetails", a.PerNodeDetails) populate(objectMap, "provisioningState", a.ProvisioningState) return json.Marshal(objectMap) @@ -228,6 +232,9 @@ func (a *ArcSettingProperties) UnmarshalJSON(data []byte) error { case "connectivityProperties": err = unpopulate(val, "ConnectivityProperties", &a.ConnectivityProperties) delete(rawMsg, key) + case "defaultExtensions": + err = unpopulate(val, "DefaultExtensions", &a.DefaultExtensions) + delete(rawMsg, key) case "perNodeDetails": err = unpopulate(val, "PerNodeDetails", &a.PerNodeDetails) delete(rawMsg, key) @@ -304,6 +311,7 @@ func (a *ArcSettingsPatchProperties) UnmarshalJSON(data []byte) error { func (c Cluster) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", c.ID) + populate(objectMap, "identity", c.Identity) populate(objectMap, "location", c.Location) populate(objectMap, "name", c.Name) populate(objectMap, "properties", c.Properties) @@ -325,6 +333,9 @@ func (c *Cluster) UnmarshalJSON(data []byte) error { case "id": err = unpopulate(val, "ID", &c.ID) delete(rawMsg, key) + case "identity": + err = unpopulate(val, "Identity", &c.Identity) + delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &c.Location) delete(rawMsg, key) @@ -483,13 +494,18 @@ func (c *ClusterList) UnmarshalJSON(data []byte) error { func (c ClusterNode) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "coreCount", c.CoreCount) + populate(objectMap, "ehcResourceId", c.EhcResourceID) populate(objectMap, "id", c.ID) + populateTimeRFC3339(objectMap, "lastLicensingTimestamp", c.LastLicensingTimestamp) populate(objectMap, "manufacturer", c.Manufacturer) populate(objectMap, "memoryInGiB", c.MemoryInGiB) populate(objectMap, "model", c.Model) populate(objectMap, "name", c.Name) + populate(objectMap, "nodeType", c.NodeType) + populate(objectMap, "osDisplayVersion", c.OSDisplayVersion) populate(objectMap, "osName", c.OSName) populate(objectMap, "osVersion", c.OSVersion) + populate(objectMap, "oemActivation", c.OemActivation) populate(objectMap, "serialNumber", c.SerialNumber) populate(objectMap, "windowsServerSubscription", c.WindowsServerSubscription) return json.Marshal(objectMap) @@ -507,9 +523,15 @@ func (c *ClusterNode) UnmarshalJSON(data []byte) error { case "coreCount": err = unpopulate(val, "CoreCount", &c.CoreCount) delete(rawMsg, key) + case "ehcResourceId": + err = unpopulate(val, "EhcResourceID", &c.EhcResourceID) + delete(rawMsg, key) case "id": err = unpopulate(val, "ID", &c.ID) delete(rawMsg, key) + case "lastLicensingTimestamp": + err = unpopulateTimeRFC3339(val, "LastLicensingTimestamp", &c.LastLicensingTimestamp) + delete(rawMsg, key) case "manufacturer": err = unpopulate(val, "Manufacturer", &c.Manufacturer) delete(rawMsg, key) @@ -522,12 +544,21 @@ func (c *ClusterNode) UnmarshalJSON(data []byte) error { case "name": err = unpopulate(val, "Name", &c.Name) delete(rawMsg, key) + case "nodeType": + err = unpopulate(val, "NodeType", &c.NodeType) + delete(rawMsg, key) + case "osDisplayVersion": + err = unpopulate(val, "OSDisplayVersion", &c.OSDisplayVersion) + delete(rawMsg, key) case "osName": err = unpopulate(val, "OSName", &c.OSName) delete(rawMsg, key) case "osVersion": err = unpopulate(val, "OSVersion", &c.OSVersion) delete(rawMsg, key) + case "oemActivation": + err = unpopulate(val, "OemActivation", &c.OemActivation) + delete(rawMsg, key) case "serialNumber": err = unpopulate(val, "SerialNumber", &c.SerialNumber) delete(rawMsg, key) @@ -545,6 +576,7 @@ func (c *ClusterNode) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ClusterPatch. func (c ClusterPatch) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "identity", c.Identity) populate(objectMap, "properties", c.Properties) populate(objectMap, "tags", c.Tags) return json.Marshal(objectMap) @@ -559,6 +591,9 @@ func (c *ClusterPatch) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "identity": + err = unpopulate(val, "Identity", &c.Identity) + delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &c.Properties) delete(rawMsg, key) @@ -628,7 +663,9 @@ func (c ClusterProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "provisioningState", c.ProvisioningState) populateTimeRFC3339(objectMap, "registrationTimestamp", c.RegistrationTimestamp) populate(objectMap, "reportedProperties", c.ReportedProperties) + populate(objectMap, "resourceProviderObjectId", c.ResourceProviderObjectID) populate(objectMap, "serviceEndpoint", c.ServiceEndpoint) + populate(objectMap, "softwareAssuranceProperties", c.SoftwareAssuranceProperties) populate(objectMap, "status", c.Status) populate(objectMap, "trialDaysRemaining", c.TrialDaysRemaining) return json.Marshal(objectMap) @@ -682,9 +719,15 @@ func (c *ClusterProperties) UnmarshalJSON(data []byte) error { case "reportedProperties": err = unpopulate(val, "ReportedProperties", &c.ReportedProperties) delete(rawMsg, key) + case "resourceProviderObjectId": + err = unpopulate(val, "ResourceProviderObjectID", &c.ResourceProviderObjectID) + delete(rawMsg, key) case "serviceEndpoint": err = unpopulate(val, "ServiceEndpoint", &c.ServiceEndpoint) delete(rawMsg, key) + case "softwareAssuranceProperties": + err = unpopulate(val, "SoftwareAssuranceProperties", &c.SoftwareAssuranceProperties) + delete(rawMsg, key) case "status": err = unpopulate(val, "Status", &c.Status) delete(rawMsg, key) @@ -704,11 +747,15 @@ func (c ClusterReportedProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "clusterId", c.ClusterID) populate(objectMap, "clusterName", c.ClusterName) + populate(objectMap, "clusterType", c.ClusterType) populate(objectMap, "clusterVersion", c.ClusterVersion) populate(objectMap, "diagnosticLevel", c.DiagnosticLevel) populate(objectMap, "imdsAttestation", c.ImdsAttestation) populateTimeRFC3339(objectMap, "lastUpdated", c.LastUpdated) + populate(objectMap, "manufacturer", c.Manufacturer) populate(objectMap, "nodes", c.Nodes) + populate(objectMap, "oemActivation", c.OemActivation) + populate(objectMap, "supportedCapabilities", c.SupportedCapabilities) return json.Marshal(objectMap) } @@ -727,6 +774,9 @@ func (c *ClusterReportedProperties) UnmarshalJSON(data []byte) error { case "clusterName": err = unpopulate(val, "ClusterName", &c.ClusterName) delete(rawMsg, key) + case "clusterType": + err = unpopulate(val, "ClusterType", &c.ClusterType) + delete(rawMsg, key) case "clusterVersion": err = unpopulate(val, "ClusterVersion", &c.ClusterVersion) delete(rawMsg, key) @@ -739,9 +789,18 @@ func (c *ClusterReportedProperties) UnmarshalJSON(data []byte) error { case "lastUpdated": err = unpopulateTimeRFC3339(val, "LastUpdated", &c.LastUpdated) delete(rawMsg, key) + case "manufacturer": + err = unpopulate(val, "Manufacturer", &c.Manufacturer) + delete(rawMsg, key) case "nodes": err = unpopulate(val, "Nodes", &c.Nodes) delete(rawMsg, key) + case "oemActivation": + err = unpopulate(val, "OemActivation", &c.OemActivation) + delete(rawMsg, key) + case "supportedCapabilities": + err = unpopulate(val, "SupportedCapabilities", &c.SupportedCapabilities) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -750,6 +809,37 @@ func (c *ClusterReportedProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type DefaultExtensionDetails. +func (d DefaultExtensionDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "category", d.Category) + populateTimeRFC3339(objectMap, "consentTime", d.ConsentTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DefaultExtensionDetails. +func (d *DefaultExtensionDetails) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "category": + err = unpopulate(val, "Category", &d.Category) + delete(rawMsg, key) + case "consentTime": + err = unpopulateTimeRFC3339(val, "ConsentTime", &d.ConsentTime) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ErrorAdditionalInfo. func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -894,6 +984,88 @@ func (e *Extension) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ExtensionInstanceView. +func (e ExtensionInstanceView) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", e.Name) + populate(objectMap, "status", e.Status) + populate(objectMap, "type", e.Type) + populate(objectMap, "typeHandlerVersion", e.TypeHandlerVersion) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExtensionInstanceView. +func (e *ExtensionInstanceView) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &e.Status) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &e.Type) + delete(rawMsg, key) + case "typeHandlerVersion": + err = unpopulate(val, "TypeHandlerVersion", &e.TypeHandlerVersion) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ExtensionInstanceViewStatus. +func (e ExtensionInstanceViewStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "code", e.Code) + populate(objectMap, "displayStatus", e.DisplayStatus) + populate(objectMap, "level", e.Level) + populate(objectMap, "message", e.Message) + populateTimeRFC3339(objectMap, "time", e.Time) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExtensionInstanceViewStatus. +func (e *ExtensionInstanceViewStatus) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "code": + err = unpopulate(val, "Code", &e.Code) + delete(rawMsg, key) + case "displayStatus": + err = unpopulate(val, "DisplayStatus", &e.DisplayStatus) + delete(rawMsg, key) + case "level": + err = unpopulate(val, "Level", &e.Level) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &e.Message) + delete(rawMsg, key) + case "time": + err = unpopulateTimeRFC3339(val, "Time", &e.Time) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ExtensionList. func (e ExtensionList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -929,6 +1101,7 @@ func (e *ExtensionList) UnmarshalJSON(data []byte) error { func (e ExtensionParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "autoUpgradeMinorVersion", e.AutoUpgradeMinorVersion) + populate(objectMap, "enableAutomaticUpgrade", e.EnableAutomaticUpgrade) populate(objectMap, "forceUpdateTag", e.ForceUpdateTag) populateAny(objectMap, "protectedSettings", e.ProtectedSettings) populate(objectMap, "publisher", e.Publisher) @@ -950,6 +1123,9 @@ func (e *ExtensionParameters) UnmarshalJSON(data []byte) error { case "autoUpgradeMinorVersion": err = unpopulate(val, "AutoUpgradeMinorVersion", &e.AutoUpgradeMinorVersion) delete(rawMsg, key) + case "enableAutomaticUpgrade": + err = unpopulate(val, "EnableAutomaticUpgrade", &e.EnableAutomaticUpgrade) + delete(rawMsg, key) case "forceUpdateTag": err = unpopulate(val, "ForceUpdateTag", &e.ForceUpdateTag) delete(rawMsg, key) @@ -981,6 +1157,7 @@ func (e ExtensionProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "aggregateState", e.AggregateState) populate(objectMap, "extensionParameters", e.ExtensionParameters) + populate(objectMap, "managedBy", e.ManagedBy) populate(objectMap, "perNodeExtensionDetails", e.PerNodeExtensionDetails) populate(objectMap, "provisioningState", e.ProvisioningState) return json.Marshal(objectMap) @@ -1001,6 +1178,9 @@ func (e *ExtensionProperties) UnmarshalJSON(data []byte) error { case "extensionParameters": err = unpopulate(val, "ExtensionParameters", &e.ExtensionParameters) delete(rawMsg, key) + case "managedBy": + err = unpopulate(val, "ManagedBy", &e.ManagedBy) + delete(rawMsg, key) case "perNodeExtensionDetails": err = unpopulate(val, "PerNodeExtensionDetails", &e.PerNodeExtensionDetails) delete(rawMsg, key) @@ -1015,6 +1195,189 @@ func (e *ExtensionProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ExtensionUpgradeParameters. +func (e ExtensionUpgradeParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "targetVersion", e.TargetVersion) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExtensionUpgradeParameters. +func (e *ExtensionUpgradeParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "targetVersion": + err = unpopulate(val, "TargetVersion", &e.TargetVersion) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedServiceIdentity. +func (m ManagedServiceIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "principalId", m.PrincipalID) + populate(objectMap, "tenantId", m.TenantID) + populate(objectMap, "type", m.Type) + populate(objectMap, "userAssignedIdentities", m.UserAssignedIdentities) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedServiceIdentity. +func (m *ManagedServiceIdentity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "principalId": + err = unpopulate(val, "PrincipalID", &m.PrincipalID) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &m.TenantID) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + case "userAssignedIdentities": + err = unpopulate(val, "UserAssignedIdentities", &m.UserAssignedIdentities) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Offer. +func (o Offer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", o.ID) + populate(objectMap, "name", o.Name) + populate(objectMap, "properties", o.Properties) + populate(objectMap, "systemData", o.SystemData) + populate(objectMap, "type", o.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Offer. +func (o *Offer) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &o.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &o.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &o.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &o.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OfferList. +func (o OfferList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OfferList. +func (o *OfferList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &o.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &o.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OfferProperties. +func (o OfferProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "content", o.Content) + populate(objectMap, "contentVersion", o.ContentVersion) + populate(objectMap, "provisioningState", o.ProvisioningState) + populate(objectMap, "publisherId", o.PublisherID) + populate(objectMap, "skuMappings", o.SKUMappings) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OfferProperties. +func (o *OfferProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "content": + err = unpopulate(val, "Content", &o.Content) + delete(rawMsg, key) + case "contentVersion": + err = unpopulate(val, "ContentVersion", &o.ContentVersion) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &o.ProvisioningState) + delete(rawMsg, key) + case "publisherId": + err = unpopulate(val, "PublisherID", &o.PublisherID) + delete(rawMsg, key) + case "skuMappings": + err = unpopulate(val, "SKUMappings", &o.SKUMappings) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type Operation. func (o Operation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -1128,6 +1491,41 @@ func (o *OperationListResult) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type PackageVersionInfo. +func (p PackageVersionInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "lastUpdated", p.LastUpdated) + populate(objectMap, "packageType", p.PackageType) + populate(objectMap, "version", p.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PackageVersionInfo. +func (p *PackageVersionInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "lastUpdated": + err = unpopulateTimeRFC3339(val, "LastUpdated", &p.LastUpdated) + delete(rawMsg, key) + case "packageType": + err = unpopulate(val, "PackageType", &p.PackageType) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &p.Version) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type PasswordCredential. func (p PasswordCredential) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -1171,8 +1569,10 @@ func (p *PasswordCredential) UnmarshalJSON(data []byte) error { func (p PerNodeExtensionState) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "extension", p.Extension) + populate(objectMap, "instanceView", p.InstanceView) populate(objectMap, "name", p.Name) populate(objectMap, "state", p.State) + populate(objectMap, "typeHandlerVersion", p.TypeHandlerVersion) return json.Marshal(objectMap) } @@ -1188,12 +1588,18 @@ func (p *PerNodeExtensionState) UnmarshalJSON(data []byte) error { case "extension": err = unpopulate(val, "Extension", &p.Extension) delete(rawMsg, key) + case "instanceView": + err = unpopulate(val, "InstanceView", &p.InstanceView) + delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &p.Name) delete(rawMsg, key) case "state": err = unpopulate(val, "State", &p.State) delete(rawMsg, key) + case "typeHandlerVersion": + err = unpopulate(val, "TypeHandlerVersion", &p.TypeHandlerVersion) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) @@ -1237,11 +1643,114 @@ func (p *PerNodeState) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ProxyResource. -func (p ProxyResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrecheckResult. +func (p PrecheckResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", p.ID) + populate(objectMap, "additionalData", p.AdditionalData) + populate(objectMap, "description", p.Description) + populate(objectMap, "healthCheckSource", p.HealthCheckSource) populate(objectMap, "name", p.Name) + populate(objectMap, "remediation", p.Remediation) + populate(objectMap, "severity", p.Severity) + populate(objectMap, "status", p.Status) + populate(objectMap, "tags", p.Tags) + populate(objectMap, "targetResourceID", p.TargetResourceID) + populate(objectMap, "targetResourceName", p.TargetResourceName) + populateTimeRFC3339(objectMap, "timestamp", p.Timestamp) + populate(objectMap, "title", p.Title) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrecheckResult. +func (p *PrecheckResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "additionalData": + err = unpopulate(val, "AdditionalData", &p.AdditionalData) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &p.Description) + delete(rawMsg, key) + case "healthCheckSource": + err = unpopulate(val, "HealthCheckSource", &p.HealthCheckSource) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "remediation": + err = unpopulate(val, "Remediation", &p.Remediation) + delete(rawMsg, key) + case "severity": + err = unpopulate(val, "Severity", &p.Severity) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &p.Status) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &p.Tags) + delete(rawMsg, key) + case "targetResourceID": + err = unpopulate(val, "TargetResourceID", &p.TargetResourceID) + delete(rawMsg, key) + case "targetResourceName": + err = unpopulate(val, "TargetResourceName", &p.TargetResourceName) + delete(rawMsg, key) + case "timestamp": + err = unpopulateTimeRFC3339(val, "Timestamp", &p.Timestamp) + delete(rawMsg, key) + case "title": + err = unpopulate(val, "Title", &p.Title) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrecheckResultTags. +func (p PrecheckResultTags) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "key", p.Key) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrecheckResultTags. +func (p *PrecheckResultTags) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "key": + err = unpopulate(val, "Key", &p.Key) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &p.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ProxyResource. +func (p ProxyResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "systemData", p.SystemData) populate(objectMap, "type", p.Type) return json.Marshal(objectMap) } @@ -1261,6 +1770,52 @@ func (p *ProxyResource) UnmarshalJSON(data []byte) error { case "name": err = unpopulate(val, "Name", &p.Name) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Publisher. +func (p Publisher) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "systemData", p.SystemData) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Publisher. +func (p *Publisher) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &p.Type) delete(rawMsg, key) @@ -1272,6 +1827,64 @@ func (p *ProxyResource) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type PublisherList. +func (p PublisherList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PublisherList. +func (p *PublisherList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &p.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &p.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PublisherProperties. +func (p PublisherProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "provisioningState", p.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PublisherProperties. +func (p *PublisherProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type RawCertificateData. func (r RawCertificateData) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -1304,6 +1917,7 @@ func (r Resource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", r.ID) populate(objectMap, "name", r.Name) + populate(objectMap, "systemData", r.SystemData) populate(objectMap, "type", r.Type) return json.Marshal(objectMap) } @@ -1323,6 +1937,9 @@ func (r *Resource) UnmarshalJSON(data []byte) error { case "name": err = unpopulate(val, "Name", &r.Name) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &r.SystemData) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &r.Type) delete(rawMsg, key) @@ -1334,20 +1951,19 @@ func (r *Resource) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SystemData. -func (s SystemData) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SKU. +func (s SKU) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) - populate(objectMap, "createdBy", s.CreatedBy) - populate(objectMap, "createdByType", s.CreatedByType) - populateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) - populate(objectMap, "lastModifiedBy", s.LastModifiedBy) - populate(objectMap, "lastModifiedByType", s.LastModifiedByType) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "type", s.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. -func (s *SystemData) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SKU. +func (s *SKU) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -1355,23 +1971,51 @@ func (s *SystemData) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "createdAt": - err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) + case "id": + err = unpopulate(val, "ID", &s.ID) delete(rawMsg, key) - case "createdBy": - err = unpopulate(val, "CreatedBy", &s.CreatedBy) + case "name": + err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) - case "createdByType": - err = unpopulate(val, "CreatedByType", &s.CreatedByType) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) delete(rawMsg, key) - case "lastModifiedAt": - err = unpopulateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) delete(rawMsg, key) - case "lastModifiedBy": - err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) + case "type": + err = unpopulate(val, "Type", &s.Type) delete(rawMsg, key) - case "lastModifiedByType": - err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SKUList. +func (s SKUList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SKUList. +func (s *SKUList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) delete(rawMsg, key) } if err != nil { @@ -1381,67 +2025,923 @@ func (s *SystemData) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type TrackedResource. -func (t TrackedResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SKUMappings. +func (s SKUMappings) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", t.ID) - populate(objectMap, "location", t.Location) - populate(objectMap, "name", t.Name) - populate(objectMap, "tags", t.Tags) - populate(objectMap, "type", t.Type) + populate(objectMap, "catalogPlanId", s.CatalogPlanID) + populate(objectMap, "marketplaceSkuId", s.MarketplaceSKUID) + populate(objectMap, "marketplaceSkuVersions", s.MarketplaceSKUVersions) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type TrackedResource. -func (t *TrackedResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SKUMappings. +func (s *SKUMappings) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &t.ID) + case "catalogPlanId": + err = unpopulate(val, "CatalogPlanID", &s.CatalogPlanID) delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &t.Location) + case "marketplaceSkuId": + err = unpopulate(val, "MarketplaceSKUID", &s.MarketplaceSKUID) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &t.Name) + case "marketplaceSkuVersions": + err = unpopulate(val, "MarketplaceSKUVersions", &s.MarketplaceSKUVersions) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &t.Tags) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SKUProperties. +func (s SKUProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "content", s.Content) + populate(objectMap, "contentVersion", s.ContentVersion) + populate(objectMap, "offerId", s.OfferID) + populate(objectMap, "provisioningState", s.ProvisioningState) + populate(objectMap, "publisherId", s.PublisherID) + populate(objectMap, "skuMappings", s.SKUMappings) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SKUProperties. +func (s *SKUProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "content": + err = unpopulate(val, "Content", &s.Content) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &t.Type) + case "contentVersion": + err = unpopulate(val, "ContentVersion", &s.ContentVersion) + delete(rawMsg, key) + case "offerId": + err = unpopulate(val, "OfferID", &s.OfferID) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + delete(rawMsg, key) + case "publisherId": + err = unpopulate(val, "PublisherID", &s.PublisherID) + delete(rawMsg, key) + case "skuMappings": + err = unpopulate(val, "SKUMappings", &s.SKUMappings) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type UploadCertificateRequest. -func (u UploadCertificateRequest) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServiceConfiguration. +func (s ServiceConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", u.Properties) + populate(objectMap, "port", s.Port) + populate(objectMap, "serviceName", s.ServiceName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type UploadCertificateRequest. -func (u *UploadCertificateRequest) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceConfiguration. +func (s *ServiceConfiguration) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "properties": - err = unpopulate(val, "Properties", &u.Properties) + case "port": + err = unpopulate(val, "Port", &s.Port) + delete(rawMsg, key) + case "serviceName": + err = unpopulate(val, "ServiceName", &s.ServiceName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SoftwareAssuranceChangeRequest. +func (s SoftwareAssuranceChangeRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", s.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SoftwareAssuranceChangeRequest. +func (s *SoftwareAssuranceChangeRequest) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SoftwareAssuranceChangeRequestProperties. +func (s SoftwareAssuranceChangeRequestProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "softwareAssuranceIntent", s.SoftwareAssuranceIntent) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SoftwareAssuranceChangeRequestProperties. +func (s *SoftwareAssuranceChangeRequestProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "softwareAssuranceIntent": + err = unpopulate(val, "SoftwareAssuranceIntent", &s.SoftwareAssuranceIntent) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SoftwareAssuranceProperties. +func (s SoftwareAssuranceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "lastUpdated", s.LastUpdated) + populate(objectMap, "softwareAssuranceIntent", s.SoftwareAssuranceIntent) + populate(objectMap, "softwareAssuranceStatus", s.SoftwareAssuranceStatus) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SoftwareAssuranceProperties. +func (s *SoftwareAssuranceProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "lastUpdated": + err = unpopulateTimeRFC3339(val, "LastUpdated", &s.LastUpdated) + delete(rawMsg, key) + case "softwareAssuranceIntent": + err = unpopulate(val, "SoftwareAssuranceIntent", &s.SoftwareAssuranceIntent) + delete(rawMsg, key) + case "softwareAssuranceStatus": + err = unpopulate(val, "SoftwareAssuranceStatus", &s.SoftwareAssuranceStatus) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Step. +func (s Step) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", s.Description) + populateTimeRFC3339(objectMap, "endTimeUtc", s.EndTimeUTC) + populate(objectMap, "errorMessage", s.ErrorMessage) + populateTimeRFC3339(objectMap, "lastUpdatedTimeUtc", s.LastUpdatedTimeUTC) + populate(objectMap, "name", s.Name) + populateTimeRFC3339(objectMap, "startTimeUtc", s.StartTimeUTC) + populate(objectMap, "status", s.Status) + populate(objectMap, "steps", s.Steps) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Step. +func (s *Step) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &s.Description) + delete(rawMsg, key) + case "endTimeUtc": + err = unpopulateTimeRFC3339(val, "EndTimeUTC", &s.EndTimeUTC) + delete(rawMsg, key) + case "errorMessage": + err = unpopulate(val, "ErrorMessage", &s.ErrorMessage) + delete(rawMsg, key) + case "lastUpdatedTimeUtc": + err = unpopulateTimeRFC3339(val, "LastUpdatedTimeUTC", &s.LastUpdatedTimeUTC) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "startTimeUtc": + err = unpopulateTimeRFC3339(val, "StartTimeUTC", &s.StartTimeUTC) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &s.Status) + delete(rawMsg, key) + case "steps": + err = unpopulate(val, "Steps", &s.Steps) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SystemData. +func (s SystemData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) + populate(objectMap, "createdBy", s.CreatedBy) + populate(objectMap, "createdByType", s.CreatedByType) + populateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) + populate(objectMap, "lastModifiedBy", s.LastModifiedBy) + populate(objectMap, "lastModifiedByType", s.LastModifiedByType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. +func (s *SystemData) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "createdAt": + err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) + delete(rawMsg, key) + case "createdBy": + err = unpopulate(val, "CreatedBy", &s.CreatedBy) + delete(rawMsg, key) + case "createdByType": + err = unpopulate(val, "CreatedByType", &s.CreatedByType) + delete(rawMsg, key) + case "lastModifiedAt": + err = unpopulateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) + delete(rawMsg, key) + case "lastModifiedBy": + err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) + delete(rawMsg, key) + case "lastModifiedByType": + err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TrackedResource. +func (t TrackedResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", t.ID) + populate(objectMap, "location", t.Location) + populate(objectMap, "name", t.Name) + populate(objectMap, "systemData", t.SystemData) + populate(objectMap, "tags", t.Tags) + populate(objectMap, "type", t.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TrackedResource. +func (t *TrackedResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &t.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &t.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &t.Name) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &t.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &t.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &t.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Update. +func (u Update) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", u.ID) + populate(objectMap, "location", u.Location) + populate(objectMap, "name", u.Name) + populate(objectMap, "properties", u.Properties) + populate(objectMap, "systemData", u.SystemData) + populate(objectMap, "type", u.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Update. +func (u *Update) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &u.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &u.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &u.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &u.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &u.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &u.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UpdateList. +func (u UpdateList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", u.NextLink) + populate(objectMap, "value", u.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UpdateList. +func (u *UpdateList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &u.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &u.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UpdatePrerequisite. +func (u UpdatePrerequisite) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "packageName", u.PackageName) + populate(objectMap, "updateType", u.UpdateType) + populate(objectMap, "version", u.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UpdatePrerequisite. +func (u *UpdatePrerequisite) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "packageName": + err = unpopulate(val, "PackageName", &u.PackageName) + delete(rawMsg, key) + case "updateType": + err = unpopulate(val, "UpdateType", &u.UpdateType) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &u.Version) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UpdateProperties. +func (u UpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "additionalProperties", u.AdditionalProperties) + populate(objectMap, "availabilityType", u.AvailabilityType) + populate(objectMap, "componentVersions", u.ComponentVersions) + populate(objectMap, "description", u.Description) + populate(objectMap, "displayName", u.DisplayName) + populateTimeRFC3339(objectMap, "healthCheckDate", u.HealthCheckDate) + populate(objectMap, "healthCheckResult", u.HealthCheckResult) + populate(objectMap, "healthState", u.HealthState) + populateTimeRFC3339(objectMap, "installedDate", u.InstalledDate) + populate(objectMap, "packagePath", u.PackagePath) + populate(objectMap, "packageSizeInMb", u.PackageSizeInMb) + populate(objectMap, "packageType", u.PackageType) + populate(objectMap, "prerequisites", u.Prerequisites) + populate(objectMap, "provisioningState", u.ProvisioningState) + populate(objectMap, "publisher", u.Publisher) + populate(objectMap, "rebootRequired", u.RebootRequired) + populate(objectMap, "releaseLink", u.ReleaseLink) + populate(objectMap, "state", u.State) + populate(objectMap, "updateStateProperties", u.UpdateStateProperties) + populate(objectMap, "version", u.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UpdateProperties. +func (u *UpdateProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "additionalProperties": + err = unpopulate(val, "AdditionalProperties", &u.AdditionalProperties) + delete(rawMsg, key) + case "availabilityType": + err = unpopulate(val, "AvailabilityType", &u.AvailabilityType) + delete(rawMsg, key) + case "componentVersions": + err = unpopulate(val, "ComponentVersions", &u.ComponentVersions) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &u.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &u.DisplayName) + delete(rawMsg, key) + case "healthCheckDate": + err = unpopulateTimeRFC3339(val, "HealthCheckDate", &u.HealthCheckDate) + delete(rawMsg, key) + case "healthCheckResult": + err = unpopulate(val, "HealthCheckResult", &u.HealthCheckResult) + delete(rawMsg, key) + case "healthState": + err = unpopulate(val, "HealthState", &u.HealthState) + delete(rawMsg, key) + case "installedDate": + err = unpopulateTimeRFC3339(val, "InstalledDate", &u.InstalledDate) + delete(rawMsg, key) + case "packagePath": + err = unpopulate(val, "PackagePath", &u.PackagePath) + delete(rawMsg, key) + case "packageSizeInMb": + err = unpopulate(val, "PackageSizeInMb", &u.PackageSizeInMb) + delete(rawMsg, key) + case "packageType": + err = unpopulate(val, "PackageType", &u.PackageType) + delete(rawMsg, key) + case "prerequisites": + err = unpopulate(val, "Prerequisites", &u.Prerequisites) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &u.ProvisioningState) + delete(rawMsg, key) + case "publisher": + err = unpopulate(val, "Publisher", &u.Publisher) + delete(rawMsg, key) + case "rebootRequired": + err = unpopulate(val, "RebootRequired", &u.RebootRequired) + delete(rawMsg, key) + case "releaseLink": + err = unpopulate(val, "ReleaseLink", &u.ReleaseLink) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &u.State) + delete(rawMsg, key) + case "updateStateProperties": + err = unpopulate(val, "UpdateStateProperties", &u.UpdateStateProperties) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &u.Version) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UpdateRun. +func (u UpdateRun) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", u.ID) + populate(objectMap, "location", u.Location) + populate(objectMap, "name", u.Name) + populate(objectMap, "properties", u.Properties) + populate(objectMap, "systemData", u.SystemData) + populate(objectMap, "type", u.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UpdateRun. +func (u *UpdateRun) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &u.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &u.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &u.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &u.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &u.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &u.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UpdateRunList. +func (u UpdateRunList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", u.NextLink) + populate(objectMap, "value", u.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UpdateRunList. +func (u *UpdateRunList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &u.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &u.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UpdateRunProperties. +func (u UpdateRunProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "duration", u.Duration) + populateTimeRFC3339(objectMap, "lastUpdatedTime", u.LastUpdatedTime) + populate(objectMap, "progress", u.Progress) + populate(objectMap, "provisioningState", u.ProvisioningState) + populate(objectMap, "state", u.State) + populateTimeRFC3339(objectMap, "timeStarted", u.TimeStarted) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UpdateRunProperties. +func (u *UpdateRunProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "duration": + err = unpopulate(val, "Duration", &u.Duration) + delete(rawMsg, key) + case "lastUpdatedTime": + err = unpopulateTimeRFC3339(val, "LastUpdatedTime", &u.LastUpdatedTime) + delete(rawMsg, key) + case "progress": + err = unpopulate(val, "Progress", &u.Progress) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &u.ProvisioningState) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &u.State) + delete(rawMsg, key) + case "timeStarted": + err = unpopulateTimeRFC3339(val, "TimeStarted", &u.TimeStarted) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UpdateStateProperties. +func (u UpdateStateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "notifyMessage", u.NotifyMessage) + populate(objectMap, "progressPercentage", u.ProgressPercentage) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UpdateStateProperties. +func (u *UpdateStateProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "notifyMessage": + err = unpopulate(val, "NotifyMessage", &u.NotifyMessage) + delete(rawMsg, key) + case "progressPercentage": + err = unpopulate(val, "ProgressPercentage", &u.ProgressPercentage) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UpdateSummaries. +func (u UpdateSummaries) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", u.ID) + populate(objectMap, "location", u.Location) + populate(objectMap, "name", u.Name) + populate(objectMap, "properties", u.Properties) + populate(objectMap, "systemData", u.SystemData) + populate(objectMap, "type", u.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UpdateSummaries. +func (u *UpdateSummaries) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &u.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &u.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &u.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &u.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &u.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &u.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UpdateSummariesList. +func (u UpdateSummariesList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", u.NextLink) + populate(objectMap, "value", u.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UpdateSummariesList. +func (u *UpdateSummariesList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &u.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &u.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UpdateSummariesProperties. +func (u UpdateSummariesProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "currentVersion", u.CurrentVersion) + populate(objectMap, "hardwareModel", u.HardwareModel) + populateTimeRFC3339(objectMap, "healthCheckDate", u.HealthCheckDate) + populate(objectMap, "healthCheckResult", u.HealthCheckResult) + populate(objectMap, "healthState", u.HealthState) + populateTimeRFC3339(objectMap, "lastChecked", u.LastChecked) + populateTimeRFC3339(objectMap, "lastUpdated", u.LastUpdated) + populate(objectMap, "oemFamily", u.OemFamily) + populate(objectMap, "packageVersions", u.PackageVersions) + populate(objectMap, "provisioningState", u.ProvisioningState) + populate(objectMap, "state", u.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UpdateSummariesProperties. +func (u *UpdateSummariesProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "currentVersion": + err = unpopulate(val, "CurrentVersion", &u.CurrentVersion) + delete(rawMsg, key) + case "hardwareModel": + err = unpopulate(val, "HardwareModel", &u.HardwareModel) + delete(rawMsg, key) + case "healthCheckDate": + err = unpopulateTimeRFC3339(val, "HealthCheckDate", &u.HealthCheckDate) + delete(rawMsg, key) + case "healthCheckResult": + err = unpopulate(val, "HealthCheckResult", &u.HealthCheckResult) + delete(rawMsg, key) + case "healthState": + err = unpopulate(val, "HealthState", &u.HealthState) + delete(rawMsg, key) + case "lastChecked": + err = unpopulateTimeRFC3339(val, "LastChecked", &u.LastChecked) + delete(rawMsg, key) + case "lastUpdated": + err = unpopulateTimeRFC3339(val, "LastUpdated", &u.LastUpdated) + delete(rawMsg, key) + case "oemFamily": + err = unpopulate(val, "OemFamily", &u.OemFamily) + delete(rawMsg, key) + case "packageVersions": + err = unpopulate(val, "PackageVersions", &u.PackageVersions) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &u.ProvisioningState) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &u.State) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UploadCertificateRequest. +func (u UploadCertificateRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", u.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UploadCertificateRequest. +func (u *UploadCertificateRequest) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &u.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UserAssignedIdentity. +func (u UserAssignedIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clientId", u.ClientID) + populate(objectMap, "principalId", u.PrincipalID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UserAssignedIdentity. +func (u *UserAssignedIdentity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "clientId": + err = unpopulate(val, "ClientID", &u.ClientID) + delete(rawMsg, key) + case "principalId": + err = unpopulate(val, "PrincipalID", &u.PrincipalID) delete(rawMsg, key) } if err != nil { diff --git a/sdk/resourcemanager/azurestackhci/armazurestackhci/offers_client.go b/sdk/resourcemanager/azurestackhci/armazurestackhci/offers_client.go new file mode 100644 index 000000000000..a14719965d05 --- /dev/null +++ b/sdk/resourcemanager/azurestackhci/armazurestackhci/offers_client.go @@ -0,0 +1,268 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armazurestackhci + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// OffersClient contains the methods for the Offers group. +// Don't use this type directly, use NewOffersClient() instead. +type OffersClient struct { + internal *arm.Client + subscriptionID string +} + +// NewOffersClient creates a new instance of OffersClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewOffersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*OffersClient, error) { + cl, err := arm.NewClient(moduleName+".OffersClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &OffersClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Get - Get Offer resource details within a publisher of HCI Cluster. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - clusterName - The name of the cluster. +// - publisherName - The name of the publisher available within HCI cluster. +// - offerName - The name of the offer available within HCI cluster. +// - options - OffersClientGetOptions contains the optional parameters for the OffersClient.Get method. +func (client *OffersClient) Get(ctx context.Context, resourceGroupName string, clusterName string, publisherName string, offerName string, options *OffersClientGetOptions) (OffersClientGetResponse, error) { + var err error + req, err := client.getCreateRequest(ctx, resourceGroupName, clusterName, publisherName, offerName, options) + if err != nil { + return OffersClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return OffersClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return OffersClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *OffersClient) getCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, publisherName string, offerName string, options *OffersClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/publishers/{publisherName}/offers/{offerName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if clusterName == "" { + return nil, errors.New("parameter clusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) + if publisherName == "" { + return nil, errors.New("parameter publisherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) + if offerName == "" { + return nil, errors.New("parameter offerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{offerName}", url.PathEscape(offerName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-01") + if options != nil && options.Expand != nil { + reqQP.Set("$expand", *options.Expand) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *OffersClient) getHandleResponse(resp *http.Response) (OffersClientGetResponse, error) { + result := OffersClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Offer); err != nil { + return OffersClientGetResponse{}, err + } + return result, nil +} + +// NewListByClusterPager - List Offers available across publishers for the HCI Cluster. +// +// Generated from API version 2023-06-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - clusterName - The name of the cluster. +// - options - OffersClientListByClusterOptions contains the optional parameters for the OffersClient.NewListByClusterPager +// method. +func (client *OffersClient) NewListByClusterPager(resourceGroupName string, clusterName string, options *OffersClientListByClusterOptions) *runtime.Pager[OffersClientListByClusterResponse] { + return runtime.NewPager(runtime.PagingHandler[OffersClientListByClusterResponse]{ + More: func(page OffersClientListByClusterResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *OffersClientListByClusterResponse) (OffersClientListByClusterResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByClusterCreateRequest(ctx, resourceGroupName, clusterName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return OffersClientListByClusterResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return OffersClientListByClusterResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return OffersClientListByClusterResponse{}, runtime.NewResponseError(resp) + } + return client.listByClusterHandleResponse(resp) + }, + }) +} + +// listByClusterCreateRequest creates the ListByCluster request. +func (client *OffersClient) listByClusterCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, options *OffersClientListByClusterOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/offers" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if clusterName == "" { + return nil, errors.New("parameter clusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-01") + if options != nil && options.Expand != nil { + reqQP.Set("$expand", *options.Expand) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByClusterHandleResponse handles the ListByCluster response. +func (client *OffersClient) listByClusterHandleResponse(resp *http.Response) (OffersClientListByClusterResponse, error) { + result := OffersClientListByClusterResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.OfferList); err != nil { + return OffersClientListByClusterResponse{}, err + } + return result, nil +} + +// NewListByPublisherPager - List Offers available for a publisher within the HCI Cluster. +// +// Generated from API version 2023-06-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - clusterName - The name of the cluster. +// - publisherName - The name of the publisher available within HCI cluster. +// - options - OffersClientListByPublisherOptions contains the optional parameters for the OffersClient.NewListByPublisherPager +// method. +func (client *OffersClient) NewListByPublisherPager(resourceGroupName string, clusterName string, publisherName string, options *OffersClientListByPublisherOptions) *runtime.Pager[OffersClientListByPublisherResponse] { + return runtime.NewPager(runtime.PagingHandler[OffersClientListByPublisherResponse]{ + More: func(page OffersClientListByPublisherResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *OffersClientListByPublisherResponse) (OffersClientListByPublisherResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByPublisherCreateRequest(ctx, resourceGroupName, clusterName, publisherName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return OffersClientListByPublisherResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return OffersClientListByPublisherResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return OffersClientListByPublisherResponse{}, runtime.NewResponseError(resp) + } + return client.listByPublisherHandleResponse(resp) + }, + }) +} + +// listByPublisherCreateRequest creates the ListByPublisher request. +func (client *OffersClient) listByPublisherCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, publisherName string, options *OffersClientListByPublisherOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/publishers/{publisherName}/offers" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if clusterName == "" { + return nil, errors.New("parameter clusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) + if publisherName == "" { + return nil, errors.New("parameter publisherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-01") + if options != nil && options.Expand != nil { + reqQP.Set("$expand", *options.Expand) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByPublisherHandleResponse handles the ListByPublisher response. +func (client *OffersClient) listByPublisherHandleResponse(resp *http.Response) (OffersClientListByPublisherResponse, error) { + result := OffersClientListByPublisherResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.OfferList); err != nil { + return OffersClientListByPublisherResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/azurestackhci/armazurestackhci/operations_client.go b/sdk/resourcemanager/azurestackhci/armazurestackhci/operations_client.go index a5031296580c..684eccdbe9cd 100644 --- a/sdk/resourcemanager/azurestackhci/armazurestackhci/operations_client.go +++ b/sdk/resourcemanager/azurestackhci/armazurestackhci/operations_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armazurestackhci @@ -41,21 +40,24 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // List - List all available Microsoft.AzureStackHCI provider operations // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-05-01 +// Generated from API version 2023-06-01 // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. func (client *OperationsClient) List(ctx context.Context, options *OperationsClientListOptions) (OperationsClientListResponse, error) { + var err error req, err := client.listCreateRequest(ctx, options) if err != nil { return OperationsClientListResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return OperationsClientListResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return OperationsClientListResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return OperationsClientListResponse{}, err } - return client.listHandleResponse(resp) + resp, err := client.listHandleResponse(httpResp) + return resp, err } // listCreateRequest creates the List request. @@ -66,7 +68,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2023-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/azurestackhci/armazurestackhci/operations_client_example_test.go b/sdk/resourcemanager/azurestackhci/armazurestackhci/operations_client_example_test.go deleted file mode 100644 index 597dadc8d108..000000000000 --- a/sdk/resourcemanager/azurestackhci/armazurestackhci/operations_client_example_test.go +++ /dev/null @@ -1,381 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armazurestackhci_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/azurestackhci/armazurestackhci" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/ListOperations.json -func ExampleOperationsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOperationsClient().List(ctx, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OperationListResult = armazurestackhci.OperationListResult{ - // Value: []*armazurestackhci.Operation{ - // { - // Name: to.Ptr("Microsoft.AzureStackHCI/Register/Action"), - // Display: &armazurestackhci.OperationDisplay{ - // Description: to.Ptr("Registers the subscription for the Azure Stack HCI resource provider and enables the creation of Azure Stack HCI resources."), - // Operation: to.Ptr("Registers the Azure Stack HCI Resource Provider"), - // Provider: to.Ptr("Microsoft.AzureStackHCI"), - // Resource: to.Ptr("Register"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.AzureStackHCI/Unregister/Action"), - // Display: &armazurestackhci.OperationDisplay{ - // Description: to.Ptr("Unregisters the subscription for the Azure Stack HCI resource provider."), - // Operation: to.Ptr("Unregisters the Azure Stack HCI Resource Provider"), - // Provider: to.Ptr("Microsoft.AzureStackHCI"), - // Resource: to.Ptr("Unregister"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.AzureStackHCI/Operations/Read"), - // Display: &armazurestackhci.OperationDisplay{ - // Description: to.Ptr("Gets operations"), - // Operation: to.Ptr("Gets/List operations resources"), - // Provider: to.Ptr("Microsoft.AzureStackHCI"), - // Resource: to.Ptr("Operations"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.AzureStackHCI/Clusters/Read"), - // Display: &armazurestackhci.OperationDisplay{ - // Description: to.Ptr("Gets clusters"), - // Operation: to.Ptr("Gets/List cluster resources"), - // Provider: to.Ptr("Microsoft.AzureStackHCI"), - // Resource: to.Ptr("Clusters"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.AzureStackHCI/Clusters/Write"), - // Display: &armazurestackhci.OperationDisplay{ - // Description: to.Ptr("Creates or updates a cluster"), - // Operation: to.Ptr("Create/update cluster resources"), - // Provider: to.Ptr("Microsoft.AzureStackHCI"), - // Resource: to.Ptr("Clusters"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.AzureStackHCI/Clusters/Delete"), - // Display: &armazurestackhci.OperationDisplay{ - // Description: to.Ptr("Deletes cluster resource"), - // Operation: to.Ptr("Deletes cluster resource"), - // Provider: to.Ptr("Microsoft.AzureStackHCI"), - // Resource: to.Ptr("Clusters"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.AzureStackHCI/Clusters/ArcSettings/Read"), - // Display: &armazurestackhci.OperationDisplay{ - // Description: to.Ptr("Gets arc resource of HCI cluster"), - // Operation: to.Ptr("Gets/List arc resources"), - // Provider: to.Ptr("Microsoft.AzureStackHCI"), - // Resource: to.Ptr("Clusters/ArcSettings"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.AzureStackHCI/Clusters/ArcSettings/Write"), - // Display: &armazurestackhci.OperationDisplay{ - // Description: to.Ptr("Create or updates arc resource of HCI cluster"), - // Operation: to.Ptr("Create/Update arc resources"), - // Provider: to.Ptr("Microsoft.AzureStackHCI"), - // Resource: to.Ptr("Clusters/ArcSettings"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.AzureStackHCI/Clusters/ArcSettings/Delete"), - // Display: &armazurestackhci.OperationDisplay{ - // Description: to.Ptr("Delete arc resource of HCI cluster"), - // Operation: to.Ptr("Delete arc resources"), - // Provider: to.Ptr("Microsoft.AzureStackHCI"), - // Resource: to.Ptr("Clusters/ArcSettings"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.AzureStackHCI/Clusters/ArcSettings/Extensions/Read"), - // Display: &armazurestackhci.OperationDisplay{ - // Description: to.Ptr("Gets extension resource of HCI cluster"), - // Operation: to.Ptr("Gets/List extension resources of HCI cluster"), - // Provider: to.Ptr("Microsoft.AzureStackHCI"), - // Resource: to.Ptr("Clusters/ArcSettings/Extensions"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.AzureStackHCI/Clusters/ArcSettings/Extensions/Write"), - // Display: &armazurestackhci.OperationDisplay{ - // Description: to.Ptr("Create or update extension resource of HCI cluster"), - // Operation: to.Ptr("Create/Update extension resources of HCI cluster"), - // Provider: to.Ptr("Microsoft.AzureStackHCI"), - // Resource: to.Ptr("Clusters/ArcSettings/Extensions"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.AzureStackHCI/Clusters/ArcSettings/Extensions/Delete"), - // Display: &armazurestackhci.OperationDisplay{ - // Description: to.Ptr("Delete extension resources of HCI cluster"), - // Operation: to.Ptr("Delete extension resources of HCI cluster"), - // Provider: to.Ptr("Microsoft.AzureStackHCI"), - // Resource: to.Ptr("Clusters/ArcSettings/Extensions"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.AzureStackHCI/VirtualMachines/Restart/Action"), - // Display: &armazurestackhci.OperationDisplay{ - // Description: to.Ptr("Restarts virtual machine resource"), - // Operation: to.Ptr("Restarts virtual machine resource"), - // Provider: to.Ptr("Microsoft.AzureStackHCI"), - // Resource: to.Ptr("VirtualMachines"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.AzureStackHCI/VirtualMachines/Start/Action"), - // Display: &armazurestackhci.OperationDisplay{ - // Description: to.Ptr("Starts virtual machine resource"), - // Operation: to.Ptr("Starts virtual machine resource"), - // Provider: to.Ptr("Microsoft.AzureStackHCI"), - // Resource: to.Ptr("VirtualMachines"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.AzureStackHCI/VirtualMachines/Stop/Action"), - // Display: &armazurestackhci.OperationDisplay{ - // Description: to.Ptr("Stops virtual machine resource"), - // Operation: to.Ptr("Stops virtual machine resource"), - // Provider: to.Ptr("Microsoft.AzureStackHCI"), - // Resource: to.Ptr("VirtualMachines"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.AzureStackHCI/VirtualMachines/Delete"), - // Display: &armazurestackhci.OperationDisplay{ - // Description: to.Ptr("Deletes virtual machine resource"), - // Operation: to.Ptr("Deletes virtual machine resource"), - // Provider: to.Ptr("Microsoft.AzureStackHCI"), - // Resource: to.Ptr("VirtualMachines"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.AzureStackHCI/VirtualMachines/Write"), - // Display: &armazurestackhci.OperationDisplay{ - // Description: to.Ptr("Creates/Updates virtual machine resource"), - // Operation: to.Ptr("Creates/Updates virtual machine resource"), - // Provider: to.Ptr("Microsoft.AzureStackHCI"), - // Resource: to.Ptr("VirtualMachines"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.AzureStackHCI/VirtualMachines/Read"), - // Display: &armazurestackhci.OperationDisplay{ - // Description: to.Ptr("Gets/Lists virtual machine resource"), - // Operation: to.Ptr("Gets/Lists virtual machine resource"), - // Provider: to.Ptr("Microsoft.AzureStackHCI"), - // Resource: to.Ptr("VirtualMachines"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.AzureStackHCI/VirtualNetworks/Delete"), - // Display: &armazurestackhci.OperationDisplay{ - // Description: to.Ptr("Deletes virtual networks resource"), - // Operation: to.Ptr("Deletes virtual networks resource"), - // Provider: to.Ptr("Microsoft.AzureStackHCI"), - // Resource: to.Ptr("VirtualNetworks"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.AzureStackHCI/VirtualNetworks/Write"), - // Display: &armazurestackhci.OperationDisplay{ - // Description: to.Ptr("Creates/Updates virtual networks resource"), - // Operation: to.Ptr("Creates/Updates virtual networks resource"), - // Provider: to.Ptr("Microsoft.AzureStackHCI"), - // Resource: to.Ptr("VirtualNetworks"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.AzureStackHCI/VirtualNetworks/Read"), - // Display: &armazurestackhci.OperationDisplay{ - // Description: to.Ptr("Gets/Lists virtual networks resource"), - // Operation: to.Ptr("Gets/Lists virtual networks resource"), - // Provider: to.Ptr("Microsoft.AzureStackHCI"), - // Resource: to.Ptr("VirtualNetworks"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.AzureStackHCI/VirtualHardDisks/Delete"), - // Display: &armazurestackhci.OperationDisplay{ - // Description: to.Ptr("Deletes virtual hard disk resource"), - // Operation: to.Ptr("Deletes virtual hard disk resource"), - // Provider: to.Ptr("Microsoft.AzureStackHCI"), - // Resource: to.Ptr("VirtualHardDisks"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.AzureStackHCI/VirtualHardDisks/Write"), - // Display: &armazurestackhci.OperationDisplay{ - // Description: to.Ptr("Creates/Updates virtual hard disk resource"), - // Operation: to.Ptr("Creates/Updates virtual hard disk resource"), - // Provider: to.Ptr("Microsoft.AzureStackHCI"), - // Resource: to.Ptr("VirtualHardDisks"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.AzureStackHCI/VirtualHardDisks/Read"), - // Display: &armazurestackhci.OperationDisplay{ - // Description: to.Ptr("Gets/Lists virtual hard disk resource"), - // Operation: to.Ptr("Gets/Lists virtual hard disk resource"), - // Provider: to.Ptr("Microsoft.AzureStackHCI"), - // Resource: to.Ptr("VirtualHardDisks"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.AzureStackHCI/NetworkInterfaces/Delete"), - // Display: &armazurestackhci.OperationDisplay{ - // Description: to.Ptr("Deletes network interfaces resource"), - // Operation: to.Ptr("Deletes network interfaces resource"), - // Provider: to.Ptr("Microsoft.AzureStackHCI"), - // Resource: to.Ptr("NetworkInterfaces"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.AzureStackHCI/NetworkInterfaces/Write"), - // Display: &armazurestackhci.OperationDisplay{ - // Description: to.Ptr("Creates/Updates network interfaces resource"), - // Operation: to.Ptr("Creates/Updates network interfaces resource"), - // Provider: to.Ptr("Microsoft.AzureStackHCI"), - // Resource: to.Ptr("NetworkInterfaces"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.AzureStackHCI/NetworkInterfaces/Read"), - // Display: &armazurestackhci.OperationDisplay{ - // Description: to.Ptr("Gets/Lists network interfaces resource"), - // Operation: to.Ptr("Gets/Lists network interfaces resource"), - // Provider: to.Ptr("Microsoft.AzureStackHCI"), - // Resource: to.Ptr("NetworkInterfaces"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.AzureStackHCI/GalleryImages/Delete"), - // Display: &armazurestackhci.OperationDisplay{ - // Description: to.Ptr("Deletes gallery images resource"), - // Operation: to.Ptr("Deletes gallery images resource"), - // Provider: to.Ptr("Microsoft.AzureStackHCI"), - // Resource: to.Ptr("GalleryImages"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.AzureStackHCI/GalleryImages/Write"), - // Display: &armazurestackhci.OperationDisplay{ - // Description: to.Ptr("Creates/Updates gallery images resource"), - // Operation: to.Ptr("Creates/Updates gallery images resource"), - // Provider: to.Ptr("Microsoft.AzureStackHCI"), - // Resource: to.Ptr("GalleryImages"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.AzureStackHCI/GalleryImages/Read"), - // Display: &armazurestackhci.OperationDisplay{ - // Description: to.Ptr("Gets/Lists gallery images resource"), - // Operation: to.Ptr("Gets/Lists gallery images resource"), - // Provider: to.Ptr("Microsoft.AzureStackHCI"), - // Resource: to.Ptr("GalleryImages"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.AzureStackHCI/VirtualMachines/HybridIdentityMetadata/Read"), - // Display: &armazurestackhci.OperationDisplay{ - // Description: to.Ptr("Gets/Lists virtual machine hybrid identity metadata proxy resource"), - // Operation: to.Ptr("Gets/Lists virtual machine hybrid identity metadata proxy resource"), - // Provider: to.Ptr("Microsoft.AzureStackHCI"), - // Resource: to.Ptr("VirtualMachines/HybridIdentityMetadata"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.AzureStackHCI/VirtualMachines/Extensions/Read"), - // Display: &armazurestackhci.OperationDisplay{ - // Description: to.Ptr("Gets/Lists virtual machine extensions resource"), - // Operation: to.Ptr("Gets/Lists virtual machine extensions resource"), - // Provider: to.Ptr("Microsoft.AzureStackHCI"), - // Resource: to.Ptr("VirtualMachines/Extensions"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.AzureStackHCI/VirtualMachines/Extensions/Write"), - // Display: &armazurestackhci.OperationDisplay{ - // Description: to.Ptr("Creates/Updates virtual machine extensions resource"), - // Operation: to.Ptr("Creates/Updates virtual machine extensions resource"), - // Provider: to.Ptr("Microsoft.AzureStackHCI"), - // Resource: to.Ptr("VirtualMachines/Extensions"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.AzureStackHCI/VirtualMachines/Extensions/Delete"), - // Display: &armazurestackhci.OperationDisplay{ - // Description: to.Ptr("Deletes virtual machine extensions resource"), - // Operation: to.Ptr("Deletes virtual machine extensions resource"), - // Provider: to.Ptr("Microsoft.AzureStackHCI"), - // Resource: to.Ptr("VirtualMachines/Extensions"), - // }, - // IsDataAction: to.Ptr(false), - // }}, - // } -} diff --git a/sdk/resourcemanager/azurestackhci/armazurestackhci/options.go b/sdk/resourcemanager/azurestackhci/armazurestackhci/options.go new file mode 100644 index 000000000000..4f8fb2106a0c --- /dev/null +++ b/sdk/resourcemanager/azurestackhci/armazurestackhci/options.go @@ -0,0 +1,263 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armazurestackhci + +// ArcSettingsClientBeginCreateIdentityOptions contains the optional parameters for the ArcSettingsClient.BeginCreateIdentity +// method. +type ArcSettingsClientBeginCreateIdentityOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ArcSettingsClientBeginDeleteOptions contains the optional parameters for the ArcSettingsClient.BeginDelete method. +type ArcSettingsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ArcSettingsClientBeginInitializeDisableProcessOptions contains the optional parameters for the ArcSettingsClient.BeginInitializeDisableProcess +// method. +type ArcSettingsClientBeginInitializeDisableProcessOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ArcSettingsClientConsentAndInstallDefaultExtensionsOptions contains the optional parameters for the ArcSettingsClient.ConsentAndInstallDefaultExtensions +// method. +type ArcSettingsClientConsentAndInstallDefaultExtensionsOptions struct { + // placeholder for future optional parameters +} + +// ArcSettingsClientCreateOptions contains the optional parameters for the ArcSettingsClient.Create method. +type ArcSettingsClientCreateOptions struct { + // placeholder for future optional parameters +} + +// ArcSettingsClientGeneratePasswordOptions contains the optional parameters for the ArcSettingsClient.GeneratePassword method. +type ArcSettingsClientGeneratePasswordOptions struct { + // placeholder for future optional parameters +} + +// ArcSettingsClientGetOptions contains the optional parameters for the ArcSettingsClient.Get method. +type ArcSettingsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ArcSettingsClientListByClusterOptions contains the optional parameters for the ArcSettingsClient.NewListByClusterPager +// method. +type ArcSettingsClientListByClusterOptions struct { + // placeholder for future optional parameters +} + +// ArcSettingsClientUpdateOptions contains the optional parameters for the ArcSettingsClient.Update method. +type ArcSettingsClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// ClustersClientBeginCreateIdentityOptions contains the optional parameters for the ClustersClient.BeginCreateIdentity method. +type ClustersClientBeginCreateIdentityOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ClustersClientBeginDeleteOptions contains the optional parameters for the ClustersClient.BeginDelete method. +type ClustersClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ClustersClientBeginExtendSoftwareAssuranceBenefitOptions contains the optional parameters for the ClustersClient.BeginExtendSoftwareAssuranceBenefit +// method. +type ClustersClientBeginExtendSoftwareAssuranceBenefitOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ClustersClientBeginUploadCertificateOptions contains the optional parameters for the ClustersClient.BeginUploadCertificate +// method. +type ClustersClientBeginUploadCertificateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ClustersClientCreateOptions contains the optional parameters for the ClustersClient.Create method. +type ClustersClientCreateOptions struct { + // placeholder for future optional parameters +} + +// ClustersClientGetOptions contains the optional parameters for the ClustersClient.Get method. +type ClustersClientGetOptions struct { + // placeholder for future optional parameters +} + +// ClustersClientListByResourceGroupOptions contains the optional parameters for the ClustersClient.NewListByResourceGroupPager +// method. +type ClustersClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// ClustersClientListBySubscriptionOptions contains the optional parameters for the ClustersClient.NewListBySubscriptionPager +// method. +type ClustersClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// ClustersClientUpdateOptions contains the optional parameters for the ClustersClient.Update method. +type ClustersClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// ExtensionsClientBeginCreateOptions contains the optional parameters for the ExtensionsClient.BeginCreate method. +type ExtensionsClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ExtensionsClientBeginDeleteOptions contains the optional parameters for the ExtensionsClient.BeginDelete method. +type ExtensionsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ExtensionsClientBeginUpdateOptions contains the optional parameters for the ExtensionsClient.BeginUpdate method. +type ExtensionsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ExtensionsClientBeginUpgradeOptions contains the optional parameters for the ExtensionsClient.BeginUpgrade method. +type ExtensionsClientBeginUpgradeOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ExtensionsClientGetOptions contains the optional parameters for the ExtensionsClient.Get method. +type ExtensionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ExtensionsClientListByArcSettingOptions contains the optional parameters for the ExtensionsClient.NewListByArcSettingPager +// method. +type ExtensionsClientListByArcSettingOptions struct { + // placeholder for future optional parameters +} + +// OffersClientGetOptions contains the optional parameters for the OffersClient.Get method. +type OffersClientGetOptions struct { + // Specify $expand=content,contentVersion to populate additional fields related to the marketplace offer. + Expand *string +} + +// OffersClientListByClusterOptions contains the optional parameters for the OffersClient.NewListByClusterPager method. +type OffersClientListByClusterOptions struct { + // Specify $expand=content,contentVersion to populate additional fields related to the marketplace offer. + Expand *string +} + +// OffersClientListByPublisherOptions contains the optional parameters for the OffersClient.NewListByPublisherPager method. +type OffersClientListByPublisherOptions struct { + // Specify $expand=content,contentVersion to populate additional fields related to the marketplace offer. + Expand *string +} + +// OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. +type OperationsClientListOptions struct { + // placeholder for future optional parameters +} + +// PublishersClientGetOptions contains the optional parameters for the PublishersClient.Get method. +type PublishersClientGetOptions struct { + // placeholder for future optional parameters +} + +// PublishersClientListByClusterOptions contains the optional parameters for the PublishersClient.NewListByClusterPager method. +type PublishersClientListByClusterOptions struct { + // placeholder for future optional parameters +} + +// SKUsClientGetOptions contains the optional parameters for the SKUsClient.Get method. +type SKUsClientGetOptions struct { + // Specify $expand=content,contentVersion to populate additional fields related to the marketplace offer. + Expand *string +} + +// SKUsClientListByOfferOptions contains the optional parameters for the SKUsClient.NewListByOfferPager method. +type SKUsClientListByOfferOptions struct { + // Specify $expand=content,contentVersion to populate additional fields related to the marketplace offer. + Expand *string +} + +// UpdateRunsClientBeginDeleteOptions contains the optional parameters for the UpdateRunsClient.BeginDelete method. +type UpdateRunsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// UpdateRunsClientGetOptions contains the optional parameters for the UpdateRunsClient.Get method. +type UpdateRunsClientGetOptions struct { + // placeholder for future optional parameters +} + +// UpdateRunsClientListOptions contains the optional parameters for the UpdateRunsClient.NewListPager method. +type UpdateRunsClientListOptions struct { + // placeholder for future optional parameters +} + +// UpdateRunsClientPutOptions contains the optional parameters for the UpdateRunsClient.Put method. +type UpdateRunsClientPutOptions struct { + // placeholder for future optional parameters +} + +// UpdateSummariesClientBeginDeleteOptions contains the optional parameters for the UpdateSummariesClient.BeginDelete method. +type UpdateSummariesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// UpdateSummariesClientGetOptions contains the optional parameters for the UpdateSummariesClient.Get method. +type UpdateSummariesClientGetOptions struct { + // placeholder for future optional parameters +} + +// UpdateSummariesClientListOptions contains the optional parameters for the UpdateSummariesClient.NewListPager method. +type UpdateSummariesClientListOptions struct { + // placeholder for future optional parameters +} + +// UpdateSummariesClientPutOptions contains the optional parameters for the UpdateSummariesClient.Put method. +type UpdateSummariesClientPutOptions struct { + // placeholder for future optional parameters +} + +// UpdatesClientBeginDeleteOptions contains the optional parameters for the UpdatesClient.BeginDelete method. +type UpdatesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// UpdatesClientBeginPostOptions contains the optional parameters for the UpdatesClient.BeginPost method. +type UpdatesClientBeginPostOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// UpdatesClientGetOptions contains the optional parameters for the UpdatesClient.Get method. +type UpdatesClientGetOptions struct { + // placeholder for future optional parameters +} + +// UpdatesClientListOptions contains the optional parameters for the UpdatesClient.NewListPager method. +type UpdatesClientListOptions struct { + // placeholder for future optional parameters +} + +// UpdatesClientPutOptions contains the optional parameters for the UpdatesClient.Put method. +type UpdatesClientPutOptions struct { + // placeholder for future optional parameters +} diff --git a/sdk/resourcemanager/azurestackhci/armazurestackhci/publishers_client.go b/sdk/resourcemanager/azurestackhci/armazurestackhci/publishers_client.go new file mode 100644 index 000000000000..1b9e732ef3ad --- /dev/null +++ b/sdk/resourcemanager/azurestackhci/armazurestackhci/publishers_client.go @@ -0,0 +1,179 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armazurestackhci + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// PublishersClient contains the methods for the Publishers group. +// Don't use this type directly, use NewPublishersClient() instead. +type PublishersClient struct { + internal *arm.Client + subscriptionID string +} + +// NewPublishersClient creates a new instance of PublishersClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewPublishersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PublishersClient, error) { + cl, err := arm.NewClient(moduleName+".PublishersClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &PublishersClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Get - Get Publisher resource details of HCI Cluster. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - clusterName - The name of the cluster. +// - publisherName - The name of the publisher available within HCI cluster. +// - options - PublishersClientGetOptions contains the optional parameters for the PublishersClient.Get method. +func (client *PublishersClient) Get(ctx context.Context, resourceGroupName string, clusterName string, publisherName string, options *PublishersClientGetOptions) (PublishersClientGetResponse, error) { + var err error + req, err := client.getCreateRequest(ctx, resourceGroupName, clusterName, publisherName, options) + if err != nil { + return PublishersClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PublishersClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PublishersClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *PublishersClient) getCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, publisherName string, options *PublishersClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/publishers/{publisherName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if clusterName == "" { + return nil, errors.New("parameter clusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) + if publisherName == "" { + return nil, errors.New("parameter publisherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *PublishersClient) getHandleResponse(resp *http.Response) (PublishersClientGetResponse, error) { + result := PublishersClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Publisher); err != nil { + return PublishersClientGetResponse{}, err + } + return result, nil +} + +// NewListByClusterPager - List Publishers available for the HCI Cluster. +// +// Generated from API version 2023-06-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - clusterName - The name of the cluster. +// - options - PublishersClientListByClusterOptions contains the optional parameters for the PublishersClient.NewListByClusterPager +// method. +func (client *PublishersClient) NewListByClusterPager(resourceGroupName string, clusterName string, options *PublishersClientListByClusterOptions) *runtime.Pager[PublishersClientListByClusterResponse] { + return runtime.NewPager(runtime.PagingHandler[PublishersClientListByClusterResponse]{ + More: func(page PublishersClientListByClusterResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *PublishersClientListByClusterResponse) (PublishersClientListByClusterResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByClusterCreateRequest(ctx, resourceGroupName, clusterName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return PublishersClientListByClusterResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PublishersClientListByClusterResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PublishersClientListByClusterResponse{}, runtime.NewResponseError(resp) + } + return client.listByClusterHandleResponse(resp) + }, + }) +} + +// listByClusterCreateRequest creates the ListByCluster request. +func (client *PublishersClient) listByClusterCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, options *PublishersClientListByClusterOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/publishers" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if clusterName == "" { + return nil, errors.New("parameter clusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByClusterHandleResponse handles the ListByCluster response. +func (client *PublishersClient) listByClusterHandleResponse(resp *http.Response) (PublishersClientListByClusterResponse, error) { + result := PublishersClientListByClusterResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PublisherList); err != nil { + return PublishersClientListByClusterResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/azurestackhci/armazurestackhci/response_types.go b/sdk/resourcemanager/azurestackhci/armazurestackhci/response_types.go index 34f9e3a7a8b6..6db8a7c03afa 100644 --- a/sdk/resourcemanager/azurestackhci/armazurestackhci/response_types.go +++ b/sdk/resourcemanager/azurestackhci/armazurestackhci/response_types.go @@ -3,19 +3,26 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armazurestackhci +// ArcSettingsClientConsentAndInstallDefaultExtensionsResponse contains the response from method ArcSettingsClient.ConsentAndInstallDefaultExtensions. +type ArcSettingsClientConsentAndInstallDefaultExtensionsResponse struct { + // ArcSetting details. + ArcSetting +} + // ArcSettingsClientCreateIdentityResponse contains the response from method ArcSettingsClient.BeginCreateIdentity. type ArcSettingsClientCreateIdentityResponse struct { + // ArcIdentity details. ArcIdentityResponse } // ArcSettingsClientCreateResponse contains the response from method ArcSettingsClient.Create. type ArcSettingsClientCreateResponse struct { + // ArcSetting details. ArcSetting } @@ -31,26 +38,36 @@ type ArcSettingsClientGeneratePasswordResponse struct { // ArcSettingsClientGetResponse contains the response from method ArcSettingsClient.Get. type ArcSettingsClientGetResponse struct { + // ArcSetting details. ArcSetting } +// ArcSettingsClientInitializeDisableProcessResponse contains the response from method ArcSettingsClient.BeginInitializeDisableProcess. +type ArcSettingsClientInitializeDisableProcessResponse struct { + // placeholder for future response values +} + // ArcSettingsClientListByClusterResponse contains the response from method ArcSettingsClient.NewListByClusterPager. type ArcSettingsClientListByClusterResponse struct { + // List of ArcSetting proxy resources for the HCI cluster. ArcSettingList } // ArcSettingsClientUpdateResponse contains the response from method ArcSettingsClient.Update. type ArcSettingsClientUpdateResponse struct { + // ArcSetting details. ArcSetting } // ClustersClientCreateIdentityResponse contains the response from method ClustersClient.BeginCreateIdentity. type ClustersClientCreateIdentityResponse struct { + // Cluster Identity details. ClusterIdentityResponse } // ClustersClientCreateResponse contains the response from method ClustersClient.Create. type ClustersClientCreateResponse struct { + // Cluster details. Cluster } @@ -59,23 +76,33 @@ type ClustersClientDeleteResponse struct { // placeholder for future response values } +// ClustersClientExtendSoftwareAssuranceBenefitResponse contains the response from method ClustersClient.BeginExtendSoftwareAssuranceBenefit. +type ClustersClientExtendSoftwareAssuranceBenefitResponse struct { + // Cluster details. + Cluster +} + // ClustersClientGetResponse contains the response from method ClustersClient.Get. type ClustersClientGetResponse struct { + // Cluster details. Cluster } // ClustersClientListByResourceGroupResponse contains the response from method ClustersClient.NewListByResourceGroupPager. type ClustersClientListByResourceGroupResponse struct { + // List of clusters. ClusterList } // ClustersClientListBySubscriptionResponse contains the response from method ClustersClient.NewListBySubscriptionPager. type ClustersClientListBySubscriptionResponse struct { + // List of clusters. ClusterList } // ClustersClientUpdateResponse contains the response from method ClustersClient.Update. type ClustersClientUpdateResponse struct { + // Cluster details. Cluster } @@ -86,6 +113,7 @@ type ClustersClientUploadCertificateResponse struct { // ExtensionsClientCreateResponse contains the response from method ExtensionsClient.BeginCreate. type ExtensionsClientCreateResponse struct { + // Details of a particular extension in HCI Cluster. Extension } @@ -96,20 +124,145 @@ type ExtensionsClientDeleteResponse struct { // ExtensionsClientGetResponse contains the response from method ExtensionsClient.Get. type ExtensionsClientGetResponse struct { + // Details of a particular extension in HCI Cluster. Extension } // ExtensionsClientListByArcSettingResponse contains the response from method ExtensionsClient.NewListByArcSettingPager. type ExtensionsClientListByArcSettingResponse struct { + // List of Extensions in HCI cluster. ExtensionList } // ExtensionsClientUpdateResponse contains the response from method ExtensionsClient.BeginUpdate. type ExtensionsClientUpdateResponse struct { + // Details of a particular extension in HCI Cluster. Extension } +// ExtensionsClientUpgradeResponse contains the response from method ExtensionsClient.BeginUpgrade. +type ExtensionsClientUpgradeResponse struct { + // placeholder for future response values +} + +// OffersClientGetResponse contains the response from method OffersClient.Get. +type OffersClientGetResponse struct { + // Offer details. + Offer +} + +// OffersClientListByClusterResponse contains the response from method OffersClient.NewListByClusterPager. +type OffersClientListByClusterResponse struct { + // List of Offer proxy resources for the HCI cluster. + OfferList +} + +// OffersClientListByPublisherResponse contains the response from method OffersClient.NewListByPublisherPager. +type OffersClientListByPublisherResponse struct { + // List of Offer proxy resources for the HCI cluster. + OfferList +} + // OperationsClientListResponse contains the response from method OperationsClient.List. type OperationsClientListResponse struct { + // A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. OperationListResult } + +// PublishersClientGetResponse contains the response from method PublishersClient.Get. +type PublishersClientGetResponse struct { + // Publisher details. + Publisher +} + +// PublishersClientListByClusterResponse contains the response from method PublishersClient.NewListByClusterPager. +type PublishersClientListByClusterResponse struct { + // List of Publisher proxy resources for the HCI cluster. + PublisherList +} + +// SKUsClientGetResponse contains the response from method SKUsClient.Get. +type SKUsClientGetResponse struct { + // Sku details. + SKU +} + +// SKUsClientListByOfferResponse contains the response from method SKUsClient.NewListByOfferPager. +type SKUsClientListByOfferResponse struct { + // List of SKU proxy resources for the HCI cluster. + SKUList +} + +// UpdateRunsClientDeleteResponse contains the response from method UpdateRunsClient.BeginDelete. +type UpdateRunsClientDeleteResponse struct { + // placeholder for future response values +} + +// UpdateRunsClientGetResponse contains the response from method UpdateRunsClient.Get. +type UpdateRunsClientGetResponse struct { + // Details of an Update run + UpdateRun +} + +// UpdateRunsClientListResponse contains the response from method UpdateRunsClient.NewListPager. +type UpdateRunsClientListResponse struct { + // List of Update runs + UpdateRunList +} + +// UpdateRunsClientPutResponse contains the response from method UpdateRunsClient.Put. +type UpdateRunsClientPutResponse struct { + // Details of an Update run + UpdateRun +} + +// UpdateSummariesClientDeleteResponse contains the response from method UpdateSummariesClient.BeginDelete. +type UpdateSummariesClientDeleteResponse struct { + // placeholder for future response values +} + +// UpdateSummariesClientGetResponse contains the response from method UpdateSummariesClient.Get. +type UpdateSummariesClientGetResponse struct { + // Get the update summaries for the cluster + UpdateSummaries +} + +// UpdateSummariesClientListResponse contains the response from method UpdateSummariesClient.NewListPager. +type UpdateSummariesClientListResponse struct { + // List of Update Summaries + UpdateSummariesList +} + +// UpdateSummariesClientPutResponse contains the response from method UpdateSummariesClient.Put. +type UpdateSummariesClientPutResponse struct { + // Get the update summaries for the cluster + UpdateSummaries +} + +// UpdatesClientDeleteResponse contains the response from method UpdatesClient.BeginDelete. +type UpdatesClientDeleteResponse struct { + // placeholder for future response values +} + +// UpdatesClientGetResponse contains the response from method UpdatesClient.Get. +type UpdatesClientGetResponse struct { + // Update details + Update +} + +// UpdatesClientListResponse contains the response from method UpdatesClient.NewListPager. +type UpdatesClientListResponse struct { + // List of Updates + UpdateList +} + +// UpdatesClientPostResponse contains the response from method UpdatesClient.BeginPost. +type UpdatesClientPostResponse struct { + // placeholder for future response values +} + +// UpdatesClientPutResponse contains the response from method UpdatesClient.Put. +type UpdatesClientPutResponse struct { + // Update details + Update +} diff --git a/sdk/resourcemanager/azurestackhci/armazurestackhci/skus_client.go b/sdk/resourcemanager/azurestackhci/armazurestackhci/skus_client.go new file mode 100644 index 000000000000..7c9024d23c4b --- /dev/null +++ b/sdk/resourcemanager/azurestackhci/armazurestackhci/skus_client.go @@ -0,0 +1,204 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armazurestackhci + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// SKUsClient contains the methods for the SKUs group. +// Don't use this type directly, use NewSKUsClient() instead. +type SKUsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewSKUsClient creates a new instance of SKUsClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewSKUsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SKUsClient, error) { + cl, err := arm.NewClient(moduleName+".SKUsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &SKUsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Get - Get SKU resource details within a offer of HCI Cluster. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - clusterName - The name of the cluster. +// - publisherName - The name of the publisher available within HCI cluster. +// - offerName - The name of the offer available within HCI cluster. +// - skuName - The name of the SKU available within HCI cluster. +// - options - SKUsClientGetOptions contains the optional parameters for the SKUsClient.Get method. +func (client *SKUsClient) Get(ctx context.Context, resourceGroupName string, clusterName string, publisherName string, offerName string, skuName string, options *SKUsClientGetOptions) (SKUsClientGetResponse, error) { + var err error + req, err := client.getCreateRequest(ctx, resourceGroupName, clusterName, publisherName, offerName, skuName, options) + if err != nil { + return SKUsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return SKUsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SKUsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *SKUsClient) getCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, publisherName string, offerName string, skuName string, options *SKUsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/publishers/{publisherName}/offers/{offerName}/skus/{skuName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if clusterName == "" { + return nil, errors.New("parameter clusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) + if publisherName == "" { + return nil, errors.New("parameter publisherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) + if offerName == "" { + return nil, errors.New("parameter offerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{offerName}", url.PathEscape(offerName)) + if skuName == "" { + return nil, errors.New("parameter skuName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{skuName}", url.PathEscape(skuName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-01") + if options != nil && options.Expand != nil { + reqQP.Set("$expand", *options.Expand) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *SKUsClient) getHandleResponse(resp *http.Response) (SKUsClientGetResponse, error) { + result := SKUsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SKU); err != nil { + return SKUsClientGetResponse{}, err + } + return result, nil +} + +// NewListByOfferPager - List Skus available for a offer within the HCI Cluster. +// +// Generated from API version 2023-06-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - clusterName - The name of the cluster. +// - publisherName - The name of the publisher available within HCI cluster. +// - offerName - The name of the offer available within HCI cluster. +// - options - SKUsClientListByOfferOptions contains the optional parameters for the SKUsClient.NewListByOfferPager method. +func (client *SKUsClient) NewListByOfferPager(resourceGroupName string, clusterName string, publisherName string, offerName string, options *SKUsClientListByOfferOptions) *runtime.Pager[SKUsClientListByOfferResponse] { + return runtime.NewPager(runtime.PagingHandler[SKUsClientListByOfferResponse]{ + More: func(page SKUsClientListByOfferResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *SKUsClientListByOfferResponse) (SKUsClientListByOfferResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByOfferCreateRequest(ctx, resourceGroupName, clusterName, publisherName, offerName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return SKUsClientListByOfferResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return SKUsClientListByOfferResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SKUsClientListByOfferResponse{}, runtime.NewResponseError(resp) + } + return client.listByOfferHandleResponse(resp) + }, + }) +} + +// listByOfferCreateRequest creates the ListByOffer request. +func (client *SKUsClient) listByOfferCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, publisherName string, offerName string, options *SKUsClientListByOfferOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/publishers/{publisherName}/offers/{offerName}/skus" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if clusterName == "" { + return nil, errors.New("parameter clusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) + if publisherName == "" { + return nil, errors.New("parameter publisherName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) + if offerName == "" { + return nil, errors.New("parameter offerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{offerName}", url.PathEscape(offerName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-01") + if options != nil && options.Expand != nil { + reqQP.Set("$expand", *options.Expand) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByOfferHandleResponse handles the ListByOffer response. +func (client *SKUsClient) listByOfferHandleResponse(resp *http.Response) (SKUsClientListByOfferResponse, error) { + result := SKUsClientListByOfferResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SKUList); err != nil { + return SKUsClientListByOfferResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/azurestackhci/armazurestackhci/time_rfc3339.go b/sdk/resourcemanager/azurestackhci/armazurestackhci/time_rfc3339.go index 4e74083db8c9..f48465f7eb74 100644 --- a/sdk/resourcemanager/azurestackhci/armazurestackhci/time_rfc3339.go +++ b/sdk/resourcemanager/azurestackhci/armazurestackhci/time_rfc3339.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armazurestackhci diff --git a/sdk/resourcemanager/azurestackhci/armazurestackhci/updateruns_client.go b/sdk/resourcemanager/azurestackhci/armazurestackhci/updateruns_client.go new file mode 100644 index 000000000000..c7ec21fcae67 --- /dev/null +++ b/sdk/resourcemanager/azurestackhci/armazurestackhci/updateruns_client.go @@ -0,0 +1,341 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armazurestackhci + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// UpdateRunsClient contains the methods for the UpdateRuns group. +// Don't use this type directly, use NewUpdateRunsClient() instead. +type UpdateRunsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewUpdateRunsClient creates a new instance of UpdateRunsClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewUpdateRunsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*UpdateRunsClient, error) { + cl, err := arm.NewClient(moduleName+".UpdateRunsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &UpdateRunsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginDelete - Delete specified Update Run +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - clusterName - The name of the cluster. +// - updateName - The name of the Update +// - updateRunName - The name of the Update Run +// - options - UpdateRunsClientBeginDeleteOptions contains the optional parameters for the UpdateRunsClient.BeginDelete method. +func (client *UpdateRunsClient) BeginDelete(ctx context.Context, resourceGroupName string, clusterName string, updateName string, updateRunName string, options *UpdateRunsClientBeginDeleteOptions) (*runtime.Poller[UpdateRunsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, clusterName, updateName, updateRunName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[UpdateRunsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[UpdateRunsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Delete specified Update Run +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01 +func (client *UpdateRunsClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, updateName string, updateRunName string, options *UpdateRunsClientBeginDeleteOptions) (*http.Response, error) { + var err error + req, err := client.deleteCreateRequest(ctx, resourceGroupName, clusterName, updateName, updateRunName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *UpdateRunsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, updateName string, updateRunName string, options *UpdateRunsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates/{updateName}/updateRuns/{updateRunName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if clusterName == "" { + return nil, errors.New("parameter clusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) + if updateName == "" { + return nil, errors.New("parameter updateName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{updateName}", url.PathEscape(updateName)) + if updateRunName == "" { + return nil, errors.New("parameter updateRunName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{updateRunName}", url.PathEscape(updateRunName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get the Update run for a specified update +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - clusterName - The name of the cluster. +// - updateName - The name of the Update +// - updateRunName - The name of the Update Run +// - options - UpdateRunsClientGetOptions contains the optional parameters for the UpdateRunsClient.Get method. +func (client *UpdateRunsClient) Get(ctx context.Context, resourceGroupName string, clusterName string, updateName string, updateRunName string, options *UpdateRunsClientGetOptions) (UpdateRunsClientGetResponse, error) { + var err error + req, err := client.getCreateRequest(ctx, resourceGroupName, clusterName, updateName, updateRunName, options) + if err != nil { + return UpdateRunsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return UpdateRunsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return UpdateRunsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *UpdateRunsClient) getCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, updateName string, updateRunName string, options *UpdateRunsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates/{updateName}/updateRuns/{updateRunName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if clusterName == "" { + return nil, errors.New("parameter clusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) + if updateName == "" { + return nil, errors.New("parameter updateName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{updateName}", url.PathEscape(updateName)) + if updateRunName == "" { + return nil, errors.New("parameter updateRunName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{updateRunName}", url.PathEscape(updateRunName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *UpdateRunsClient) getHandleResponse(resp *http.Response) (UpdateRunsClientGetResponse, error) { + result := UpdateRunsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.UpdateRun); err != nil { + return UpdateRunsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - List all Update runs for a specified update +// +// Generated from API version 2023-06-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - clusterName - The name of the cluster. +// - updateName - The name of the Update +// - options - UpdateRunsClientListOptions contains the optional parameters for the UpdateRunsClient.NewListPager method. +func (client *UpdateRunsClient) NewListPager(resourceGroupName string, clusterName string, updateName string, options *UpdateRunsClientListOptions) *runtime.Pager[UpdateRunsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[UpdateRunsClientListResponse]{ + More: func(page UpdateRunsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *UpdateRunsClientListResponse) (UpdateRunsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, clusterName, updateName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return UpdateRunsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return UpdateRunsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return UpdateRunsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *UpdateRunsClient) listCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, updateName string, options *UpdateRunsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates/{updateName}/updateRuns" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if clusterName == "" { + return nil, errors.New("parameter clusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) + if updateName == "" { + return nil, errors.New("parameter updateName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{updateName}", url.PathEscape(updateName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *UpdateRunsClient) listHandleResponse(resp *http.Response) (UpdateRunsClientListResponse, error) { + result := UpdateRunsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.UpdateRunList); err != nil { + return UpdateRunsClientListResponse{}, err + } + return result, nil +} + +// Put - Put Update runs for a specified update +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - clusterName - The name of the cluster. +// - updateName - The name of the Update +// - updateRunName - The name of the Update Run +// - updateRunsProperties - Properties of the updateRuns object +// - options - UpdateRunsClientPutOptions contains the optional parameters for the UpdateRunsClient.Put method. +func (client *UpdateRunsClient) Put(ctx context.Context, resourceGroupName string, clusterName string, updateName string, updateRunName string, updateRunsProperties UpdateRun, options *UpdateRunsClientPutOptions) (UpdateRunsClientPutResponse, error) { + var err error + req, err := client.putCreateRequest(ctx, resourceGroupName, clusterName, updateName, updateRunName, updateRunsProperties, options) + if err != nil { + return UpdateRunsClientPutResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return UpdateRunsClientPutResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return UpdateRunsClientPutResponse{}, err + } + resp, err := client.putHandleResponse(httpResp) + return resp, err +} + +// putCreateRequest creates the Put request. +func (client *UpdateRunsClient) putCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, updateName string, updateRunName string, updateRunsProperties UpdateRun, options *UpdateRunsClientPutOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates/{updateName}/updateRuns/{updateRunName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if clusterName == "" { + return nil, errors.New("parameter clusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) + if updateName == "" { + return nil, errors.New("parameter updateName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{updateName}", url.PathEscape(updateName)) + if updateRunName == "" { + return nil, errors.New("parameter updateRunName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{updateRunName}", url.PathEscape(updateRunName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, updateRunsProperties); err != nil { + return nil, err + } + return req, nil +} + +// putHandleResponse handles the Put response. +func (client *UpdateRunsClient) putHandleResponse(resp *http.Response) (UpdateRunsClientPutResponse, error) { + result := UpdateRunsClientPutResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.UpdateRun); err != nil { + return UpdateRunsClientPutResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/azurestackhci/armazurestackhci/updates_client.go b/sdk/resourcemanager/azurestackhci/armazurestackhci/updates_client.go new file mode 100644 index 000000000000..e92201c6a88e --- /dev/null +++ b/sdk/resourcemanager/azurestackhci/armazurestackhci/updates_client.go @@ -0,0 +1,395 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armazurestackhci + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// UpdatesClient contains the methods for the Updates group. +// Don't use this type directly, use NewUpdatesClient() instead. +type UpdatesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewUpdatesClient creates a new instance of UpdatesClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewUpdatesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*UpdatesClient, error) { + cl, err := arm.NewClient(moduleName+".UpdatesClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &UpdatesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginDelete - Delete specified Update +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - clusterName - The name of the cluster. +// - updateName - The name of the Update +// - options - UpdatesClientBeginDeleteOptions contains the optional parameters for the UpdatesClient.BeginDelete method. +func (client *UpdatesClient) BeginDelete(ctx context.Context, resourceGroupName string, clusterName string, updateName string, options *UpdatesClientBeginDeleteOptions) (*runtime.Poller[UpdatesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, clusterName, updateName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[UpdatesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[UpdatesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Delete specified Update +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01 +func (client *UpdatesClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, updateName string, options *UpdatesClientBeginDeleteOptions) (*http.Response, error) { + var err error + req, err := client.deleteCreateRequest(ctx, resourceGroupName, clusterName, updateName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *UpdatesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, updateName string, options *UpdatesClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates/{updateName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if clusterName == "" { + return nil, errors.New("parameter clusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) + if updateName == "" { + return nil, errors.New("parameter updateName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{updateName}", url.PathEscape(updateName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get specified Update +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - clusterName - The name of the cluster. +// - updateName - The name of the Update +// - options - UpdatesClientGetOptions contains the optional parameters for the UpdatesClient.Get method. +func (client *UpdatesClient) Get(ctx context.Context, resourceGroupName string, clusterName string, updateName string, options *UpdatesClientGetOptions) (UpdatesClientGetResponse, error) { + var err error + req, err := client.getCreateRequest(ctx, resourceGroupName, clusterName, updateName, options) + if err != nil { + return UpdatesClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return UpdatesClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return UpdatesClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *UpdatesClient) getCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, updateName string, options *UpdatesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates/{updateName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if clusterName == "" { + return nil, errors.New("parameter clusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) + if updateName == "" { + return nil, errors.New("parameter updateName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{updateName}", url.PathEscape(updateName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *UpdatesClient) getHandleResponse(resp *http.Response) (UpdatesClientGetResponse, error) { + result := UpdatesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Update); err != nil { + return UpdatesClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - List all Updates +// +// Generated from API version 2023-06-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - clusterName - The name of the cluster. +// - options - UpdatesClientListOptions contains the optional parameters for the UpdatesClient.NewListPager method. +func (client *UpdatesClient) NewListPager(resourceGroupName string, clusterName string, options *UpdatesClientListOptions) *runtime.Pager[UpdatesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[UpdatesClientListResponse]{ + More: func(page UpdatesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *UpdatesClientListResponse) (UpdatesClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, clusterName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return UpdatesClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return UpdatesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return UpdatesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *UpdatesClient) listCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, options *UpdatesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if clusterName == "" { + return nil, errors.New("parameter clusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *UpdatesClient) listHandleResponse(resp *http.Response) (UpdatesClientListResponse, error) { + result := UpdatesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.UpdateList); err != nil { + return UpdatesClientListResponse{}, err + } + return result, nil +} + +// BeginPost - Apply Update +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - clusterName - The name of the cluster. +// - updateName - The name of the Update +// - options - UpdatesClientBeginPostOptions contains the optional parameters for the UpdatesClient.BeginPost method. +func (client *UpdatesClient) BeginPost(ctx context.Context, resourceGroupName string, clusterName string, updateName string, options *UpdatesClientBeginPostOptions) (*runtime.Poller[UpdatesClientPostResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.post(ctx, resourceGroupName, clusterName, updateName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[UpdatesClientPostResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[UpdatesClientPostResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Post - Apply Update +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01 +func (client *UpdatesClient) post(ctx context.Context, resourceGroupName string, clusterName string, updateName string, options *UpdatesClientBeginPostOptions) (*http.Response, error) { + var err error + req, err := client.postCreateRequest(ctx, resourceGroupName, clusterName, updateName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// postCreateRequest creates the Post request. +func (client *UpdatesClient) postCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, updateName string, options *UpdatesClientBeginPostOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates/{updateName}/apply" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if clusterName == "" { + return nil, errors.New("parameter clusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) + if updateName == "" { + return nil, errors.New("parameter updateName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{updateName}", url.PathEscape(updateName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Put - Put specified Update +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - clusterName - The name of the cluster. +// - updateName - The name of the Update +// - updateProperties - Properties of the Updates object +// - options - UpdatesClientPutOptions contains the optional parameters for the UpdatesClient.Put method. +func (client *UpdatesClient) Put(ctx context.Context, resourceGroupName string, clusterName string, updateName string, updateProperties Update, options *UpdatesClientPutOptions) (UpdatesClientPutResponse, error) { + var err error + req, err := client.putCreateRequest(ctx, resourceGroupName, clusterName, updateName, updateProperties, options) + if err != nil { + return UpdatesClientPutResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return UpdatesClientPutResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return UpdatesClientPutResponse{}, err + } + resp, err := client.putHandleResponse(httpResp) + return resp, err +} + +// putCreateRequest creates the Put request. +func (client *UpdatesClient) putCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, updateName string, updateProperties Update, options *UpdatesClientPutOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates/{updateName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if clusterName == "" { + return nil, errors.New("parameter clusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) + if updateName == "" { + return nil, errors.New("parameter updateName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{updateName}", url.PathEscape(updateName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, updateProperties); err != nil { + return nil, err + } + return req, nil +} + +// putHandleResponse handles the Put response. +func (client *UpdatesClient) putHandleResponse(resp *http.Response) (UpdatesClientPutResponse, error) { + result := UpdatesClientPutResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Update); err != nil { + return UpdatesClientPutResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/azurestackhci/armazurestackhci/updatesummaries_client.go b/sdk/resourcemanager/azurestackhci/armazurestackhci/updatesummaries_client.go new file mode 100644 index 000000000000..7d786ddeaeb7 --- /dev/null +++ b/sdk/resourcemanager/azurestackhci/armazurestackhci/updatesummaries_client.go @@ -0,0 +1,308 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armazurestackhci + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// UpdateSummariesClient contains the methods for the UpdateSummaries group. +// Don't use this type directly, use NewUpdateSummariesClient() instead. +type UpdateSummariesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewUpdateSummariesClient creates a new instance of UpdateSummariesClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewUpdateSummariesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*UpdateSummariesClient, error) { + cl, err := arm.NewClient(moduleName+".UpdateSummariesClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &UpdateSummariesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginDelete - Delete Update Summaries +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - clusterName - The name of the cluster. +// - options - UpdateSummariesClientBeginDeleteOptions contains the optional parameters for the UpdateSummariesClient.BeginDelete +// method. +func (client *UpdateSummariesClient) BeginDelete(ctx context.Context, resourceGroupName string, clusterName string, options *UpdateSummariesClientBeginDeleteOptions) (*runtime.Poller[UpdateSummariesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, clusterName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[UpdateSummariesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[UpdateSummariesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Delete Update Summaries +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01 +func (client *UpdateSummariesClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, options *UpdateSummariesClientBeginDeleteOptions) (*http.Response, error) { + var err error + req, err := client.deleteCreateRequest(ctx, resourceGroupName, clusterName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *UpdateSummariesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, options *UpdateSummariesClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updateSummaries/default" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if clusterName == "" { + return nil, errors.New("parameter clusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get all Update summaries under the HCI cluster +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - clusterName - The name of the cluster. +// - options - UpdateSummariesClientGetOptions contains the optional parameters for the UpdateSummariesClient.Get method. +func (client *UpdateSummariesClient) Get(ctx context.Context, resourceGroupName string, clusterName string, options *UpdateSummariesClientGetOptions) (UpdateSummariesClientGetResponse, error) { + var err error + req, err := client.getCreateRequest(ctx, resourceGroupName, clusterName, options) + if err != nil { + return UpdateSummariesClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return UpdateSummariesClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return UpdateSummariesClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *UpdateSummariesClient) getCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, options *UpdateSummariesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updateSummaries/default" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if clusterName == "" { + return nil, errors.New("parameter clusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *UpdateSummariesClient) getHandleResponse(resp *http.Response) (UpdateSummariesClientGetResponse, error) { + result := UpdateSummariesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.UpdateSummaries); err != nil { + return UpdateSummariesClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - List all Update summaries under the HCI cluster +// +// Generated from API version 2023-06-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - clusterName - The name of the cluster. +// - options - UpdateSummariesClientListOptions contains the optional parameters for the UpdateSummariesClient.NewListPager +// method. +func (client *UpdateSummariesClient) NewListPager(resourceGroupName string, clusterName string, options *UpdateSummariesClientListOptions) *runtime.Pager[UpdateSummariesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[UpdateSummariesClientListResponse]{ + More: func(page UpdateSummariesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *UpdateSummariesClientListResponse) (UpdateSummariesClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, clusterName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return UpdateSummariesClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return UpdateSummariesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return UpdateSummariesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *UpdateSummariesClient) listCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, options *UpdateSummariesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updateSummaries" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if clusterName == "" { + return nil, errors.New("parameter clusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *UpdateSummariesClient) listHandleResponse(resp *http.Response) (UpdateSummariesClientListResponse, error) { + result := UpdateSummariesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.UpdateSummariesList); err != nil { + return UpdateSummariesClientListResponse{}, err + } + return result, nil +} + +// Put - Put Update summaries under the HCI cluster +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - clusterName - The name of the cluster. +// - updateLocationProperties - Properties of the UpdateSummaries resource +// - options - UpdateSummariesClientPutOptions contains the optional parameters for the UpdateSummariesClient.Put method. +func (client *UpdateSummariesClient) Put(ctx context.Context, resourceGroupName string, clusterName string, updateLocationProperties UpdateSummaries, options *UpdateSummariesClientPutOptions) (UpdateSummariesClientPutResponse, error) { + var err error + req, err := client.putCreateRequest(ctx, resourceGroupName, clusterName, updateLocationProperties, options) + if err != nil { + return UpdateSummariesClientPutResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return UpdateSummariesClientPutResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return UpdateSummariesClientPutResponse{}, err + } + resp, err := client.putHandleResponse(httpResp) + return resp, err +} + +// putCreateRequest creates the Put request. +func (client *UpdateSummariesClient) putCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, updateLocationProperties UpdateSummaries, options *UpdateSummariesClientPutOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updateSummaries/default" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if clusterName == "" { + return nil, errors.New("parameter clusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, updateLocationProperties); err != nil { + return nil, err + } + return req, nil +} + +// putHandleResponse handles the Put response. +func (client *UpdateSummariesClient) putHandleResponse(resp *http.Response) (UpdateSummariesClientPutResponse, error) { + result := UpdateSummariesClientPutResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.UpdateSummaries); err != nil { + return UpdateSummariesClientPutResponse{}, err + } + return result, nil +}