diff --git a/sdk/resourcemanager/azurestackhci/armazurestackhci/CHANGELOG.md b/sdk/resourcemanager/azurestackhci/armazurestackhci/CHANGELOG.md index c40d6c19337c..c9997aa11dfd 100644 --- a/sdk/resourcemanager/azurestackhci/armazurestackhci/CHANGELOG.md +++ b/sdk/resourcemanager/azurestackhci/armazurestackhci/CHANGELOG.md @@ -1,5 +1,111 @@ # Release History +## 1.2.0 (2023-05-17) +### 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 `RebootRequirement` with values `RebootRequirementFalse`, `RebootRequirementTrue`, `RebootRequirementUnknown` +- 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 `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 `DefaultExtensions` in struct `ArcSettingProperties` +- New field `Identity` in struct `Cluster` +- New field `EhcResourceID`, `LastLicensingTimestamp`, `NodeType`, `OSDisplayVersion` in struct `ClusterNode` +- New field `Identity` in struct `ClusterPatch` +- New field `ResourceProviderObjectID`, `SoftwareAssuranceProperties` in struct `ClusterProperties` +- New field `ClusterType`, `Manufacturer`, `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..d8347d694302 100644 --- a/sdk/resourcemanager/azurestackhci/armazurestackhci/arcsettings_client.go +++ b/sdk/resourcemanager/azurestackhci/armazurestackhci/arcsettings_client.go @@ -44,10 +44,73 @@ 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-03-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) { + req, err := client.consentAndInstallDefaultExtensionsCreateRequest(ctx, resourceGroupName, clusterName, arcSettingName, options) + if err != nil { + return ArcSettingsClientConsentAndInstallDefaultExtensionsResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ArcSettingsClientConsentAndInstallDefaultExtensionsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ArcSettingsClientConsentAndInstallDefaultExtensionsResponse{}, runtime.NewResponseError(resp) + } + return client.consentAndInstallDefaultExtensionsHandleResponse(resp) +} + +// 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-03-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-03-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. @@ -92,7 +155,7 @@ 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-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, arcSetting) @@ -110,7 +173,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-03-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. @@ -133,7 +196,7 @@ 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-03-01 func (client *ArcSettingsClient) createIdentity(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string, options *ArcSettingsClientBeginCreateIdentityOptions) (*http.Response, error) { req, err := client.createIdentityCreateRequest(ctx, resourceGroupName, clusterName, arcSettingName, options) if err != nil { @@ -173,7 +236,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-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -182,7 +245,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-03-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. @@ -204,7 +267,7 @@ 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-03-01 func (client *ArcSettingsClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string, options *ArcSettingsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, clusterName, arcSettingName, options) if err != nil { @@ -244,7 +307,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-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -253,7 +316,7 @@ 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-03-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. @@ -298,7 +361,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-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -316,7 +379,7 @@ 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-03-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. @@ -360,7 +423,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-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -375,9 +438,81 @@ 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-03-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 + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ArcSettingsClientInitializeDisableProcessResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } 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-03-01 +func (client *ArcSettingsClient) initializeDisableProcess(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string, options *ArcSettingsClientBeginInitializeDisableProcessOptions) (*http.Response, error) { + req, err := client.initializeDisableProcessCreateRequest(ctx, resourceGroupName, clusterName, arcSettingName, options) + if err != nil { + return nil, err + } + resp, 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) + } + return resp, 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-03-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-03-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 +565,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-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -448,7 +583,7 @@ 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-03-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. @@ -493,7 +628,7 @@ 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-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, arcSetting) 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..e0d5c1d668f8 100644 --- a/sdk/resourcemanager/azurestackhci/armazurestackhci/client_factory.go +++ b/sdk/resourcemanager/azurestackhci/armazurestackhci/client_factory.go @@ -53,7 +53,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..9a77cac77415 100644 --- a/sdk/resourcemanager/azurestackhci/armazurestackhci/clusters_client.go +++ b/sdk/resourcemanager/azurestackhci/armazurestackhci/clusters_client.go @@ -47,7 +47,7 @@ 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-03-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. @@ -87,7 +87,7 @@ 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-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, cluster) @@ -105,7 +105,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-03-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 @@ -127,7 +127,7 @@ 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-03-01 func (client *ClustersClient) createIdentity(ctx context.Context, resourceGroupName string, clusterName string, options *ClustersClientBeginCreateIdentityOptions) (*http.Response, error) { req, err := client.createIdentityCreateRequest(ctx, resourceGroupName, clusterName, options) if err != nil { @@ -163,7 +163,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-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -172,7 +172,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-03-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. @@ -191,7 +191,7 @@ 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-03-01 func (client *ClustersClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, options *ClustersClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, clusterName, options) if err != nil { @@ -227,16 +227,84 @@ 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-03-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-03-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 + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ClustersClientExtendSoftwareAssuranceBenefitResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } 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-03-01 +func (client *ClustersClient) extendSoftwareAssuranceBenefit(ctx context.Context, resourceGroupName string, clusterName string, softwareAssuranceChangeRequest SoftwareAssuranceChangeRequest, options *ClustersClientBeginExtendSoftwareAssuranceBenefitOptions) (*http.Response, error) { + req, err := client.extendSoftwareAssuranceBenefitCreateRequest(ctx, resourceGroupName, clusterName, softwareAssuranceChangeRequest, options) + if err != nil { + return nil, err + } + resp, 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) + } + return resp, 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-03-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, softwareAssuranceChangeRequest) +} + // 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-03-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. @@ -275,7 +343,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-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -292,7 +360,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-03-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 +408,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-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -357,7 +425,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-03-01 // - options - ClustersClientListBySubscriptionOptions contains the optional parameters for the ClustersClient.NewListBySubscriptionPager // method. func (client *ClustersClient) NewListBySubscriptionPager(options *ClustersClientListBySubscriptionOptions) *runtime.Pager[ClustersClientListBySubscriptionResponse] { @@ -400,7 +468,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-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -418,7 +486,7 @@ 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-03-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. @@ -458,7 +526,7 @@ 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-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, cluster) @@ -476,7 +544,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-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - uploadCertificateRequest - Upload certificate request. @@ -499,7 +567,7 @@ 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-03-01 func (client *ClustersClient) uploadCertificate(ctx context.Context, resourceGroupName string, clusterName string, uploadCertificateRequest UploadCertificateRequest, options *ClustersClientBeginUploadCertificateOptions) (*http.Response, error) { req, err := client.uploadCertificateCreateRequest(ctx, resourceGroupName, clusterName, uploadCertificateRequest, options) if err != nil { @@ -535,7 +603,7 @@ 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-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, uploadCertificateRequest) 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..efa84b156d0b 100644 --- a/sdk/resourcemanager/azurestackhci/armazurestackhci/constants.go +++ b/sdk/resourcemanager/azurestackhci/armazurestackhci/constants.go @@ -11,7 +11,7 @@ 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 +32,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 +47,7 @@ const ( ArcSettingAggregateStateNotSpecified ArcSettingAggregateState = "NotSpecified" ArcSettingAggregateStatePartiallyConnected ArcSettingAggregateState = "PartiallyConnected" ArcSettingAggregateStatePartiallySucceeded ArcSettingAggregateState = "PartiallySucceeded" + ArcSettingAggregateStateProvisioning ArcSettingAggregateState = "Provisioning" ArcSettingAggregateStateSucceeded ArcSettingAggregateState = "Succeeded" ArcSettingAggregateStateUpdating ArcSettingAggregateState = "Updating" ) @@ -52,11 +55,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 +70,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 +152,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 +189,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 +251,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 +323,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,8 +354,12 @@ func PossibleNodeExtensionStateValues() []NodeExtensionState { NodeExtensionStateDisconnected, NodeExtensionStateError, NodeExtensionStateFailed, + NodeExtensionStateInProgress, NodeExtensionStateMoving, NodeExtensionStateNotSpecified, + NodeExtensionStatePartiallyConnected, + NodeExtensionStatePartiallySucceeded, + NodeExtensionStateProvisioning, NodeExtensionStateSucceeded, NodeExtensionStateUpdating, } @@ -261,11 +388,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 +413,140 @@ 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, + } +} + +// 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 +557,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 +571,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..d3447db63636 100644 --- a/sdk/resourcemanager/azurestackhci/armazurestackhci/extensions_client.go +++ b/sdk/resourcemanager/azurestackhci/armazurestackhci/extensions_client.go @@ -47,7 +47,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-03-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. @@ -71,7 +71,7 @@ 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-03-01 func (client *ExtensionsClient) create(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string, extensionName string, extension Extension, options *ExtensionsClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, clusterName, arcSettingName, extensionName, extension, options) if err != nil { @@ -115,7 +115,7 @@ 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-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, extension) @@ -124,7 +124,7 @@ func (client *ExtensionsClient) createCreateRequest(ctx context.Context, resourc // 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-03-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. @@ -147,7 +147,7 @@ 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-03-01 func (client *ExtensionsClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string, extensionName string, options *ExtensionsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, clusterName, arcSettingName, extensionName, options) if err != nil { @@ -191,7 +191,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-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -200,7 +200,7 @@ 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-03-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. @@ -249,7 +249,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-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -266,7 +266,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-03-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 +324,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-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -342,7 +342,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-03-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. @@ -366,7 +366,7 @@ 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-03-01 func (client *ExtensionsClient) update(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string, extensionName string, extension Extension, options *ExtensionsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, clusterName, arcSettingName, extensionName, extension, options) if err != nil { @@ -410,8 +410,85 @@ 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-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, extension) } + +// BeginUpgrade - Upgrade a particular Arc Extension of HCI Cluster. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-03-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 + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExtensionsClientUpgradeResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } 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-03-01 +func (client *ExtensionsClient) upgrade(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string, extensionName string, extensionUpgradeParameters ExtensionUpgradeParameters, options *ExtensionsClientBeginUpgradeOptions) (*http.Response, error) { + req, err := client.upgradeCreateRequest(ctx, resourceGroupName, clusterName, arcSettingName, extensionName, extensionUpgradeParameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, 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-03-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, extensionUpgradeParameters) +} 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..5c342e5cd698 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.4.0 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 + github.com/davecgh/go-spew v1.1.1 // 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 + 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..b6bd7eaad1ba 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/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= +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..dabc29e0d952 100644 --- a/sdk/resourcemanager/azurestackhci/armazurestackhci/models.go +++ b/sdk/resourcemanager/azurestackhci/armazurestackhci/models.go @@ -41,7 +41,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 +80,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 @@ -100,6 +103,19 @@ type ArcSettingsClientBeginDeleteOptions struct { 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 @@ -146,6 +162,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 +177,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 +220,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,6 +241,12 @@ 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 @@ -231,6 +262,9 @@ type ClusterNode struct { // ClusterPatch - Cluster details to update. type ClusterPatch struct { + // Identity of Cluster resource + Identity *ManagedServiceIdentity + // Cluster properties. Properties *ClusterPatchProperties @@ -273,6 +307,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 +331,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 +355,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,8 +367,14 @@ 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 + + // READ-ONLY; Capabilities supported by the cluster. + SupportedCapabilities []*string } // ClustersClientBeginCreateIdentityOptions contains the optional parameters for the ClustersClient.BeginCreateIdentity method. @@ -340,6 +389,13 @@ type ClustersClientBeginDeleteOptions struct { 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 { @@ -374,6 +430,15 @@ type ClustersClientUpdateOptions struct { // placeholder for future optional parameters } +// DefaultExtensionDetails - Properties for a particular default extension category. +type DefaultExtensionDetails struct { + // READ-ONLY; Default extension category + Category *string + + // READ-ONLY; Consent time for extension category + ConsentTime *time.Time +} + // ErrorAdditionalInfo - The resource management error additional info. type ErrorAdditionalInfo struct { // READ-ONLY; The additional info. @@ -419,13 +484,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 +540,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 +558,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 +570,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,6 +580,12 @@ type ExtensionProperties struct { ProvisioningState *ProvisioningState } +// ExtensionUpgradeParameters - Describes the parameters for Extension upgrade. +type ExtensionUpgradeParameters struct { + // Extension Upgrade Target Version. + TargetVersion *string +} + // ExtensionsClientBeginCreateOptions contains the optional parameters for the ExtensionsClient.BeginCreate method. type ExtensionsClientBeginCreateOptions struct { // Resumes the LRO from the provided token. @@ -494,6 +604,12 @@ type ExtensionsClientBeginUpdateOptions struct { 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 @@ -505,6 +621,89 @@ type ExtensionsClientListByArcSettingOptions struct { // placeholder for future optional parameters } +// 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 +} + +// 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 +} + +// 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 +} + +// 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 +} + +// 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 +} + // Operation - Details of a REST API operation, returned from the Resource Provider Operations API type Operation struct { // Localized display information for this particular operation. @@ -559,6 +758,18 @@ 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 { EndDateTime *time.Time KeyID *string @@ -571,11 +782,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 +807,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 +865,56 @@ 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 +} + +// 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 +} + type RawCertificateData struct { Certificates []*string } @@ -615,10 +927,134 @@ 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 +} + +// 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 +} + +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 +1091,327 @@ 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 +} + +// 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 +} + +// 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 } +// 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 +} + +// 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 +} + +// 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 +} + 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..86fe82baf291 100644 --- a/sdk/resourcemanager/azurestackhci/armazurestackhci/models_serde.go +++ b/sdk/resourcemanager/azurestackhci/armazurestackhci/models_serde.go @@ -193,6 +193,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 +229,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 +308,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 +330,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,11 +491,15 @@ 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, "serialNumber", c.SerialNumber) @@ -507,9 +519,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,6 +540,12 @@ 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) @@ -545,6 +569,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 +584,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 +656,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 +712,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 +740,14 @@ 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, "supportedCapabilities", c.SupportedCapabilities) return json.Marshal(objectMap) } @@ -727,6 +766,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 +781,15 @@ 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 "supportedCapabilities": + err = unpopulate(val, "SupportedCapabilities", &c.SupportedCapabilities) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -750,6 +798,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 +973,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 +1090,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 +1112,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 +1146,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 +1167,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 +1184,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 +1480,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 +1558,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 +1577,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,17 +1632,160 @@ 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, "type", p.Type) + 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 ProxyResource. -func (p *ProxyResource) UnmarshalJSON(data []byte) error { +// 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) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResource. +func (p *ProxyResource) 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 "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) @@ -1261,6 +1799,12 @@ func (p *ProxyResource) UnmarshalJSON(data []byte) error { 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 +1816,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 +1906,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 +1926,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 +1940,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 +1960,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 +2014,892 @@ 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 SoftwareAssuranceChangeRequest. +func (s SoftwareAssuranceChangeRequest) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", u.Properties) + populate(objectMap, "properties", s.Properties) 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 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", 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) + 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..ed8a5ee0d92c --- /dev/null +++ b/sdk/resourcemanager/azurestackhci/armazurestackhci/offers_client.go @@ -0,0 +1,266 @@ +//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 + +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-03-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) { + req, err := client.getCreateRequest(ctx, resourceGroupName, clusterName, publisherName, offerName, options) + if err != nil { + return OffersClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return OffersClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return OffersClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// 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-03-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-03-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-03-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-03-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-03-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..4b77d8f638d3 100644 --- a/sdk/resourcemanager/azurestackhci/armazurestackhci/operations_client.go +++ b/sdk/resourcemanager/azurestackhci/armazurestackhci/operations_client.go @@ -41,7 +41,7 @@ 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-03-01 // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. func (client *OperationsClient) List(ctx context.Context, options *OperationsClientListOptions) (OperationsClientListResponse, error) { req, err := client.listCreateRequest(ctx, options) @@ -66,7 +66,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-03-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/publishers_client.go b/sdk/resourcemanager/azurestackhci/armazurestackhci/publishers_client.go new file mode 100644 index 000000000000..4d731e80e17c --- /dev/null +++ b/sdk/resourcemanager/azurestackhci/armazurestackhci/publishers_client.go @@ -0,0 +1,177 @@ +//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 + +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-03-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) { + req, err := client.getCreateRequest(ctx, resourceGroupName, clusterName, publisherName, options) + if err != nil { + return PublishersClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PublishersClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PublishersClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// 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-03-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-03-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-03-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..3487121d8ee2 100644 --- a/sdk/resourcemanager/azurestackhci/armazurestackhci/response_types.go +++ b/sdk/resourcemanager/azurestackhci/armazurestackhci/response_types.go @@ -9,6 +9,11 @@ package armazurestackhci +// ArcSettingsClientConsentAndInstallDefaultExtensionsResponse contains the response from method ArcSettingsClient.ConsentAndInstallDefaultExtensions. +type ArcSettingsClientConsentAndInstallDefaultExtensionsResponse struct { + ArcSetting +} + // ArcSettingsClientCreateIdentityResponse contains the response from method ArcSettingsClient.BeginCreateIdentity. type ArcSettingsClientCreateIdentityResponse struct { ArcIdentityResponse @@ -34,6 +39,11 @@ type ArcSettingsClientGetResponse struct { 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 { ArcSettingList @@ -59,6 +69,11 @@ type ClustersClientDeleteResponse struct { // placeholder for future response values } +// ClustersClientExtendSoftwareAssuranceBenefitResponse contains the response from method ClustersClient.BeginExtendSoftwareAssuranceBenefit. +type ClustersClientExtendSoftwareAssuranceBenefitResponse struct { + Cluster +} + // ClustersClientGetResponse contains the response from method ClustersClient.Get. type ClustersClientGetResponse struct { Cluster @@ -109,7 +124,112 @@ type ExtensionsClientUpdateResponse struct { 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 +} + +// OffersClientListByClusterResponse contains the response from method OffersClient.NewListByClusterPager. +type OffersClientListByClusterResponse struct { + OfferList +} + +// OffersClientListByPublisherResponse contains the response from method OffersClient.NewListByPublisherPager. +type OffersClientListByPublisherResponse struct { + OfferList +} + // OperationsClientListResponse contains the response from method OperationsClient.List. type OperationsClientListResponse struct { OperationListResult } + +// PublishersClientGetResponse contains the response from method PublishersClient.Get. +type PublishersClientGetResponse struct { + Publisher +} + +// PublishersClientListByClusterResponse contains the response from method PublishersClient.NewListByClusterPager. +type PublishersClientListByClusterResponse struct { + PublisherList +} + +// SKUsClientGetResponse contains the response from method SKUsClient.Get. +type SKUsClientGetResponse struct { + SKU +} + +// SKUsClientListByOfferResponse contains the response from method SKUsClient.NewListByOfferPager. +type SKUsClientListByOfferResponse struct { + 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 { + UpdateRun +} + +// UpdateRunsClientListResponse contains the response from method UpdateRunsClient.NewListPager. +type UpdateRunsClientListResponse struct { + UpdateRunList +} + +// UpdateRunsClientPutResponse contains the response from method UpdateRunsClient.Put. +type UpdateRunsClientPutResponse struct { + 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 { + UpdateSummaries +} + +// UpdateSummariesClientListResponse contains the response from method UpdateSummariesClient.NewListPager. +type UpdateSummariesClientListResponse struct { + UpdateSummariesList +} + +// UpdateSummariesClientPutResponse contains the response from method UpdateSummariesClient.Put. +type UpdateSummariesClientPutResponse struct { + 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 +} + +// UpdatesClientListResponse contains the response from method UpdatesClient.NewListPager. +type UpdatesClientListResponse struct { + 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 +} diff --git a/sdk/resourcemanager/azurestackhci/armazurestackhci/skus_client.go b/sdk/resourcemanager/azurestackhci/armazurestackhci/skus_client.go new file mode 100644 index 000000000000..95b21f49b1b7 --- /dev/null +++ b/sdk/resourcemanager/azurestackhci/armazurestackhci/skus_client.go @@ -0,0 +1,202 @@ +//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 + +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-03-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) { + req, err := client.getCreateRequest(ctx, resourceGroupName, clusterName, publisherName, offerName, skuName, options) + if err != nil { + return SKUsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return SKUsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SKUsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// 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-03-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-03-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-03-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/updateruns_client.go b/sdk/resourcemanager/azurestackhci/armazurestackhci/updateruns_client.go new file mode 100644 index 000000000000..3e1276a8596c --- /dev/null +++ b/sdk/resourcemanager/azurestackhci/armazurestackhci/updateruns_client.go @@ -0,0 +1,330 @@ +//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 + +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-03-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 + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[UpdateRunsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } 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-03-01 +func (client *UpdateRunsClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, updateName string, updateRunName string, options *UpdateRunsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, clusterName, updateName, updateRunName, options) + if err != nil { + return nil, err + } + resp, 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) + } + return resp, 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-03-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-03-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) { + req, err := client.getCreateRequest(ctx, resourceGroupName, clusterName, updateName, updateRunName, options) + if err != nil { + return UpdateRunsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return UpdateRunsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return UpdateRunsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// 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-03-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-03-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-03-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-03-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) { + req, err := client.putCreateRequest(ctx, resourceGroupName, clusterName, updateName, updateRunName, updateRunsProperties, options) + if err != nil { + return UpdateRunsClientPutResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return UpdateRunsClientPutResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return UpdateRunsClientPutResponse{}, runtime.NewResponseError(resp) + } + return client.putHandleResponse(resp) +} + +// 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-03-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, updateRunsProperties) +} + +// 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..97b8333c3706 --- /dev/null +++ b/sdk/resourcemanager/azurestackhci/armazurestackhci/updates_client.go @@ -0,0 +1,381 @@ +//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 + +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-03-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 + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[UpdatesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } 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-03-01 +func (client *UpdatesClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, updateName string, options *UpdatesClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, clusterName, updateName, options) + if err != nil { + return nil, err + } + resp, 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) + } + return resp, 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-03-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-03-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) { + req, err := client.getCreateRequest(ctx, resourceGroupName, clusterName, updateName, options) + if err != nil { + return UpdatesClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return UpdatesClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return UpdatesClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// 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-03-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-03-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-03-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-03-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 + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[UpdatesClientPostResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } 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-03-01 +func (client *UpdatesClient) post(ctx context.Context, resourceGroupName string, clusterName string, updateName string, options *UpdatesClientBeginPostOptions) (*http.Response, error) { + req, err := client.postCreateRequest(ctx, resourceGroupName, clusterName, updateName, options) + if err != nil { + return nil, err + } + resp, 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) + } + return resp, 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-03-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-03-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) { + req, err := client.putCreateRequest(ctx, resourceGroupName, clusterName, updateName, updateProperties, options) + if err != nil { + return UpdatesClientPutResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return UpdatesClientPutResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return UpdatesClientPutResponse{}, runtime.NewResponseError(resp) + } + return client.putHandleResponse(resp) +} + +// 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-03-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, updateProperties) +} + +// 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..669188346317 --- /dev/null +++ b/sdk/resourcemanager/azurestackhci/armazurestackhci/updatesummaries_client.go @@ -0,0 +1,297 @@ +//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 + +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-03-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 + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[UpdateSummariesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } 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-03-01 +func (client *UpdateSummariesClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, options *UpdateSummariesClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, clusterName, options) + if err != nil { + return nil, err + } + resp, 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) + } + return resp, 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-03-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-03-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) { + req, err := client.getCreateRequest(ctx, resourceGroupName, clusterName, options) + if err != nil { + return UpdateSummariesClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return UpdateSummariesClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return UpdateSummariesClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// 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-03-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-03-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-03-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-03-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) { + req, err := client.putCreateRequest(ctx, resourceGroupName, clusterName, updateLocationProperties, options) + if err != nil { + return UpdateSummariesClientPutResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return UpdateSummariesClientPutResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return UpdateSummariesClientPutResponse{}, runtime.NewResponseError(resp) + } + return client.putHandleResponse(resp) +} + +// 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-03-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, updateLocationProperties) +} + +// 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 +}