diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/CHANGELOG.md b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/CHANGELOG.md index e486be525b76..1c5cba60acb3 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/CHANGELOG.md +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/CHANGELOG.md @@ -1,5 +1,157 @@ # Release History +## 3.0.0-beta.1 (2024-09-25) +### Breaking Changes + +- Type of `ApplicationGroup.Identity` has been changed from `*ResourceModelWithAllowedPropertySetIdentity` to `*ManagedServiceIdentity` +- Type of `ApplicationGroup.Plan` has been changed from `*ResourceModelWithAllowedPropertySetPlan` to `*Plan` +- Type of `ApplicationGroup.SKU` has been changed from `*ResourceModelWithAllowedPropertySetSKU` to `*SKU` +- Type of `HostPool.Identity` has been changed from `*ResourceModelWithAllowedPropertySetIdentity` to `*ManagedServiceIdentity` +- Type of `HostPool.Plan` has been changed from `*ResourceModelWithAllowedPropertySetPlan` to `*Plan` +- Type of `HostPool.SKU` has been changed from `*ResourceModelWithAllowedPropertySetSKU` to `*SKU` +- Type of `ScalingPlan.Identity` has been changed from `*ResourceModelWithAllowedPropertySetIdentity` to `*ManagedServiceIdentity` +- Type of `ScalingPlan.Plan` has been changed from `*ResourceModelWithAllowedPropertySetPlan` to `*Plan` +- Type of `ScalingPlan.SKU` has been changed from `*ResourceModelWithAllowedPropertySetSKU` to `*SKU` +- Type of `Workspace.Identity` has been changed from `*ResourceModelWithAllowedPropertySetIdentity` to `*ManagedServiceIdentity` +- Type of `Workspace.Plan` has been changed from `*ResourceModelWithAllowedPropertySetPlan` to `*Plan` +- Type of `Workspace.SKU` has been changed from `*ResourceModelWithAllowedPropertySetSKU` to `*SKU` +- Struct `ResourceModelWithAllowedPropertySetIdentity` has been removed +- Struct `ResourceModelWithAllowedPropertySetPlan` has been removed +- Struct `ResourceModelWithAllowedPropertySetSKU` has been removed + +### Features Added + +- New value `LoadBalancerTypeMultiplePersistent` added to enum type `LoadBalancerType` +- New value `ScalingHostPoolTypePersonal` added to enum type `ScalingHostPoolType` +- New enum type `AppAttachPackageArchitectures` with values `AppAttachPackageArchitecturesALL`, `AppAttachPackageArchitecturesARM`, `AppAttachPackageArchitecturesARM64`, `AppAttachPackageArchitecturesNeutral`, `AppAttachPackageArchitecturesX64`, `AppAttachPackageArchitecturesX86`, `AppAttachPackageArchitecturesX86A64` +- New enum type `DirectUDP` with values `DirectUDPDefault`, `DirectUDPDisabled`, `DirectUDPEnabled` +- New enum type `DomainJoinType` with values `DomainJoinTypeActiveDirectory`, `DomainJoinTypeAzureActiveDirectory` +- New enum type `FailHealthCheckOnStagingFailure` with values `FailHealthCheckOnStagingFailureDoNotFail`, `FailHealthCheckOnStagingFailureNeedsAssistance`, `FailHealthCheckOnStagingFailureUnhealthy` +- New enum type `HostPoolUpdateAction` with values `HostPoolUpdateActionCancel`, `HostPoolUpdateActionPause`, `HostPoolUpdateActionResume`, `HostPoolUpdateActionRetry`, `HostPoolUpdateActionStart` +- New enum type `ManagedPrivateUDP` with values `ManagedPrivateUDPDefault`, `ManagedPrivateUDPDisabled`, `ManagedPrivateUDPEnabled` +- New enum type `ManagedServiceIdentityType` with values `ManagedServiceIdentityTypeNone`, `ManagedServiceIdentityTypeSystemAssigned`, `ManagedServiceIdentityTypeSystemAssignedUserAssigned`, `ManagedServiceIdentityTypeUserAssigned` +- New enum type `ManagementType` with values `ManagementTypeAutomated`, `ManagementTypeStandard` +- New enum type `PackageTimestamped` with values `PackageTimestampedNotTimestamped`, `PackageTimestampedTimestamped` +- New enum type `ProvisioningState` with values `ProvisioningStateCanceled`, `ProvisioningStateFailed`, `ProvisioningStateProvisioning`, `ProvisioningStateSucceeded` +- New enum type `ProvisioningStateSHC` with values `ProvisioningStateSHCCanceled`, `ProvisioningStateSHCFailed`, `ProvisioningStateSHCProvisioning`, `ProvisioningStateSHCSucceeded` +- New enum type `PublicUDP` with values `PublicUDPDefault`, `PublicUDPDisabled`, `PublicUDPEnabled` +- New enum type `RelayUDP` with values `RelayUDPDefault`, `RelayUDPDisabled`, `RelayUDPEnabled` +- New enum type `Type` with values `TypeCustom`, `TypeMarketplace` +- New enum type `VirtualMachineDiskType` with values `VirtualMachineDiskTypePremiumLRS`, `VirtualMachineDiskTypeStandardLRS`, `VirtualMachineDiskTypeStandardSSDLRS` +- New enum type `VirtualMachineSecurityType` with values `VirtualMachineSecurityTypeConfidentialVM`, `VirtualMachineSecurityTypeStandard`, `VirtualMachineSecurityTypeTrustedLaunch` +- New function `NewActiveSessionHostConfigurationsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ActiveSessionHostConfigurationsClient, error)` +- New function `*ActiveSessionHostConfigurationsClient.Get(context.Context, string, string, *ActiveSessionHostConfigurationsClientGetOptions) (ActiveSessionHostConfigurationsClientGetResponse, error)` +- New function `*ActiveSessionHostConfigurationsClient.NewListByHostPoolPager(string, string, *ActiveSessionHostConfigurationsClientListByHostPoolOptions) *runtime.Pager[ActiveSessionHostConfigurationsClientListByHostPoolResponse]` +- New function `NewAppAttachPackageClient(string, azcore.TokenCredential, *arm.ClientOptions) (*AppAttachPackageClient, error)` +- New function `*AppAttachPackageClient.CreateOrUpdate(context.Context, string, string, AppAttachPackage, *AppAttachPackageClientCreateOrUpdateOptions) (AppAttachPackageClientCreateOrUpdateResponse, error)` +- New function `*AppAttachPackageClient.Delete(context.Context, string, string, *AppAttachPackageClientDeleteOptions) (AppAttachPackageClientDeleteResponse, error)` +- New function `*AppAttachPackageClient.Get(context.Context, string, string, *AppAttachPackageClientGetOptions) (AppAttachPackageClientGetResponse, error)` +- New function `*AppAttachPackageClient.NewListByResourceGroupPager(string, *AppAttachPackageClientListByResourceGroupOptions) *runtime.Pager[AppAttachPackageClientListByResourceGroupResponse]` +- New function `*AppAttachPackageClient.NewListBySubscriptionPager(*AppAttachPackageClientListBySubscriptionOptions) *runtime.Pager[AppAttachPackageClientListBySubscriptionResponse]` +- New function `*AppAttachPackageClient.Update(context.Context, string, string, *AppAttachPackageClientUpdateOptions) (AppAttachPackageClientUpdateResponse, error)` +- New function `NewAppAttachPackageInfoClient(string, azcore.TokenCredential, *arm.ClientOptions) (*AppAttachPackageInfoClient, error)` +- New function `*AppAttachPackageInfoClient.NewImportPager(string, string, ImportPackageInfoRequest, *AppAttachPackageInfoClientImportOptions) *runtime.Pager[AppAttachPackageInfoClientImportResponse]` +- New function `*ClientFactory.NewActiveSessionHostConfigurationsClient() *ActiveSessionHostConfigurationsClient` +- New function `*ClientFactory.NewAppAttachPackageClient() *AppAttachPackageClient` +- New function `*ClientFactory.NewAppAttachPackageInfoClient() *AppAttachPackageInfoClient` +- New function `*ClientFactory.NewControlSessionHostUpdateClient() *ControlSessionHostUpdateClient` +- New function `*ClientFactory.NewInitiateSessionHostUpdateClient() *InitiateSessionHostUpdateClient` +- New function `*ClientFactory.NewSessionHostClient() *SessionHostClient` +- New function `*ClientFactory.NewSessionHostConfigurationsClient() *SessionHostConfigurationsClient` +- New function `*ClientFactory.NewSessionHostManagementsClient() *SessionHostManagementsClient` +- New function `*ClientFactory.NewSessionHostManagementsUpdateStatusClient() *SessionHostManagementsUpdateStatusClient` +- New function `NewControlSessionHostUpdateClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ControlSessionHostUpdateClient, error)` +- New function `*ControlSessionHostUpdateClient.BeginPost(context.Context, string, string, HostPoolUpdateControlParameter, *ControlSessionHostUpdateClientBeginPostOptions) (*runtime.Poller[ControlSessionHostUpdateClientPostResponse], error)` +- New function `*HostPoolsClient.ListRegistrationTokens(context.Context, string, string, *HostPoolsClientListRegistrationTokensOptions) (HostPoolsClientListRegistrationTokensResponse, error)` +- New function `NewInitiateSessionHostUpdateClient(string, azcore.TokenCredential, *arm.ClientOptions) (*InitiateSessionHostUpdateClient, error)` +- New function `*InitiateSessionHostUpdateClient.Post(context.Context, string, string, *InitiateSessionHostUpdateClientPostOptions) (InitiateSessionHostUpdateClientPostResponse, error)` +- New function `NewSessionHostClient(string, azcore.TokenCredential, *arm.ClientOptions) (*SessionHostClient, error)` +- New function `*SessionHostClient.RetryProvisioning(context.Context, string, string, string, *SessionHostClientRetryProvisioningOptions) (SessionHostClientRetryProvisioningResponse, error)` +- New function `NewSessionHostConfigurationsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*SessionHostConfigurationsClient, error)` +- New function `*SessionHostConfigurationsClient.BeginCreateOrUpdate(context.Context, string, string, SessionHostConfiguration, *SessionHostConfigurationsClientBeginCreateOrUpdateOptions) (*runtime.Poller[SessionHostConfigurationsClientCreateOrUpdateResponse], error)` +- New function `*SessionHostConfigurationsClient.Get(context.Context, string, string, *SessionHostConfigurationsClientGetOptions) (SessionHostConfigurationsClientGetResponse, error)` +- New function `*SessionHostConfigurationsClient.NewListByHostPoolPager(string, string, *SessionHostConfigurationsClientListByHostPoolOptions) *runtime.Pager[SessionHostConfigurationsClientListByHostPoolResponse]` +- New function `*SessionHostConfigurationsClient.BeginUpdate(context.Context, string, string, *SessionHostConfigurationsClientBeginUpdateOptions) (*runtime.Poller[SessionHostConfigurationsClientUpdateResponse], error)` +- New function `NewSessionHostManagementsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*SessionHostManagementsClient, error)` +- New function `*SessionHostManagementsClient.CreateOrUpdate(context.Context, string, string, SessionHostManagement, *SessionHostManagementsClientCreateOrUpdateOptions) (SessionHostManagementsClientCreateOrUpdateResponse, error)` +- New function `*SessionHostManagementsClient.Get(context.Context, string, string, *SessionHostManagementsClientGetOptions) (SessionHostManagementsClientGetResponse, error)` +- New function `*SessionHostManagementsClient.NewListByHostPoolPager(string, string, *SessionHostManagementsClientListByHostPoolOptions) *runtime.Pager[SessionHostManagementsClientListByHostPoolResponse]` +- New function `*SessionHostManagementsClient.Update(context.Context, string, string, *SessionHostManagementsClientUpdateOptions) (SessionHostManagementsClientUpdateResponse, error)` +- New function `NewSessionHostManagementsUpdateStatusClient(string, azcore.TokenCredential, *arm.ClientOptions) (*SessionHostManagementsUpdateStatusClient, error)` +- New function `*SessionHostManagementsUpdateStatusClient.Get(context.Context, string, string, *SessionHostManagementsUpdateStatusClientGetOptions) (SessionHostManagementsUpdateStatusClientGetResponse, error)` +- New struct `ActiveDirectoryInfoPatchProperties` +- New struct `ActiveDirectoryInfoProperties` +- New struct `ActiveSessionHostConfiguration` +- New struct `ActiveSessionHostConfigurationList` +- New struct `ActiveSessionHostConfigurationProperties` +- New struct `AppAttachPackage` +- New struct `AppAttachPackageInfoProperties` +- New struct `AppAttachPackageList` +- New struct `AppAttachPackagePatch` +- New struct `AppAttachPackagePatchProperties` +- New struct `AppAttachPackageProperties` +- New struct `AzureActiveDirectoryInfoProperties` +- New struct `BootDiagnosticsInfoPatchProperties` +- New struct `BootDiagnosticsInfoProperties` +- New struct `CustomInfoPatchProperties` +- New struct `CustomInfoProperties` +- New struct `DiskInfoPatchProperties` +- New struct `DiskInfoProperties` +- New struct `DomainInfoPatchProperties` +- New struct `DomainInfoProperties` +- New struct `ErrorAdditionalInfo` +- New struct `ErrorDetail` +- New struct `HostPoolUpdateConfigurationPatchProperties` +- New struct `HostPoolUpdateConfigurationProperties` +- New struct `HostPoolUpdateControlParameter` +- New struct `ImageInfoPatchProperties` +- New struct `ImageInfoProperties` +- New struct `ImportPackageInfoRequest` +- New struct `KeyVaultCredentialsPatchProperties` +- New struct `KeyVaultCredentialsProperties` +- New struct `ManagedServiceIdentity` +- New struct `MarketplaceInfoPatchProperties` +- New struct `MarketplaceInfoProperties` +- New struct `NetworkInfoPatchProperties` +- New struct `NetworkInfoProperties` +- New struct `Plan` +- New struct `RegistrationTokenList` +- New struct `RegistrationTokenMinimal` +- New struct `SKU` +- New struct `SecurityInfoPatchProperties` +- New struct `SecurityInfoProperties` +- New struct `SessionHostConfiguration` +- New struct `SessionHostConfigurationList` +- New struct `SessionHostConfigurationPatch` +- New struct `SessionHostConfigurationPatchProperties` +- New struct `SessionHostConfigurationProperties` +- New struct `SessionHostManagement` +- New struct `SessionHostManagementList` +- New struct `SessionHostManagementOperationProgress` +- New struct `SessionHostManagementPatch` +- New struct `SessionHostManagementPatchProperties` +- New struct `SessionHostManagementProperties` +- New struct `SessionHostManagementUpdateStatus` +- New struct `SessionHostManagementUpdateStatusProperties` +- New struct `UpdateSessionHostsRequestBody` +- New struct `UserAssignedIdentity` +- New field `SystemData` in struct `ApplicationGroupPatch` +- New field `SystemData` in struct `ExpandMsixImage` +- New field `CertificateExpiry`, `CertificateName` in struct `ExpandMsixImageProperties` +- New field `SystemData` in struct `HostPoolPatch` +- New field `DirectUDP`, `ManagedPrivateUDP`, `PublicUDP`, `RelayUDP` in struct `HostPoolPatchProperties` +- New field `AppAttachPackageReferences`, `DirectUDP`, `ManagedPrivateUDP`, `ManagementType`, `PublicUDP`, `RelayUDP` in struct `HostPoolProperties` +- New field `SystemData` in struct `MSIXPackagePatch` +- New field `SystemData` in struct `PrivateEndpointConnection` +- New field `GroupIDs` in struct `PrivateEndpointConnectionProperties` +- New field `SystemData` in struct `PrivateLinkResource` +- New field `SystemData` in struct `ScalingPlanPooledSchedulePatch` +- New field `SystemData` in struct `SessionHostPatch` +- New field `LastSessionHostUpdateTime`, `SessionHostConfiguration` in struct `SessionHostProperties` +- New field `VMPath` in struct `SessionHostsClientListOptions` +- New field `SystemData` in struct `StartMenuItem` + + ## 2.2.0 (2023-11-24) ### Features Added diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/README.md b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/README.md index bb5ca459adc1..22ca3a510c96 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/README.md +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/README.md @@ -1,6 +1,6 @@ # Azure Virtual Desktop Module for Go -[![PkgGoDev](https://pkg.go.dev/badge/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v2)](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v2) +[![PkgGoDev](https://pkg.go.dev/badge/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v3)](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v3) The `armdesktopvirtualization` module provides operations for working with Azure Virtual Desktop. @@ -20,7 +20,7 @@ This project uses [Go modules](https://github.com/golang/go/wiki/Modules) for ve Install the Azure Virtual Desktop module: ```sh -go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v2 +go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v3 ``` ## Authorization @@ -57,7 +57,7 @@ clientFactory, err := armdesktopvirtualization.NewClientFactory( 0 + }, + Fetcher: func(ctx context.Context, page *ActiveSessionHostConfigurationsClientListByHostPoolResponse) (ActiveSessionHostConfigurationsClientListByHostPoolResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ActiveSessionHostConfigurationsClient.NewListByHostPoolPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listByHostPoolCreateRequest(ctx, resourceGroupName, hostPoolName, options) + }, nil) + if err != nil { + return ActiveSessionHostConfigurationsClientListByHostPoolResponse{}, err + } + return client.listByHostPoolHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listByHostPoolCreateRequest creates the ListByHostPool request. +func (client *ActiveSessionHostConfigurationsClient) listByHostPoolCreateRequest(ctx context.Context, resourceGroupName string, hostPoolName string, options *ActiveSessionHostConfigurationsClientListByHostPoolOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/activeSessionHostConfigurations" + 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 hostPoolName == "" { + return nil, errors.New("parameter hostPoolName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{hostPoolName}", url.PathEscape(hostPoolName)) + 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", "2024-04-08-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByHostPoolHandleResponse handles the ListByHostPool response. +func (client *ActiveSessionHostConfigurationsClient) listByHostPoolHandleResponse(resp *http.Response) (ActiveSessionHostConfigurationsClientListByHostPoolResponse, error) { + result := ActiveSessionHostConfigurationsClientListByHostPoolResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ActiveSessionHostConfigurationList); err != nil { + return ActiveSessionHostConfigurationsClientListByHostPoolResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/appattachpackage_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/appattachpackage_client.go new file mode 100644 index 000000000000..997b6009fe69 --- /dev/null +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/appattachpackage_client.go @@ -0,0 +1,426 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armdesktopvirtualization + +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" + "strconv" + "strings" +) + +// AppAttachPackageClient contains the methods for the AppAttachPackage group. +// Don't use this type directly, use NewAppAttachPackageClient() instead. +type AppAttachPackageClient struct { + internal *arm.Client + subscriptionID string +} + +// NewAppAttachPackageClient creates a new instance of AppAttachPackageClient with the specified values. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewAppAttachPackageClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AppAttachPackageClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &AppAttachPackageClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// CreateOrUpdate - Create or update an App Attach package. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-04-08-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - appAttachPackageName - The name of the App Attach package arm object +// - appAttachPackage - Object containing App Attach Package definitions. +// - options - AppAttachPackageClientCreateOrUpdateOptions contains the optional parameters for the AppAttachPackageClient.CreateOrUpdate +// method. +func (client *AppAttachPackageClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, appAttachPackageName string, appAttachPackage AppAttachPackage, options *AppAttachPackageClientCreateOrUpdateOptions) (AppAttachPackageClientCreateOrUpdateResponse, error) { + var err error + const operationName = "AppAttachPackageClient.CreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, appAttachPackageName, appAttachPackage, options) + if err != nil { + return AppAttachPackageClientCreateOrUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AppAttachPackageClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return AppAttachPackageClientCreateOrUpdateResponse{}, err + } + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *AppAttachPackageClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, appAttachPackageName string, appAttachPackage AppAttachPackage, options *AppAttachPackageClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/appAttachPackages/{appAttachPackageName}" + 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 appAttachPackageName == "" { + return nil, errors.New("parameter appAttachPackageName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{appAttachPackageName}", url.PathEscape(appAttachPackageName)) + 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", "2024-04-08-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, appAttachPackage); err != nil { + return nil, err + } + return req, nil +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *AppAttachPackageClient) createOrUpdateHandleResponse(resp *http.Response) (AppAttachPackageClientCreateOrUpdateResponse, error) { + result := AppAttachPackageClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AppAttachPackage); err != nil { + return AppAttachPackageClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Delete - Remove an App Attach Package. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-04-08-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - appAttachPackageName - The name of the App Attach package arm object +// - options - AppAttachPackageClientDeleteOptions contains the optional parameters for the AppAttachPackageClient.Delete method. +func (client *AppAttachPackageClient) Delete(ctx context.Context, resourceGroupName string, appAttachPackageName string, options *AppAttachPackageClientDeleteOptions) (AppAttachPackageClientDeleteResponse, error) { + var err error + const operationName = "AppAttachPackageClient.Delete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deleteCreateRequest(ctx, resourceGroupName, appAttachPackageName, options) + if err != nil { + return AppAttachPackageClientDeleteResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AppAttachPackageClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return AppAttachPackageClientDeleteResponse{}, err + } + return AppAttachPackageClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *AppAttachPackageClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, appAttachPackageName string, options *AppAttachPackageClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/appAttachPackages/{appAttachPackageName}" + 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 appAttachPackageName == "" { + return nil, errors.New("parameter appAttachPackageName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{appAttachPackageName}", url.PathEscape(appAttachPackageName)) + 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", "2024-04-08-preview") + if options != nil && options.Force != nil { + reqQP.Set("force", strconv.FormatBool(*options.Force)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get an app attach package. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-04-08-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - appAttachPackageName - The name of the App Attach package arm object +// - options - AppAttachPackageClientGetOptions contains the optional parameters for the AppAttachPackageClient.Get method. +func (client *AppAttachPackageClient) Get(ctx context.Context, resourceGroupName string, appAttachPackageName string, options *AppAttachPackageClientGetOptions) (AppAttachPackageClientGetResponse, error) { + var err error + const operationName = "AppAttachPackageClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, appAttachPackageName, options) + if err != nil { + return AppAttachPackageClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AppAttachPackageClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AppAttachPackageClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *AppAttachPackageClient) getCreateRequest(ctx context.Context, resourceGroupName string, appAttachPackageName string, options *AppAttachPackageClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/appAttachPackages/{appAttachPackageName}" + 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 appAttachPackageName == "" { + return nil, errors.New("parameter appAttachPackageName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{appAttachPackageName}", url.PathEscape(appAttachPackageName)) + 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", "2024-04-08-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *AppAttachPackageClient) getHandleResponse(resp *http.Response) (AppAttachPackageClientGetResponse, error) { + result := AppAttachPackageClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AppAttachPackage); err != nil { + return AppAttachPackageClientGetResponse{}, err + } + return result, nil +} + +// NewListByResourceGroupPager - List App Attach packages in resource group. +// +// Generated from API version 2024-04-08-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - options - AppAttachPackageClientListByResourceGroupOptions contains the optional parameters for the AppAttachPackageClient.NewListByResourceGroupPager +// method. +func (client *AppAttachPackageClient) NewListByResourceGroupPager(resourceGroupName string, options *AppAttachPackageClientListByResourceGroupOptions) *runtime.Pager[AppAttachPackageClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[AppAttachPackageClientListByResourceGroupResponse]{ + More: func(page AppAttachPackageClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *AppAttachPackageClientListByResourceGroupResponse) (AppAttachPackageClientListByResourceGroupResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "AppAttachPackageClient.NewListByResourceGroupPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + }, nil) + if err != nil { + return AppAttachPackageClientListByResourceGroupResponse{}, err + } + return client.listByResourceGroupHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *AppAttachPackageClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *AppAttachPackageClientListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/appAttachPackages" + 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)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + reqQP.Set("api-version", "2024-04-08-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *AppAttachPackageClient) listByResourceGroupHandleResponse(resp *http.Response) (AppAttachPackageClientListByResourceGroupResponse, error) { + result := AppAttachPackageClientListByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AppAttachPackageList); err != nil { + return AppAttachPackageClientListByResourceGroupResponse{}, err + } + return result, nil +} + +// NewListBySubscriptionPager - List App Attach packages in subscription. +// +// Generated from API version 2024-04-08-preview +// - options - AppAttachPackageClientListBySubscriptionOptions contains the optional parameters for the AppAttachPackageClient.NewListBySubscriptionPager +// method. +func (client *AppAttachPackageClient) NewListBySubscriptionPager(options *AppAttachPackageClientListBySubscriptionOptions) *runtime.Pager[AppAttachPackageClientListBySubscriptionResponse] { + return runtime.NewPager(runtime.PagingHandler[AppAttachPackageClientListBySubscriptionResponse]{ + More: func(page AppAttachPackageClientListBySubscriptionResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *AppAttachPackageClientListBySubscriptionResponse) (AppAttachPackageClientListBySubscriptionResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "AppAttachPackageClient.NewListBySubscriptionPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listBySubscriptionCreateRequest(ctx, options) + }, nil) + if err != nil { + return AppAttachPackageClientListBySubscriptionResponse{}, err + } + return client.listBySubscriptionHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listBySubscriptionCreateRequest creates the ListBySubscription request. +func (client *AppAttachPackageClient) listBySubscriptionCreateRequest(ctx context.Context, options *AppAttachPackageClientListBySubscriptionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DesktopVirtualization/appAttachPackages" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + reqQP.Set("api-version", "2024-04-08-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listBySubscriptionHandleResponse handles the ListBySubscription response. +func (client *AppAttachPackageClient) listBySubscriptionHandleResponse(resp *http.Response) (AppAttachPackageClientListBySubscriptionResponse, error) { + result := AppAttachPackageClientListBySubscriptionResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AppAttachPackageList); err != nil { + return AppAttachPackageClientListBySubscriptionResponse{}, err + } + return result, nil +} + +// Update - Update an App Attach Package +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-04-08-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - appAttachPackageName - The name of the App Attach package arm object +// - options - AppAttachPackageClientUpdateOptions contains the optional parameters for the AppAttachPackageClient.Update method. +func (client *AppAttachPackageClient) Update(ctx context.Context, resourceGroupName string, appAttachPackageName string, options *AppAttachPackageClientUpdateOptions) (AppAttachPackageClientUpdateResponse, error) { + var err error + const operationName = "AppAttachPackageClient.Update" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.updateCreateRequest(ctx, resourceGroupName, appAttachPackageName, options) + if err != nil { + return AppAttachPackageClientUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AppAttachPackageClientUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AppAttachPackageClientUpdateResponse{}, err + } + resp, err := client.updateHandleResponse(httpResp) + return resp, err +} + +// updateCreateRequest creates the Update request. +func (client *AppAttachPackageClient) updateCreateRequest(ctx context.Context, resourceGroupName string, appAttachPackageName string, options *AppAttachPackageClientUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/appAttachPackages/{appAttachPackageName}" + 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 appAttachPackageName == "" { + return nil, errors.New("parameter appAttachPackageName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{appAttachPackageName}", url.PathEscape(appAttachPackageName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-04-08-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if options != nil && options.AppAttachPackagePatch != nil { + if err := runtime.MarshalAsJSON(req, *options.AppAttachPackagePatch); err != nil { + return nil, err + } + return req, nil + } + return req, nil +} + +// updateHandleResponse handles the Update response. +func (client *AppAttachPackageClient) updateHandleResponse(resp *http.Response) (AppAttachPackageClientUpdateResponse, error) { + result := AppAttachPackageClientUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AppAttachPackage); err != nil { + return AppAttachPackageClientUpdateResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/appattachpackageinfo_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/appattachpackageinfo_client.go new file mode 100644 index 000000000000..0da2ced2cc4b --- /dev/null +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/appattachpackageinfo_client.go @@ -0,0 +1,113 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armdesktopvirtualization + +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" +) + +// AppAttachPackageInfoClient contains the methods for the AppAttachPackageInfo group. +// Don't use this type directly, use NewAppAttachPackageInfoClient() instead. +type AppAttachPackageInfoClient struct { + internal *arm.Client + subscriptionID string +} + +// NewAppAttachPackageInfoClient creates a new instance of AppAttachPackageInfoClient with the specified values. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewAppAttachPackageInfoClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AppAttachPackageInfoClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &AppAttachPackageInfoClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// NewImportPager - Gets information from a package given the path to the package. +// +// Generated from API version 2024-04-08-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - hostPoolName - The name of the host pool within the specified resource group +// - importPackageInfoRequest - Object containing URI to package image and other optional properties +// - options - AppAttachPackageInfoClientImportOptions contains the optional parameters for the AppAttachPackageInfoClient.NewImportPager +// method. +func (client *AppAttachPackageInfoClient) NewImportPager(resourceGroupName string, hostPoolName string, importPackageInfoRequest ImportPackageInfoRequest, options *AppAttachPackageInfoClientImportOptions) *runtime.Pager[AppAttachPackageInfoClientImportResponse] { + return runtime.NewPager(runtime.PagingHandler[AppAttachPackageInfoClientImportResponse]{ + More: func(page AppAttachPackageInfoClientImportResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *AppAttachPackageInfoClientImportResponse) (AppAttachPackageInfoClientImportResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "AppAttachPackageInfoClient.NewImportPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.importCreateRequest(ctx, resourceGroupName, hostPoolName, importPackageInfoRequest, options) + }, nil) + if err != nil { + return AppAttachPackageInfoClientImportResponse{}, err + } + return client.importHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// importCreateRequest creates the Import request. +func (client *AppAttachPackageInfoClient) importCreateRequest(ctx context.Context, resourceGroupName string, hostPoolName string, importPackageInfoRequest ImportPackageInfoRequest, options *AppAttachPackageInfoClientImportOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/importAppAttachPackageInfo" + 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 hostPoolName == "" { + return nil, errors.New("parameter hostPoolName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{hostPoolName}", url.PathEscape(hostPoolName)) + 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", "2024-04-08-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, importPackageInfoRequest); err != nil { + return nil, err + } + return req, nil +} + +// importHandleResponse handles the Import response. +func (client *AppAttachPackageInfoClient) importHandleResponse(resp *http.Response) (AppAttachPackageInfoClientImportResponse, error) { + result := AppAttachPackageInfoClientImportResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AppAttachPackageList); err != nil { + return AppAttachPackageInfoClientImportResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/applicationgroups_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/applicationgroups_client.go index 5e9855c22d80..e23d2e875260 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/applicationgroups_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/applicationgroups_client.go @@ -29,7 +29,7 @@ type ApplicationGroupsClient struct { } // NewApplicationGroupsClient creates a new instance of ApplicationGroupsClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewApplicationGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ApplicationGroupsClient, error) { @@ -47,7 +47,7 @@ func NewApplicationGroupsClient(subscriptionID string, credential azcore.TokenCr // CreateOrUpdate - Create or update an applicationGroup. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - applicationGroupName - The name of the application group // - applicationGroup - Object containing ApplicationGroup definitions. @@ -95,7 +95,7 @@ func (client *ApplicationGroupsClient) createOrUpdateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-08-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, applicationGroup); err != nil { @@ -116,7 +116,7 @@ func (client *ApplicationGroupsClient) createOrUpdateHandleResponse(resp *http.R // Delete - Remove an applicationGroup. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - applicationGroupName - The name of the application group // - options - ApplicationGroupsClientDeleteOptions contains the optional parameters for the ApplicationGroupsClient.Delete @@ -162,7 +162,7 @@ func (client *ApplicationGroupsClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-08-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -171,7 +171,7 @@ func (client *ApplicationGroupsClient) deleteCreateRequest(ctx context.Context, // Get - Get an application group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - applicationGroupName - The name of the application group // - options - ApplicationGroupsClientGetOptions contains the optional parameters for the ApplicationGroupsClient.Get method. @@ -217,7 +217,7 @@ func (client *ApplicationGroupsClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-08-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -234,7 +234,7 @@ func (client *ApplicationGroupsClient) getHandleResponse(resp *http.Response) (A // NewListByResourceGroupPager - List applicationGroups. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - ApplicationGroupsClientListByResourceGroupOptions contains the optional parameters for the ApplicationGroupsClient.NewListByResourceGroupPager // method. @@ -277,18 +277,18 @@ func (client *ApplicationGroupsClient) listByResourceGroupCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - if options != nil && options.PageSize != nil { - reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) + reqQP.Set("api-version", "2024-04-08-preview") + if options != nil && options.InitialSkip != nil { + reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) } if options != nil && options.IsDescending != nil { reqQP.Set("isDescending", strconv.FormatBool(*options.IsDescending)) } - if options != nil && options.InitialSkip != nil { - reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) + if options != nil && options.PageSize != nil { + reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} @@ -306,7 +306,7 @@ func (client *ApplicationGroupsClient) listByResourceGroupHandleResponse(resp *h // NewListBySubscriptionPager - List applicationGroups in subscription. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - options - ApplicationGroupsClientListBySubscriptionOptions contains the optional parameters for the ApplicationGroupsClient.NewListBySubscriptionPager // method. func (client *ApplicationGroupsClient) NewListBySubscriptionPager(options *ApplicationGroupsClientListBySubscriptionOptions) *runtime.Pager[ApplicationGroupsClientListBySubscriptionResponse] { @@ -344,10 +344,10 @@ func (client *ApplicationGroupsClient) listBySubscriptionCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } + reqQP.Set("api-version", "2024-04-08-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -365,7 +365,7 @@ func (client *ApplicationGroupsClient) listBySubscriptionHandleResponse(resp *ht // Update - Update an applicationGroup. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - applicationGroupName - The name of the application group // - options - ApplicationGroupsClientUpdateOptions contains the optional parameters for the ApplicationGroupsClient.Update @@ -412,7 +412,7 @@ func (client *ApplicationGroupsClient) updateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-08-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.ApplicationGroup != nil { diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/applicationgroups_client_example_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/applicationgroups_client_example_test.go deleted file mode 100644 index 62d3faf09a3f..000000000000 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/applicationgroups_client_example_test.go +++ /dev/null @@ -1,376 +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 armdesktopvirtualization_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/desktopvirtualization/armdesktopvirtualization/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ApplicationGroup_Get.json -func ExampleApplicationGroupsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApplicationGroupsClient().Get(ctx, "resourceGroup1", "applicationGroup1", 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.ApplicationGroup = armdesktopvirtualization.ApplicationGroup{ - // Name: to.Ptr("applicationGroup1"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/applicationGroups"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/applicationGroups/applicationGroup1"), - // Location: to.Ptr("centralus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armdesktopvirtualization.ApplicationGroupProperties{ - // Description: to.Ptr("des1"), - // ApplicationGroupType: to.Ptr(armdesktopvirtualization.ApplicationGroupTypeRemoteApp), - // CloudPcResource: to.Ptr(false), - // FriendlyName: to.Ptr("friendly"), - // HostPoolArmPath: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1"), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // ShowInFeed: to.Ptr(true), - // WorkspaceArmPath: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/workspaces/workspace1"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ApplicationGroup_Create.json -func ExampleApplicationGroupsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApplicationGroupsClient().CreateOrUpdate(ctx, "resourceGroup1", "applicationGroup1", armdesktopvirtualization.ApplicationGroup{ - Location: to.Ptr("centralus"), - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - Properties: &armdesktopvirtualization.ApplicationGroupProperties{ - Description: to.Ptr("des1"), - ApplicationGroupType: to.Ptr(armdesktopvirtualization.ApplicationGroupTypeRemoteApp), - FriendlyName: to.Ptr("friendly"), - HostPoolArmPath: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1"), - ShowInFeed: to.Ptr(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.ApplicationGroup = armdesktopvirtualization.ApplicationGroup{ - // Name: to.Ptr("applicationGroup1"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/applicationGroups"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/applicationGroups/applicationGroup1"), - // Location: to.Ptr("centralus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armdesktopvirtualization.ApplicationGroupProperties{ - // Description: to.Ptr("des1"), - // ApplicationGroupType: to.Ptr(armdesktopvirtualization.ApplicationGroupTypeRemoteApp), - // CloudPcResource: to.Ptr(false), - // FriendlyName: to.Ptr("friendly"), - // HostPoolArmPath: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1"), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // ShowInFeed: to.Ptr(true), - // WorkspaceArmPath: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/workspaces/workspace1"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ApplicationGroup_Delete.json -func ExampleApplicationGroupsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewApplicationGroupsClient().Delete(ctx, "resourceGroup1", "applicationGroup1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ApplicationGroup_Update.json -func ExampleApplicationGroupsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApplicationGroupsClient().Update(ctx, "resourceGroup1", "applicationGroup1", &armdesktopvirtualization.ApplicationGroupsClientUpdateOptions{ApplicationGroup: &armdesktopvirtualization.ApplicationGroupPatch{ - Properties: &armdesktopvirtualization.ApplicationGroupPatchProperties{ - Description: to.Ptr("des1"), - FriendlyName: to.Ptr("friendly"), - ShowInFeed: to.Ptr(true), - }, - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, - }) - 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.ApplicationGroup = armdesktopvirtualization.ApplicationGroup{ - // Name: to.Ptr("applicationGroup1"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/applicationGroups"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/applicationGroups/applicationGroup1"), - // Location: to.Ptr("centralus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armdesktopvirtualization.ApplicationGroupProperties{ - // Description: to.Ptr("des1"), - // ApplicationGroupType: to.Ptr(armdesktopvirtualization.ApplicationGroupTypeRemoteApp), - // CloudPcResource: to.Ptr(false), - // FriendlyName: to.Ptr("friendly"), - // HostPoolArmPath: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1"), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // ShowInFeed: to.Ptr(true), - // WorkspaceArmPath: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/workspaces/workspace1"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ApplicationGroup_ListByResourceGroup.json -func ExampleApplicationGroupsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewApplicationGroupsClient().NewListByResourceGroupPager("resourceGroup1", &armdesktopvirtualization.ApplicationGroupsClientListByResourceGroupOptions{Filter: to.Ptr("applicationGroupType eq 'RailApplication'"), - PageSize: to.Ptr[int32](10), - IsDescending: to.Ptr(true), - InitialSkip: to.Ptr[int32](0), - }) - 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.ApplicationGroupList = armdesktopvirtualization.ApplicationGroupList{ - // Value: []*armdesktopvirtualization.ApplicationGroup{ - // { - // Name: to.Ptr("applicationGroup1"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/applicationGroups"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/applicationGroups/applicationGroup1"), - // Location: to.Ptr("centralus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armdesktopvirtualization.ApplicationGroupProperties{ - // Description: to.Ptr("des1"), - // ApplicationGroupType: to.Ptr(armdesktopvirtualization.ApplicationGroupTypeRemoteApp), - // CloudPcResource: to.Ptr(false), - // FriendlyName: to.Ptr("friendly"), - // HostPoolArmPath: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1"), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // ShowInFeed: to.Ptr(true), - // WorkspaceArmPath: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/workspaces/workspace1"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }, - // { - // Name: to.Ptr("applicationGroup2"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/applicationGroups"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/applicationGroups/applicationGroup2"), - // Location: to.Ptr("centralus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armdesktopvirtualization.ApplicationGroupProperties{ - // Description: to.Ptr("des1"), - // ApplicationGroupType: to.Ptr(armdesktopvirtualization.ApplicationGroupTypeRemoteApp), - // CloudPcResource: to.Ptr(false), - // FriendlyName: to.Ptr("friendly"), - // HostPoolArmPath: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1"), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // ShowInFeed: to.Ptr(true), - // WorkspaceArmPath: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/workspaces/workspace1"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ApplicationGroup_ListBySubscription.json -func ExampleApplicationGroupsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewApplicationGroupsClient().NewListBySubscriptionPager(&armdesktopvirtualization.ApplicationGroupsClientListBySubscriptionOptions{Filter: to.Ptr("applicationGroupType eq 'RailApplication'")}) - 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.ApplicationGroupList = armdesktopvirtualization.ApplicationGroupList{ - // Value: []*armdesktopvirtualization.ApplicationGroup{ - // { - // Name: to.Ptr("applicationGroup1"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/applicationGroups"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/applicationGroups/applicationGroup1"), - // Location: to.Ptr("centralus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armdesktopvirtualization.ApplicationGroupProperties{ - // Description: to.Ptr("des1"), - // ApplicationGroupType: to.Ptr(armdesktopvirtualization.ApplicationGroupTypeRemoteApp), - // CloudPcResource: to.Ptr(false), - // FriendlyName: to.Ptr("friendly"), - // HostPoolArmPath: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1"), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // ShowInFeed: to.Ptr(true), - // WorkspaceArmPath: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/workspaces/workspace1"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }, - // { - // Name: to.Ptr("applicationGroup2"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/applicationGroups"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/applicationGroups/applicationGroup2"), - // Location: to.Ptr("centralus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armdesktopvirtualization.ApplicationGroupProperties{ - // Description: to.Ptr("des1"), - // ApplicationGroupType: to.Ptr(armdesktopvirtualization.ApplicationGroupTypeRemoteApp), - // CloudPcResource: to.Ptr(false), - // FriendlyName: to.Ptr("friendly"), - // HostPoolArmPath: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1"), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // ShowInFeed: to.Ptr(true), - // WorkspaceArmPath: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/workspaces/workspace1"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/applications_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/applications_client.go index bf67edaa5e4c..7e6343e84e9e 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/applications_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/applications_client.go @@ -29,7 +29,7 @@ type ApplicationsClient struct { } // NewApplicationsClient creates a new instance of ApplicationsClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewApplicationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ApplicationsClient, error) { @@ -47,7 +47,7 @@ func NewApplicationsClient(subscriptionID string, credential azcore.TokenCredent // CreateOrUpdate - Create or update an application. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - applicationGroupName - The name of the application group // - applicationName - The name of the application within the specified application group @@ -100,7 +100,7 @@ func (client *ApplicationsClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-08-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, application); err != nil { @@ -121,7 +121,7 @@ func (client *ApplicationsClient) createOrUpdateHandleResponse(resp *http.Respon // Delete - Remove an application. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - applicationGroupName - The name of the application group // - applicationName - The name of the application within the specified application group @@ -171,7 +171,7 @@ func (client *ApplicationsClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-08-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -180,7 +180,7 @@ func (client *ApplicationsClient) deleteCreateRequest(ctx context.Context, resou // Get - Get an application. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - applicationGroupName - The name of the application group // - applicationName - The name of the application within the specified application group @@ -231,7 +231,7 @@ func (client *ApplicationsClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-08-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -248,7 +248,7 @@ func (client *ApplicationsClient) getHandleResponse(resp *http.Response) (Applic // NewListPager - List applications. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - applicationGroupName - The name of the application group // - options - ApplicationsClientListOptions contains the optional parameters for the ApplicationsClient.NewListPager method. @@ -295,15 +295,15 @@ func (client *ApplicationsClient) listCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") - if options != nil && options.PageSize != nil { - reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) + reqQP.Set("api-version", "2024-04-08-preview") + if options != nil && options.InitialSkip != nil { + reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) } if options != nil && options.IsDescending != nil { reqQP.Set("isDescending", strconv.FormatBool(*options.IsDescending)) } - if options != nil && options.InitialSkip != nil { - reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) + if options != nil && options.PageSize != nil { + reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} @@ -322,7 +322,7 @@ func (client *ApplicationsClient) listHandleResponse(resp *http.Response) (Appli // Update - Update an application. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - applicationGroupName - The name of the application group // - applicationName - The name of the application within the specified application group @@ -373,7 +373,7 @@ func (client *ApplicationsClient) updateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-08-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Application != nil { diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/applications_client_example_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/applications_client_example_test.go deleted file mode 100644 index 52a7e3ba4f49..000000000000 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/applications_client_example_test.go +++ /dev/null @@ -1,286 +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 armdesktopvirtualization_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/desktopvirtualization/armdesktopvirtualization/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Application_Get.json -func ExampleApplicationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApplicationsClient().Get(ctx, "resourceGroup1", "applicationGroup1", "application1", 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.Application = armdesktopvirtualization.Application{ - // Name: to.Ptr("applicationGroup1/application1"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/applicationGroups/applications"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/applicationGroups/applicationGroup1/applications/application1"), - // Properties: &armdesktopvirtualization.ApplicationProperties{ - // Description: to.Ptr("des1"), - // ApplicationType: to.Ptr(armdesktopvirtualization.RemoteApplicationTypeInBuilt), - // CommandLineArguments: to.Ptr("arguments"), - // CommandLineSetting: to.Ptr(armdesktopvirtualization.CommandLineSettingAllow), - // FilePath: to.Ptr("path"), - // FriendlyName: to.Ptr("friendly"), - // IconContent: []byte("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo"), - // IconHash: to.Ptr("bEQ1n2HysrGxCDvgt4bfOtkET8ydzh5SXGM0KGTBPVc"), - // IconIndex: to.Ptr[int32](1), - // IconPath: to.Ptr("icon"), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // ShowInPortal: to.Ptr(true), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Application_Create.json -func ExampleApplicationsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApplicationsClient().CreateOrUpdate(ctx, "resourceGroup1", "applicationGroup1", "application1", armdesktopvirtualization.Application{ - Properties: &armdesktopvirtualization.ApplicationProperties{ - Description: to.Ptr("des1"), - CommandLineArguments: to.Ptr("arguments"), - CommandLineSetting: to.Ptr(armdesktopvirtualization.CommandLineSettingAllow), - FilePath: to.Ptr("path"), - FriendlyName: to.Ptr("friendly"), - IconIndex: to.Ptr[int32](1), - IconPath: to.Ptr("icon"), - ShowInPortal: to.Ptr(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.Application = armdesktopvirtualization.Application{ - // Name: to.Ptr("applicationGroup1/application1"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/applicationGroups/applications"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/applicationGroups/applicationGroup1/applications/application1"), - // Properties: &armdesktopvirtualization.ApplicationProperties{ - // Description: to.Ptr("des1"), - // ApplicationType: to.Ptr(armdesktopvirtualization.RemoteApplicationTypeInBuilt), - // CommandLineArguments: to.Ptr("arguments"), - // CommandLineSetting: to.Ptr(armdesktopvirtualization.CommandLineSettingAllow), - // FilePath: to.Ptr("path"), - // FriendlyName: to.Ptr("friendly"), - // IconContent: []byte("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo"), - // IconHash: to.Ptr("bEQ1n2HysrGxCDvgt4bfOtkET8ydzh5SXGM0KGTBPVc"), - // IconIndex: to.Ptr[int32](1), - // IconPath: to.Ptr("icon"), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // ShowInPortal: to.Ptr(true), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Application_Delete.json -func ExampleApplicationsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewApplicationsClient().Delete(ctx, "resourceGroup1", "applicationGroup1", "application1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Application_Update.json -func ExampleApplicationsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApplicationsClient().Update(ctx, "resourceGroup1", "applicationGroup1", "application1", &armdesktopvirtualization.ApplicationsClientUpdateOptions{Application: &armdesktopvirtualization.ApplicationPatch{ - Properties: &armdesktopvirtualization.ApplicationPatchProperties{ - Description: to.Ptr("des1"), - ApplicationType: to.Ptr(armdesktopvirtualization.RemoteApplicationTypeInBuilt), - CommandLineArguments: to.Ptr("arguments"), - CommandLineSetting: to.Ptr(armdesktopvirtualization.CommandLineSettingAllow), - FilePath: to.Ptr("path"), - FriendlyName: to.Ptr("friendly"), - IconIndex: to.Ptr[int32](1), - IconPath: to.Ptr("icon"), - ShowInPortal: to.Ptr(true), - }, - }, - }) - 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.Application = armdesktopvirtualization.Application{ - // Name: to.Ptr("applicationGroup1/application1"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/applicationGroups/applications"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/applicationGroups/applicationGroup1/applications/application1"), - // Properties: &armdesktopvirtualization.ApplicationProperties{ - // Description: to.Ptr("des1"), - // ApplicationType: to.Ptr(armdesktopvirtualization.RemoteApplicationTypeInBuilt), - // CommandLineArguments: to.Ptr("arguments"), - // CommandLineSetting: to.Ptr(armdesktopvirtualization.CommandLineSettingAllow), - // FilePath: to.Ptr("path"), - // FriendlyName: to.Ptr("friendly"), - // IconContent: []byte("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo"), - // IconHash: to.Ptr("bEQ1n2HysrGxCDvgt4bfOtkET8ydzh5SXGM0KGTBPVc"), - // IconIndex: to.Ptr[int32](1), - // IconPath: to.Ptr("icon"), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // ShowInPortal: to.Ptr(true), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Application_List.json -func ExampleApplicationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewApplicationsClient().NewListPager("resourceGroup1", "applicationGroup1", &armdesktopvirtualization.ApplicationsClientListOptions{PageSize: to.Ptr[int32](10), - IsDescending: to.Ptr(true), - InitialSkip: to.Ptr[int32](0), - }) - 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.ApplicationList = armdesktopvirtualization.ApplicationList{ - // Value: []*armdesktopvirtualization.Application{ - // { - // Name: to.Ptr("applicationGroup1/application1"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/applicationGroups/applications"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/applicationGroups/applicationGroup1/applications/application1"), - // Properties: &armdesktopvirtualization.ApplicationProperties{ - // Description: to.Ptr("des1"), - // ApplicationType: to.Ptr(armdesktopvirtualization.RemoteApplicationTypeInBuilt), - // CommandLineArguments: to.Ptr("arguments"), - // CommandLineSetting: to.Ptr(armdesktopvirtualization.CommandLineSettingAllow), - // FilePath: to.Ptr("path"), - // FriendlyName: to.Ptr("friendly"), - // IconContent: []byte("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo"), - // IconHash: to.Ptr("bEQ1n2HysrGxCDvgt4bfOtkET8ydzh5SXGM0KGTBPVc"), - // IconIndex: to.Ptr[int32](1), - // IconPath: to.Ptr("icon"), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // ShowInPortal: to.Ptr(true), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }, - // { - // Name: to.Ptr("applicationGroup1/application2"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/applicationGroups/applications"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/applicationGroups/applicationGroup1/applications/application2"), - // Properties: &armdesktopvirtualization.ApplicationProperties{ - // Description: to.Ptr("des2"), - // ApplicationType: to.Ptr(armdesktopvirtualization.RemoteApplicationTypeInBuilt), - // CommandLineArguments: to.Ptr("arguments"), - // CommandLineSetting: to.Ptr(armdesktopvirtualization.CommandLineSettingAllow), - // FilePath: to.Ptr("path"), - // FriendlyName: to.Ptr("friendly"), - // IconContent: []byte("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo"), - // IconHash: to.Ptr("bEQ1n2HysrGxCDvgt4bfOtkET8ydzh5SXGM0KGTBPVc"), - // IconIndex: to.Ptr[int32](1), - // IconPath: to.Ptr("icon"), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // ShowInPortal: to.Ptr(true), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/autorest.md b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/autorest.md index e7eb60411eb1..610e80e95bf8 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/autorest.md +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/autorest.md @@ -5,9 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/desktopvirtualization/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/desktopvirtualization/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 2.2.0 -tag: package-2023-09 +module-version: 3.0.0-beta.1 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/client_factory.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/client_factory.go index cf8d3ef1a230..5b47ee8df42e 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/client_factory.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/client_factory.go @@ -17,118 +17,220 @@ import ( // Don't use this type directly, use NewClientFactory instead. type ClientFactory struct { subscriptionID string - credential azcore.TokenCredential - options *arm.ClientOptions + internal *arm.Client } // NewClientFactory creates a new instance of ClientFactory with the specified values. // The parameter values will be propagated to any client created from this factory. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error) { - _, err := arm.NewClient(moduleName, moduleVersion, credential, options) + internal, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } return &ClientFactory{ - subscriptionID: subscriptionID, credential: credential, - options: options.Clone(), + subscriptionID: subscriptionID, + internal: internal, }, nil } +// NewActiveSessionHostConfigurationsClient creates a new instance of ActiveSessionHostConfigurationsClient. +func (c *ClientFactory) NewActiveSessionHostConfigurationsClient() *ActiveSessionHostConfigurationsClient { + return &ActiveSessionHostConfigurationsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewAppAttachPackageClient creates a new instance of AppAttachPackageClient. +func (c *ClientFactory) NewAppAttachPackageClient() *AppAttachPackageClient { + return &AppAttachPackageClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewAppAttachPackageInfoClient creates a new instance of AppAttachPackageInfoClient. +func (c *ClientFactory) NewAppAttachPackageInfoClient() *AppAttachPackageInfoClient { + return &AppAttachPackageInfoClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + // NewApplicationGroupsClient creates a new instance of ApplicationGroupsClient. func (c *ClientFactory) NewApplicationGroupsClient() *ApplicationGroupsClient { - subClient, _ := NewApplicationGroupsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &ApplicationGroupsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewApplicationsClient creates a new instance of ApplicationsClient. func (c *ClientFactory) NewApplicationsClient() *ApplicationsClient { - subClient, _ := NewApplicationsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &ApplicationsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewControlSessionHostUpdateClient creates a new instance of ControlSessionHostUpdateClient. +func (c *ClientFactory) NewControlSessionHostUpdateClient() *ControlSessionHostUpdateClient { + return &ControlSessionHostUpdateClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewDesktopsClient creates a new instance of DesktopsClient. func (c *ClientFactory) NewDesktopsClient() *DesktopsClient { - subClient, _ := NewDesktopsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &DesktopsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewHostPoolsClient creates a new instance of HostPoolsClient. func (c *ClientFactory) NewHostPoolsClient() *HostPoolsClient { - subClient, _ := NewHostPoolsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &HostPoolsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewInitiateSessionHostUpdateClient creates a new instance of InitiateSessionHostUpdateClient. +func (c *ClientFactory) NewInitiateSessionHostUpdateClient() *InitiateSessionHostUpdateClient { + return &InitiateSessionHostUpdateClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewMSIXPackagesClient creates a new instance of MSIXPackagesClient. func (c *ClientFactory) NewMSIXPackagesClient() *MSIXPackagesClient { - subClient, _ := NewMSIXPackagesClient(c.subscriptionID, c.credential, c.options) - return subClient + return &MSIXPackagesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewMsixImagesClient creates a new instance of MsixImagesClient. func (c *ClientFactory) NewMsixImagesClient() *MsixImagesClient { - subClient, _ := NewMsixImagesClient(c.subscriptionID, c.credential, c.options) - return subClient + return &MsixImagesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewOperationsClient creates a new instance of OperationsClient. func (c *ClientFactory) NewOperationsClient() *OperationsClient { - subClient, _ := NewOperationsClient(c.credential, c.options) - return subClient + return &OperationsClient{ + internal: c.internal, + } } // NewPrivateEndpointConnectionsClient creates a new instance of PrivateEndpointConnectionsClient. func (c *ClientFactory) NewPrivateEndpointConnectionsClient() *PrivateEndpointConnectionsClient { - subClient, _ := NewPrivateEndpointConnectionsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &PrivateEndpointConnectionsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewPrivateLinkResourcesClient creates a new instance of PrivateLinkResourcesClient. func (c *ClientFactory) NewPrivateLinkResourcesClient() *PrivateLinkResourcesClient { - subClient, _ := NewPrivateLinkResourcesClient(c.subscriptionID, c.credential, c.options) - return subClient + return &PrivateLinkResourcesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewScalingPlanPersonalSchedulesClient creates a new instance of ScalingPlanPersonalSchedulesClient. func (c *ClientFactory) NewScalingPlanPersonalSchedulesClient() *ScalingPlanPersonalSchedulesClient { - subClient, _ := NewScalingPlanPersonalSchedulesClient(c.subscriptionID, c.credential, c.options) - return subClient + return &ScalingPlanPersonalSchedulesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewScalingPlanPooledSchedulesClient creates a new instance of ScalingPlanPooledSchedulesClient. func (c *ClientFactory) NewScalingPlanPooledSchedulesClient() *ScalingPlanPooledSchedulesClient { - subClient, _ := NewScalingPlanPooledSchedulesClient(c.subscriptionID, c.credential, c.options) - return subClient + return &ScalingPlanPooledSchedulesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewScalingPlansClient creates a new instance of ScalingPlansClient. func (c *ClientFactory) NewScalingPlansClient() *ScalingPlansClient { - subClient, _ := NewScalingPlansClient(c.subscriptionID, c.credential, c.options) - return subClient + return &ScalingPlansClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewSessionHostClient creates a new instance of SessionHostClient. +func (c *ClientFactory) NewSessionHostClient() *SessionHostClient { + return &SessionHostClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewSessionHostConfigurationsClient creates a new instance of SessionHostConfigurationsClient. +func (c *ClientFactory) NewSessionHostConfigurationsClient() *SessionHostConfigurationsClient { + return &SessionHostConfigurationsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewSessionHostManagementsClient creates a new instance of SessionHostManagementsClient. +func (c *ClientFactory) NewSessionHostManagementsClient() *SessionHostManagementsClient { + return &SessionHostManagementsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewSessionHostManagementsUpdateStatusClient creates a new instance of SessionHostManagementsUpdateStatusClient. +func (c *ClientFactory) NewSessionHostManagementsUpdateStatusClient() *SessionHostManagementsUpdateStatusClient { + return &SessionHostManagementsUpdateStatusClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewSessionHostsClient creates a new instance of SessionHostsClient. func (c *ClientFactory) NewSessionHostsClient() *SessionHostsClient { - subClient, _ := NewSessionHostsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &SessionHostsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewStartMenuItemsClient creates a new instance of StartMenuItemsClient. func (c *ClientFactory) NewStartMenuItemsClient() *StartMenuItemsClient { - subClient, _ := NewStartMenuItemsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &StartMenuItemsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewUserSessionsClient creates a new instance of UserSessionsClient. func (c *ClientFactory) NewUserSessionsClient() *UserSessionsClient { - subClient, _ := NewUserSessionsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &UserSessionsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewWorkspacesClient creates a new instance of WorkspacesClient. func (c *ClientFactory) NewWorkspacesClient() *WorkspacesClient { - subClient, _ := NewWorkspacesClient(c.subscriptionID, c.credential, c.options) - return subClient + return &WorkspacesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/constants.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/constants.go index 4ceb1d89e104..a6a77ce0878e 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/constants.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/constants.go @@ -10,9 +10,35 @@ package armdesktopvirtualization const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization" - moduleVersion = "v2.2.0" + moduleVersion = "v3.0.0-beta.1" ) +// AppAttachPackageArchitectures - Possible device architectures that an app attach package can be configured for +type AppAttachPackageArchitectures string + +const ( + AppAttachPackageArchitecturesALL AppAttachPackageArchitectures = "ALL" + AppAttachPackageArchitecturesARM AppAttachPackageArchitectures = "ARM" + AppAttachPackageArchitecturesARM64 AppAttachPackageArchitectures = "ARM64" + AppAttachPackageArchitecturesNeutral AppAttachPackageArchitectures = "Neutral" + AppAttachPackageArchitecturesX64 AppAttachPackageArchitectures = "x64" + AppAttachPackageArchitecturesX86 AppAttachPackageArchitectures = "x86" + AppAttachPackageArchitecturesX86A64 AppAttachPackageArchitectures = "x86a64" +) + +// PossibleAppAttachPackageArchitecturesValues returns the possible values for the AppAttachPackageArchitectures const type. +func PossibleAppAttachPackageArchitecturesValues() []AppAttachPackageArchitectures { + return []AppAttachPackageArchitectures{ + AppAttachPackageArchitecturesALL, + AppAttachPackageArchitecturesARM, + AppAttachPackageArchitecturesARM64, + AppAttachPackageArchitecturesNeutral, + AppAttachPackageArchitecturesX64, + AppAttachPackageArchitecturesX86, + AppAttachPackageArchitecturesX86A64, + } +} + // ApplicationGroupType - Resource Type of ApplicationGroup. type ApplicationGroupType string @@ -110,6 +136,63 @@ func PossibleDayOfWeekValues() []DayOfWeek { } } +// DirectUDP - Default: AVD-wide settings are used to determine connection availability, Enabled: UDP will attempt this connection +// type when making connections. This means that this connection is possible, but is +// not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP will not attempt this connection +// type when making connections +type DirectUDP string + +const ( + DirectUDPDefault DirectUDP = "Default" + DirectUDPDisabled DirectUDP = "Disabled" + DirectUDPEnabled DirectUDP = "Enabled" +) + +// PossibleDirectUDPValues returns the possible values for the DirectUDP const type. +func PossibleDirectUDPValues() []DirectUDP { + return []DirectUDP{ + DirectUDPDefault, + DirectUDPDisabled, + DirectUDPEnabled, + } +} + +// DomainJoinType - The type of domain join done by the virtual machine. +type DomainJoinType string + +const ( + // DomainJoinTypeActiveDirectory - Using microsoft active directory. + DomainJoinTypeActiveDirectory DomainJoinType = "ActiveDirectory" + // DomainJoinTypeAzureActiveDirectory - Using microsoft azure active directory. + DomainJoinTypeAzureActiveDirectory DomainJoinType = "AzureActiveDirectory" +) + +// PossibleDomainJoinTypeValues returns the possible values for the DomainJoinType const type. +func PossibleDomainJoinTypeValues() []DomainJoinType { + return []DomainJoinType{ + DomainJoinTypeActiveDirectory, + DomainJoinTypeAzureActiveDirectory, + } +} + +// FailHealthCheckOnStagingFailure - Parameter indicating how the health check should behave if this package fails staging +type FailHealthCheckOnStagingFailure string + +const ( + FailHealthCheckOnStagingFailureDoNotFail FailHealthCheckOnStagingFailure = "DoNotFail" + FailHealthCheckOnStagingFailureNeedsAssistance FailHealthCheckOnStagingFailure = "NeedsAssistance" + FailHealthCheckOnStagingFailureUnhealthy FailHealthCheckOnStagingFailure = "Unhealthy" +) + +// PossibleFailHealthCheckOnStagingFailureValues returns the possible values for the FailHealthCheckOnStagingFailure const type. +func PossibleFailHealthCheckOnStagingFailureValues() []FailHealthCheckOnStagingFailure { + return []FailHealthCheckOnStagingFailure{ + FailHealthCheckOnStagingFailureDoNotFail, + FailHealthCheckOnStagingFailureNeedsAssistance, + FailHealthCheckOnStagingFailureUnhealthy, + } +} + // HealthCheckName - Represents the name of the health check operation performed. type HealthCheckName string @@ -227,6 +310,33 @@ func PossibleHostPoolTypeValues() []HostPoolType { } } +// HostPoolUpdateAction - Action types for controlling hostpool update. +type HostPoolUpdateAction string + +const ( + // HostPoolUpdateActionCancel - Cancel the hostpool update. + HostPoolUpdateActionCancel HostPoolUpdateAction = "Cancel" + // HostPoolUpdateActionPause - Pause the hostpool update. + HostPoolUpdateActionPause HostPoolUpdateAction = "Pause" + // HostPoolUpdateActionResume - Resume the hostpool update. + HostPoolUpdateActionResume HostPoolUpdateAction = "Resume" + // HostPoolUpdateActionRetry - Retry the hostpool update. + HostPoolUpdateActionRetry HostPoolUpdateAction = "Retry" + // HostPoolUpdateActionStart - Start the hostpool update. + HostPoolUpdateActionStart HostPoolUpdateAction = "Start" +) + +// PossibleHostPoolUpdateActionValues returns the possible values for the HostPoolUpdateAction const type. +func PossibleHostPoolUpdateActionValues() []HostPoolUpdateAction { + return []HostPoolUpdateAction{ + HostPoolUpdateActionCancel, + HostPoolUpdateActionPause, + HostPoolUpdateActionResume, + HostPoolUpdateActionRetry, + HostPoolUpdateActionStart, + } +} + // HostpoolPublicNetworkAccess - Enabled allows this resource to be accessed from both public and private networks, Disabled // allows this resource to only be accessed via private endpoints type HostpoolPublicNetworkAccess string @@ -252,9 +362,10 @@ func PossibleHostpoolPublicNetworkAccessValues() []HostpoolPublicNetworkAccess { type LoadBalancerType string const ( - LoadBalancerTypeBreadthFirst LoadBalancerType = "BreadthFirst" - LoadBalancerTypeDepthFirst LoadBalancerType = "DepthFirst" - LoadBalancerTypePersistent LoadBalancerType = "Persistent" + LoadBalancerTypeBreadthFirst LoadBalancerType = "BreadthFirst" + LoadBalancerTypeDepthFirst LoadBalancerType = "DepthFirst" + LoadBalancerTypeMultiplePersistent LoadBalancerType = "MultiplePersistent" + LoadBalancerTypePersistent LoadBalancerType = "Persistent" ) // PossibleLoadBalancerTypeValues returns the possible values for the LoadBalancerType const type. @@ -262,10 +373,84 @@ func PossibleLoadBalancerTypeValues() []LoadBalancerType { return []LoadBalancerType{ LoadBalancerTypeBreadthFirst, LoadBalancerTypeDepthFirst, + LoadBalancerTypeMultiplePersistent, LoadBalancerTypePersistent, } } +// ManagedPrivateUDP - Default: AVD-wide settings are used to determine connection availability, Enabled: UDP will attempt +// this connection type when making connections. This means that this connection is possible, but is +// not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP will not attempt this connection +// type when making connections +type ManagedPrivateUDP string + +const ( + ManagedPrivateUDPDefault ManagedPrivateUDP = "Default" + ManagedPrivateUDPDisabled ManagedPrivateUDP = "Disabled" + ManagedPrivateUDPEnabled ManagedPrivateUDP = "Enabled" +) + +// PossibleManagedPrivateUDPValues returns the possible values for the ManagedPrivateUDP const type. +func PossibleManagedPrivateUDPValues() []ManagedPrivateUDP { + return []ManagedPrivateUDP{ + ManagedPrivateUDPDefault, + ManagedPrivateUDPDisabled, + ManagedPrivateUDPEnabled, + } +} + +// 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, + } +} + +// ManagementType - The type of management for this hostpool, Automated or Standard. The default value is Automated. +type ManagementType string + +const ( + ManagementTypeAutomated ManagementType = "Automated" + ManagementTypeStandard ManagementType = "Standard" +) + +// PossibleManagementTypeValues returns the possible values for the ManagementType const type. +func PossibleManagementTypeValues() []ManagementType { + return []ManagementType{ + ManagementTypeAutomated, + ManagementTypeStandard, + } +} + +// PackageTimestamped - Is package timestamped so it can ignore the certificate expiry date +type PackageTimestamped string + +const ( + PackageTimestampedNotTimestamped PackageTimestamped = "NotTimestamped" + PackageTimestampedTimestamped PackageTimestamped = "Timestamped" +) + +// PossiblePackageTimestampedValues returns the possible values for the PackageTimestamped const type. +func PossiblePackageTimestampedValues() []PackageTimestamped { + return []PackageTimestamped{ + PackageTimestampedNotTimestamped, + PackageTimestampedTimestamped, + } +} + // PersonalDesktopAssignmentType - PersonalDesktopAssignment type for HostPool. type PersonalDesktopAssignmentType string @@ -338,6 +523,46 @@ func PossiblePrivateEndpointServiceConnectionStatusValues() []PrivateEndpointSer } } +// ProvisioningState - The current provisioning state. +type ProvisioningState string + +const ( + ProvisioningStateCanceled ProvisioningState = "Canceled" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateProvisioning ProvisioningState = "Provisioning" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" +) + +// PossibleProvisioningStateValues returns the possible values for the ProvisioningState const type. +func PossibleProvisioningStateValues() []ProvisioningState { + return []ProvisioningState{ + ProvisioningStateCanceled, + ProvisioningStateFailed, + ProvisioningStateProvisioning, + ProvisioningStateSucceeded, + } +} + +// ProvisioningStateSHC - Provisioning state of the Session Host Configuration. +type ProvisioningStateSHC string + +const ( + ProvisioningStateSHCCanceled ProvisioningStateSHC = "Canceled" + ProvisioningStateSHCFailed ProvisioningStateSHC = "Failed" + ProvisioningStateSHCProvisioning ProvisioningStateSHC = "Provisioning" + ProvisioningStateSHCSucceeded ProvisioningStateSHC = "Succeeded" +) + +// PossibleProvisioningStateSHCValues returns the possible values for the ProvisioningStateSHC const type. +func PossibleProvisioningStateSHCValues() []ProvisioningStateSHC { + return []ProvisioningStateSHC{ + ProvisioningStateSHCCanceled, + ProvisioningStateSHCFailed, + ProvisioningStateSHCProvisioning, + ProvisioningStateSHCSucceeded, + } +} + // PublicNetworkAccess - Enabled allows this resource to be accessed from both public and private networks, Disabled allows // this resource to only be accessed via private endpoints type PublicNetworkAccess string @@ -355,6 +580,27 @@ func PossiblePublicNetworkAccessValues() []PublicNetworkAccess { } } +// PublicUDP - Default: AVD-wide settings are used to determine connection availability, Enabled: UDP will attempt this connection +// type when making connections. This means that this connection is possible, but is +// not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP will not attempt this connection +// type when making connections +type PublicUDP string + +const ( + PublicUDPDefault PublicUDP = "Default" + PublicUDPDisabled PublicUDP = "Disabled" + PublicUDPEnabled PublicUDP = "Enabled" +) + +// PossiblePublicUDPValues returns the possible values for the PublicUDP const type. +func PossiblePublicUDPValues() []PublicUDP { + return []PublicUDP{ + PublicUDPDefault, + PublicUDPDisabled, + PublicUDPEnabled, + } +} + // RegistrationTokenOperation - The type of resetting the token. type RegistrationTokenOperation string @@ -373,6 +619,27 @@ func PossibleRegistrationTokenOperationValues() []RegistrationTokenOperation { } } +// RelayUDP - Default: AVD-wide settings are used to determine connection availability, Enabled: UDP will attempt this connection +// type when making connections. This means that this connection is possible, but is +// not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP will not attempt this connection +// type when making connections +type RelayUDP string + +const ( + RelayUDPDefault RelayUDP = "Default" + RelayUDPDisabled RelayUDP = "Disabled" + RelayUDPEnabled RelayUDP = "Enabled" +) + +// PossibleRelayUDPValues returns the possible values for the RelayUDP const type. +func PossibleRelayUDPValues() []RelayUDP { + return []RelayUDP{ + RelayUDPDefault, + RelayUDPDisabled, + RelayUDPEnabled, + } +} + // RemoteApplicationType - Resource Type of Application. type RemoteApplicationType string @@ -434,6 +701,10 @@ func PossibleSSOSecretTypeValues() []SSOSecretType { type ScalingHostPoolType string const ( + // ScalingHostPoolTypePersonal - Users will be assigned a SessionHost either by administrators (PersonalDesktopAssignmentType + // = Direct) or upon connecting to the pool (PersonalDesktopAssignmentType = Automatic). They will always be redirected to + // their assigned SessionHost. + ScalingHostPoolTypePersonal ScalingHostPoolType = "Personal" // ScalingHostPoolTypePooled - Users get a new (random) SessionHost every time it connects to the HostPool. ScalingHostPoolTypePooled ScalingHostPoolType = "Pooled" ) @@ -441,6 +712,7 @@ const ( // PossibleScalingHostPoolTypeValues returns the possible values for the ScalingHostPoolType const type. func PossibleScalingHostPoolTypeValues() []ScalingHostPoolType { return []ScalingHostPoolType{ + ScalingHostPoolTypePersonal, ScalingHostPoolTypePooled, } } @@ -655,6 +927,24 @@ func PossibleStopHostsWhenValues() []StopHostsWhen { } } +// Type - The type of image session hosts use in the hostpool. +type Type string + +const ( + // TypeCustom - Using a custom image. + TypeCustom Type = "Custom" + // TypeMarketplace - Using default marketplace images offered by Azure Marketplace. + TypeMarketplace Type = "Marketplace" +) + +// PossibleTypeValues returns the possible values for the Type const type. +func PossibleTypeValues() []Type { + return []Type{ + TypeCustom, + TypeMarketplace, + } +} + // UpdateState - Update state of a SessionHost. type UpdateState string @@ -676,3 +966,48 @@ func PossibleUpdateStateValues() []UpdateState { UpdateStateSucceeded, } } + +// VirtualMachineDiskType - The disk type used by virtual machine in hostpool session host. +type VirtualMachineDiskType string + +const ( + // VirtualMachineDiskTypePremiumLRS - Premium SSD locally redundant storage. Best for production and performance sensitive + // workloads. + VirtualMachineDiskTypePremiumLRS VirtualMachineDiskType = "Premium_LRS" + // VirtualMachineDiskTypeStandardLRS - Standard HDD locally redundant storage. Best for backup, non-critical, and infrequent + // access. + VirtualMachineDiskTypeStandardLRS VirtualMachineDiskType = "Standard_LRS" + // VirtualMachineDiskTypeStandardSSDLRS - Standard SSD locally redundant storage. Best for web servers, lightly used enterprise + // applications and dev/test. + VirtualMachineDiskTypeStandardSSDLRS VirtualMachineDiskType = "StandardSSD_LRS" +) + +// PossibleVirtualMachineDiskTypeValues returns the possible values for the VirtualMachineDiskType const type. +func PossibleVirtualMachineDiskTypeValues() []VirtualMachineDiskType { + return []VirtualMachineDiskType{ + VirtualMachineDiskTypePremiumLRS, + VirtualMachineDiskTypeStandardLRS, + VirtualMachineDiskTypeStandardSSDLRS, + } +} + +// VirtualMachineSecurityType - The security type used by virtual machine in hostpool session host. Default is Standard. +type VirtualMachineSecurityType string + +const ( + // VirtualMachineSecurityTypeConfidentialVM - Confidential Virtual Machine security protocol + VirtualMachineSecurityTypeConfidentialVM VirtualMachineSecurityType = "ConfidentialVM" + // VirtualMachineSecurityTypeStandard - Standard security protocol. No additional parameters + VirtualMachineSecurityTypeStandard VirtualMachineSecurityType = "Standard" + // VirtualMachineSecurityTypeTrustedLaunch - TrustedLaunch allows for secure boot adn vTPM + VirtualMachineSecurityTypeTrustedLaunch VirtualMachineSecurityType = "TrustedLaunch" +) + +// PossibleVirtualMachineSecurityTypeValues returns the possible values for the VirtualMachineSecurityType const type. +func PossibleVirtualMachineSecurityTypeValues() []VirtualMachineSecurityType { + return []VirtualMachineSecurityType{ + VirtualMachineSecurityTypeConfidentialVM, + VirtualMachineSecurityTypeStandard, + VirtualMachineSecurityTypeTrustedLaunch, + } +} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/controlsessionhostupdate_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/controlsessionhostupdate_client.go new file mode 100644 index 000000000000..a67c9589061f --- /dev/null +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/controlsessionhostupdate_client.go @@ -0,0 +1,125 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armdesktopvirtualization + +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" +) + +// ControlSessionHostUpdateClient contains the methods for the ControlSessionHostUpdate group. +// Don't use this type directly, use NewControlSessionHostUpdateClient() instead. +type ControlSessionHostUpdateClient struct { + internal *arm.Client + subscriptionID string +} + +// NewControlSessionHostUpdateClient creates a new instance of ControlSessionHostUpdateClient with the specified values. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewControlSessionHostUpdateClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ControlSessionHostUpdateClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ControlSessionHostUpdateClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginPost - Control update of a hostpool. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-04-08-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - hostPoolName - The name of the host pool within the specified resource group +// - hostPoolUpdateControlParameter - Object containing control action for hostpool update. +// - options - ControlSessionHostUpdateClientBeginPostOptions contains the optional parameters for the ControlSessionHostUpdateClient.BeginPost +// method. +func (client *ControlSessionHostUpdateClient) BeginPost(ctx context.Context, resourceGroupName string, hostPoolName string, hostPoolUpdateControlParameter HostPoolUpdateControlParameter, options *ControlSessionHostUpdateClientBeginPostOptions) (*runtime.Poller[ControlSessionHostUpdateClientPostResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.post(ctx, resourceGroupName, hostPoolName, hostPoolUpdateControlParameter, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ControlSessionHostUpdateClientPostResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ControlSessionHostUpdateClientPostResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Post - Control update of a hostpool. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-04-08-preview +func (client *ControlSessionHostUpdateClient) post(ctx context.Context, resourceGroupName string, hostPoolName string, hostPoolUpdateControlParameter HostPoolUpdateControlParameter, options *ControlSessionHostUpdateClientBeginPostOptions) (*http.Response, error) { + var err error + const operationName = "ControlSessionHostUpdateClient.BeginPost" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.postCreateRequest(ctx, resourceGroupName, hostPoolName, hostPoolUpdateControlParameter, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// postCreateRequest creates the Post request. +func (client *ControlSessionHostUpdateClient) postCreateRequest(ctx context.Context, resourceGroupName string, hostPoolName string, hostPoolUpdateControlParameter HostPoolUpdateControlParameter, options *ControlSessionHostUpdateClientBeginPostOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostManagements/default/controlSessionHostUpdate" + 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 hostPoolName == "" { + return nil, errors.New("parameter hostPoolName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{hostPoolName}", url.PathEscape(hostPoolName)) + 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", "2024-04-08-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, hostPoolUpdateControlParameter); err != nil { + return nil, err + } + return req, nil +} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/desktops_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/desktops_client.go index 1ffaaa3ff65a..4901bd44b84f 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/desktops_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/desktops_client.go @@ -29,7 +29,7 @@ type DesktopsClient struct { } // NewDesktopsClient creates a new instance of DesktopsClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewDesktopsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DesktopsClient, error) { @@ -47,7 +47,7 @@ func NewDesktopsClient(subscriptionID string, credential azcore.TokenCredential, // Get - Get a desktop. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - applicationGroupName - The name of the application group // - desktopName - The name of the desktop within the specified desktop group @@ -98,7 +98,7 @@ func (client *DesktopsClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-08-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -115,7 +115,7 @@ func (client *DesktopsClient) getHandleResponse(resp *http.Response) (DesktopsCl // NewListPager - List desktops. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - applicationGroupName - The name of the application group // - options - DesktopsClientListOptions contains the optional parameters for the DesktopsClient.NewListPager method. @@ -162,15 +162,15 @@ func (client *DesktopsClient) listCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") - if options != nil && options.PageSize != nil { - reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) + reqQP.Set("api-version", "2024-04-08-preview") + if options != nil && options.InitialSkip != nil { + reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) } if options != nil && options.IsDescending != nil { reqQP.Set("isDescending", strconv.FormatBool(*options.IsDescending)) } - if options != nil && options.InitialSkip != nil { - reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) + if options != nil && options.PageSize != nil { + reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} @@ -189,7 +189,7 @@ func (client *DesktopsClient) listHandleResponse(resp *http.Response) (DesktopsC // Update - Update a desktop. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - applicationGroupName - The name of the application group // - desktopName - The name of the desktop within the specified desktop group @@ -240,7 +240,7 @@ func (client *DesktopsClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-08-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Desktop != nil { diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/desktops_client_example_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/desktops_client_example_test.go deleted file mode 100644 index dbe02bfe89bf..000000000000 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/desktops_client_example_test.go +++ /dev/null @@ -1,156 +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 armdesktopvirtualization_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/desktopvirtualization/armdesktopvirtualization/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Desktop_Get.json -func ExampleDesktopsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDesktopsClient().Get(ctx, "resourceGroup1", "applicationGroup1", "SessionDesktop", 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.Desktop = armdesktopvirtualization.Desktop{ - // Name: to.Ptr("applicationGroup1/SessionDesktop"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/applicationGroups/desktops"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/applicationGroups/applicationGroup1/applications/SessionDesktop"), - // Properties: &armdesktopvirtualization.DesktopProperties{ - // Description: to.Ptr("des1"), - // FriendlyName: to.Ptr("friendly"), - // IconContent: []byte("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo"), - // IconHash: to.Ptr("bEQ1n2HysrGxCDvgt4bfOtkET8ydzh5SXGM0KGTBPVc"), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Desktop_Update.json -func ExampleDesktopsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDesktopsClient().Update(ctx, "resourceGroup1", "applicationGroup1", "SessionDesktop", &armdesktopvirtualization.DesktopsClientUpdateOptions{Desktop: &armdesktopvirtualization.DesktopPatch{ - Properties: &armdesktopvirtualization.DesktopPatchProperties{ - Description: to.Ptr("des1"), - FriendlyName: to.Ptr("friendly"), - }, - }, - }) - 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.Desktop = armdesktopvirtualization.Desktop{ - // Name: to.Ptr("applicationGroup1/SessionDesktop"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/applicationGroups/desktops"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/applicationGroups/applicationGroup1/desktops/SessionDesktop"), - // Properties: &armdesktopvirtualization.DesktopProperties{ - // Description: to.Ptr("des1"), - // FriendlyName: to.Ptr("friendly"), - // IconContent: []byte("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo"), - // IconHash: to.Ptr("bEQ1n2HysrGxCDvgt4bfOtkET8ydzh5SXGM0KGTBPVc"), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Desktop_List.json -func ExampleDesktopsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDesktopsClient().NewListPager("resourceGroup1", "applicationGroup1", &armdesktopvirtualization.DesktopsClientListOptions{PageSize: to.Ptr[int32](10), - IsDescending: to.Ptr(true), - InitialSkip: to.Ptr[int32](0), - }) - 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.DesktopList = armdesktopvirtualization.DesktopList{ - // Value: []*armdesktopvirtualization.Desktop{ - // { - // Name: to.Ptr("applicationGroup1/SessionDesktop"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/applicationGroups/desktops"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/applicationGroups/applicationGroup1/applications/SessionDesktop"), - // Properties: &armdesktopvirtualization.DesktopProperties{ - // Description: to.Ptr("des1"), - // FriendlyName: to.Ptr("friendly"), - // IconContent: []byte("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo"), - // IconHash: to.Ptr("bEQ1n2HysrGxCDvgt4bfOtkET8ydzh5SXGM0KGTBPVc"), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/activesessionhostconfigurations_server.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/activesessionhostconfigurations_server.go new file mode 100644 index 000000000000..5e92a675a31a --- /dev/null +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/activesessionhostconfigurations_server.go @@ -0,0 +1,152 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v3" + "net/http" + "net/url" + "regexp" +) + +// ActiveSessionHostConfigurationsServer is a fake server for instances of the armdesktopvirtualization.ActiveSessionHostConfigurationsClient type. +type ActiveSessionHostConfigurationsServer struct { + // Get is the fake for method ActiveSessionHostConfigurationsClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, hostPoolName string, options *armdesktopvirtualization.ActiveSessionHostConfigurationsClientGetOptions) (resp azfake.Responder[armdesktopvirtualization.ActiveSessionHostConfigurationsClientGetResponse], errResp azfake.ErrorResponder) + + // NewListByHostPoolPager is the fake for method ActiveSessionHostConfigurationsClient.NewListByHostPoolPager + // HTTP status codes to indicate success: http.StatusOK + NewListByHostPoolPager func(resourceGroupName string, hostPoolName string, options *armdesktopvirtualization.ActiveSessionHostConfigurationsClientListByHostPoolOptions) (resp azfake.PagerResponder[armdesktopvirtualization.ActiveSessionHostConfigurationsClientListByHostPoolResponse]) +} + +// NewActiveSessionHostConfigurationsServerTransport creates a new instance of ActiveSessionHostConfigurationsServerTransport with the provided implementation. +// The returned ActiveSessionHostConfigurationsServerTransport instance is connected to an instance of armdesktopvirtualization.ActiveSessionHostConfigurationsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewActiveSessionHostConfigurationsServerTransport(srv *ActiveSessionHostConfigurationsServer) *ActiveSessionHostConfigurationsServerTransport { + return &ActiveSessionHostConfigurationsServerTransport{ + srv: srv, + newListByHostPoolPager: newTracker[azfake.PagerResponder[armdesktopvirtualization.ActiveSessionHostConfigurationsClientListByHostPoolResponse]](), + } +} + +// ActiveSessionHostConfigurationsServerTransport connects instances of armdesktopvirtualization.ActiveSessionHostConfigurationsClient to instances of ActiveSessionHostConfigurationsServer. +// Don't use this type directly, use NewActiveSessionHostConfigurationsServerTransport instead. +type ActiveSessionHostConfigurationsServerTransport struct { + srv *ActiveSessionHostConfigurationsServer + newListByHostPoolPager *tracker[azfake.PagerResponder[armdesktopvirtualization.ActiveSessionHostConfigurationsClientListByHostPoolResponse]] +} + +// Do implements the policy.Transporter interface for ActiveSessionHostConfigurationsServerTransport. +func (a *ActiveSessionHostConfigurationsServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "ActiveSessionHostConfigurationsClient.Get": + resp, err = a.dispatchGet(req) + case "ActiveSessionHostConfigurationsClient.NewListByHostPoolPager": + resp, err = a.dispatchNewListByHostPoolPager(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (a *ActiveSessionHostConfigurationsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if a.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DesktopVirtualization/hostPools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/activeSessionHostConfigurations/default` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + hostPoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("hostPoolName")]) + if err != nil { + return nil, err + } + respr, errRespr := a.srv.Get(req.Context(), resourceGroupNameParam, hostPoolNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ActiveSessionHostConfiguration, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (a *ActiveSessionHostConfigurationsServerTransport) dispatchNewListByHostPoolPager(req *http.Request) (*http.Response, error) { + if a.srv.NewListByHostPoolPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListByHostPoolPager not implemented")} + } + newListByHostPoolPager := a.newListByHostPoolPager.get(req) + if newListByHostPoolPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DesktopVirtualization/hostPools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/activeSessionHostConfigurations` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + hostPoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("hostPoolName")]) + if err != nil { + return nil, err + } + resp := a.srv.NewListByHostPoolPager(resourceGroupNameParam, hostPoolNameParam, nil) + newListByHostPoolPager = &resp + a.newListByHostPoolPager.add(req, newListByHostPoolPager) + server.PagerResponderInjectNextLinks(newListByHostPoolPager, req, func(page *armdesktopvirtualization.ActiveSessionHostConfigurationsClientListByHostPoolResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListByHostPoolPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + a.newListByHostPoolPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListByHostPoolPager) { + a.newListByHostPoolPager.remove(req) + } + return resp, nil +} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/appattachpackage_server.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/appattachpackage_server.go new file mode 100644 index 000000000000..ed23af55eb46 --- /dev/null +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/appattachpackage_server.go @@ -0,0 +1,361 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v3" + "net/http" + "net/url" + "reflect" + "regexp" + "strconv" +) + +// AppAttachPackageServer is a fake server for instances of the armdesktopvirtualization.AppAttachPackageClient type. +type AppAttachPackageServer struct { + // CreateOrUpdate is the fake for method AppAttachPackageClient.CreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + CreateOrUpdate func(ctx context.Context, resourceGroupName string, appAttachPackageName string, appAttachPackage armdesktopvirtualization.AppAttachPackage, options *armdesktopvirtualization.AppAttachPackageClientCreateOrUpdateOptions) (resp azfake.Responder[armdesktopvirtualization.AppAttachPackageClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // Delete is the fake for method AppAttachPackageClient.Delete + // HTTP status codes to indicate success: http.StatusOK, http.StatusNoContent + Delete func(ctx context.Context, resourceGroupName string, appAttachPackageName string, options *armdesktopvirtualization.AppAttachPackageClientDeleteOptions) (resp azfake.Responder[armdesktopvirtualization.AppAttachPackageClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method AppAttachPackageClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, appAttachPackageName string, options *armdesktopvirtualization.AppAttachPackageClientGetOptions) (resp azfake.Responder[armdesktopvirtualization.AppAttachPackageClientGetResponse], errResp azfake.ErrorResponder) + + // NewListByResourceGroupPager is the fake for method AppAttachPackageClient.NewListByResourceGroupPager + // HTTP status codes to indicate success: http.StatusOK + NewListByResourceGroupPager func(resourceGroupName string, options *armdesktopvirtualization.AppAttachPackageClientListByResourceGroupOptions) (resp azfake.PagerResponder[armdesktopvirtualization.AppAttachPackageClientListByResourceGroupResponse]) + + // NewListBySubscriptionPager is the fake for method AppAttachPackageClient.NewListBySubscriptionPager + // HTTP status codes to indicate success: http.StatusOK + NewListBySubscriptionPager func(options *armdesktopvirtualization.AppAttachPackageClientListBySubscriptionOptions) (resp azfake.PagerResponder[armdesktopvirtualization.AppAttachPackageClientListBySubscriptionResponse]) + + // Update is the fake for method AppAttachPackageClient.Update + // HTTP status codes to indicate success: http.StatusOK + Update func(ctx context.Context, resourceGroupName string, appAttachPackageName string, options *armdesktopvirtualization.AppAttachPackageClientUpdateOptions) (resp azfake.Responder[armdesktopvirtualization.AppAttachPackageClientUpdateResponse], errResp azfake.ErrorResponder) +} + +// NewAppAttachPackageServerTransport creates a new instance of AppAttachPackageServerTransport with the provided implementation. +// The returned AppAttachPackageServerTransport instance is connected to an instance of armdesktopvirtualization.AppAttachPackageClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewAppAttachPackageServerTransport(srv *AppAttachPackageServer) *AppAttachPackageServerTransport { + return &AppAttachPackageServerTransport{ + srv: srv, + newListByResourceGroupPager: newTracker[azfake.PagerResponder[armdesktopvirtualization.AppAttachPackageClientListByResourceGroupResponse]](), + newListBySubscriptionPager: newTracker[azfake.PagerResponder[armdesktopvirtualization.AppAttachPackageClientListBySubscriptionResponse]](), + } +} + +// AppAttachPackageServerTransport connects instances of armdesktopvirtualization.AppAttachPackageClient to instances of AppAttachPackageServer. +// Don't use this type directly, use NewAppAttachPackageServerTransport instead. +type AppAttachPackageServerTransport struct { + srv *AppAttachPackageServer + newListByResourceGroupPager *tracker[azfake.PagerResponder[armdesktopvirtualization.AppAttachPackageClientListByResourceGroupResponse]] + newListBySubscriptionPager *tracker[azfake.PagerResponder[armdesktopvirtualization.AppAttachPackageClientListBySubscriptionResponse]] +} + +// Do implements the policy.Transporter interface for AppAttachPackageServerTransport. +func (a *AppAttachPackageServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "AppAttachPackageClient.CreateOrUpdate": + resp, err = a.dispatchCreateOrUpdate(req) + case "AppAttachPackageClient.Delete": + resp, err = a.dispatchDelete(req) + case "AppAttachPackageClient.Get": + resp, err = a.dispatchGet(req) + case "AppAttachPackageClient.NewListByResourceGroupPager": + resp, err = a.dispatchNewListByResourceGroupPager(req) + case "AppAttachPackageClient.NewListBySubscriptionPager": + resp, err = a.dispatchNewListBySubscriptionPager(req) + case "AppAttachPackageClient.Update": + resp, err = a.dispatchUpdate(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (a *AppAttachPackageServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { + if a.srv.CreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method CreateOrUpdate not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DesktopVirtualization/appAttachPackages/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armdesktopvirtualization.AppAttachPackage](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + appAttachPackageNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("appAttachPackageName")]) + if err != nil { + return nil, err + } + respr, errRespr := a.srv.CreateOrUpdate(req.Context(), resourceGroupNameParam, appAttachPackageNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).AppAttachPackage, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (a *AppAttachPackageServerTransport) dispatchDelete(req *http.Request) (*http.Response, error) { + if a.srv.Delete == nil { + return nil, &nonRetriableError{errors.New("fake for method Delete not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DesktopVirtualization/appAttachPackages/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + appAttachPackageNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("appAttachPackageName")]) + if err != nil { + return nil, err + } + forceUnescaped, err := url.QueryUnescape(qp.Get("force")) + if err != nil { + return nil, err + } + forceParam, err := parseOptional(forceUnescaped, strconv.ParseBool) + if err != nil { + return nil, err + } + var options *armdesktopvirtualization.AppAttachPackageClientDeleteOptions + if forceParam != nil { + options = &armdesktopvirtualization.AppAttachPackageClientDeleteOptions{ + Force: forceParam, + } + } + respr, errRespr := a.srv.Delete(req.Context(), resourceGroupNameParam, appAttachPackageNameParam, options) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusNoContent", respContent.HTTPStatus)} + } + resp, err := server.NewResponse(respContent, req, nil) + if err != nil { + return nil, err + } + return resp, nil +} + +func (a *AppAttachPackageServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if a.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DesktopVirtualization/appAttachPackages/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + appAttachPackageNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("appAttachPackageName")]) + if err != nil { + return nil, err + } + respr, errRespr := a.srv.Get(req.Context(), resourceGroupNameParam, appAttachPackageNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).AppAttachPackage, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (a *AppAttachPackageServerTransport) dispatchNewListByResourceGroupPager(req *http.Request) (*http.Response, error) { + if a.srv.NewListByResourceGroupPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListByResourceGroupPager not implemented")} + } + newListByResourceGroupPager := a.newListByResourceGroupPager.get(req) + if newListByResourceGroupPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DesktopVirtualization/appAttachPackages` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 2 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + filterUnescaped, err := url.QueryUnescape(qp.Get("$filter")) + if err != nil { + return nil, err + } + filterParam := getOptional(filterUnescaped) + var options *armdesktopvirtualization.AppAttachPackageClientListByResourceGroupOptions + if filterParam != nil { + options = &armdesktopvirtualization.AppAttachPackageClientListByResourceGroupOptions{ + Filter: filterParam, + } + } + resp := a.srv.NewListByResourceGroupPager(resourceGroupNameParam, options) + newListByResourceGroupPager = &resp + a.newListByResourceGroupPager.add(req, newListByResourceGroupPager) + server.PagerResponderInjectNextLinks(newListByResourceGroupPager, req, func(page *armdesktopvirtualization.AppAttachPackageClientListByResourceGroupResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListByResourceGroupPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + a.newListByResourceGroupPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListByResourceGroupPager) { + a.newListByResourceGroupPager.remove(req) + } + return resp, nil +} + +func (a *AppAttachPackageServerTransport) dispatchNewListBySubscriptionPager(req *http.Request) (*http.Response, error) { + if a.srv.NewListBySubscriptionPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListBySubscriptionPager not implemented")} + } + newListBySubscriptionPager := a.newListBySubscriptionPager.get(req) + if newListBySubscriptionPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DesktopVirtualization/appAttachPackages` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 1 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + filterUnescaped, err := url.QueryUnescape(qp.Get("$filter")) + if err != nil { + return nil, err + } + filterParam := getOptional(filterUnescaped) + var options *armdesktopvirtualization.AppAttachPackageClientListBySubscriptionOptions + if filterParam != nil { + options = &armdesktopvirtualization.AppAttachPackageClientListBySubscriptionOptions{ + Filter: filterParam, + } + } + resp := a.srv.NewListBySubscriptionPager(options) + newListBySubscriptionPager = &resp + a.newListBySubscriptionPager.add(req, newListBySubscriptionPager) + server.PagerResponderInjectNextLinks(newListBySubscriptionPager, req, func(page *armdesktopvirtualization.AppAttachPackageClientListBySubscriptionResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListBySubscriptionPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + a.newListBySubscriptionPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListBySubscriptionPager) { + a.newListBySubscriptionPager.remove(req) + } + return resp, nil +} + +func (a *AppAttachPackageServerTransport) dispatchUpdate(req *http.Request) (*http.Response, error) { + if a.srv.Update == nil { + return nil, &nonRetriableError{errors.New("fake for method Update not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DesktopVirtualization/appAttachPackages/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armdesktopvirtualization.AppAttachPackagePatch](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + appAttachPackageNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("appAttachPackageName")]) + if err != nil { + return nil, err + } + var options *armdesktopvirtualization.AppAttachPackageClientUpdateOptions + if !reflect.ValueOf(body).IsZero() { + options = &armdesktopvirtualization.AppAttachPackageClientUpdateOptions{ + AppAttachPackagePatch: &body, + } + } + respr, errRespr := a.srv.Update(req.Context(), resourceGroupNameParam, appAttachPackageNameParam, options) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).AppAttachPackage, req) + if err != nil { + return nil, err + } + return resp, nil +} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/appattachpackageinfo_server.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/appattachpackageinfo_server.go new file mode 100644 index 000000000000..c6c1630c9cfa --- /dev/null +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/appattachpackageinfo_server.go @@ -0,0 +1,116 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v3" + "net/http" + "net/url" + "regexp" +) + +// AppAttachPackageInfoServer is a fake server for instances of the armdesktopvirtualization.AppAttachPackageInfoClient type. +type AppAttachPackageInfoServer struct { + // NewImportPager is the fake for method AppAttachPackageInfoClient.NewImportPager + // HTTP status codes to indicate success: http.StatusOK + NewImportPager func(resourceGroupName string, hostPoolName string, importPackageInfoRequest armdesktopvirtualization.ImportPackageInfoRequest, options *armdesktopvirtualization.AppAttachPackageInfoClientImportOptions) (resp azfake.PagerResponder[armdesktopvirtualization.AppAttachPackageInfoClientImportResponse]) +} + +// NewAppAttachPackageInfoServerTransport creates a new instance of AppAttachPackageInfoServerTransport with the provided implementation. +// The returned AppAttachPackageInfoServerTransport instance is connected to an instance of armdesktopvirtualization.AppAttachPackageInfoClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewAppAttachPackageInfoServerTransport(srv *AppAttachPackageInfoServer) *AppAttachPackageInfoServerTransport { + return &AppAttachPackageInfoServerTransport{ + srv: srv, + newImportPager: newTracker[azfake.PagerResponder[armdesktopvirtualization.AppAttachPackageInfoClientImportResponse]](), + } +} + +// AppAttachPackageInfoServerTransport connects instances of armdesktopvirtualization.AppAttachPackageInfoClient to instances of AppAttachPackageInfoServer. +// Don't use this type directly, use NewAppAttachPackageInfoServerTransport instead. +type AppAttachPackageInfoServerTransport struct { + srv *AppAttachPackageInfoServer + newImportPager *tracker[azfake.PagerResponder[armdesktopvirtualization.AppAttachPackageInfoClientImportResponse]] +} + +// Do implements the policy.Transporter interface for AppAttachPackageInfoServerTransport. +func (a *AppAttachPackageInfoServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "AppAttachPackageInfoClient.NewImportPager": + resp, err = a.dispatchNewImportPager(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (a *AppAttachPackageInfoServerTransport) dispatchNewImportPager(req *http.Request) (*http.Response, error) { + if a.srv.NewImportPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewImportPager not implemented")} + } + newImportPager := a.newImportPager.get(req) + if newImportPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DesktopVirtualization/hostPools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/importAppAttachPackageInfo` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armdesktopvirtualization.ImportPackageInfoRequest](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + hostPoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("hostPoolName")]) + if err != nil { + return nil, err + } + resp := a.srv.NewImportPager(resourceGroupNameParam, hostPoolNameParam, body, nil) + newImportPager = &resp + a.newImportPager.add(req, newImportPager) + server.PagerResponderInjectNextLinks(newImportPager, req, func(page *armdesktopvirtualization.AppAttachPackageInfoClientImportResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newImportPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + a.newImportPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newImportPager) { + a.newImportPager.remove(req) + } + return resp, nil +} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/applicationgroups_server.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/applicationgroups_server.go index 646303fca197..cc908d866d83 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/applicationgroups_server.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/applicationgroups_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v3" "net/http" "net/url" "reflect" diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/applications_server.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/applications_server.go index 26ce1f45f8c3..cac9731a20b7 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/applications_server.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/applications_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v3" "net/http" "net/url" "reflect" diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/controlsessionhostupdate_server.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/controlsessionhostupdate_server.go new file mode 100644 index 000000000000..8ed3a6846edf --- /dev/null +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/controlsessionhostupdate_server.go @@ -0,0 +1,119 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v3" + "net/http" + "net/url" + "regexp" +) + +// ControlSessionHostUpdateServer is a fake server for instances of the armdesktopvirtualization.ControlSessionHostUpdateClient type. +type ControlSessionHostUpdateServer struct { + // BeginPost is the fake for method ControlSessionHostUpdateClient.BeginPost + // HTTP status codes to indicate success: http.StatusAccepted + BeginPost func(ctx context.Context, resourceGroupName string, hostPoolName string, hostPoolUpdateControlParameter armdesktopvirtualization.HostPoolUpdateControlParameter, options *armdesktopvirtualization.ControlSessionHostUpdateClientBeginPostOptions) (resp azfake.PollerResponder[armdesktopvirtualization.ControlSessionHostUpdateClientPostResponse], errResp azfake.ErrorResponder) +} + +// NewControlSessionHostUpdateServerTransport creates a new instance of ControlSessionHostUpdateServerTransport with the provided implementation. +// The returned ControlSessionHostUpdateServerTransport instance is connected to an instance of armdesktopvirtualization.ControlSessionHostUpdateClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewControlSessionHostUpdateServerTransport(srv *ControlSessionHostUpdateServer) *ControlSessionHostUpdateServerTransport { + return &ControlSessionHostUpdateServerTransport{ + srv: srv, + beginPost: newTracker[azfake.PollerResponder[armdesktopvirtualization.ControlSessionHostUpdateClientPostResponse]](), + } +} + +// ControlSessionHostUpdateServerTransport connects instances of armdesktopvirtualization.ControlSessionHostUpdateClient to instances of ControlSessionHostUpdateServer. +// Don't use this type directly, use NewControlSessionHostUpdateServerTransport instead. +type ControlSessionHostUpdateServerTransport struct { + srv *ControlSessionHostUpdateServer + beginPost *tracker[azfake.PollerResponder[armdesktopvirtualization.ControlSessionHostUpdateClientPostResponse]] +} + +// Do implements the policy.Transporter interface for ControlSessionHostUpdateServerTransport. +func (c *ControlSessionHostUpdateServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "ControlSessionHostUpdateClient.BeginPost": + resp, err = c.dispatchBeginPost(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (c *ControlSessionHostUpdateServerTransport) dispatchBeginPost(req *http.Request) (*http.Response, error) { + if c.srv.BeginPost == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginPost not implemented")} + } + beginPost := c.beginPost.get(req) + if beginPost == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DesktopVirtualization/hostPools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/sessionHostManagements/default/controlSessionHostUpdate` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armdesktopvirtualization.HostPoolUpdateControlParameter](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + hostPoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("hostPoolName")]) + if err != nil { + return nil, err + } + respr, errRespr := c.srv.BeginPost(req.Context(), resourceGroupNameParam, hostPoolNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginPost = &respr + c.beginPost.add(req, beginPost) + } + + resp, err := server.PollerResponderNext(beginPost, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + c.beginPost.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginPost) { + c.beginPost.remove(req) + } + + return resp, nil +} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/desktops_server.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/desktops_server.go index ed14e2507861..7992721e3f84 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/desktops_server.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/desktops_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v3" "net/http" "net/url" "reflect" diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/hostpools_server.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/hostpools_server.go index a0272e5db2fc..97767df7b7f6 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/hostpools_server.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/hostpools_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v3" "net/http" "net/url" "reflect" @@ -46,6 +46,10 @@ type HostPoolsServer struct { // HTTP status codes to indicate success: http.StatusOK NewListByResourceGroupPager func(resourceGroupName string, options *armdesktopvirtualization.HostPoolsClientListByResourceGroupOptions) (resp azfake.PagerResponder[armdesktopvirtualization.HostPoolsClientListByResourceGroupResponse]) + // ListRegistrationTokens is the fake for method HostPoolsClient.ListRegistrationTokens + // HTTP status codes to indicate success: http.StatusOK + ListRegistrationTokens func(ctx context.Context, resourceGroupName string, hostPoolName string, options *armdesktopvirtualization.HostPoolsClientListRegistrationTokensOptions) (resp azfake.Responder[armdesktopvirtualization.HostPoolsClientListRegistrationTokensResponse], errResp azfake.ErrorResponder) + // RetrieveRegistrationToken is the fake for method HostPoolsClient.RetrieveRegistrationToken // HTTP status codes to indicate success: http.StatusOK RetrieveRegistrationToken func(ctx context.Context, resourceGroupName string, hostPoolName string, options *armdesktopvirtualization.HostPoolsClientRetrieveRegistrationTokenOptions) (resp azfake.Responder[armdesktopvirtualization.HostPoolsClientRetrieveRegistrationTokenResponse], errResp azfake.ErrorResponder) @@ -96,6 +100,8 @@ func (h *HostPoolsServerTransport) Do(req *http.Request) (*http.Response, error) resp, err = h.dispatchNewListPager(req) case "HostPoolsClient.NewListByResourceGroupPager": resp, err = h.dispatchNewListByResourceGroupPager(req) + case "HostPoolsClient.ListRegistrationTokens": + resp, err = h.dispatchListRegistrationTokens(req) case "HostPoolsClient.RetrieveRegistrationToken": resp, err = h.dispatchRetrieveRegistrationToken(req) case "HostPoolsClient.Update": @@ -389,6 +395,39 @@ func (h *HostPoolsServerTransport) dispatchNewListByResourceGroupPager(req *http return resp, nil } +func (h *HostPoolsServerTransport) dispatchListRegistrationTokens(req *http.Request) (*http.Response, error) { + if h.srv.ListRegistrationTokens == nil { + return nil, &nonRetriableError{errors.New("fake for method ListRegistrationTokens not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DesktopVirtualization/hostPools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/listRegistrationTokens` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + hostPoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("hostPoolName")]) + if err != nil { + return nil, err + } + respr, errRespr := h.srv.ListRegistrationTokens(req.Context(), resourceGroupNameParam, hostPoolNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).RegistrationTokenList, req) + if err != nil { + return nil, err + } + return resp, nil +} + func (h *HostPoolsServerTransport) dispatchRetrieveRegistrationToken(req *http.Request) (*http.Response, error) { if h.srv.RetrieveRegistrationToken == nil { return nil, &nonRetriableError{errors.New("fake for method RetrieveRegistrationToken not implemented")} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/initiatesessionhostupdate_server.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/initiatesessionhostupdate_server.go new file mode 100644 index 000000000000..39d99de837de --- /dev/null +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/initiatesessionhostupdate_server.go @@ -0,0 +1,111 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v3" + "net/http" + "net/url" + "reflect" + "regexp" +) + +// InitiateSessionHostUpdateServer is a fake server for instances of the armdesktopvirtualization.InitiateSessionHostUpdateClient type. +type InitiateSessionHostUpdateServer struct { + // Post is the fake for method InitiateSessionHostUpdateClient.Post + // HTTP status codes to indicate success: http.StatusOK + Post func(ctx context.Context, resourceGroupName string, hostPoolName string, options *armdesktopvirtualization.InitiateSessionHostUpdateClientPostOptions) (resp azfake.Responder[armdesktopvirtualization.InitiateSessionHostUpdateClientPostResponse], errResp azfake.ErrorResponder) +} + +// NewInitiateSessionHostUpdateServerTransport creates a new instance of InitiateSessionHostUpdateServerTransport with the provided implementation. +// The returned InitiateSessionHostUpdateServerTransport instance is connected to an instance of armdesktopvirtualization.InitiateSessionHostUpdateClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewInitiateSessionHostUpdateServerTransport(srv *InitiateSessionHostUpdateServer) *InitiateSessionHostUpdateServerTransport { + return &InitiateSessionHostUpdateServerTransport{srv: srv} +} + +// InitiateSessionHostUpdateServerTransport connects instances of armdesktopvirtualization.InitiateSessionHostUpdateClient to instances of InitiateSessionHostUpdateServer. +// Don't use this type directly, use NewInitiateSessionHostUpdateServerTransport instead. +type InitiateSessionHostUpdateServerTransport struct { + srv *InitiateSessionHostUpdateServer +} + +// Do implements the policy.Transporter interface for InitiateSessionHostUpdateServerTransport. +func (i *InitiateSessionHostUpdateServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "InitiateSessionHostUpdateClient.Post": + resp, err = i.dispatchPost(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (i *InitiateSessionHostUpdateServerTransport) dispatchPost(req *http.Request) (*http.Response, error) { + if i.srv.Post == nil { + return nil, &nonRetriableError{errors.New("fake for method Post not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DesktopVirtualization/hostPools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/sessionHostManagements/default/initiateSessionHostUpdate` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armdesktopvirtualization.UpdateSessionHostsRequestBody](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + hostPoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("hostPoolName")]) + if err != nil { + return nil, err + } + var options *armdesktopvirtualization.InitiateSessionHostUpdateClientPostOptions + if !reflect.ValueOf(body).IsZero() { + options = &armdesktopvirtualization.InitiateSessionHostUpdateClientPostOptions{ + UpdateSessionHostsRequestBody: &body, + } + } + respr, errRespr := i.srv.Post(req.Context(), resourceGroupNameParam, hostPoolNameParam, options) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.NewResponse(respContent, req, nil) + if err != nil { + return nil, err + } + return resp, nil +} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/msiximages_server.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/msiximages_server.go index 644c2ef89dd5..d7343fb2309e 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/msiximages_server.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/msiximages_server.go @@ -15,7 +15,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v3" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/msixpackages_server.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/msixpackages_server.go index da1f72bae6d0..14f901183a71 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/msixpackages_server.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/msixpackages_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v3" "net/http" "net/url" "reflect" diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/operations_server.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/operations_server.go index fb58e5f807f2..4613e59deb26 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/operations_server.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/operations_server.go @@ -15,7 +15,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v3" "net/http" ) diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/privateendpointconnections_server.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/privateendpointconnections_server.go index f377b83fee6d..031b44e48463 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/privateendpointconnections_server.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/privateendpointconnections_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v3" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/privatelinkresources_server.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/privatelinkresources_server.go index 65c1912ec461..b1314de8cb34 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/privatelinkresources_server.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/privatelinkresources_server.go @@ -15,7 +15,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v3" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/scalingplanpersonalschedules_server.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/scalingplanpersonalschedules_server.go index 485b8ff5e21b..3c7c55048789 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/scalingplanpersonalschedules_server.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/scalingplanpersonalschedules_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v3" "net/http" "net/url" "reflect" diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/scalingplanpooledschedules_server.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/scalingplanpooledschedules_server.go index 7604555e5557..16faf6749c9c 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/scalingplanpooledschedules_server.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/scalingplanpooledschedules_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v3" "net/http" "net/url" "reflect" diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/scalingplans_server.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/scalingplans_server.go index 70d382457172..3469cd3076a6 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/scalingplans_server.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/scalingplans_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v3" "net/http" "net/url" "reflect" diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/server_factory.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/server_factory.go index b8912a0f565c..4ff03e2b7be7 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/server_factory.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/server_factory.go @@ -19,22 +19,31 @@ import ( // ServerFactory is a fake server for instances of the armdesktopvirtualization.ClientFactory type. type ServerFactory struct { - ApplicationGroupsServer ApplicationGroupsServer - ApplicationsServer ApplicationsServer - DesktopsServer DesktopsServer - HostPoolsServer HostPoolsServer - MSIXPackagesServer MSIXPackagesServer - MsixImagesServer MsixImagesServer - OperationsServer OperationsServer - PrivateEndpointConnectionsServer PrivateEndpointConnectionsServer - PrivateLinkResourcesServer PrivateLinkResourcesServer - ScalingPlanPersonalSchedulesServer ScalingPlanPersonalSchedulesServer - ScalingPlanPooledSchedulesServer ScalingPlanPooledSchedulesServer - ScalingPlansServer ScalingPlansServer - SessionHostsServer SessionHostsServer - StartMenuItemsServer StartMenuItemsServer - UserSessionsServer UserSessionsServer - WorkspacesServer WorkspacesServer + ActiveSessionHostConfigurationsServer ActiveSessionHostConfigurationsServer + AppAttachPackageServer AppAttachPackageServer + AppAttachPackageInfoServer AppAttachPackageInfoServer + ApplicationGroupsServer ApplicationGroupsServer + ApplicationsServer ApplicationsServer + ControlSessionHostUpdateServer ControlSessionHostUpdateServer + DesktopsServer DesktopsServer + HostPoolsServer HostPoolsServer + InitiateSessionHostUpdateServer InitiateSessionHostUpdateServer + MSIXPackagesServer MSIXPackagesServer + MsixImagesServer MsixImagesServer + OperationsServer OperationsServer + PrivateEndpointConnectionsServer PrivateEndpointConnectionsServer + PrivateLinkResourcesServer PrivateLinkResourcesServer + ScalingPlanPersonalSchedulesServer ScalingPlanPersonalSchedulesServer + ScalingPlanPooledSchedulesServer ScalingPlanPooledSchedulesServer + ScalingPlansServer ScalingPlansServer + SessionHostServer SessionHostServer + SessionHostConfigurationsServer SessionHostConfigurationsServer + SessionHostManagementsServer SessionHostManagementsServer + SessionHostManagementsUpdateStatusServer SessionHostManagementsUpdateStatusServer + SessionHostsServer SessionHostsServer + StartMenuItemsServer StartMenuItemsServer + UserSessionsServer UserSessionsServer + WorkspacesServer WorkspacesServer } // NewServerFactoryTransport creates a new instance of ServerFactoryTransport with the provided implementation. @@ -49,24 +58,33 @@ func NewServerFactoryTransport(srv *ServerFactory) *ServerFactoryTransport { // ServerFactoryTransport connects instances of armdesktopvirtualization.ClientFactory to instances of ServerFactory. // Don't use this type directly, use NewServerFactoryTransport instead. type ServerFactoryTransport struct { - srv *ServerFactory - trMu sync.Mutex - trApplicationGroupsServer *ApplicationGroupsServerTransport - trApplicationsServer *ApplicationsServerTransport - trDesktopsServer *DesktopsServerTransport - trHostPoolsServer *HostPoolsServerTransport - trMSIXPackagesServer *MSIXPackagesServerTransport - trMsixImagesServer *MsixImagesServerTransport - trOperationsServer *OperationsServerTransport - trPrivateEndpointConnectionsServer *PrivateEndpointConnectionsServerTransport - trPrivateLinkResourcesServer *PrivateLinkResourcesServerTransport - trScalingPlanPersonalSchedulesServer *ScalingPlanPersonalSchedulesServerTransport - trScalingPlanPooledSchedulesServer *ScalingPlanPooledSchedulesServerTransport - trScalingPlansServer *ScalingPlansServerTransport - trSessionHostsServer *SessionHostsServerTransport - trStartMenuItemsServer *StartMenuItemsServerTransport - trUserSessionsServer *UserSessionsServerTransport - trWorkspacesServer *WorkspacesServerTransport + srv *ServerFactory + trMu sync.Mutex + trActiveSessionHostConfigurationsServer *ActiveSessionHostConfigurationsServerTransport + trAppAttachPackageServer *AppAttachPackageServerTransport + trAppAttachPackageInfoServer *AppAttachPackageInfoServerTransport + trApplicationGroupsServer *ApplicationGroupsServerTransport + trApplicationsServer *ApplicationsServerTransport + trControlSessionHostUpdateServer *ControlSessionHostUpdateServerTransport + trDesktopsServer *DesktopsServerTransport + trHostPoolsServer *HostPoolsServerTransport + trInitiateSessionHostUpdateServer *InitiateSessionHostUpdateServerTransport + trMSIXPackagesServer *MSIXPackagesServerTransport + trMsixImagesServer *MsixImagesServerTransport + trOperationsServer *OperationsServerTransport + trPrivateEndpointConnectionsServer *PrivateEndpointConnectionsServerTransport + trPrivateLinkResourcesServer *PrivateLinkResourcesServerTransport + trScalingPlanPersonalSchedulesServer *ScalingPlanPersonalSchedulesServerTransport + trScalingPlanPooledSchedulesServer *ScalingPlanPooledSchedulesServerTransport + trScalingPlansServer *ScalingPlansServerTransport + trSessionHostServer *SessionHostServerTransport + trSessionHostConfigurationsServer *SessionHostConfigurationsServerTransport + trSessionHostManagementsServer *SessionHostManagementsServerTransport + trSessionHostManagementsUpdateStatusServer *SessionHostManagementsUpdateStatusServerTransport + trSessionHostsServer *SessionHostsServerTransport + trStartMenuItemsServer *StartMenuItemsServerTransport + trUserSessionsServer *UserSessionsServerTransport + trWorkspacesServer *WorkspacesServerTransport } // Do implements the policy.Transporter interface for ServerFactoryTransport. @@ -82,6 +100,21 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { var err error switch client { + case "ActiveSessionHostConfigurationsClient": + initServer(s, &s.trActiveSessionHostConfigurationsServer, func() *ActiveSessionHostConfigurationsServerTransport { + return NewActiveSessionHostConfigurationsServerTransport(&s.srv.ActiveSessionHostConfigurationsServer) + }) + resp, err = s.trActiveSessionHostConfigurationsServer.Do(req) + case "AppAttachPackageClient": + initServer(s, &s.trAppAttachPackageServer, func() *AppAttachPackageServerTransport { + return NewAppAttachPackageServerTransport(&s.srv.AppAttachPackageServer) + }) + resp, err = s.trAppAttachPackageServer.Do(req) + case "AppAttachPackageInfoClient": + initServer(s, &s.trAppAttachPackageInfoServer, func() *AppAttachPackageInfoServerTransport { + return NewAppAttachPackageInfoServerTransport(&s.srv.AppAttachPackageInfoServer) + }) + resp, err = s.trAppAttachPackageInfoServer.Do(req) case "ApplicationGroupsClient": initServer(s, &s.trApplicationGroupsServer, func() *ApplicationGroupsServerTransport { return NewApplicationGroupsServerTransport(&s.srv.ApplicationGroupsServer) @@ -90,12 +123,22 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { case "ApplicationsClient": initServer(s, &s.trApplicationsServer, func() *ApplicationsServerTransport { return NewApplicationsServerTransport(&s.srv.ApplicationsServer) }) resp, err = s.trApplicationsServer.Do(req) + case "ControlSessionHostUpdateClient": + initServer(s, &s.trControlSessionHostUpdateServer, func() *ControlSessionHostUpdateServerTransport { + return NewControlSessionHostUpdateServerTransport(&s.srv.ControlSessionHostUpdateServer) + }) + resp, err = s.trControlSessionHostUpdateServer.Do(req) case "DesktopsClient": initServer(s, &s.trDesktopsServer, func() *DesktopsServerTransport { return NewDesktopsServerTransport(&s.srv.DesktopsServer) }) resp, err = s.trDesktopsServer.Do(req) case "HostPoolsClient": initServer(s, &s.trHostPoolsServer, func() *HostPoolsServerTransport { return NewHostPoolsServerTransport(&s.srv.HostPoolsServer) }) resp, err = s.trHostPoolsServer.Do(req) + case "InitiateSessionHostUpdateClient": + initServer(s, &s.trInitiateSessionHostUpdateServer, func() *InitiateSessionHostUpdateServerTransport { + return NewInitiateSessionHostUpdateServerTransport(&s.srv.InitiateSessionHostUpdateServer) + }) + resp, err = s.trInitiateSessionHostUpdateServer.Do(req) case "MSIXPackagesClient": initServer(s, &s.trMSIXPackagesServer, func() *MSIXPackagesServerTransport { return NewMSIXPackagesServerTransport(&s.srv.MSIXPackagesServer) }) resp, err = s.trMSIXPackagesServer.Do(req) @@ -128,6 +171,24 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { case "ScalingPlansClient": initServer(s, &s.trScalingPlansServer, func() *ScalingPlansServerTransport { return NewScalingPlansServerTransport(&s.srv.ScalingPlansServer) }) resp, err = s.trScalingPlansServer.Do(req) + case "SessionHostClient": + initServer(s, &s.trSessionHostServer, func() *SessionHostServerTransport { return NewSessionHostServerTransport(&s.srv.SessionHostServer) }) + resp, err = s.trSessionHostServer.Do(req) + case "SessionHostConfigurationsClient": + initServer(s, &s.trSessionHostConfigurationsServer, func() *SessionHostConfigurationsServerTransport { + return NewSessionHostConfigurationsServerTransport(&s.srv.SessionHostConfigurationsServer) + }) + resp, err = s.trSessionHostConfigurationsServer.Do(req) + case "SessionHostManagementsClient": + initServer(s, &s.trSessionHostManagementsServer, func() *SessionHostManagementsServerTransport { + return NewSessionHostManagementsServerTransport(&s.srv.SessionHostManagementsServer) + }) + resp, err = s.trSessionHostManagementsServer.Do(req) + case "SessionHostManagementsUpdateStatusClient": + initServer(s, &s.trSessionHostManagementsUpdateStatusServer, func() *SessionHostManagementsUpdateStatusServerTransport { + return NewSessionHostManagementsUpdateStatusServerTransport(&s.srv.SessionHostManagementsUpdateStatusServer) + }) + resp, err = s.trSessionHostManagementsUpdateStatusServer.Do(req) case "SessionHostsClient": initServer(s, &s.trSessionHostsServer, func() *SessionHostsServerTransport { return NewSessionHostsServerTransport(&s.srv.SessionHostsServer) }) resp, err = s.trSessionHostsServer.Do(req) diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/sessionhost_server.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/sessionhost_server.go new file mode 100644 index 000000000000..e6ebcdbe4e7f --- /dev/null +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/sessionhost_server.go @@ -0,0 +1,104 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v3" + "net/http" + "net/url" + "regexp" +) + +// SessionHostServer is a fake server for instances of the armdesktopvirtualization.SessionHostClient type. +type SessionHostServer struct { + // RetryProvisioning is the fake for method SessionHostClient.RetryProvisioning + // HTTP status codes to indicate success: http.StatusOK + RetryProvisioning func(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string, options *armdesktopvirtualization.SessionHostClientRetryProvisioningOptions) (resp azfake.Responder[armdesktopvirtualization.SessionHostClientRetryProvisioningResponse], errResp azfake.ErrorResponder) +} + +// NewSessionHostServerTransport creates a new instance of SessionHostServerTransport with the provided implementation. +// The returned SessionHostServerTransport instance is connected to an instance of armdesktopvirtualization.SessionHostClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewSessionHostServerTransport(srv *SessionHostServer) *SessionHostServerTransport { + return &SessionHostServerTransport{srv: srv} +} + +// SessionHostServerTransport connects instances of armdesktopvirtualization.SessionHostClient to instances of SessionHostServer. +// Don't use this type directly, use NewSessionHostServerTransport instead. +type SessionHostServerTransport struct { + srv *SessionHostServer +} + +// Do implements the policy.Transporter interface for SessionHostServerTransport. +func (s *SessionHostServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "SessionHostClient.RetryProvisioning": + resp, err = s.dispatchRetryProvisioning(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (s *SessionHostServerTransport) dispatchRetryProvisioning(req *http.Request) (*http.Response, error) { + if s.srv.RetryProvisioning == nil { + return nil, &nonRetriableError{errors.New("fake for method RetryProvisioning not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DesktopVirtualization/hostPools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/sessionHosts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/retryProvisioning` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + hostPoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("hostPoolName")]) + if err != nil { + return nil, err + } + sessionHostNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("sessionHostName")]) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.RetryProvisioning(req.Context(), resourceGroupNameParam, hostPoolNameParam, sessionHostNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.NewResponse(respContent, req, nil) + if err != nil { + return nil, err + } + return resp, nil +} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/sessionhostconfigurations_server.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/sessionhostconfigurations_server.go new file mode 100644 index 000000000000..69c9296acf21 --- /dev/null +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/sessionhostconfigurations_server.go @@ -0,0 +1,271 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v3" + "net/http" + "net/url" + "reflect" + "regexp" +) + +// SessionHostConfigurationsServer is a fake server for instances of the armdesktopvirtualization.SessionHostConfigurationsClient type. +type SessionHostConfigurationsServer struct { + // BeginCreateOrUpdate is the fake for method SessionHostConfigurationsClient.BeginCreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostConfiguration armdesktopvirtualization.SessionHostConfiguration, options *armdesktopvirtualization.SessionHostConfigurationsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armdesktopvirtualization.SessionHostConfigurationsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method SessionHostConfigurationsClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, hostPoolName string, options *armdesktopvirtualization.SessionHostConfigurationsClientGetOptions) (resp azfake.Responder[armdesktopvirtualization.SessionHostConfigurationsClientGetResponse], errResp azfake.ErrorResponder) + + // NewListByHostPoolPager is the fake for method SessionHostConfigurationsClient.NewListByHostPoolPager + // HTTP status codes to indicate success: http.StatusOK + NewListByHostPoolPager func(resourceGroupName string, hostPoolName string, options *armdesktopvirtualization.SessionHostConfigurationsClientListByHostPoolOptions) (resp azfake.PagerResponder[armdesktopvirtualization.SessionHostConfigurationsClientListByHostPoolResponse]) + + // BeginUpdate is the fake for method SessionHostConfigurationsClient.BeginUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginUpdate func(ctx context.Context, resourceGroupName string, hostPoolName string, options *armdesktopvirtualization.SessionHostConfigurationsClientBeginUpdateOptions) (resp azfake.PollerResponder[armdesktopvirtualization.SessionHostConfigurationsClientUpdateResponse], errResp azfake.ErrorResponder) +} + +// NewSessionHostConfigurationsServerTransport creates a new instance of SessionHostConfigurationsServerTransport with the provided implementation. +// The returned SessionHostConfigurationsServerTransport instance is connected to an instance of armdesktopvirtualization.SessionHostConfigurationsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewSessionHostConfigurationsServerTransport(srv *SessionHostConfigurationsServer) *SessionHostConfigurationsServerTransport { + return &SessionHostConfigurationsServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armdesktopvirtualization.SessionHostConfigurationsClientCreateOrUpdateResponse]](), + newListByHostPoolPager: newTracker[azfake.PagerResponder[armdesktopvirtualization.SessionHostConfigurationsClientListByHostPoolResponse]](), + beginUpdate: newTracker[azfake.PollerResponder[armdesktopvirtualization.SessionHostConfigurationsClientUpdateResponse]](), + } +} + +// SessionHostConfigurationsServerTransport connects instances of armdesktopvirtualization.SessionHostConfigurationsClient to instances of SessionHostConfigurationsServer. +// Don't use this type directly, use NewSessionHostConfigurationsServerTransport instead. +type SessionHostConfigurationsServerTransport struct { + srv *SessionHostConfigurationsServer + beginCreateOrUpdate *tracker[azfake.PollerResponder[armdesktopvirtualization.SessionHostConfigurationsClientCreateOrUpdateResponse]] + newListByHostPoolPager *tracker[azfake.PagerResponder[armdesktopvirtualization.SessionHostConfigurationsClientListByHostPoolResponse]] + beginUpdate *tracker[azfake.PollerResponder[armdesktopvirtualization.SessionHostConfigurationsClientUpdateResponse]] +} + +// Do implements the policy.Transporter interface for SessionHostConfigurationsServerTransport. +func (s *SessionHostConfigurationsServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "SessionHostConfigurationsClient.BeginCreateOrUpdate": + resp, err = s.dispatchBeginCreateOrUpdate(req) + case "SessionHostConfigurationsClient.Get": + resp, err = s.dispatchGet(req) + case "SessionHostConfigurationsClient.NewListByHostPoolPager": + resp, err = s.dispatchNewListByHostPoolPager(req) + case "SessionHostConfigurationsClient.BeginUpdate": + resp, err = s.dispatchBeginUpdate(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (s *SessionHostConfigurationsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { + if s.srv.BeginCreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} + } + beginCreateOrUpdate := s.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DesktopVirtualization/hostPools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/sessionHostConfigurations/default` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armdesktopvirtualization.SessionHostConfiguration](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + hostPoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("hostPoolName")]) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, hostPoolNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreateOrUpdate = &respr + s.beginCreateOrUpdate.add(req, beginCreateOrUpdate) + } + + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + s.beginCreateOrUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCreateOrUpdate) { + s.beginCreateOrUpdate.remove(req) + } + + return resp, nil +} + +func (s *SessionHostConfigurationsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if s.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DesktopVirtualization/hostPools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/sessionHostConfigurations/default` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + hostPoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("hostPoolName")]) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.Get(req.Context(), resourceGroupNameParam, hostPoolNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).SessionHostConfiguration, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (s *SessionHostConfigurationsServerTransport) dispatchNewListByHostPoolPager(req *http.Request) (*http.Response, error) { + if s.srv.NewListByHostPoolPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListByHostPoolPager not implemented")} + } + newListByHostPoolPager := s.newListByHostPoolPager.get(req) + if newListByHostPoolPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DesktopVirtualization/hostPools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/sessionHostConfigurations` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + hostPoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("hostPoolName")]) + if err != nil { + return nil, err + } + resp := s.srv.NewListByHostPoolPager(resourceGroupNameParam, hostPoolNameParam, nil) + newListByHostPoolPager = &resp + s.newListByHostPoolPager.add(req, newListByHostPoolPager) + server.PagerResponderInjectNextLinks(newListByHostPoolPager, req, func(page *armdesktopvirtualization.SessionHostConfigurationsClientListByHostPoolResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListByHostPoolPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + s.newListByHostPoolPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListByHostPoolPager) { + s.newListByHostPoolPager.remove(req) + } + return resp, nil +} + +func (s *SessionHostConfigurationsServerTransport) dispatchBeginUpdate(req *http.Request) (*http.Response, error) { + if s.srv.BeginUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} + } + beginUpdate := s.beginUpdate.get(req) + if beginUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DesktopVirtualization/hostPools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/sessionHostConfigurations/default` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armdesktopvirtualization.SessionHostConfigurationPatch](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + hostPoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("hostPoolName")]) + if err != nil { + return nil, err + } + var options *armdesktopvirtualization.SessionHostConfigurationsClientBeginUpdateOptions + if !reflect.ValueOf(body).IsZero() { + options = &armdesktopvirtualization.SessionHostConfigurationsClientBeginUpdateOptions{ + SessionHostConfiguration: &body, + } + } + respr, errRespr := s.srv.BeginUpdate(req.Context(), resourceGroupNameParam, hostPoolNameParam, options) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginUpdate = &respr + s.beginUpdate.add(req, beginUpdate) + } + + resp, err := server.PollerResponderNext(beginUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + s.beginUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginUpdate) { + s.beginUpdate.remove(req) + } + + return resp, nil +} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/sessionhostmanagements_server.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/sessionhostmanagements_server.go new file mode 100644 index 000000000000..3888c4fcab9b --- /dev/null +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/sessionhostmanagements_server.go @@ -0,0 +1,245 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v3" + "net/http" + "net/url" + "reflect" + "regexp" +) + +// SessionHostManagementsServer is a fake server for instances of the armdesktopvirtualization.SessionHostManagementsClient type. +type SessionHostManagementsServer struct { + // CreateOrUpdate is the fake for method SessionHostManagementsClient.CreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + CreateOrUpdate func(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostManagement armdesktopvirtualization.SessionHostManagement, options *armdesktopvirtualization.SessionHostManagementsClientCreateOrUpdateOptions) (resp azfake.Responder[armdesktopvirtualization.SessionHostManagementsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method SessionHostManagementsClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, hostPoolName string, options *armdesktopvirtualization.SessionHostManagementsClientGetOptions) (resp azfake.Responder[armdesktopvirtualization.SessionHostManagementsClientGetResponse], errResp azfake.ErrorResponder) + + // NewListByHostPoolPager is the fake for method SessionHostManagementsClient.NewListByHostPoolPager + // HTTP status codes to indicate success: http.StatusOK + NewListByHostPoolPager func(resourceGroupName string, hostPoolName string, options *armdesktopvirtualization.SessionHostManagementsClientListByHostPoolOptions) (resp azfake.PagerResponder[armdesktopvirtualization.SessionHostManagementsClientListByHostPoolResponse]) + + // Update is the fake for method SessionHostManagementsClient.Update + // HTTP status codes to indicate success: http.StatusOK + Update func(ctx context.Context, resourceGroupName string, hostPoolName string, options *armdesktopvirtualization.SessionHostManagementsClientUpdateOptions) (resp azfake.Responder[armdesktopvirtualization.SessionHostManagementsClientUpdateResponse], errResp azfake.ErrorResponder) +} + +// NewSessionHostManagementsServerTransport creates a new instance of SessionHostManagementsServerTransport with the provided implementation. +// The returned SessionHostManagementsServerTransport instance is connected to an instance of armdesktopvirtualization.SessionHostManagementsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewSessionHostManagementsServerTransport(srv *SessionHostManagementsServer) *SessionHostManagementsServerTransport { + return &SessionHostManagementsServerTransport{ + srv: srv, + newListByHostPoolPager: newTracker[azfake.PagerResponder[armdesktopvirtualization.SessionHostManagementsClientListByHostPoolResponse]](), + } +} + +// SessionHostManagementsServerTransport connects instances of armdesktopvirtualization.SessionHostManagementsClient to instances of SessionHostManagementsServer. +// Don't use this type directly, use NewSessionHostManagementsServerTransport instead. +type SessionHostManagementsServerTransport struct { + srv *SessionHostManagementsServer + newListByHostPoolPager *tracker[azfake.PagerResponder[armdesktopvirtualization.SessionHostManagementsClientListByHostPoolResponse]] +} + +// Do implements the policy.Transporter interface for SessionHostManagementsServerTransport. +func (s *SessionHostManagementsServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "SessionHostManagementsClient.CreateOrUpdate": + resp, err = s.dispatchCreateOrUpdate(req) + case "SessionHostManagementsClient.Get": + resp, err = s.dispatchGet(req) + case "SessionHostManagementsClient.NewListByHostPoolPager": + resp, err = s.dispatchNewListByHostPoolPager(req) + case "SessionHostManagementsClient.Update": + resp, err = s.dispatchUpdate(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (s *SessionHostManagementsServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { + if s.srv.CreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method CreateOrUpdate not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DesktopVirtualization/hostPools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/sessionHostManagements/default` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armdesktopvirtualization.SessionHostManagement](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + hostPoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("hostPoolName")]) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.CreateOrUpdate(req.Context(), resourceGroupNameParam, hostPoolNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).SessionHostManagement, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (s *SessionHostManagementsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if s.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DesktopVirtualization/hostPools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/sessionHostManagements/default` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + hostPoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("hostPoolName")]) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.Get(req.Context(), resourceGroupNameParam, hostPoolNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).SessionHostManagement, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (s *SessionHostManagementsServerTransport) dispatchNewListByHostPoolPager(req *http.Request) (*http.Response, error) { + if s.srv.NewListByHostPoolPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListByHostPoolPager not implemented")} + } + newListByHostPoolPager := s.newListByHostPoolPager.get(req) + if newListByHostPoolPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DesktopVirtualization/hostPools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/sessionHostManagements` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + hostPoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("hostPoolName")]) + if err != nil { + return nil, err + } + resp := s.srv.NewListByHostPoolPager(resourceGroupNameParam, hostPoolNameParam, nil) + newListByHostPoolPager = &resp + s.newListByHostPoolPager.add(req, newListByHostPoolPager) + server.PagerResponderInjectNextLinks(newListByHostPoolPager, req, func(page *armdesktopvirtualization.SessionHostManagementsClientListByHostPoolResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListByHostPoolPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + s.newListByHostPoolPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListByHostPoolPager) { + s.newListByHostPoolPager.remove(req) + } + return resp, nil +} + +func (s *SessionHostManagementsServerTransport) dispatchUpdate(req *http.Request) (*http.Response, error) { + if s.srv.Update == nil { + return nil, &nonRetriableError{errors.New("fake for method Update not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DesktopVirtualization/hostPools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/sessionHostManagements/default` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armdesktopvirtualization.SessionHostManagementPatch](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + hostPoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("hostPoolName")]) + if err != nil { + return nil, err + } + var options *armdesktopvirtualization.SessionHostManagementsClientUpdateOptions + if !reflect.ValueOf(body).IsZero() { + options = &armdesktopvirtualization.SessionHostManagementsClientUpdateOptions{ + SessionHostManagement: &body, + } + } + respr, errRespr := s.srv.Update(req.Context(), resourceGroupNameParam, hostPoolNameParam, options) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).SessionHostManagement, req) + if err != nil { + return nil, err + } + return resp, nil +} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/sessionhostmanagementsupdatestatus_server.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/sessionhostmanagementsupdatestatus_server.go new file mode 100644 index 000000000000..837772317878 --- /dev/null +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/sessionhostmanagementsupdatestatus_server.go @@ -0,0 +1,100 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v3" + "net/http" + "net/url" + "regexp" +) + +// SessionHostManagementsUpdateStatusServer is a fake server for instances of the armdesktopvirtualization.SessionHostManagementsUpdateStatusClient type. +type SessionHostManagementsUpdateStatusServer struct { + // Get is the fake for method SessionHostManagementsUpdateStatusClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, hostPoolName string, options *armdesktopvirtualization.SessionHostManagementsUpdateStatusClientGetOptions) (resp azfake.Responder[armdesktopvirtualization.SessionHostManagementsUpdateStatusClientGetResponse], errResp azfake.ErrorResponder) +} + +// NewSessionHostManagementsUpdateStatusServerTransport creates a new instance of SessionHostManagementsUpdateStatusServerTransport with the provided implementation. +// The returned SessionHostManagementsUpdateStatusServerTransport instance is connected to an instance of armdesktopvirtualization.SessionHostManagementsUpdateStatusClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewSessionHostManagementsUpdateStatusServerTransport(srv *SessionHostManagementsUpdateStatusServer) *SessionHostManagementsUpdateStatusServerTransport { + return &SessionHostManagementsUpdateStatusServerTransport{srv: srv} +} + +// SessionHostManagementsUpdateStatusServerTransport connects instances of armdesktopvirtualization.SessionHostManagementsUpdateStatusClient to instances of SessionHostManagementsUpdateStatusServer. +// Don't use this type directly, use NewSessionHostManagementsUpdateStatusServerTransport instead. +type SessionHostManagementsUpdateStatusServerTransport struct { + srv *SessionHostManagementsUpdateStatusServer +} + +// Do implements the policy.Transporter interface for SessionHostManagementsUpdateStatusServerTransport. +func (s *SessionHostManagementsUpdateStatusServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "SessionHostManagementsUpdateStatusClient.Get": + resp, err = s.dispatchGet(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (s *SessionHostManagementsUpdateStatusServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if s.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DesktopVirtualization/hostPools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/sessionHostManagements/default/sessionHostUpdateStatuses/default` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + hostPoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("hostPoolName")]) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.Get(req.Context(), resourceGroupNameParam, hostPoolNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).SessionHostManagementUpdateStatus, req) + if err != nil { + return nil, err + } + return resp, nil +} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/sessionhosts_server.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/sessionhosts_server.go index 205ed31003cc..8bb38d4d89b1 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/sessionhosts_server.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/sessionhosts_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v3" "net/http" "net/url" "reflect" @@ -237,12 +237,18 @@ func (s *SessionHostsServerTransport) dispatchNewListPager(req *http.Request) (* if err != nil { return nil, err } + vMPathUnescaped, err := url.QueryUnescape(qp.Get("vmPath")) + if err != nil { + return nil, err + } + vMPathParam := getOptional(vMPathUnescaped) var options *armdesktopvirtualization.SessionHostsClientListOptions - if pageSizeParam != nil || isDescendingParam != nil || initialSkipParam != nil { + if pageSizeParam != nil || isDescendingParam != nil || initialSkipParam != nil || vMPathParam != nil { options = &armdesktopvirtualization.SessionHostsClientListOptions{ PageSize: pageSizeParam, IsDescending: isDescendingParam, InitialSkip: initialSkipParam, + VMPath: vMPathParam, } } resp := s.srv.NewListPager(resourceGroupNameParam, hostPoolNameParam, options) diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/startmenuitems_server.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/startmenuitems_server.go index 3f27aa6c7275..bc2d79a096a9 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/startmenuitems_server.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/startmenuitems_server.go @@ -15,7 +15,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v3" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/time_rfc3339.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/time_rfc3339.go index b0535a7b63e6..81f308b0d343 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/time_rfc3339.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/time_rfc3339.go @@ -19,12 +19,16 @@ import ( ) // Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. -var tzOffsetRegex = regexp.MustCompile(`(Z|z|\+|-)(\d+:\d+)*"*$`) +var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`) const ( - utcDateTimeJSON = `"2006-01-02T15:04:05.999999999"` - utcDateTime = "2006-01-02T15:04:05.999999999" - dateTimeJSON = `"` + time.RFC3339Nano + `"` + utcDateTime = "2006-01-02T15:04:05.999999999" + utcDateTimeJSON = `"` + utcDateTime + `"` + utcDateTimeNoT = "2006-01-02 15:04:05.999999999" + utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"` + dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00` + dateTimeJSON = `"` + time.RFC3339Nano + `"` + dateTimeJSONNoT = `"` + dateTimeNoT + `"` ) type dateTimeRFC3339 time.Time @@ -40,17 +44,33 @@ func (t dateTimeRFC3339) MarshalText() ([]byte, error) { } func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { - layout := utcDateTimeJSON - if tzOffsetRegex.Match(data) { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { layout = dateTimeJSON + } else if tzOffset { + layout = dateTimeJSONNoT + } else if hasT { + layout = utcDateTimeJSON + } else { + layout = utcDateTimeJSONNoT } return t.Parse(layout, string(data)) } func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { - layout := utcDateTime - if tzOffsetRegex.Match(data) { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { layout = time.RFC3339Nano + } else if tzOffset { + layout = dateTimeNoT + } else if hasT { + layout = utcDateTime + } else { + layout = utcDateTimeNoT } return t.Parse(layout, string(data)) } @@ -61,6 +81,10 @@ func (t *dateTimeRFC3339) Parse(layout, value string) error { return err } +func (t dateTimeRFC3339) String() string { + return time.Time(t).Format(time.RFC3339Nano) +} + func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { if t == nil { return @@ -74,7 +98,7 @@ func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { } func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || strings.EqualFold(string(data), "null") { + if data == nil || string(data) == "null" { return nil } var aux dateTimeRFC3339 diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/usersessions_server.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/usersessions_server.go index 1f83003d1294..ae7ee07c24c7 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/usersessions_server.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/usersessions_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v3" "net/http" "net/url" "reflect" diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/workspaces_server.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/workspaces_server.go index aae61eb98697..b750aa4bd3eb 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/workspaces_server.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/workspaces_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v3" "net/http" "net/url" "reflect" diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/go.mod b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/go.mod index 2d9c956afaf5..7872bd697d59 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/go.mod +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/go.mod @@ -1,21 +1,11 @@ -module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v2 +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v3 go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect - github.com/golang-jwt/jwt/v5 v5.2.1 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect - golang.org/x/crypto v0.25.0 // indirect golang.org/x/net v0.27.0 // indirect - golang.org/x/sys v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect ) diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/go.sum b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/go.sum index 09d275cb9a37..917448a001b7 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/go.sum +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/go.sum @@ -1,29 +1,12 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0 h1:GJHeeA2N7xrG3q30L2UXDyuWRzDM900/65j70wcM4Ww= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0/go.mod h1:l38EPgmsp71HHLq9j7De57JcKOWPyhrsW1Awm1JS6K0= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 h1:tfLQ34V6F7tVSwoTf/4lH5sE0o6eCJuNDTmH09nDpbc= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0/go.mod h1:9kIvujWAA58nmPmWB1m23fyWic1kYZMxD9CxaWn4Qpg= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 h1:ywEEhmNahHBihViHepv3xPBn1663uRv2t2q/ESv9seY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0/go.mod h1:iZDifYGJTIgIIkYRNWPENUnqx6bJ2xnSDFI2tjwZNuY= -github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 h1:XHOnouVk1mxXfQidrMEnLlPk9UMeRtyBTnEFtxkV0kU= -github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= -github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.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-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= -github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30= -golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= -golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/hostpools_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/hostpools_client.go index 2f575130e558..f1ab85af8437 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/hostpools_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/hostpools_client.go @@ -29,7 +29,7 @@ type HostPoolsClient struct { } // NewHostPoolsClient creates a new instance of HostPoolsClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewHostPoolsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*HostPoolsClient, error) { @@ -47,7 +47,7 @@ func NewHostPoolsClient(subscriptionID string, credential azcore.TokenCredential // CreateOrUpdate - Create or update a host pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - hostPoolName - The name of the host pool within the specified resource group // - hostPool - Object containing HostPool definitions. @@ -95,7 +95,7 @@ func (client *HostPoolsClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-08-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, hostPool); err != nil { @@ -116,7 +116,7 @@ func (client *HostPoolsClient) createOrUpdateHandleResponse(resp *http.Response) // Delete - Remove a host pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - hostPoolName - The name of the host pool within the specified resource group // - options - HostPoolsClientDeleteOptions contains the optional parameters for the HostPoolsClient.Delete method. @@ -161,7 +161,7 @@ func (client *HostPoolsClient) deleteCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-08-preview") if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } @@ -173,7 +173,7 @@ func (client *HostPoolsClient) deleteCreateRequest(ctx context.Context, resource // Get - Get a host pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - hostPoolName - The name of the host pool within the specified resource group // - options - HostPoolsClientGetOptions contains the optional parameters for the HostPoolsClient.Get method. @@ -219,7 +219,7 @@ func (client *HostPoolsClient) getCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-08-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -236,7 +236,7 @@ func (client *HostPoolsClient) getHandleResponse(resp *http.Response) (HostPools // NewListPager - List hostPools in subscription. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - options - HostPoolsClientListOptions contains the optional parameters for the HostPoolsClient.NewListPager method. func (client *HostPoolsClient) NewListPager(options *HostPoolsClientListOptions) *runtime.Pager[HostPoolsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[HostPoolsClientListResponse]{ @@ -273,15 +273,15 @@ func (client *HostPoolsClient) listCreateRequest(ctx context.Context, options *H return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") - if options != nil && options.PageSize != nil { - reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) + reqQP.Set("api-version", "2024-04-08-preview") + if options != nil && options.InitialSkip != nil { + reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) } if options != nil && options.IsDescending != nil { reqQP.Set("isDescending", strconv.FormatBool(*options.IsDescending)) } - if options != nil && options.InitialSkip != nil { - reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) + if options != nil && options.PageSize != nil { + reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} @@ -299,7 +299,7 @@ func (client *HostPoolsClient) listHandleResponse(resp *http.Response) (HostPool // NewListByResourceGroupPager - List hostPools. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - HostPoolsClientListByResourceGroupOptions contains the optional parameters for the HostPoolsClient.NewListByResourceGroupPager // method. @@ -342,15 +342,15 @@ func (client *HostPoolsClient) listByResourceGroupCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") - if options != nil && options.PageSize != nil { - reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) + reqQP.Set("api-version", "2024-04-08-preview") + if options != nil && options.InitialSkip != nil { + reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) } if options != nil && options.IsDescending != nil { reqQP.Set("isDescending", strconv.FormatBool(*options.IsDescending)) } - if options != nil && options.InitialSkip != nil { - reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) + if options != nil && options.PageSize != nil { + reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} @@ -366,10 +366,75 @@ func (client *HostPoolsClient) listByResourceGroupHandleResponse(resp *http.Resp return result, nil } +// ListRegistrationTokens - Operation to list the RegistrationTokens associated with the HostPool. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-04-08-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - hostPoolName - The name of the host pool within the specified resource group +// - options - HostPoolsClientListRegistrationTokensOptions contains the optional parameters for the HostPoolsClient.ListRegistrationTokens +// method. +func (client *HostPoolsClient) ListRegistrationTokens(ctx context.Context, resourceGroupName string, hostPoolName string, options *HostPoolsClientListRegistrationTokensOptions) (HostPoolsClientListRegistrationTokensResponse, error) { + var err error + const operationName = "HostPoolsClient.ListRegistrationTokens" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.listRegistrationTokensCreateRequest(ctx, resourceGroupName, hostPoolName, options) + if err != nil { + return HostPoolsClientListRegistrationTokensResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return HostPoolsClientListRegistrationTokensResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return HostPoolsClientListRegistrationTokensResponse{}, err + } + resp, err := client.listRegistrationTokensHandleResponse(httpResp) + return resp, err +} + +// listRegistrationTokensCreateRequest creates the ListRegistrationTokens request. +func (client *HostPoolsClient) listRegistrationTokensCreateRequest(ctx context.Context, resourceGroupName string, hostPoolName string, options *HostPoolsClientListRegistrationTokensOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/listRegistrationTokens" + 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 hostPoolName == "" { + return nil, errors.New("parameter hostPoolName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{hostPoolName}", url.PathEscape(hostPoolName)) + 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", "2024-04-08-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listRegistrationTokensHandleResponse handles the ListRegistrationTokens response. +func (client *HostPoolsClient) listRegistrationTokensHandleResponse(resp *http.Response) (HostPoolsClientListRegistrationTokensResponse, error) { + result := HostPoolsClientListRegistrationTokensResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.RegistrationTokenList); err != nil { + return HostPoolsClientListRegistrationTokensResponse{}, err + } + return result, nil +} + // RetrieveRegistrationToken - Registration token of the host pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - hostPoolName - The name of the host pool within the specified resource group // - options - HostPoolsClientRetrieveRegistrationTokenOptions contains the optional parameters for the HostPoolsClient.RetrieveRegistrationToken @@ -416,7 +481,7 @@ func (client *HostPoolsClient) retrieveRegistrationTokenCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-08-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -434,7 +499,7 @@ func (client *HostPoolsClient) retrieveRegistrationTokenHandleResponse(resp *htt // Update - Update a host pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - hostPoolName - The name of the host pool within the specified resource group // - options - HostPoolsClientUpdateOptions contains the optional parameters for the HostPoolsClient.Update method. @@ -480,7 +545,7 @@ func (client *HostPoolsClient) updateCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-08-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.HostPool != nil { diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/hostpools_client_example_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/hostpools_client_example_test.go deleted file mode 100644 index a91ad4e36c3a..000000000000 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/hostpools_client_example_test.go +++ /dev/null @@ -1,639 +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 armdesktopvirtualization_test - -import ( - "context" - "log" - - "time" - - "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/desktopvirtualization/armdesktopvirtualization/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/HostPool_Get.json -func ExampleHostPoolsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewHostPoolsClient().Get(ctx, "resourceGroup1", "hostPool1", 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.HostPool = armdesktopvirtualization.HostPool{ - // Name: to.Ptr("hostPool1"), - // Type: to.Ptr("/Microsoft.DesktopVirtualization/hostPools"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1"), - // Location: to.Ptr("centralus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armdesktopvirtualization.HostPoolProperties{ - // Description: to.Ptr("des1"), - // AgentUpdate: &armdesktopvirtualization.AgentUpdateProperties{ - // Type: to.Ptr(armdesktopvirtualization.SessionHostComponentUpdateTypeScheduled), - // MaintenanceWindowTimeZone: to.Ptr("Alaskan Standard Time"), - // MaintenanceWindows: []*armdesktopvirtualization.MaintenanceWindowProperties{ - // { - // DayOfWeek: to.Ptr(armdesktopvirtualization.DayOfWeekFriday), - // Hour: to.Ptr[int32](7), - // }, - // { - // DayOfWeek: to.Ptr(armdesktopvirtualization.DayOfWeekSaturday), - // Hour: to.Ptr[int32](8), - // }}, - // UseSessionHostLocalTime: to.Ptr(false), - // }, - // CloudPcResource: to.Ptr(false), - // FriendlyName: to.Ptr("friendly"), - // HostPoolType: to.Ptr(armdesktopvirtualization.HostPoolTypePooled), - // LoadBalancerType: to.Ptr(armdesktopvirtualization.LoadBalancerTypeBreadthFirst), - // MaxSessionLimit: to.Ptr[int32](999999), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // PersonalDesktopAssignmentType: to.Ptr(armdesktopvirtualization.PersonalDesktopAssignmentTypeAutomatic), - // PreferredAppGroupType: to.Ptr(armdesktopvirtualization.PreferredAppGroupTypeDesktop), - // RegistrationInfo: &armdesktopvirtualization.RegistrationInfo{ - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2008-09-22T14:01:54.957Z"); return t}()), - // RegistrationTokenOperation: to.Ptr(armdesktopvirtualization.RegistrationTokenOperationUpdate), - // Token: to.Ptr("token"), - // }, - // SsoClientID: to.Ptr("client"), - // SsoClientSecretKeyVaultPath: to.Ptr("https://keyvault/secret"), - // SsoSecretType: to.Ptr(armdesktopvirtualization.SSOSecretTypeSharedKey), - // SsoadfsAuthority: to.Ptr("https://adfs"), - // StartVMOnConnect: to.Ptr(false), - // VMTemplate: to.Ptr("{json:json}"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/HostPool_Create.json -func ExampleHostPoolsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewHostPoolsClient().CreateOrUpdate(ctx, "resourceGroup1", "hostPool1", armdesktopvirtualization.HostPool{ - Location: to.Ptr("centralus"), - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - Properties: &armdesktopvirtualization.HostPoolProperties{ - Description: to.Ptr("des1"), - AgentUpdate: &armdesktopvirtualization.AgentUpdateProperties{ - Type: to.Ptr(armdesktopvirtualization.SessionHostComponentUpdateTypeScheduled), - MaintenanceWindowTimeZone: to.Ptr("Alaskan Standard Time"), - MaintenanceWindows: []*armdesktopvirtualization.MaintenanceWindowProperties{ - { - DayOfWeek: to.Ptr(armdesktopvirtualization.DayOfWeekFriday), - Hour: to.Ptr[int32](7), - }, - { - DayOfWeek: to.Ptr(armdesktopvirtualization.DayOfWeekSaturday), - Hour: to.Ptr[int32](8), - }}, - UseSessionHostLocalTime: to.Ptr(false), - }, - FriendlyName: to.Ptr("friendly"), - HostPoolType: to.Ptr(armdesktopvirtualization.HostPoolTypePooled), - LoadBalancerType: to.Ptr(armdesktopvirtualization.LoadBalancerTypeBreadthFirst), - MaxSessionLimit: to.Ptr[int32](999999), - PersonalDesktopAssignmentType: to.Ptr(armdesktopvirtualization.PersonalDesktopAssignmentTypeAutomatic), - PreferredAppGroupType: to.Ptr(armdesktopvirtualization.PreferredAppGroupTypeDesktop), - RegistrationInfo: &armdesktopvirtualization.RegistrationInfo{ - ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-01T14:01:54.957Z"); return t }()), - RegistrationTokenOperation: to.Ptr(armdesktopvirtualization.RegistrationTokenOperationUpdate), - }, - SsoClientID: to.Ptr("client"), - SsoClientSecretKeyVaultPath: to.Ptr("https://keyvault/secret"), - SsoSecretType: to.Ptr(armdesktopvirtualization.SSOSecretTypeSharedKey), - SsoadfsAuthority: to.Ptr("https://adfs"), - StartVMOnConnect: to.Ptr(false), - VMTemplate: to.Ptr("{json:json}"), - }, - }, 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.HostPool = armdesktopvirtualization.HostPool{ - // Name: to.Ptr("hostPool1"), - // Type: to.Ptr("/Microsoft.DesktopVirtualization/hostPools"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1"), - // Location: to.Ptr("centralus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armdesktopvirtualization.HostPoolProperties{ - // Description: to.Ptr("des1"), - // AgentUpdate: &armdesktopvirtualization.AgentUpdateProperties{ - // Type: to.Ptr(armdesktopvirtualization.SessionHostComponentUpdateTypeScheduled), - // MaintenanceWindowTimeZone: to.Ptr("Alaskan Standard Time"), - // MaintenanceWindows: []*armdesktopvirtualization.MaintenanceWindowProperties{ - // { - // DayOfWeek: to.Ptr(armdesktopvirtualization.DayOfWeekFriday), - // Hour: to.Ptr[int32](7), - // }, - // { - // DayOfWeek: to.Ptr(armdesktopvirtualization.DayOfWeekSaturday), - // Hour: to.Ptr[int32](8), - // }}, - // UseSessionHostLocalTime: to.Ptr(false), - // }, - // CloudPcResource: to.Ptr(false), - // FriendlyName: to.Ptr("friendly"), - // HostPoolType: to.Ptr(armdesktopvirtualization.HostPoolTypePooled), - // LoadBalancerType: to.Ptr(armdesktopvirtualization.LoadBalancerTypeBreadthFirst), - // MaxSessionLimit: to.Ptr[int32](999999), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // PersonalDesktopAssignmentType: to.Ptr(armdesktopvirtualization.PersonalDesktopAssignmentTypeAutomatic), - // PreferredAppGroupType: to.Ptr(armdesktopvirtualization.PreferredAppGroupTypeDesktop), - // RegistrationInfo: &armdesktopvirtualization.RegistrationInfo{ - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-01T14:01:54.957Z"); return t}()), - // RegistrationTokenOperation: to.Ptr(armdesktopvirtualization.RegistrationTokenOperationUpdate), - // Token: to.Ptr("token"), - // }, - // SsoClientID: to.Ptr("client"), - // SsoClientSecretKeyVaultPath: to.Ptr("https://keyvault/secret"), - // SsoSecretType: to.Ptr(armdesktopvirtualization.SSOSecretTypeSharedKey), - // SsoadfsAuthority: to.Ptr("https://adfs"), - // StartVMOnConnect: to.Ptr(false), - // VMTemplate: to.Ptr("{json:json}"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/HostPool_Delete.json -func ExampleHostPoolsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewHostPoolsClient().Delete(ctx, "resourceGroup1", "hostPool1", &armdesktopvirtualization.HostPoolsClientDeleteOptions{Force: to.Ptr(true)}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/HostPool_Update.json -func ExampleHostPoolsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewHostPoolsClient().Update(ctx, "resourceGroup1", "hostPool1", &armdesktopvirtualization.HostPoolsClientUpdateOptions{HostPool: &armdesktopvirtualization.HostPoolPatch{ - Properties: &armdesktopvirtualization.HostPoolPatchProperties{ - Description: to.Ptr("des1"), - AgentUpdate: &armdesktopvirtualization.AgentUpdatePatchProperties{ - Type: to.Ptr(armdesktopvirtualization.SessionHostComponentUpdateTypeScheduled), - MaintenanceWindowTimeZone: to.Ptr("Alaskan Standard Time"), - MaintenanceWindows: []*armdesktopvirtualization.MaintenanceWindowPatchProperties{ - { - DayOfWeek: to.Ptr(armdesktopvirtualization.DayOfWeekFriday), - Hour: to.Ptr[int32](7), - }, - { - DayOfWeek: to.Ptr(armdesktopvirtualization.DayOfWeekSaturday), - Hour: to.Ptr[int32](8), - }}, - UseSessionHostLocalTime: to.Ptr(false), - }, - FriendlyName: to.Ptr("friendly"), - LoadBalancerType: to.Ptr(armdesktopvirtualization.LoadBalancerTypeBreadthFirst), - MaxSessionLimit: to.Ptr[int32](999999), - PersonalDesktopAssignmentType: to.Ptr(armdesktopvirtualization.PersonalDesktopAssignmentTypeAutomatic), - RegistrationInfo: &armdesktopvirtualization.RegistrationInfoPatch{ - ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-01T15:01:54.957Z"); return t }()), - RegistrationTokenOperation: to.Ptr(armdesktopvirtualization.RegistrationTokenOperationUpdate), - }, - SsoClientID: to.Ptr("client"), - SsoClientSecretKeyVaultPath: to.Ptr("https://keyvault/secret"), - SsoSecretType: to.Ptr(armdesktopvirtualization.SSOSecretTypeSharedKey), - SsoadfsAuthority: to.Ptr("https://adfs"), - StartVMOnConnect: to.Ptr(false), - VMTemplate: to.Ptr("{json:json}"), - }, - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, - }) - 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.HostPool = armdesktopvirtualization.HostPool{ - // Name: to.Ptr("hostPool1"), - // Type: to.Ptr("/Microsoft.DesktopVirtualization/hostPools"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1"), - // Location: to.Ptr("centralus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armdesktopvirtualization.HostPoolProperties{ - // Description: to.Ptr("des1"), - // AgentUpdate: &armdesktopvirtualization.AgentUpdateProperties{ - // Type: to.Ptr(armdesktopvirtualization.SessionHostComponentUpdateTypeScheduled), - // MaintenanceWindowTimeZone: to.Ptr("Alaskan Standard Time"), - // MaintenanceWindows: []*armdesktopvirtualization.MaintenanceWindowProperties{ - // { - // DayOfWeek: to.Ptr(armdesktopvirtualization.DayOfWeekFriday), - // Hour: to.Ptr[int32](7), - // }, - // { - // DayOfWeek: to.Ptr(armdesktopvirtualization.DayOfWeekSaturday), - // Hour: to.Ptr[int32](8), - // }}, - // UseSessionHostLocalTime: to.Ptr(false), - // }, - // CloudPcResource: to.Ptr(false), - // FriendlyName: to.Ptr("friendly"), - // HostPoolType: to.Ptr(armdesktopvirtualization.HostPoolTypePooled), - // LoadBalancerType: to.Ptr(armdesktopvirtualization.LoadBalancerTypeBreadthFirst), - // MaxSessionLimit: to.Ptr[int32](999999), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // PersonalDesktopAssignmentType: to.Ptr(armdesktopvirtualization.PersonalDesktopAssignmentTypeAutomatic), - // PreferredAppGroupType: to.Ptr(armdesktopvirtualization.PreferredAppGroupTypeDesktop), - // RegistrationInfo: &armdesktopvirtualization.RegistrationInfo{ - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2008-09-22T14:01:54.957Z"); return t}()), - // RegistrationTokenOperation: to.Ptr(armdesktopvirtualization.RegistrationTokenOperationUpdate), - // Token: to.Ptr("token"), - // }, - // SsoClientID: to.Ptr("client"), - // SsoClientSecretKeyVaultPath: to.Ptr("https://keyvault/secret"), - // SsoSecretType: to.Ptr(armdesktopvirtualization.SSOSecretTypeSharedKey), - // SsoadfsAuthority: to.Ptr("https://adfs"), - // StartVMOnConnect: to.Ptr(false), - // VMTemplate: to.Ptr("{json:json}"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/HostPool_ListByResourceGroup.json -func ExampleHostPoolsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewHostPoolsClient().NewListByResourceGroupPager("resourceGroup1", &armdesktopvirtualization.HostPoolsClientListByResourceGroupOptions{PageSize: to.Ptr[int32](10), - IsDescending: to.Ptr(true), - InitialSkip: to.Ptr[int32](0), - }) - 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.HostPoolList = armdesktopvirtualization.HostPoolList{ - // Value: []*armdesktopvirtualization.HostPool{ - // { - // Name: to.Ptr("hostPool1"), - // Type: to.Ptr("/Microsoft.DesktopVirtualization/hostPools"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1"), - // Location: to.Ptr("centralus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armdesktopvirtualization.HostPoolProperties{ - // Description: to.Ptr("des1"), - // AgentUpdate: &armdesktopvirtualization.AgentUpdateProperties{ - // Type: to.Ptr(armdesktopvirtualization.SessionHostComponentUpdateTypeScheduled), - // MaintenanceWindowTimeZone: to.Ptr("Alaskan Standard Time"), - // MaintenanceWindows: []*armdesktopvirtualization.MaintenanceWindowProperties{ - // { - // DayOfWeek: to.Ptr(armdesktopvirtualization.DayOfWeekFriday), - // Hour: to.Ptr[int32](7), - // }, - // { - // DayOfWeek: to.Ptr(armdesktopvirtualization.DayOfWeekSaturday), - // Hour: to.Ptr[int32](8), - // }}, - // UseSessionHostLocalTime: to.Ptr(false), - // }, - // CloudPcResource: to.Ptr(false), - // FriendlyName: to.Ptr("friendly"), - // HostPoolType: to.Ptr(armdesktopvirtualization.HostPoolTypePooled), - // LoadBalancerType: to.Ptr(armdesktopvirtualization.LoadBalancerTypeBreadthFirst), - // MaxSessionLimit: to.Ptr[int32](999999), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // PersonalDesktopAssignmentType: to.Ptr(armdesktopvirtualization.PersonalDesktopAssignmentTypeAutomatic), - // PreferredAppGroupType: to.Ptr(armdesktopvirtualization.PreferredAppGroupTypeDesktop), - // RegistrationInfo: &armdesktopvirtualization.RegistrationInfo{ - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2008-09-22T14:01:54.957Z"); return t}()), - // RegistrationTokenOperation: to.Ptr(armdesktopvirtualization.RegistrationTokenOperationUpdate), - // Token: to.Ptr("token"), - // }, - // SsoClientID: to.Ptr("client"), - // SsoClientSecretKeyVaultPath: to.Ptr("https://keyvault/secret"), - // SsoSecretType: to.Ptr(armdesktopvirtualization.SSOSecretTypeSharedKey), - // SsoadfsAuthority: to.Ptr("https://adfs"), - // StartVMOnConnect: to.Ptr(false), - // VMTemplate: to.Ptr("{json:json}"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }, - // { - // Name: to.Ptr("hostPool2"), - // Type: to.Ptr("/Microsoft.DesktopVirtualization/hostPools"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool2"), - // Location: to.Ptr("centralus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armdesktopvirtualization.HostPoolProperties{ - // Description: to.Ptr("des1"), - // AgentUpdate: &armdesktopvirtualization.AgentUpdateProperties{ - // Type: to.Ptr(armdesktopvirtualization.SessionHostComponentUpdateTypeScheduled), - // MaintenanceWindowTimeZone: to.Ptr("Alaskan Standard Time"), - // MaintenanceWindows: []*armdesktopvirtualization.MaintenanceWindowProperties{ - // { - // DayOfWeek: to.Ptr(armdesktopvirtualization.DayOfWeekFriday), - // Hour: to.Ptr[int32](7), - // }, - // { - // DayOfWeek: to.Ptr(armdesktopvirtualization.DayOfWeekSaturday), - // Hour: to.Ptr[int32](8), - // }}, - // UseSessionHostLocalTime: to.Ptr(false), - // }, - // CloudPcResource: to.Ptr(false), - // FriendlyName: to.Ptr("friendly"), - // HostPoolType: to.Ptr(armdesktopvirtualization.HostPoolTypePooled), - // LoadBalancerType: to.Ptr(armdesktopvirtualization.LoadBalancerTypeBreadthFirst), - // MaxSessionLimit: to.Ptr[int32](999999), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // PersonalDesktopAssignmentType: to.Ptr(armdesktopvirtualization.PersonalDesktopAssignmentTypeAutomatic), - // PreferredAppGroupType: to.Ptr(armdesktopvirtualization.PreferredAppGroupTypeDesktop), - // RegistrationInfo: &armdesktopvirtualization.RegistrationInfo{ - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2008-09-22T14:01:54.957Z"); return t}()), - // RegistrationTokenOperation: to.Ptr(armdesktopvirtualization.RegistrationTokenOperationUpdate), - // Token: to.Ptr("token"), - // }, - // SsoClientID: to.Ptr("client"), - // SsoClientSecretKeyVaultPath: to.Ptr("https://keyvault/secret"), - // SsoSecretType: to.Ptr(armdesktopvirtualization.SSOSecretTypeSharedKey), - // SsoadfsAuthority: to.Ptr("https://adfs"), - // StartVMOnConnect: to.Ptr(false), - // VMTemplate: to.Ptr("{json:json}"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/HostPool_List.json -func ExampleHostPoolsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewHostPoolsClient().NewListPager(&armdesktopvirtualization.HostPoolsClientListOptions{PageSize: to.Ptr[int32](10), - IsDescending: to.Ptr(true), - InitialSkip: to.Ptr[int32](0), - }) - 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.HostPoolList = armdesktopvirtualization.HostPoolList{ - // Value: []*armdesktopvirtualization.HostPool{ - // { - // Name: to.Ptr("hostPool1"), - // Type: to.Ptr("/Microsoft.DesktopVirtualization/hostPools"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1"), - // Location: to.Ptr("centralus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armdesktopvirtualization.HostPoolProperties{ - // Description: to.Ptr("des1"), - // AgentUpdate: &armdesktopvirtualization.AgentUpdateProperties{ - // Type: to.Ptr(armdesktopvirtualization.SessionHostComponentUpdateTypeScheduled), - // MaintenanceWindowTimeZone: to.Ptr("Alaskan Standard Time"), - // MaintenanceWindows: []*armdesktopvirtualization.MaintenanceWindowProperties{ - // { - // DayOfWeek: to.Ptr(armdesktopvirtualization.DayOfWeekFriday), - // Hour: to.Ptr[int32](7), - // }, - // { - // DayOfWeek: to.Ptr(armdesktopvirtualization.DayOfWeekSaturday), - // Hour: to.Ptr[int32](8), - // }}, - // UseSessionHostLocalTime: to.Ptr(false), - // }, - // CloudPcResource: to.Ptr(false), - // FriendlyName: to.Ptr("friendly"), - // HostPoolType: to.Ptr(armdesktopvirtualization.HostPoolTypePooled), - // LoadBalancerType: to.Ptr(armdesktopvirtualization.LoadBalancerTypeBreadthFirst), - // MaxSessionLimit: to.Ptr[int32](999999), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // PersonalDesktopAssignmentType: to.Ptr(armdesktopvirtualization.PersonalDesktopAssignmentTypeAutomatic), - // PreferredAppGroupType: to.Ptr(armdesktopvirtualization.PreferredAppGroupTypeDesktop), - // RegistrationInfo: &armdesktopvirtualization.RegistrationInfo{ - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2008-09-22T14:01:54.957Z"); return t}()), - // RegistrationTokenOperation: to.Ptr(armdesktopvirtualization.RegistrationTokenOperationUpdate), - // Token: to.Ptr("token"), - // }, - // SsoClientID: to.Ptr("client"), - // SsoClientSecretKeyVaultPath: to.Ptr("https://keyvault/secret"), - // SsoSecretType: to.Ptr(armdesktopvirtualization.SSOSecretTypeSharedKey), - // SsoadfsAuthority: to.Ptr("https://adfs"), - // StartVMOnConnect: to.Ptr(false), - // VMTemplate: to.Ptr("{json:json}"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }, - // { - // Name: to.Ptr("hostPool2"), - // Type: to.Ptr("/Microsoft.DesktopVirtualization/hostPools"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool2"), - // Location: to.Ptr("centralus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armdesktopvirtualization.HostPoolProperties{ - // Description: to.Ptr("des1"), - // AgentUpdate: &armdesktopvirtualization.AgentUpdateProperties{ - // Type: to.Ptr(armdesktopvirtualization.SessionHostComponentUpdateTypeScheduled), - // MaintenanceWindowTimeZone: to.Ptr("Alaskan Standard Time"), - // MaintenanceWindows: []*armdesktopvirtualization.MaintenanceWindowProperties{ - // { - // DayOfWeek: to.Ptr(armdesktopvirtualization.DayOfWeekFriday), - // Hour: to.Ptr[int32](7), - // }, - // { - // DayOfWeek: to.Ptr(armdesktopvirtualization.DayOfWeekSaturday), - // Hour: to.Ptr[int32](8), - // }}, - // UseSessionHostLocalTime: to.Ptr(false), - // }, - // CloudPcResource: to.Ptr(false), - // FriendlyName: to.Ptr("friendly"), - // HostPoolType: to.Ptr(armdesktopvirtualization.HostPoolTypePooled), - // LoadBalancerType: to.Ptr(armdesktopvirtualization.LoadBalancerTypeBreadthFirst), - // MaxSessionLimit: to.Ptr[int32](999999), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // PersonalDesktopAssignmentType: to.Ptr(armdesktopvirtualization.PersonalDesktopAssignmentTypeAutomatic), - // PreferredAppGroupType: to.Ptr(armdesktopvirtualization.PreferredAppGroupTypeDesktop), - // RegistrationInfo: &armdesktopvirtualization.RegistrationInfo{ - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2008-09-22T14:01:54.957Z"); return t}()), - // RegistrationTokenOperation: to.Ptr(armdesktopvirtualization.RegistrationTokenOperationUpdate), - // Token: to.Ptr("token"), - // }, - // SsoClientID: to.Ptr("client"), - // SsoClientSecretKeyVaultPath: to.Ptr("https://keyvault/secret"), - // SsoSecretType: to.Ptr(armdesktopvirtualization.SSOSecretTypeSharedKey), - // SsoadfsAuthority: to.Ptr("https://adfs"), - // StartVMOnConnect: to.Ptr(false), - // VMTemplate: to.Ptr("{json:json}"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/HostPools_RetrieveRegistrationToken_Post.json -func ExampleHostPoolsClient_RetrieveRegistrationToken() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewHostPoolsClient().RetrieveRegistrationToken(ctx, "resourceGroup1", "hostPool1", 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.RegistrationInfo = armdesktopvirtualization.RegistrationInfo{ - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2008-09-22T14:01:54.957Z"); return t}()), - // RegistrationTokenOperation: to.Ptr(armdesktopvirtualization.RegistrationTokenOperationUpdate), - // Token: to.Ptr("token"), - // } -} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/initiatesessionhostupdate_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/initiatesessionhostupdate_client.go new file mode 100644 index 000000000000..fe3be9bd742d --- /dev/null +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/initiatesessionhostupdate_client.go @@ -0,0 +1,105 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armdesktopvirtualization + +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" +) + +// InitiateSessionHostUpdateClient contains the methods for the InitiateSessionHostUpdate group. +// Don't use this type directly, use NewInitiateSessionHostUpdateClient() instead. +type InitiateSessionHostUpdateClient struct { + internal *arm.Client + subscriptionID string +} + +// NewInitiateSessionHostUpdateClient creates a new instance of InitiateSessionHostUpdateClient with the specified values. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewInitiateSessionHostUpdateClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*InitiateSessionHostUpdateClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &InitiateSessionHostUpdateClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Post - Initiates a hostpool update or schedule an update for the future. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-04-08-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - hostPoolName - The name of the host pool within the specified resource group +// - options - InitiateSessionHostUpdateClientPostOptions contains the optional parameters for the InitiateSessionHostUpdateClient.Post +// method. +func (client *InitiateSessionHostUpdateClient) Post(ctx context.Context, resourceGroupName string, hostPoolName string, options *InitiateSessionHostUpdateClientPostOptions) (InitiateSessionHostUpdateClientPostResponse, error) { + var err error + const operationName = "InitiateSessionHostUpdateClient.Post" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.postCreateRequest(ctx, resourceGroupName, hostPoolName, options) + if err != nil { + return InitiateSessionHostUpdateClientPostResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return InitiateSessionHostUpdateClientPostResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return InitiateSessionHostUpdateClientPostResponse{}, err + } + return InitiateSessionHostUpdateClientPostResponse{}, nil +} + +// postCreateRequest creates the Post request. +func (client *InitiateSessionHostUpdateClient) postCreateRequest(ctx context.Context, resourceGroupName string, hostPoolName string, options *InitiateSessionHostUpdateClientPostOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostManagements/default/initiateSessionHostUpdate" + 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 hostPoolName == "" { + return nil, errors.New("parameter hostPoolName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{hostPoolName}", url.PathEscape(hostPoolName)) + 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", "2024-04-08-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if options != nil && options.UpdateSessionHostsRequestBody != nil { + if err := runtime.MarshalAsJSON(req, *options.UpdateSessionHostsRequestBody); err != nil { + return nil, err + } + return req, nil + } + return req, nil +} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/models.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/models.go index 3b6e378d188d..2ce3b848c738 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/models.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/models.go @@ -10,6 +10,103 @@ package armdesktopvirtualization import "time" +// ActiveDirectoryInfoPatchProperties - Active directory info. Only one should be populated based on the join type. +type ActiveDirectoryInfoPatchProperties struct { + // Credentials needed to create the virtual machine. + DomainCredentials *KeyVaultCredentialsPatchProperties +} + +// ActiveDirectoryInfoProperties - Active directory info. Only one should be populated based on the join type. +type ActiveDirectoryInfoProperties struct { + // REQUIRED; Credentials needed to create the virtual machine. + DomainCredentials *KeyVaultCredentialsProperties + + // REQUIRED; The organizational unit(OU) path. + OuPath *string + + // The domain a virtual machine connected to a hostpool will join. + DomainName *string +} + +// ActiveSessionHostConfiguration - Represents a ActiveSessionHostConfiguration definition. This has all of the sessionHostConfiguration +// properties except provisioningState +type ActiveSessionHostConfiguration struct { + // REQUIRED; Detailed properties for SessionHostConfiguration + Properties *ActiveSessionHostConfigurationProperties + + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/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 +} + +// ActiveSessionHostConfigurationList - List of ActiveSessionHostConfiguration definitions. +type ActiveSessionHostConfigurationList struct { + // List of ActiveSessionHostConfiguration definitions. + Value []*ActiveSessionHostConfiguration + + // READ-ONLY; Link to the next page of results. + NextLink *string +} + +// ActiveSessionHostConfigurationProperties - Session host configurations of HostPool. +type ActiveSessionHostConfigurationProperties struct { + // REQUIRED; Disk information. + DiskInfo *DiskInfoProperties + + // REQUIRED; Domain configurations of session hosts. + DomainInfo *DomainInfoProperties + + // REQUIRED; Image configurations of HostPool. + ImageInfo *ImageInfoProperties + + // REQUIRED; Network information. + NetworkInfo *NetworkInfoProperties + + // REQUIRED; Local Admin credentials for session hosts. + VMAdminCredentials *KeyVaultCredentialsProperties + + // REQUIRED; The prefix that should be associated with session host names + VMNamePrefix *string + + // REQUIRED; The id of the size of a virtual machine connected to a hostpool. Example: StandardD2asv6 + VMSizeID *string + + // Value for availability zones to be used by the session host. Should be from [1,2,3]. + AvailabilityZones []*int32 + + // Boot Diagnostics information. + BootDiagnosticsInfo *BootDiagnosticsInfoProperties + + // The uri to the storage blob containing the arm template to be run on the virtual machine after provisioning. + CustomConfigurationScriptURL *string + + // Friendly name to describe this version of the SessionHostConfiguration. + FriendlyName *string + + // Security information. + SecurityInfo *SecurityInfoProperties + + // The Location for the session host to be created in. It will default to the location of the hostpool if not provided. + VMLocation *string + + // The ResourceGroup for the session hosts to be created in. It will default to the ResourceGroup of the hostpool if not provided. + VMResourceGroup *string + + // Hashtable that lists key/value pair tags to apply to the VMs + VMTags map[string]*string + + // READ-ONLY; The timestamp of the last update. + Version *time.Time +} + // AgentUpdatePatchProperties - The session host configuration for updating agent, monitoring agent, and stack component. type AgentUpdatePatchProperties struct { // Time zone for maintenance as defined in https://docs.microsoft.com/en-us/dotnet/api/system.timezoneinfo.findsystemtimezonebyid?view=net-5.0. @@ -42,18 +139,171 @@ type AgentUpdateProperties struct { UseSessionHostLocalTime *bool } +// AppAttachPackage - Schema for App Attach Package properties. +type AppAttachPackage struct { + // REQUIRED; The geo-location where the resource lives + Location *string + + // REQUIRED; Detailed properties for App Attach Package + Properties *AppAttachPackageProperties + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/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 +} + +// AppAttachPackageInfoProperties - Schema for Import Package Information properties. +type AppAttachPackageInfoProperties struct { + // Date certificate expires, found in the appxmanifest.xml. + CertificateExpiry *time.Time + + // Certificate name found in the appxmanifest.xml. + CertificateName *string + + // User friendly Name to be displayed in the portal. + DisplayName *string + + // VHD/CIM/APP-V image path on Network Share. + ImagePath *string + + // Make this version of the package the active one across the hostpool. + IsActive *bool + + // Is package timestamped so it can ignore the certificate expiry date + IsPackageTimestamped *PackageTimestamped + + // Specifies how to register Package in feed. + IsRegularRegistration *bool + + // Date the package source was last updated, for Msix packages this is found in the appxmanifest.xml. + LastUpdated *time.Time + + // Alias of App Attach Package. Assigned at import time + PackageAlias *string + + // List of package applications. + PackageApplications []*MsixPackageApplications + + // List of package dependencies. + PackageDependencies []*MsixPackageDependencies + + // Identifier not including the package version, for Msix packages it is the family name from the appxmanifest.xml. + PackageFamilyName *string + + // Identifier including the package version, for Msix packages it is the full name from the appxmanifest.xml. + PackageFullName *string + + // Package Name from appxmanifest.xml. + PackageName *string + + // Relative Path to the package inside the image. + PackageRelativePath *string + + // Package Version found in the appxmanifest.xml. + Version *string +} + +// AppAttachPackageList - List of App Attach Package definitions. +type AppAttachPackageList struct { + // List of App Attach Package definitions. + Value []*AppAttachPackage + + // READ-ONLY; Link to the next page of results. + NextLink *string +} + +// AppAttachPackagePatch - Schema for patchable App Attach Package properties. +type AppAttachPackagePatch struct { + // Detailed properties for App Attach Package + Properties *AppAttachPackagePatchProperties + + // tags to be updated + Tags map[string]*string + + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/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 +} + +// AppAttachPackagePatchProperties - Schema for patchable fields on an App Attach Package. +type AppAttachPackagePatchProperties struct { + // Field that can be populated with custom data and filtered on in list GET calls + CustomData *string + + // Parameter indicating how the health check should behave if this package fails staging + FailHealthCheckOnStagingFailure *FailHealthCheckOnStagingFailure + + // List of Hostpool resource Ids. + HostPoolReferences []*string + + // Detailed properties for App Attach Package + Image *AppAttachPackageInfoProperties + + // URL of keyvault location to store certificate + KeyVaultURL *string + + // Lookback url to third party control plane, should be null for first party packages + PackageLookbackURL *string +} + +// AppAttachPackageProperties - Schema for App Attach Package properties. +type AppAttachPackageProperties struct { + // Field that can be populated with custom data and filtered on in list GET calls + CustomData *string + + // Parameter indicating how the health check should behave if this package fails staging + FailHealthCheckOnStagingFailure *FailHealthCheckOnStagingFailure + + // List of Hostpool resource Ids. + HostPoolReferences []*string + + // Detailed properties for App Attach Package + Image *AppAttachPackageInfoProperties + + // URL of keyvault location to store certificate + KeyVaultURL *string + + // Lookback url to third party control plane, is null for native app attach packages + PackageLookbackURL *string + + // Specific name of package owner, is "AppAttach" for native app attach packages + PackageOwnerName *string + + // READ-ONLY; The provisioning state of the App Attach Package. + ProvisioningState *ProvisioningState +} + // Application - Schema for Application properties. type Application struct { // REQUIRED; Detailed properties for Application Properties *ApplicationProperties - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Metadata pertaining to creation and last modification of the 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" @@ -62,24 +312,30 @@ type Application struct { // ApplicationGroup - Represents a ApplicationGroup definition. type ApplicationGroup struct { + // REQUIRED; The geo-location where the resource lives + Location *string + // REQUIRED; Detailed properties for ApplicationGroup Properties *ApplicationGroupProperties - Identity *ResourceModelWithAllowedPropertySetIdentity - // Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are + // Managed service identity (system assigned and/or user assigned identities) + Identity *ManagedServiceIdentity + + // Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type. E.g. ApiApps are // a kind of Microsoft.Web/sites type. If supported, the resource provider must // validate and persist this value. Kind *string - // The geo-location where the resource lives - Location *string - // The fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed by another // Azure resource. If this is present, complete mode deployment will not // delete the resource if it is removed from the template since it is managed by another resource. ManagedBy *string - Plan *ResourceModelWithAllowedPropertySetPlan - SKU *ResourceModelWithAllowedPropertySetSKU + + // Plan for the resource. + Plan *Plan + + // The resource model definition representing SKU + SKU *SKU // Resource tags. Tags map[string]*string @@ -90,13 +346,13 @@ type ApplicationGroup struct { // (section 14.26), and If-Range (section 14.27) header fields. Etag *string - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Metadata pertaining to creation and last modification of the 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" @@ -120,12 +376,15 @@ type ApplicationGroupPatch struct { // tags to be updated Tags map[string]*string - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/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 } @@ -270,18 +529,62 @@ type ApplicationProperties struct { ObjectID *string } +// AzureActiveDirectoryInfoProperties - Azure Active directory info. Only one should be populated based on the join type. +type AzureActiveDirectoryInfoProperties struct { + // REQUIRED; The Mobile Device Management(MDM) guid. + MdmProviderGUID *string +} + +// BootDiagnosticsInfoPatchProperties - Boot Diagnostics is a debugging feature which allows you to view Console Output and +// Screenshot to diagnose VM status. +// You can easily view the output of your console log. +// Azure also enables you to see a screenshot of the VM from the hypervisor. +type BootDiagnosticsInfoPatchProperties struct { + // Whether boot diagnostics should be enabled on the Virtual Machine. + Enabled *bool + + // Uri of the storage account to use for placing the console output and screenshot. + // If storageUri is not specified while enabling boot diagnostics, managed storage will be used. + StorageURI *string +} + +// BootDiagnosticsInfoProperties - Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot +// to diagnose VM status. +// You can easily view the output of your console log. +// Azure also enables you to see a screenshot of the VM from the hypervisor. +type BootDiagnosticsInfoProperties struct { + // Whether boot diagnostics should be enabled on the Virtual Machine. + Enabled *bool + + // Uri of the storage account to use for placing the console output and screenshot. + // If storageUri is not specified while enabling boot diagnostics, managed storage will be used. + StorageURI *string +} + +// CustomInfoPatchProperties - Custom image information. +type CustomInfoPatchProperties struct { + // The resource id of the custom image. + ResourceID *string +} + +// CustomInfoProperties - Custom image information. +type CustomInfoProperties struct { + // REQUIRED; The resource id of the custom image. + ResourceID *string +} + // Desktop - Schema for Desktop properties. type Desktop struct { // Detailed properties for Desktop Properties *DesktopProperties - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Metadata pertaining to creation and last modification of the 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" @@ -333,17 +636,77 @@ type DesktopProperties struct { ObjectID *string } +// DiskInfoPatchProperties - Disk information. +type DiskInfoPatchProperties struct { + // The disk type used by virtual machine in hostpool session host. + Type *VirtualMachineDiskType +} + +// DiskInfoProperties - Disk information. +type DiskInfoProperties struct { + // REQUIRED; The disk type used by virtual machine in hostpool session host. + Type *VirtualMachineDiskType +} + +// DomainInfoPatchProperties - Domain configurations of session hosts. +type DomainInfoPatchProperties struct { + // Active directory info. Only one should be populated based on the join type. + ActiveDirectoryInfo *ActiveDirectoryInfoPatchProperties +} + +// DomainInfoProperties - Domain configurations of session hosts. +type DomainInfoProperties struct { + // REQUIRED; The type of domain join done by the virtual machine. + JoinType *DomainJoinType + + // Active directory info. Only one should be populated based on the join type. + ActiveDirectoryInfo *ActiveDirectoryInfoProperties + + // Azure active directory info. Only one should be populated based on the join type. + AzureActiveDirectoryInfo *AzureActiveDirectoryInfoProperties +} + +// ErrorAdditionalInfo - The resource management error additional info. +type ErrorAdditionalInfo struct { + // READ-ONLY; The additional info. + Info any + + // READ-ONLY; The additional info type. + Type *string +} + +// ErrorDetail - The error detail. +type ErrorDetail struct { + // READ-ONLY; The error additional info. + AdditionalInfo []*ErrorAdditionalInfo + + // READ-ONLY; The error code. + Code *string + + // READ-ONLY; The error details. + Details []*ErrorDetail + + // READ-ONLY; The error message. + Message *string + + // READ-ONLY; The error target. + Target *string +} + // ExpandMsixImage - Represents the definition of contents retrieved after expanding the MSIX Image. type ExpandMsixImage struct { // Detailed properties for ExpandMsixImage Properties *ExpandMsixImageProperties - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/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 } @@ -359,6 +722,12 @@ type ExpandMsixImageList struct { // ExpandMsixImageProperties - Schema for Expand MSIX Image properties. type ExpandMsixImageProperties struct { + // Date certificate expires, found in the appxmanifest.xml. + CertificateExpiry *time.Time + + // Certificate name found in the appxmanifest.xml. + CertificateName *string + // User friendly Name to be displayed in the portal. DisplayName *string @@ -401,24 +770,30 @@ type ExpandMsixImageProperties struct { // HostPool - Represents a HostPool definition. type HostPool struct { + // REQUIRED; The geo-location where the resource lives + Location *string + // REQUIRED; Detailed properties for HostPool Properties *HostPoolProperties - Identity *ResourceModelWithAllowedPropertySetIdentity - // Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are + // Managed service identity (system assigned and/or user assigned identities) + Identity *ManagedServiceIdentity + + // Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type. E.g. ApiApps are // a kind of Microsoft.Web/sites type. If supported, the resource provider must // validate and persist this value. Kind *string - // The geo-location where the resource lives - Location *string - // The fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed by another // Azure resource. If this is present, complete mode deployment will not // delete the resource if it is removed from the template since it is managed by another resource. ManagedBy *string - Plan *ResourceModelWithAllowedPropertySetPlan - SKU *ResourceModelWithAllowedPropertySetSKU + + // Plan for the resource. + Plan *Plan + + // The resource model definition representing SKU + SKU *SKU // Resource tags. Tags map[string]*string @@ -429,13 +804,13 @@ type HostPool struct { // (section 14.26), and If-Range (section 14.27) header fields. Etag *string - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Metadata pertaining to creation and last modification of the 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" @@ -459,12 +834,15 @@ type HostPoolPatch struct { // tags to be updated Tags map[string]*string - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/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 } @@ -480,12 +858,24 @@ type HostPoolPatchProperties struct { // Description of HostPool. Description *string + // Default: AVD-wide settings are used to determine connection availability, Enabled: UDP will attempt this connection type + // when making connections. This means that this connection is possible, but is + // not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP will not attempt this connection + // type when making connections + DirectUDP *DirectUDP + // Friendly name of HostPool. FriendlyName *string // The type of the load balancer. LoadBalancerType *LoadBalancerType + // Default: AVD-wide settings are used to determine connection availability, Enabled: UDP will attempt this connection type + // when making connections. This means that this connection is possible, but is + // not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP will not attempt this connection + // type when making connections + ManagedPrivateUDP *ManagedPrivateUDP + // The max session limit of HostPool. MaxSessionLimit *int32 @@ -498,9 +888,21 @@ type HostPoolPatchProperties struct { // Enabled to allow this resource to be access from the public network PublicNetworkAccess *HostpoolPublicNetworkAccess + // Default: AVD-wide settings are used to determine connection availability, Enabled: UDP will attempt this connection type + // when making connections. This means that this connection is possible, but is + // not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP will not attempt this connection + // type when making connections + PublicUDP *PublicUDP + // The registration info of HostPool. RegistrationInfo *RegistrationInfoPatch + // Default: AVD-wide settings are used to determine connection availability, Enabled: UDP will attempt this connection type + // when making connections. This means that this connection is possible, but is + // not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP will not attempt this connection + // type when making connections + RelayUDP *RelayUDP + // The ring number of HostPool. Ring *int32 @@ -546,9 +948,24 @@ type HostPoolProperties struct { // Description of HostPool. Description *string + // Default: AVD-wide settings are used to determine connection availability, Enabled: UDP will attempt this connection type + // when making connections. This means that this connection is possible, but is + // not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP will not attempt this connection + // type when making connections + DirectUDP *DirectUDP + // Friendly name of HostPool. FriendlyName *string + // Default: AVD-wide settings are used to determine connection availability, Enabled: UDP will attempt this connection type + // when making connections. This means that this connection is possible, but is + // not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP will not attempt this connection + // type when making connections + ManagedPrivateUDP *ManagedPrivateUDP + + // The type of management for this hostpool, Automated or Standard. The default value is Automated. + ManagementType *ManagementType + // The max session limit of HostPool. MaxSessionLimit *int32 @@ -559,9 +976,21 @@ type HostPoolProperties struct { // be accessed via private endpoints PublicNetworkAccess *HostpoolPublicNetworkAccess + // Default: AVD-wide settings are used to determine connection availability, Enabled: UDP will attempt this connection type + // when making connections. This means that this connection is possible, but is + // not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP will not attempt this connection + // type when making connections + PublicUDP *PublicUDP + // The registration info of HostPool. RegistrationInfo *RegistrationInfo + // Default: AVD-wide settings are used to determine connection availability, Enabled: UDP will attempt this connection type + // when making connections. This means that this connection is possible, but is + // not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP will not attempt this connection + // type when making connections + RelayUDP *RelayUDP + // The ring number of HostPool. Ring *int32 @@ -586,6 +1015,9 @@ type HostPoolProperties struct { // Is validation environment. ValidationEnvironment *bool + // READ-ONLY; List of App Attach Package links. + AppAttachPackageReferences []*string + // READ-ONLY; List of applicationGroup links. ApplicationGroupReferences []*string @@ -599,6 +1031,96 @@ type HostPoolProperties struct { PrivateEndpointConnections []*PrivateEndpointConnection } +// HostPoolUpdateConfigurationPatchProperties - The configurations of a hostpool update. +type HostPoolUpdateConfigurationPatchProperties struct { + // Whether not to save original disk. False by default. + DeleteOriginalVM *bool + + // Grace period before logging off users in minutes. + LogOffDelayMinutes *int32 + + // Log off message sent to user for logoff. + LogOffMessage *string + + // The maximum number of virtual machines to be removed during hostpool update. + MaxVMsRemoved *int32 +} + +// HostPoolUpdateConfigurationProperties - The configurations of a hostpool update. +type HostPoolUpdateConfigurationProperties struct { + // REQUIRED; Grace period before logging off users in minutes. + LogOffDelayMinutes *int32 + + // REQUIRED; The maximum number of virtual machines to be removed during hostpool update. + MaxVMsRemoved *int32 + + // Whether not to save original disk. False by default. + DeleteOriginalVM *bool + + // Log off message sent to user for logoff. Default value is an empty string. + LogOffMessage *string +} + +// HostPoolUpdateControlParameter - Represents properties for a hostpool update control request. +type HostPoolUpdateControlParameter struct { + // REQUIRED; Action types for controlling hostpool update. + Action *HostPoolUpdateAction + + // The cancel message sent to the user on the session host. This is can only be specified if the action is 'Cancel'. + CancelMessage *string +} + +// ImageInfoPatchProperties - Image configurations of session host in a HostPool. +type ImageInfoPatchProperties struct { + // The values to uniquely identify a custom image. Only one should be populated based on the image type. + CustomInfo *CustomInfoPatchProperties + + // The type of image session hosts use in the hostpool. + ImageType *Type + + // The values to uniquely identify a marketplace image. Only one should be populated based on the image type. + MarketplaceInfo *MarketplaceInfoPatchProperties +} + +// ImageInfoProperties - Image configurations of session host in a HostPool. +type ImageInfoProperties struct { + // REQUIRED; The type of image session hosts use in the hostpool. + ImageType *Type + + // The values to uniquely identify a custom image. Only one should be populated based on the image type. + CustomInfo *CustomInfoProperties + + // The values to uniquely identify a marketplace image. Only one should be populated based on the image type. + MarketplaceInfo *MarketplaceInfoProperties +} + +// ImportPackageInfoRequest - Information to import app attach package +type ImportPackageInfoRequest struct { + // Possible device architectures that an app attach package can be configured for + PackageArchitecture *AppAttachPackageArchitectures + + // URI to Image + Path *string +} + +// KeyVaultCredentialsPatchProperties - Credentials kept in the keyvault. +type KeyVaultCredentialsPatchProperties struct { + // The uri to access the secret that the password is stored in. + PasswordKeyVaultSecretURI *string + + // The uri to access the secret that the username is stored in. + UsernameKeyVaultSecretURI *string +} + +// KeyVaultCredentialsProperties - Credentials kept in the keyvault. +type KeyVaultCredentialsProperties struct { + // REQUIRED; The uri to access the secret that the password is stored in. + PasswordKeyVaultSecretURI *string + + // REQUIRED; The uri to access the secret that the username is stored in. + UsernameKeyVaultSecretURI *string +} + // LogSpecification - Specifications of the Log for Azure Monitoring type LogSpecification struct { // Blob duration of the log @@ -622,13 +1144,13 @@ type MSIXPackage struct { // REQUIRED; Detailed properties for MSIX Package Properties *MSIXPackageProperties - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Metadata pertaining to creation and last modification of the 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" @@ -649,12 +1171,15 @@ type MSIXPackagePatch struct { // Detailed properties for MSIX Package Properties *MSIXPackagePatchProperties - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/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 } @@ -725,6 +1250,56 @@ type MaintenanceWindowProperties struct { Hour *int32 } +// 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 +} + +// MarketplaceInfoPatchProperties - Marketplace image information. +type MarketplaceInfoPatchProperties struct { + // The exact version of the image. + ExactVersion *string + + // The offer of the image. + Offer *string + + // The publisher of the image. + Publisher *string + + // The sku of the image. + SKU *string +} + +// MarketplaceInfoProperties - Marketplace image information. +type MarketplaceInfoProperties struct { + // REQUIRED; The exact version of the image. + ExactVersion *string + + // REQUIRED; The offer of the image. + Offer *string + + // REQUIRED; The publisher of the image. + Publisher *string + + // REQUIRED; The sku of the image. + SKU *string +} + // MsixPackageApplications - Schema for MSIX Package Application properties. type MsixPackageApplications struct { // Package Application Id, found in appxmanifest.xml. @@ -751,7 +1326,8 @@ type MsixPackageApplications struct { // MsixPackageDependencies - Schema for MSIX Package Dependencies properties. type MsixPackageDependencies struct { - // Name of package dependency. + // Name of the package dependency. For Msix packages, this is the other packages this package depends upon, for APP-V packages + // this is the locations of the user and deployment config files DependencyName *string // Dependency version required. @@ -761,29 +1337,69 @@ type MsixPackageDependencies struct { Publisher *string } +// NetworkInfoPatchProperties - Network information. +type NetworkInfoPatchProperties struct { + // The resource ID of the security group. Any allowable/open ports should be specified in the Network Security Group(NSG). + SecurityGroupID *string + + // The resource ID of the subnet. + SubnetID *string +} + +// NetworkInfoProperties - Network information. +type NetworkInfoProperties struct { + // REQUIRED; The resource ID of the subnet. + SubnetID *string + + // The resource ID of the security group. Any allowable/open ports should be specified in the Network Security Group(NSG). + SecurityGroupID *string +} + // OperationProperties - Properties of the operation type OperationProperties struct { // Service specification payload ServiceSpecification *ServiceSpecification } -// PrivateEndpoint - The Private Endpoint resource. +// Plan for the resource. +type Plan struct { + // REQUIRED; A user defined name of the 3rd Party Artifact that is being procured. + Name *string + + // REQUIRED; The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to the OfferID specified for the artifact + // at the time of Data Market onboarding. + Product *string + + // REQUIRED; The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic + Publisher *string + + // A publisher provided promotion code as provisioned in Data Market for the said product/artifact. + PromotionCode *string + + // The version of the desired product/artifact. + Version *string +} + +// PrivateEndpoint - The private endpoint resource. type PrivateEndpoint struct { - // READ-ONLY; The ARM identifier for Private Endpoint + // READ-ONLY; The ARM identifier for private endpoint. ID *string } -// PrivateEndpointConnection - The Private Endpoint Connection resource. +// PrivateEndpointConnection - The private endpoint connection resource. type PrivateEndpointConnection struct { // Resource properties. Properties *PrivateEndpointConnectionProperties - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/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 } @@ -798,14 +1414,17 @@ type PrivateEndpointConnectionListResultWithSystemData struct { NextLink *string } -// PrivateEndpointConnectionProperties - Properties of the PrivateEndpointConnectProperties. +// PrivateEndpointConnectionProperties - Properties of the private endpoint connection. type PrivateEndpointConnectionProperties struct { // REQUIRED; A collection of information about the state of the connection between service consumer and provider. PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState - // The resource of private end point. + // The private endpoint resource. PrivateEndpoint *PrivateEndpoint + // READ-ONLY; The group ids for the private endpoint resource. + GroupIDs []*string + // READ-ONLY; The provisioning state of the private endpoint connection resource. ProvisioningState *PrivateEndpointConnectionProvisioningState } @@ -815,13 +1434,13 @@ type PrivateEndpointConnectionWithSystemData struct { // Resource properties. Properties *PrivateEndpointConnectionProperties - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Metadata pertaining to creation and last modification of the 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" @@ -833,12 +1452,15 @@ type PrivateLinkResource struct { // Resource properties. Properties *PrivateLinkResourceProperties - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/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 } @@ -898,52 +1520,22 @@ type RegistrationInfoPatch struct { RegistrationTokenOperation *RegistrationTokenOperation } -type ResourceModelWithAllowedPropertySetIdentity struct { - // The identity type. - Type *string - - // READ-ONLY; The principal ID of resource identity. - PrincipalID *string - - // READ-ONLY; The tenant ID of resource. - TenantID *string -} - -type ResourceModelWithAllowedPropertySetPlan struct { - // REQUIRED; A user defined name of the 3rd Party Artifact that is being procured. - Name *string - - // REQUIRED; The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to the OfferID specified for the artifact - // at the time of Data Market onboarding. - Product *string +// RegistrationTokenList - List of RegistrationToken definitions. +type RegistrationTokenList struct { + // List of RegistrationToken definitions. + Value []*RegistrationTokenMinimal - // REQUIRED; The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic - Publisher *string - - // A publisher provided promotion code as provisioned in Data Market for the said product/artifact. - PromotionCode *string - - // The version of the desired product/artifact. - Version *string + // READ-ONLY; Link to the next page of results. + NextLink *string } -type ResourceModelWithAllowedPropertySetSKU struct { - // REQUIRED; The name of the SKU. Ex - P3. It is typically a letter+number code - Name *string - - // If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the - // resource this may be omitted. - Capacity *int32 - - // If the service has different generations of hardware, for the same SKU, then that can be captured here. - Family *string - - // The SKU size. When the name field is the combination of tier and some other value, this would be the standalone code. - Size *string +// RegistrationTokenMinimal - Represents a Minimal set of properties for RegistrationToken definition. +type RegistrationTokenMinimal struct { + // Expiration time of registration token. + ExpirationTime *time.Time - // This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required - // on a PUT. - Tier *SKUTier + // The registration token base64 encoded string. + Token *string } // ResourceProviderOperation - Supported operation of this resource provider. @@ -985,6 +1577,26 @@ type ResourceProviderOperationList struct { NextLink *string } +// SKU - The resource model definition representing SKU +type SKU struct { + // REQUIRED; The name of the SKU. E.g. P3. It is typically a letter+number code + Name *string + + // If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the + // resource this may be omitted. + Capacity *int32 + + // If the service has different generations of hardware, for the same SKU, then that can be captured here. + Family *string + + // The SKU size. When the name field is the combination of tier and some other value, this would be the standalone code. + Size *string + + // This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required + // on a PUT. + Tier *SKUTier +} + // ScalingHostPoolReference - Scaling plan reference to hostpool. type ScalingHostPoolReference struct { // Arm path of referenced hostpool. @@ -996,24 +1608,30 @@ type ScalingHostPoolReference struct { // ScalingPlan - Represents a scaling plan definition. type ScalingPlan struct { + // REQUIRED; The geo-location where the resource lives + Location *string + // REQUIRED; Detailed properties for scaling plan. Properties *ScalingPlanProperties - Identity *ResourceModelWithAllowedPropertySetIdentity - // Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are + // Managed service identity (system assigned and/or user assigned identities) + Identity *ManagedServiceIdentity + + // Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type. E.g. ApiApps are // a kind of Microsoft.Web/sites type. If supported, the resource provider must // validate and persist this value. Kind *string - // The geo-location where the resource lives - Location *string - // The fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed by another // Azure resource. If this is present, complete mode deployment will not // delete the resource if it is removed from the template since it is managed by another resource. ManagedBy *string - Plan *ResourceModelWithAllowedPropertySetPlan - SKU *ResourceModelWithAllowedPropertySetSKU + + // Plan for the resource. + Plan *Plan + + // The resource model definition representing SKU + SKU *SKU // Resource tags. Tags map[string]*string @@ -1024,13 +1642,13 @@ type ScalingPlan struct { // (section 14.26), and If-Range (section 14.27) header fields. Etag *string - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Metadata pertaining to creation and last modification of the 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" @@ -1081,13 +1699,13 @@ type ScalingPlanPersonalSchedule struct { // REQUIRED; Detailed properties for ScalingPlanPersonalSchedule Properties *ScalingPlanPersonalScheduleProperties - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Metadata pertaining to creation and last modification of the 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" @@ -1205,13 +1823,13 @@ type ScalingPlanPooledSchedule struct { // REQUIRED; Detailed properties for ScalingPlanPooledSchedule Properties *ScalingPlanPooledScheduleProperties - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Metadata pertaining to creation and last modification of the 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" @@ -1232,12 +1850,15 @@ type ScalingPlanPooledSchedulePatch struct { // Detailed properties for ScalingPlanPooledSchedule Properties *ScalingPlanPooledScheduleProperties - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/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 } @@ -1380,6 +2001,30 @@ type ScalingSchedule struct { RampUpStartTime *Time } +// SecurityInfoPatchProperties - Security information. +type SecurityInfoPatchProperties struct { + // Whether to use secureBoot on the virtual machine. + SecureBootEnabled *bool + + // The security type used by virtual machine in hostpool session host. + Type *VirtualMachineSecurityType + + // Whether to use vTPM on the virtual machine. + VTpmEnabled *bool +} + +// SecurityInfoProperties - Security information. +type SecurityInfoProperties struct { + // Whether to use secureBoot on the virtual machine. + SecureBootEnabled *bool + + // The security type used by virtual machine in hostpool session host. Default is Standard. + Type *VirtualMachineSecurityType + + // Whether to use vTPM on the virtual machine. + VTpmEnabled *bool +} + // SendMessage - Represents message sent to a UserSession. type SendMessage struct { // Body of message. @@ -1400,19 +2045,154 @@ type SessionHost struct { // Detailed properties for SessionHost Properties *SessionHostProperties - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/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 +} + +// SessionHostConfiguration - Represents a SessionHostConfiguration definition. +type SessionHostConfiguration struct { + // REQUIRED; Detailed properties for SessionHostConfiguration + Properties *SessionHostConfigurationProperties + + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Metadata pertaining to creation and last modification of the 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 } +// SessionHostConfigurationList - List of SessionHostConfiguration definitions. +type SessionHostConfigurationList struct { + // List of SessionHostConfiguration definitions. + Value []*SessionHostConfiguration + + // READ-ONLY; Link to the next page of results. + NextLink *string +} + +// SessionHostConfigurationPatch - Represents a SessionHostConfigurationPatch definition. +type SessionHostConfigurationPatch struct { + // Detailed properties for SessionHostConfigurationPatch + Properties *SessionHostConfigurationPatchProperties +} + +// SessionHostConfigurationPatchProperties - Session host configurations of HostPool. +type SessionHostConfigurationPatchProperties struct { + // Value for availability zones to be used by the session host. Should be from [1,2,3]. + AvailabilityZones []*int32 + + // Boot Diagnostics information. + BootDiagnosticsInfo *BootDiagnosticsInfoPatchProperties + + // The uri to the storage blob containing the arm template to be run on the virtual machine after provisioning. + CustomConfigurationScriptURL *string + + // Disk information. + DiskInfo *DiskInfoPatchProperties + + // Domain configurations of session hosts. + DomainInfo *DomainInfoPatchProperties + + // Friendly name to describe this version of the SessionHostConfiguration. + FriendlyName *string + + // Image configurations of HostPool. + ImageInfo *ImageInfoPatchProperties + + // Network information. + NetworkInfo *NetworkInfoPatchProperties + + // Security information. + SecurityInfo *SecurityInfoPatchProperties + + // Local Admin credentials for session hosts. + VMAdminCredentials *KeyVaultCredentialsPatchProperties + + // The Location for the session host to be created in + VMLocation *string + + // The prefix that should be associated with session host names + VMNamePrefix *string + + // The ResourceGroup for the session hosts to be created in. It will default to the ResourceGroup of the hostpool if not provided. + VMResourceGroup *string + + // The id of the size of a virtual machine connected to a hostpool. Example: StandardD2asv6 + VMSizeID *string + + // Hashtable that lists key/value pair tags to apply to the VMs + VMTags map[string]*string +} + +// SessionHostConfigurationProperties - Session host configurations of HostPool. +type SessionHostConfigurationProperties struct { + // REQUIRED; Disk information. + DiskInfo *DiskInfoProperties + + // REQUIRED; Domain configurations of session hosts. + DomainInfo *DomainInfoProperties + + // REQUIRED; Image configurations of HostPool. + ImageInfo *ImageInfoProperties + + // REQUIRED; Network information. + NetworkInfo *NetworkInfoProperties + + // REQUIRED; Local Admin credentials for session hosts. + VMAdminCredentials *KeyVaultCredentialsProperties + + // REQUIRED; The prefix that should be associated with session host names + VMNamePrefix *string + + // REQUIRED; The id of the size of a virtual machine connected to a hostpool. Example: StandardD2asv6 + VMSizeID *string + + // Value for availability zones to be used by the session host. Should be from [1,2,3]. + AvailabilityZones []*int32 + + // Boot Diagnostics information. + BootDiagnosticsInfo *BootDiagnosticsInfoProperties + + // The uri to the storage blob containing the arm template to be run on the virtual machine after provisioning. + CustomConfigurationScriptURL *string + + // Friendly name to describe this version of the SessionHostConfiguration. + FriendlyName *string + + // Security information. + SecurityInfo *SecurityInfoProperties + + // The Location for the session host to be created in. It will default to the location of the hostpool if not provided. + VMLocation *string + + // The ResourceGroup for the session hosts to be created in. It will default to the ResourceGroup of the hostpool if not provided. + VMResourceGroup *string + + // Hashtable that lists key/value pair tags to apply to the VMs + VMTags map[string]*string + + // READ-ONLY; Provisioning state of the Session Host Configuration. + ProvisioningState *ProvisioningStateSHC + + // READ-ONLY; The timestamp of the last update. + Version *time.Time +} + // SessionHostHealthCheckFailureDetails - Contains details on the failure. type SessionHostHealthCheckFailureDetails struct { // READ-ONLY; Error code corresponding for the failure. @@ -1446,17 +2226,135 @@ type SessionHostList struct { NextLink *string } +// SessionHostManagement - Represents a SessionHostManagement definition. +type SessionHostManagement struct { + // REQUIRED; Detailed properties for SessionHostManagement + Properties *SessionHostManagementProperties + + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/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 +} + +// SessionHostManagementList - List of SessionHostManagement definitions. +type SessionHostManagementList struct { + // List of SessionHostManagement definitions. + Value []*SessionHostManagement + + // READ-ONLY; Link to the next page of results. + NextLink *string +} + +// SessionHostManagementOperationProgress - SessionHostManagement Operation Progress information. +type SessionHostManagementOperationProgress struct { + // Time that the sessionHostManagement operation was created. + ExecutionStartTime *time.Time + + // The number of sessionHosts completed in the sessionHostManagement operation. + SessionHostsCompleted *int32 + + // The number of sessionHosts in progress in the sessionHostManagement operation. + SessionHostsInProgress *int32 + + // The number of sessionHosts rollback failed in the sessionHostManagement operation. + SessionHostsRollbackFailed *int32 + + // The number of sessionHosts to be started in the sessionHostManagement operation. + TotalSessionHosts *int32 +} + +// SessionHostManagementPatch - Represents a SessionHostManagementPatch definition. +type SessionHostManagementPatch struct { + // Detailed properties for SessionHostManagementPatch + Properties *SessionHostManagementPatchProperties +} + +// SessionHostManagementPatchProperties - Session host Managements of HostPool. +type SessionHostManagementPatchProperties struct { + // Time zone for sessionHostManagement operations as defined in https://docs.microsoft.com/dotnet/api/system.timezoneinfo.findsystemtimezonebyid. + // Must be set if useLocalTime is true. + ScheduledDateTimeZone *string + + // Parameters for a hostpool update. + Update *HostPoolUpdateConfigurationPatchProperties +} + +// SessionHostManagementProperties - Session host Managements of HostPool. +type SessionHostManagementProperties struct { + // REQUIRED; Time zone for sessionHostManagement operations as defined in https://docs.microsoft.com/dotnet/api/system.timezoneinfo.findsystemtimezonebyid. + // Must be set if useLocalTime is true. + ScheduledDateTimeZone *string + + // REQUIRED; Parameters for a hostpool update. + Update *HostPoolUpdateConfigurationProperties +} + +// SessionHostManagementUpdateStatus - The current status of the session host update async operation. +type SessionHostManagementUpdateStatus struct { + // REQUIRED; Operation status. Current defined values are < Error | Scheduled | UpdatingSessionHosts | ValidatingSessionHostUpdate + // | Paused | Pausing | Cancelling > | Succeeded | Failed | Canceled + Status *string + + // The end time of the operation. + EndTime *time.Time + + // If present, details of the operation error. + Error *ErrorDetail + + // Fully qualified ID for the async operation. + ID *string + + // Name of the async operation. + Name *string + + // Percent of the operation that is complete. + PercentComplete *float32 + + // The custom properties of the SessionHost Update Status. + Properties *SessionHostManagementUpdateStatusProperties + + // The start time of the operation. + StartTime *time.Time +} + +// SessionHostManagementUpdateStatusProperties - Properties bag to hold custom RP properties for sessionHostManagement Update +// Statuses. +type SessionHostManagementUpdateStatusProperties struct { + // The Log Analytics. + CorrelationID *string + + // Progress information on the sessionHostManagement operation. + Progress *SessionHostManagementOperationProgress + + // The timestamp that the update is scheduled for. + ScheduledDateTime *time.Time + + // SessionHostManagement properties used for the operation. + SessionHostManagement *SessionHostManagement +} + // SessionHostPatch - SessionHost properties that can be patched. type SessionHostPatch struct { // Detailed properties for SessionHost Properties *SessionHostPatchProperties - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/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 } @@ -1508,6 +2406,9 @@ type SessionHostProperties struct { // Update state of a SessionHost. UpdateState *UpdateState + // READ-ONLY; The last time update was completed. + LastSessionHostUpdateTime *time.Time + // READ-ONLY; The timestamp of the last update. LastUpdateTime *time.Time @@ -1517,6 +2418,10 @@ type SessionHostProperties struct { // READ-ONLY; Resource Id of SessionHost's underlying virtual machine. ResourceID *string + // READ-ONLY; SessionHostConfiguration version reference at the time the update is initiated, in the format of date time. + // Example: 2024-04-26T04:56:45Z + SessionHostConfiguration *string + // READ-ONLY; List of SessionHostHealthCheckReports SessionHostHealthCheckResults []*SessionHostHealthCheckReport @@ -1532,12 +2437,15 @@ type StartMenuItem struct { // Detailed properties for StartMenuItem Properties *StartMenuItemProperties - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/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 } @@ -1599,18 +2507,40 @@ type Time struct { Minute *int32 } +// UpdateSessionHostsRequestBody - Object containing the definition for properties to be used for a sessionHostUpdate operation. +type UpdateSessionHostsRequestBody struct { + // The timestamp that the update validation is scheduled for. If none is provided, the update will be executed immediately + ScheduledDateTime *time.Time + + // The timeZone as defined in https://docs.microsoft.com/dotnet/api/system.timezoneinfo.findsystemtimezonebyid. + ScheduledDateTimeZone *string + + // settings for management information for the hostpool update operation. If none is provided the update will use the settings + // saved in the sessionHostManagement object. + Update *HostPoolUpdateConfigurationPatchProperties +} + +// 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 +} + // UserSession - Represents a UserSession definition. type UserSession struct { // Detailed properties for UserSession Properties *UserSessionProperties - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Metadata pertaining to creation and last modification of the 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" @@ -1649,25 +2579,30 @@ type UserSessionProperties struct { // Workspace - Represents a Workspace definition. type Workspace struct { - Identity *ResourceModelWithAllowedPropertySetIdentity + // REQUIRED; The geo-location where the resource lives + Location *string - // Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are + // Managed service identity (system assigned and/or user assigned identities) + Identity *ManagedServiceIdentity + + // Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type. E.g. ApiApps are // a kind of Microsoft.Web/sites type. If supported, the resource provider must // validate and persist this value. Kind *string - // The geo-location where the resource lives - Location *string - // The fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed by another // Azure resource. If this is present, complete mode deployment will not // delete the resource if it is removed from the template since it is managed by another resource. ManagedBy *string - Plan *ResourceModelWithAllowedPropertySetPlan + + // Plan for the resource. + Plan *Plan // Detailed properties for Workspace Properties *WorkspaceProperties - SKU *ResourceModelWithAllowedPropertySetSKU + + // The resource model definition representing SKU + SKU *SKU // Resource tags. Tags map[string]*string @@ -1678,13 +2613,13 @@ type Workspace struct { // (section 14.26), and If-Range (section 14.27) header fields. Etag *string - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Metadata pertaining to creation and last modification of the 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" diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/models_serde.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/models_serde.go index 5f5f4e9d977d..0417b835780f 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/models_serde.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/models_serde.go @@ -16,6 +16,229 @@ import ( "reflect" ) +// MarshalJSON implements the json.Marshaller interface for type ActiveDirectoryInfoPatchProperties. +func (a ActiveDirectoryInfoPatchProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "domainCredentials", a.DomainCredentials) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ActiveDirectoryInfoPatchProperties. +func (a *ActiveDirectoryInfoPatchProperties) 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", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "domainCredentials": + err = unpopulate(val, "DomainCredentials", &a.DomainCredentials) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ActiveDirectoryInfoProperties. +func (a ActiveDirectoryInfoProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "domainCredentials", a.DomainCredentials) + populate(objectMap, "domainName", a.DomainName) + populate(objectMap, "ouPath", a.OuPath) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ActiveDirectoryInfoProperties. +func (a *ActiveDirectoryInfoProperties) 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", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "domainCredentials": + err = unpopulate(val, "DomainCredentials", &a.DomainCredentials) + delete(rawMsg, key) + case "domainName": + err = unpopulate(val, "DomainName", &a.DomainName) + delete(rawMsg, key) + case "ouPath": + err = unpopulate(val, "OuPath", &a.OuPath) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ActiveSessionHostConfiguration. +func (a ActiveSessionHostConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", a.ID) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "systemData", a.SystemData) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ActiveSessionHostConfiguration. +func (a *ActiveSessionHostConfiguration) 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", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &a.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ActiveSessionHostConfigurationList. +func (a ActiveSessionHostConfigurationList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ActiveSessionHostConfigurationList. +func (a *ActiveSessionHostConfigurationList) 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", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &a.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &a.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ActiveSessionHostConfigurationProperties. +func (a ActiveSessionHostConfigurationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "availabilityZones", a.AvailabilityZones) + populate(objectMap, "bootDiagnosticsInfo", a.BootDiagnosticsInfo) + populate(objectMap, "customConfigurationScriptUrl", a.CustomConfigurationScriptURL) + populate(objectMap, "diskInfo", a.DiskInfo) + populate(objectMap, "domainInfo", a.DomainInfo) + populate(objectMap, "friendlyName", a.FriendlyName) + populate(objectMap, "imageInfo", a.ImageInfo) + populate(objectMap, "networkInfo", a.NetworkInfo) + populate(objectMap, "securityInfo", a.SecurityInfo) + populate(objectMap, "vmAdminCredentials", a.VMAdminCredentials) + populate(objectMap, "vmLocation", a.VMLocation) + populate(objectMap, "vmNamePrefix", a.VMNamePrefix) + populate(objectMap, "vmResourceGroup", a.VMResourceGroup) + populate(objectMap, "vmSizeId", a.VMSizeID) + populate(objectMap, "vmTags", a.VMTags) + populateDateTimeRFC3339(objectMap, "version", a.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ActiveSessionHostConfigurationProperties. +func (a *ActiveSessionHostConfigurationProperties) 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", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "availabilityZones": + err = unpopulate(val, "AvailabilityZones", &a.AvailabilityZones) + delete(rawMsg, key) + case "bootDiagnosticsInfo": + err = unpopulate(val, "BootDiagnosticsInfo", &a.BootDiagnosticsInfo) + delete(rawMsg, key) + case "customConfigurationScriptUrl": + err = unpopulate(val, "CustomConfigurationScriptURL", &a.CustomConfigurationScriptURL) + delete(rawMsg, key) + case "diskInfo": + err = unpopulate(val, "DiskInfo", &a.DiskInfo) + delete(rawMsg, key) + case "domainInfo": + err = unpopulate(val, "DomainInfo", &a.DomainInfo) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &a.FriendlyName) + delete(rawMsg, key) + case "imageInfo": + err = unpopulate(val, "ImageInfo", &a.ImageInfo) + delete(rawMsg, key) + case "networkInfo": + err = unpopulate(val, "NetworkInfo", &a.NetworkInfo) + delete(rawMsg, key) + case "securityInfo": + err = unpopulate(val, "SecurityInfo", &a.SecurityInfo) + delete(rawMsg, key) + case "vmAdminCredentials": + err = unpopulate(val, "VMAdminCredentials", &a.VMAdminCredentials) + delete(rawMsg, key) + case "vmLocation": + err = unpopulate(val, "VMLocation", &a.VMLocation) + delete(rawMsg, key) + case "vmNamePrefix": + err = unpopulate(val, "VMNamePrefix", &a.VMNamePrefix) + delete(rawMsg, key) + case "vmResourceGroup": + err = unpopulate(val, "VMResourceGroup", &a.VMResourceGroup) + delete(rawMsg, key) + case "vmSizeId": + err = unpopulate(val, "VMSizeID", &a.VMSizeID) + delete(rawMsg, key) + case "vmTags": + err = unpopulate(val, "VMTags", &a.VMTags) + delete(rawMsg, key) + case "version": + err = unpopulateDateTimeRFC3339(val, "Version", &a.Version) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type AgentUpdatePatchProperties. func (a AgentUpdatePatchProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -94,19 +317,21 @@ func (a *AgentUpdateProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type Application. -func (a Application) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AppAttachPackage. +func (a AppAttachPackage) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", a.ID) + populate(objectMap, "location", a.Location) populate(objectMap, "name", a.Name) populate(objectMap, "properties", a.Properties) populate(objectMap, "systemData", a.SystemData) + populate(objectMap, "tags", a.Tags) populate(objectMap, "type", a.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Application. -func (a *Application) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AppAttachPackage. +func (a *AppAttachPackage) 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", a, err) @@ -117,6 +342,9 @@ func (a *Application) UnmarshalJSON(data []byte) error { case "id": err = unpopulate(val, "ID", &a.ID) delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &a.Location) + delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &a.Name) delete(rawMsg, key) @@ -126,6 +354,9 @@ func (a *Application) UnmarshalJSON(data []byte) error { case "systemData": err = unpopulate(val, "SystemData", &a.SystemData) delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &a.Tags) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &a.Type) delete(rawMsg, key) @@ -137,27 +368,30 @@ func (a *Application) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ApplicationGroup. -func (a ApplicationGroup) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AppAttachPackageInfoProperties. +func (a AppAttachPackageInfoProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "etag", a.Etag) - populate(objectMap, "id", a.ID) - populate(objectMap, "identity", a.Identity) - populate(objectMap, "kind", a.Kind) - populate(objectMap, "location", a.Location) - populate(objectMap, "managedBy", a.ManagedBy) - populate(objectMap, "name", a.Name) - populate(objectMap, "plan", a.Plan) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "sku", a.SKU) - populate(objectMap, "systemData", a.SystemData) - populate(objectMap, "tags", a.Tags) - populate(objectMap, "type", a.Type) + populateDateTimeRFC3339(objectMap, "certificateExpiry", a.CertificateExpiry) + populate(objectMap, "certificateName", a.CertificateName) + populate(objectMap, "displayName", a.DisplayName) + populate(objectMap, "imagePath", a.ImagePath) + populate(objectMap, "isActive", a.IsActive) + populate(objectMap, "isPackageTimestamped", a.IsPackageTimestamped) + populate(objectMap, "isRegularRegistration", a.IsRegularRegistration) + populateDateTimeRFC3339(objectMap, "lastUpdated", a.LastUpdated) + populate(objectMap, "packageAlias", a.PackageAlias) + populate(objectMap, "packageApplications", a.PackageApplications) + populate(objectMap, "packageDependencies", a.PackageDependencies) + populate(objectMap, "packageFamilyName", a.PackageFamilyName) + populate(objectMap, "packageFullName", a.PackageFullName) + populate(objectMap, "packageName", a.PackageName) + populate(objectMap, "packageRelativePath", a.PackageRelativePath) + populate(objectMap, "version", a.Version) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGroup. -func (a *ApplicationGroup) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AppAttachPackageInfoProperties. +func (a *AppAttachPackageInfoProperties) 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", a, err) @@ -165,44 +399,53 @@ func (a *ApplicationGroup) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "etag": - err = unpopulate(val, "Etag", &a.Etag) + case "certificateExpiry": + err = unpopulateDateTimeRFC3339(val, "CertificateExpiry", &a.CertificateExpiry) delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &a.ID) + case "certificateName": + err = unpopulate(val, "CertificateName", &a.CertificateName) delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &a.Identity) + case "displayName": + err = unpopulate(val, "DisplayName", &a.DisplayName) delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &a.Kind) + case "imagePath": + err = unpopulate(val, "ImagePath", &a.ImagePath) delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &a.Location) + case "isActive": + err = unpopulate(val, "IsActive", &a.IsActive) delete(rawMsg, key) - case "managedBy": - err = unpopulate(val, "ManagedBy", &a.ManagedBy) + case "isPackageTimestamped": + err = unpopulate(val, "IsPackageTimestamped", &a.IsPackageTimestamped) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) + case "isRegularRegistration": + err = unpopulate(val, "IsRegularRegistration", &a.IsRegularRegistration) delete(rawMsg, key) - case "plan": - err = unpopulate(val, "Plan", &a.Plan) + case "lastUpdated": + err = unpopulateDateTimeRFC3339(val, "LastUpdated", &a.LastUpdated) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &a.Properties) + case "packageAlias": + err = unpopulate(val, "PackageAlias", &a.PackageAlias) delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &a.SKU) + case "packageApplications": + err = unpopulate(val, "PackageApplications", &a.PackageApplications) delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &a.SystemData) + case "packageDependencies": + err = unpopulate(val, "PackageDependencies", &a.PackageDependencies) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &a.Tags) + case "packageFamilyName": + err = unpopulate(val, "PackageFamilyName", &a.PackageFamilyName) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) + case "packageFullName": + err = unpopulate(val, "PackageFullName", &a.PackageFullName) + delete(rawMsg, key) + case "packageName": + err = unpopulate(val, "PackageName", &a.PackageName) + delete(rawMsg, key) + case "packageRelativePath": + err = unpopulate(val, "PackageRelativePath", &a.PackageRelativePath) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &a.Version) delete(rawMsg, key) } if err != nil { @@ -212,16 +455,16 @@ func (a *ApplicationGroup) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ApplicationGroupList. -func (a ApplicationGroupList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AppAttachPackageList. +func (a AppAttachPackageList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", a.NextLink) populate(objectMap, "value", a.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGroupList. -func (a *ApplicationGroupList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AppAttachPackageList. +func (a *AppAttachPackageList) 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", a, err) @@ -243,19 +486,20 @@ func (a *ApplicationGroupList) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ApplicationGroupPatch. -func (a ApplicationGroupPatch) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AppAttachPackagePatch. +func (a AppAttachPackagePatch) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", a.ID) populate(objectMap, "name", a.Name) populate(objectMap, "properties", a.Properties) + populate(objectMap, "systemData", a.SystemData) populate(objectMap, "tags", a.Tags) populate(objectMap, "type", a.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGroupPatch. -func (a *ApplicationGroupPatch) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AppAttachPackagePatch. +func (a *AppAttachPackagePatch) 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", a, err) @@ -272,6 +516,9 @@ func (a *ApplicationGroupPatch) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &a.Properties) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &a.SystemData) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &a.Tags) delete(rawMsg, key) @@ -286,17 +533,20 @@ func (a *ApplicationGroupPatch) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ApplicationGroupPatchProperties. -func (a ApplicationGroupPatchProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AppAttachPackagePatchProperties. +func (a AppAttachPackagePatchProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", a.Description) - populate(objectMap, "friendlyName", a.FriendlyName) - populate(objectMap, "showInFeed", a.ShowInFeed) + populate(objectMap, "customData", a.CustomData) + populate(objectMap, "failHealthCheckOnStagingFailure", a.FailHealthCheckOnStagingFailure) + populate(objectMap, "hostPoolReferences", a.HostPoolReferences) + populate(objectMap, "image", a.Image) + populate(objectMap, "keyVaultURL", a.KeyVaultURL) + populate(objectMap, "packageLookbackUrl", a.PackageLookbackURL) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGroupPatchProperties. -func (a *ApplicationGroupPatchProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AppAttachPackagePatchProperties. +func (a *AppAttachPackagePatchProperties) 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", a, err) @@ -304,14 +554,23 @@ func (a *ApplicationGroupPatchProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "description": - err = unpopulate(val, "Description", &a.Description) + case "customData": + err = unpopulate(val, "CustomData", &a.CustomData) delete(rawMsg, key) - case "friendlyName": - err = unpopulate(val, "FriendlyName", &a.FriendlyName) + case "failHealthCheckOnStagingFailure": + err = unpopulate(val, "FailHealthCheckOnStagingFailure", &a.FailHealthCheckOnStagingFailure) delete(rawMsg, key) - case "showInFeed": - err = unpopulate(val, "ShowInFeed", &a.ShowInFeed) + case "hostPoolReferences": + err = unpopulate(val, "HostPoolReferences", &a.HostPoolReferences) + delete(rawMsg, key) + case "image": + err = unpopulate(val, "Image", &a.Image) + delete(rawMsg, key) + case "keyVaultURL": + err = unpopulate(val, "KeyVaultURL", &a.KeyVaultURL) + delete(rawMsg, key) + case "packageLookbackUrl": + err = unpopulate(val, "PackageLookbackURL", &a.PackageLookbackURL) delete(rawMsg, key) } if err != nil { @@ -321,22 +580,22 @@ func (a *ApplicationGroupPatchProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ApplicationGroupProperties. -func (a ApplicationGroupProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AppAttachPackageProperties. +func (a AppAttachPackageProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "applicationGroupType", a.ApplicationGroupType) - populate(objectMap, "cloudPcResource", a.CloudPcResource) - populate(objectMap, "description", a.Description) - populate(objectMap, "friendlyName", a.FriendlyName) - populate(objectMap, "hostPoolArmPath", a.HostPoolArmPath) - populate(objectMap, "objectId", a.ObjectID) - populate(objectMap, "showInFeed", a.ShowInFeed) - populate(objectMap, "workspaceArmPath", a.WorkspaceArmPath) + populate(objectMap, "customData", a.CustomData) + populate(objectMap, "failHealthCheckOnStagingFailure", a.FailHealthCheckOnStagingFailure) + populate(objectMap, "hostPoolReferences", a.HostPoolReferences) + populate(objectMap, "image", a.Image) + populate(objectMap, "keyVaultURL", a.KeyVaultURL) + populate(objectMap, "packageLookbackUrl", a.PackageLookbackURL) + populate(objectMap, "packageOwnerName", a.PackageOwnerName) + populate(objectMap, "provisioningState", a.ProvisioningState) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGroupProperties. -func (a *ApplicationGroupProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AppAttachPackageProperties. +func (a *AppAttachPackageProperties) 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", a, err) @@ -344,29 +603,29 @@ func (a *ApplicationGroupProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "applicationGroupType": - err = unpopulate(val, "ApplicationGroupType", &a.ApplicationGroupType) + case "customData": + err = unpopulate(val, "CustomData", &a.CustomData) delete(rawMsg, key) - case "cloudPcResource": - err = unpopulate(val, "CloudPcResource", &a.CloudPcResource) + case "failHealthCheckOnStagingFailure": + err = unpopulate(val, "FailHealthCheckOnStagingFailure", &a.FailHealthCheckOnStagingFailure) delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &a.Description) + case "hostPoolReferences": + err = unpopulate(val, "HostPoolReferences", &a.HostPoolReferences) delete(rawMsg, key) - case "friendlyName": - err = unpopulate(val, "FriendlyName", &a.FriendlyName) + case "image": + err = unpopulate(val, "Image", &a.Image) delete(rawMsg, key) - case "hostPoolArmPath": - err = unpopulate(val, "HostPoolArmPath", &a.HostPoolArmPath) + case "keyVaultURL": + err = unpopulate(val, "KeyVaultURL", &a.KeyVaultURL) delete(rawMsg, key) - case "objectId": - err = unpopulate(val, "ObjectID", &a.ObjectID) + case "packageLookbackUrl": + err = unpopulate(val, "PackageLookbackURL", &a.PackageLookbackURL) delete(rawMsg, key) - case "showInFeed": - err = unpopulate(val, "ShowInFeed", &a.ShowInFeed) + case "packageOwnerName": + err = unpopulate(val, "PackageOwnerName", &a.PackageOwnerName) delete(rawMsg, key) - case "workspaceArmPath": - err = unpopulate(val, "WorkspaceArmPath", &a.WorkspaceArmPath) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) delete(rawMsg, key) } if err != nil { @@ -376,16 +635,19 @@ func (a *ApplicationGroupProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ApplicationList. -func (a ApplicationList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Application. +func (a Application) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", a.NextLink) - populate(objectMap, "value", a.Value) + populate(objectMap, "id", a.ID) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "systemData", a.SystemData) + populate(objectMap, "type", a.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationList. -func (a *ApplicationList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Application. +func (a *Application) 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", a, err) @@ -393,11 +655,20 @@ func (a *ApplicationList) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &a.NextLink) + case "id": + err = unpopulate(val, "ID", &a.ID) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &a.Value) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &a.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) delete(rawMsg, key) } if err != nil { @@ -407,16 +678,27 @@ func (a *ApplicationList) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ApplicationPatch. -func (a ApplicationPatch) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ApplicationGroup. +func (a ApplicationGroup) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "etag", a.Etag) + populate(objectMap, "id", a.ID) + populate(objectMap, "identity", a.Identity) + populate(objectMap, "kind", a.Kind) + populate(objectMap, "location", a.Location) + populate(objectMap, "managedBy", a.ManagedBy) + populate(objectMap, "name", a.Name) + populate(objectMap, "plan", a.Plan) populate(objectMap, "properties", a.Properties) + populate(objectMap, "sku", a.SKU) + populate(objectMap, "systemData", a.SystemData) populate(objectMap, "tags", a.Tags) + populate(objectMap, "type", a.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationPatch. -func (a *ApplicationPatch) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGroup. +func (a *ApplicationGroup) 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", a, err) @@ -424,12 +706,45 @@ func (a *ApplicationPatch) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "etag": + err = unpopulate(val, "Etag", &a.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "identity": + err = unpopulate(val, "Identity", &a.Identity) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &a.Kind) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &a.Location) + delete(rawMsg, key) + case "managedBy": + err = unpopulate(val, "ManagedBy", &a.ManagedBy) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "plan": + err = unpopulate(val, "Plan", &a.Plan) + delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &a.Properties) delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &a.SKU) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &a.SystemData) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &a.Tags) delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) @@ -438,25 +753,16 @@ func (a *ApplicationPatch) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ApplicationPatchProperties. -func (a ApplicationPatchProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ApplicationGroupList. +func (a ApplicationGroupList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "applicationType", a.ApplicationType) - populate(objectMap, "commandLineArguments", a.CommandLineArguments) - populate(objectMap, "commandLineSetting", a.CommandLineSetting) - populate(objectMap, "description", a.Description) - populate(objectMap, "filePath", a.FilePath) - populate(objectMap, "friendlyName", a.FriendlyName) - populate(objectMap, "iconIndex", a.IconIndex) - populate(objectMap, "iconPath", a.IconPath) - populate(objectMap, "msixPackageApplicationId", a.MsixPackageApplicationID) - populate(objectMap, "msixPackageFamilyName", a.MsixPackageFamilyName) - populate(objectMap, "showInPortal", a.ShowInPortal) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationPatchProperties. -func (a *ApplicationPatchProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGroupList. +func (a *ApplicationGroupList) 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", a, err) @@ -464,38 +770,11 @@ func (a *ApplicationPatchProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "applicationType": - err = unpopulate(val, "ApplicationType", &a.ApplicationType) - delete(rawMsg, key) - case "commandLineArguments": - err = unpopulate(val, "CommandLineArguments", &a.CommandLineArguments) - delete(rawMsg, key) - case "commandLineSetting": - err = unpopulate(val, "CommandLineSetting", &a.CommandLineSetting) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &a.Description) - delete(rawMsg, key) - case "filePath": - err = unpopulate(val, "FilePath", &a.FilePath) - delete(rawMsg, key) - case "friendlyName": - err = unpopulate(val, "FriendlyName", &a.FriendlyName) - delete(rawMsg, key) - case "iconIndex": - err = unpopulate(val, "IconIndex", &a.IconIndex) - delete(rawMsg, key) - case "iconPath": - err = unpopulate(val, "IconPath", &a.IconPath) - delete(rawMsg, key) - case "msixPackageApplicationId": - err = unpopulate(val, "MsixPackageApplicationID", &a.MsixPackageApplicationID) - delete(rawMsg, key) - case "msixPackageFamilyName": - err = unpopulate(val, "MsixPackageFamilyName", &a.MsixPackageFamilyName) + case "nextLink": + err = unpopulate(val, "NextLink", &a.NextLink) delete(rawMsg, key) - case "showInPortal": - err = unpopulate(val, "ShowInPortal", &a.ShowInPortal) + case "value": + err = unpopulate(val, "Value", &a.Value) delete(rawMsg, key) } if err != nil { @@ -505,28 +784,20 @@ func (a *ApplicationPatchProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ApplicationProperties. -func (a ApplicationProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ApplicationGroupPatch. +func (a ApplicationGroupPatch) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "applicationType", a.ApplicationType) - populate(objectMap, "commandLineArguments", a.CommandLineArguments) - populate(objectMap, "commandLineSetting", a.CommandLineSetting) - populate(objectMap, "description", a.Description) - populate(objectMap, "filePath", a.FilePath) - populate(objectMap, "friendlyName", a.FriendlyName) - populateByteArray(objectMap, "iconContent", a.IconContent, runtime.Base64StdFormat) - populate(objectMap, "iconHash", a.IconHash) - populate(objectMap, "iconIndex", a.IconIndex) - populate(objectMap, "iconPath", a.IconPath) - populate(objectMap, "msixPackageApplicationId", a.MsixPackageApplicationID) - populate(objectMap, "msixPackageFamilyName", a.MsixPackageFamilyName) - populate(objectMap, "objectId", a.ObjectID) - populate(objectMap, "showInPortal", a.ShowInPortal) + populate(objectMap, "id", a.ID) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "systemData", a.SystemData) + populate(objectMap, "tags", a.Tags) + populate(objectMap, "type", a.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationProperties. -func (a *ApplicationProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGroupPatch. +func (a *ApplicationGroupPatch) 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", a, err) @@ -534,47 +805,23 @@ func (a *ApplicationProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "applicationType": - err = unpopulate(val, "ApplicationType", &a.ApplicationType) - delete(rawMsg, key) - case "commandLineArguments": - err = unpopulate(val, "CommandLineArguments", &a.CommandLineArguments) - delete(rawMsg, key) - case "commandLineSetting": - err = unpopulate(val, "CommandLineSetting", &a.CommandLineSetting) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &a.Description) - delete(rawMsg, key) - case "filePath": - err = unpopulate(val, "FilePath", &a.FilePath) - delete(rawMsg, key) - case "friendlyName": - err = unpopulate(val, "FriendlyName", &a.FriendlyName) - delete(rawMsg, key) - case "iconContent": - err = runtime.DecodeByteArray(string(val), &a.IconContent, runtime.Base64StdFormat) - delete(rawMsg, key) - case "iconHash": - err = unpopulate(val, "IconHash", &a.IconHash) - delete(rawMsg, key) - case "iconIndex": - err = unpopulate(val, "IconIndex", &a.IconIndex) + case "id": + err = unpopulate(val, "ID", &a.ID) delete(rawMsg, key) - case "iconPath": - err = unpopulate(val, "IconPath", &a.IconPath) + case "name": + err = unpopulate(val, "Name", &a.Name) delete(rawMsg, key) - case "msixPackageApplicationId": - err = unpopulate(val, "MsixPackageApplicationID", &a.MsixPackageApplicationID) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) delete(rawMsg, key) - case "msixPackageFamilyName": - err = unpopulate(val, "MsixPackageFamilyName", &a.MsixPackageFamilyName) + case "systemData": + err = unpopulate(val, "SystemData", &a.SystemData) delete(rawMsg, key) - case "objectId": - err = unpopulate(val, "ObjectID", &a.ObjectID) + case "tags": + err = unpopulate(val, "Tags", &a.Tags) delete(rawMsg, key) - case "showInPortal": - err = unpopulate(val, "ShowInPortal", &a.ShowInPortal) + case "type": + err = unpopulate(val, "Type", &a.Type) delete(rawMsg, key) } if err != nil { @@ -584,1762 +831,3479 @@ func (a *ApplicationProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type Desktop. -func (d Desktop) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ApplicationGroupPatchProperties. +func (a ApplicationGroupPatchProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", d.ID) - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "systemData", d.SystemData) - populate(objectMap, "type", d.Type) + populate(objectMap, "description", a.Description) + populate(objectMap, "friendlyName", a.FriendlyName) + populate(objectMap, "showInFeed", a.ShowInFeed) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Desktop. -func (d *Desktop) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGroupPatchProperties. +func (a *ApplicationGroupPatchProperties) 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) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &d.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &d.Properties) + case "description": + err = unpopulate(val, "Description", &a.Description) delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &d.SystemData) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &a.FriendlyName) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &d.Type) + case "showInFeed": + err = unpopulate(val, "ShowInFeed", &a.ShowInFeed) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DesktopList. -func (d DesktopList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ApplicationGroupProperties. +func (a ApplicationGroupProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", d.NextLink) - populate(objectMap, "value", d.Value) + populate(objectMap, "applicationGroupType", a.ApplicationGroupType) + populate(objectMap, "cloudPcResource", a.CloudPcResource) + populate(objectMap, "description", a.Description) + populate(objectMap, "friendlyName", a.FriendlyName) + populate(objectMap, "hostPoolArmPath", a.HostPoolArmPath) + populate(objectMap, "objectId", a.ObjectID) + populate(objectMap, "showInFeed", a.ShowInFeed) + populate(objectMap, "workspaceArmPath", a.WorkspaceArmPath) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DesktopList. -func (d *DesktopList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGroupProperties. +func (a *ApplicationGroupProperties) 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) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &d.NextLink) + case "applicationGroupType": + err = unpopulate(val, "ApplicationGroupType", &a.ApplicationGroupType) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &d.Value) + case "cloudPcResource": + err = unpopulate(val, "CloudPcResource", &a.CloudPcResource) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &a.Description) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &a.FriendlyName) + delete(rawMsg, key) + case "hostPoolArmPath": + err = unpopulate(val, "HostPoolArmPath", &a.HostPoolArmPath) + delete(rawMsg, key) + case "objectId": + err = unpopulate(val, "ObjectID", &a.ObjectID) + delete(rawMsg, key) + case "showInFeed": + err = unpopulate(val, "ShowInFeed", &a.ShowInFeed) + delete(rawMsg, key) + case "workspaceArmPath": + err = unpopulate(val, "WorkspaceArmPath", &a.WorkspaceArmPath) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DesktopPatch. -func (d DesktopPatch) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ApplicationList. +func (a ApplicationList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "tags", d.Tags) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DesktopPatch. -func (d *DesktopPatch) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationList. +func (a *ApplicationList) 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) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "properties": - err = unpopulate(val, "Properties", &d.Properties) + case "nextLink": + err = unpopulate(val, "NextLink", &a.NextLink) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &d.Tags) + case "value": + err = unpopulate(val, "Value", &a.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DesktopPatchProperties. -func (d DesktopPatchProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ApplicationPatch. +func (a ApplicationPatch) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", d.Description) - populate(objectMap, "friendlyName", d.FriendlyName) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "tags", a.Tags) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DesktopPatchProperties. -func (d *DesktopPatchProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationPatch. +func (a *ApplicationPatch) 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) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "description": - err = unpopulate(val, "Description", &d.Description) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) delete(rawMsg, key) - case "friendlyName": - err = unpopulate(val, "FriendlyName", &d.FriendlyName) + case "tags": + err = unpopulate(val, "Tags", &a.Tags) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DesktopProperties. -func (d DesktopProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ApplicationPatchProperties. +func (a ApplicationPatchProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", d.Description) - populate(objectMap, "friendlyName", d.FriendlyName) - populateByteArray(objectMap, "iconContent", d.IconContent, runtime.Base64StdFormat) - populate(objectMap, "iconHash", d.IconHash) - populate(objectMap, "objectId", d.ObjectID) + populate(objectMap, "applicationType", a.ApplicationType) + populate(objectMap, "commandLineArguments", a.CommandLineArguments) + populate(objectMap, "commandLineSetting", a.CommandLineSetting) + populate(objectMap, "description", a.Description) + populate(objectMap, "filePath", a.FilePath) + populate(objectMap, "friendlyName", a.FriendlyName) + populate(objectMap, "iconIndex", a.IconIndex) + populate(objectMap, "iconPath", a.IconPath) + populate(objectMap, "msixPackageApplicationId", a.MsixPackageApplicationID) + populate(objectMap, "msixPackageFamilyName", a.MsixPackageFamilyName) + populate(objectMap, "showInPortal", a.ShowInPortal) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DesktopProperties. -func (d *DesktopProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationPatchProperties. +func (a *ApplicationPatchProperties) 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) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { + case "applicationType": + err = unpopulate(val, "ApplicationType", &a.ApplicationType) + delete(rawMsg, key) + case "commandLineArguments": + err = unpopulate(val, "CommandLineArguments", &a.CommandLineArguments) + delete(rawMsg, key) + case "commandLineSetting": + err = unpopulate(val, "CommandLineSetting", &a.CommandLineSetting) + delete(rawMsg, key) case "description": - err = unpopulate(val, "Description", &d.Description) + err = unpopulate(val, "Description", &a.Description) + delete(rawMsg, key) + case "filePath": + err = unpopulate(val, "FilePath", &a.FilePath) delete(rawMsg, key) case "friendlyName": - err = unpopulate(val, "FriendlyName", &d.FriendlyName) + err = unpopulate(val, "FriendlyName", &a.FriendlyName) delete(rawMsg, key) - case "iconContent": - err = runtime.DecodeByteArray(string(val), &d.IconContent, runtime.Base64StdFormat) + case "iconIndex": + err = unpopulate(val, "IconIndex", &a.IconIndex) delete(rawMsg, key) - case "iconHash": - err = unpopulate(val, "IconHash", &d.IconHash) + case "iconPath": + err = unpopulate(val, "IconPath", &a.IconPath) delete(rawMsg, key) - case "objectId": - err = unpopulate(val, "ObjectID", &d.ObjectID) + case "msixPackageApplicationId": + err = unpopulate(val, "MsixPackageApplicationID", &a.MsixPackageApplicationID) + delete(rawMsg, key) + case "msixPackageFamilyName": + err = unpopulate(val, "MsixPackageFamilyName", &a.MsixPackageFamilyName) + delete(rawMsg, key) + case "showInPortal": + err = unpopulate(val, "ShowInPortal", &a.ShowInPortal) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ExpandMsixImage. -func (e ExpandMsixImage) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ApplicationProperties. +func (a ApplicationProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", e.ID) - populate(objectMap, "name", e.Name) - populate(objectMap, "properties", e.Properties) - populate(objectMap, "type", e.Type) + populate(objectMap, "applicationType", a.ApplicationType) + populate(objectMap, "commandLineArguments", a.CommandLineArguments) + populate(objectMap, "commandLineSetting", a.CommandLineSetting) + populate(objectMap, "description", a.Description) + populate(objectMap, "filePath", a.FilePath) + populate(objectMap, "friendlyName", a.FriendlyName) + populateByteArray(objectMap, "iconContent", a.IconContent, func() any { + return runtime.EncodeByteArray(a.IconContent, runtime.Base64StdFormat) + }) + populate(objectMap, "iconHash", a.IconHash) + populate(objectMap, "iconIndex", a.IconIndex) + populate(objectMap, "iconPath", a.IconPath) + populate(objectMap, "msixPackageApplicationId", a.MsixPackageApplicationID) + populate(objectMap, "msixPackageFamilyName", a.MsixPackageFamilyName) + populate(objectMap, "objectId", a.ObjectID) + populate(objectMap, "showInPortal", a.ShowInPortal) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpandMsixImage. -func (e *ExpandMsixImage) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationProperties. +func (a *ApplicationProperties) 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) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &e.ID) + case "applicationType": + err = unpopulate(val, "ApplicationType", &a.ApplicationType) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &e.Name) + case "commandLineArguments": + err = unpopulate(val, "CommandLineArguments", &a.CommandLineArguments) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &e.Properties) + case "commandLineSetting": + err = unpopulate(val, "CommandLineSetting", &a.CommandLineSetting) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &e.Type) + case "description": + err = unpopulate(val, "Description", &a.Description) + delete(rawMsg, key) + case "filePath": + err = unpopulate(val, "FilePath", &a.FilePath) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &a.FriendlyName) + delete(rawMsg, key) + case "iconContent": + if val != nil && string(val) != "null" { + err = runtime.DecodeByteArray(string(val), &a.IconContent, runtime.Base64StdFormat) + } + delete(rawMsg, key) + case "iconHash": + err = unpopulate(val, "IconHash", &a.IconHash) + delete(rawMsg, key) + case "iconIndex": + err = unpopulate(val, "IconIndex", &a.IconIndex) + delete(rawMsg, key) + case "iconPath": + err = unpopulate(val, "IconPath", &a.IconPath) + delete(rawMsg, key) + case "msixPackageApplicationId": + err = unpopulate(val, "MsixPackageApplicationID", &a.MsixPackageApplicationID) + delete(rawMsg, key) + case "msixPackageFamilyName": + err = unpopulate(val, "MsixPackageFamilyName", &a.MsixPackageFamilyName) + delete(rawMsg, key) + case "objectId": + err = unpopulate(val, "ObjectID", &a.ObjectID) + delete(rawMsg, key) + case "showInPortal": + err = unpopulate(val, "ShowInPortal", &a.ShowInPortal) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ExpandMsixImageList. -func (e ExpandMsixImageList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureActiveDirectoryInfoProperties. +func (a AzureActiveDirectoryInfoProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", e.NextLink) - populate(objectMap, "value", e.Value) + populate(objectMap, "mdmProviderGuid", a.MdmProviderGUID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpandMsixImageList. -func (e *ExpandMsixImageList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureActiveDirectoryInfoProperties. +func (a *AzureActiveDirectoryInfoProperties) 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) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &e.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &e.Value) + case "mdmProviderGuid": + err = unpopulate(val, "MdmProviderGUID", &a.MdmProviderGUID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ExpandMsixImageProperties. -func (e ExpandMsixImageProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type BootDiagnosticsInfoPatchProperties. +func (b BootDiagnosticsInfoPatchProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "displayName", e.DisplayName) - populate(objectMap, "imagePath", e.ImagePath) - populate(objectMap, "isActive", e.IsActive) - populate(objectMap, "isRegularRegistration", e.IsRegularRegistration) - populateDateTimeRFC3339(objectMap, "lastUpdated", e.LastUpdated) - populate(objectMap, "packageAlias", e.PackageAlias) - populate(objectMap, "packageApplications", e.PackageApplications) - populate(objectMap, "packageDependencies", e.PackageDependencies) - populate(objectMap, "packageFamilyName", e.PackageFamilyName) - populate(objectMap, "packageFullName", e.PackageFullName) - populate(objectMap, "packageName", e.PackageName) - populate(objectMap, "packageRelativePath", e.PackageRelativePath) - populate(objectMap, "version", e.Version) + populate(objectMap, "enabled", b.Enabled) + populate(objectMap, "storageUri", b.StorageURI) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpandMsixImageProperties. -func (e *ExpandMsixImageProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BootDiagnosticsInfoPatchProperties. +func (b *BootDiagnosticsInfoPatchProperties) 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) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { - case "displayName": - err = unpopulate(val, "DisplayName", &e.DisplayName) - delete(rawMsg, key) - case "imagePath": - err = unpopulate(val, "ImagePath", &e.ImagePath) - delete(rawMsg, key) - case "isActive": - err = unpopulate(val, "IsActive", &e.IsActive) + case "enabled": + err = unpopulate(val, "Enabled", &b.Enabled) delete(rawMsg, key) - case "isRegularRegistration": - err = unpopulate(val, "IsRegularRegistration", &e.IsRegularRegistration) - delete(rawMsg, key) - case "lastUpdated": - err = unpopulateDateTimeRFC3339(val, "LastUpdated", &e.LastUpdated) - delete(rawMsg, key) - case "packageAlias": - err = unpopulate(val, "PackageAlias", &e.PackageAlias) - delete(rawMsg, key) - case "packageApplications": - err = unpopulate(val, "PackageApplications", &e.PackageApplications) - delete(rawMsg, key) - case "packageDependencies": - err = unpopulate(val, "PackageDependencies", &e.PackageDependencies) - delete(rawMsg, key) - case "packageFamilyName": - err = unpopulate(val, "PackageFamilyName", &e.PackageFamilyName) - delete(rawMsg, key) - case "packageFullName": - err = unpopulate(val, "PackageFullName", &e.PackageFullName) + case "storageUri": + err = unpopulate(val, "StorageURI", &b.StorageURI) delete(rawMsg, key) - case "packageName": - err = unpopulate(val, "PackageName", &e.PackageName) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BootDiagnosticsInfoProperties. +func (b BootDiagnosticsInfoProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "enabled", b.Enabled) + populate(objectMap, "storageUri", b.StorageURI) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BootDiagnosticsInfoProperties. +func (b *BootDiagnosticsInfoProperties) 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", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "enabled": + err = unpopulate(val, "Enabled", &b.Enabled) delete(rawMsg, key) - case "packageRelativePath": - err = unpopulate(val, "PackageRelativePath", &e.PackageRelativePath) + case "storageUri": + err = unpopulate(val, "StorageURI", &b.StorageURI) delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &e.Version) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CustomInfoPatchProperties. +func (c CustomInfoPatchProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "resourceId", c.ResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomInfoPatchProperties. +func (c *CustomInfoPatchProperties) 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", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "resourceId": + err = unpopulate(val, "ResourceID", &c.ResourceID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type HostPool. -func (h HostPool) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CustomInfoProperties. +func (c CustomInfoProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "etag", h.Etag) - populate(objectMap, "id", h.ID) - populate(objectMap, "identity", h.Identity) - populate(objectMap, "kind", h.Kind) - populate(objectMap, "location", h.Location) - populate(objectMap, "managedBy", h.ManagedBy) - populate(objectMap, "name", h.Name) - populate(objectMap, "plan", h.Plan) - populate(objectMap, "properties", h.Properties) - populate(objectMap, "sku", h.SKU) - populate(objectMap, "systemData", h.SystemData) - populate(objectMap, "tags", h.Tags) - populate(objectMap, "type", h.Type) + populate(objectMap, "resourceId", c.ResourceID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type HostPool. -func (h *HostPool) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomInfoProperties. +func (c *CustomInfoProperties) 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", h, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "etag": - err = unpopulate(val, "Etag", &h.Etag) + case "resourceId": + err = unpopulate(val, "ResourceID", &c.ResourceID) delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Desktop. +func (d Desktop) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "systemData", d.SystemData) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Desktop. +func (d *Desktop) 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 "id": - err = unpopulate(val, "ID", &h.ID) - delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &h.Identity) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &h.Kind) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &h.Location) - delete(rawMsg, key) - case "managedBy": - err = unpopulate(val, "ManagedBy", &h.ManagedBy) + err = unpopulate(val, "ID", &d.ID) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &h.Name) - delete(rawMsg, key) - case "plan": - err = unpopulate(val, "Plan", &h.Plan) + err = unpopulate(val, "Name", &d.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &h.Properties) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &h.SKU) + err = unpopulate(val, "Properties", &d.Properties) delete(rawMsg, key) case "systemData": - err = unpopulate(val, "SystemData", &h.SystemData) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &h.Tags) + err = unpopulate(val, "SystemData", &d.SystemData) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &h.Type) + err = unpopulate(val, "Type", &d.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type HostPoolList. -func (h HostPoolList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DesktopList. +func (d DesktopList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", h.NextLink) - populate(objectMap, "value", h.Value) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type HostPoolList. -func (h *HostPoolList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DesktopList. +func (d *DesktopList) 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", h, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { case "nextLink": - err = unpopulate(val, "NextLink", &h.NextLink) + err = unpopulate(val, "NextLink", &d.NextLink) delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &h.Value) + err = unpopulate(val, "Value", &d.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type HostPoolPatch. -func (h HostPoolPatch) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DesktopPatch. +func (d DesktopPatch) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", h.ID) - populate(objectMap, "name", h.Name) - populate(objectMap, "properties", h.Properties) - populate(objectMap, "tags", h.Tags) - populate(objectMap, "type", h.Type) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "tags", d.Tags) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type HostPoolPatch. -func (h *HostPoolPatch) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DesktopPatch. +func (d *DesktopPatch) 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", h, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &h.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &h.Name) - delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &h.Properties) + err = unpopulate(val, "Properties", &d.Properties) delete(rawMsg, key) case "tags": - err = unpopulate(val, "Tags", &h.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &h.Type) + err = unpopulate(val, "Tags", &d.Tags) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type HostPoolPatchProperties. -func (h HostPoolPatchProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DesktopPatchProperties. +func (d DesktopPatchProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "agentUpdate", h.AgentUpdate) - populate(objectMap, "customRdpProperty", h.CustomRdpProperty) - populate(objectMap, "description", h.Description) - populate(objectMap, "friendlyName", h.FriendlyName) - populate(objectMap, "loadBalancerType", h.LoadBalancerType) - populate(objectMap, "maxSessionLimit", h.MaxSessionLimit) - populate(objectMap, "personalDesktopAssignmentType", h.PersonalDesktopAssignmentType) - populate(objectMap, "preferredAppGroupType", h.PreferredAppGroupType) - populate(objectMap, "publicNetworkAccess", h.PublicNetworkAccess) - populate(objectMap, "registrationInfo", h.RegistrationInfo) - populate(objectMap, "ring", h.Ring) - populate(objectMap, "ssoClientId", h.SsoClientID) - populate(objectMap, "ssoClientSecretKeyVaultPath", h.SsoClientSecretKeyVaultPath) - populate(objectMap, "ssoSecretType", h.SsoSecretType) - populate(objectMap, "ssoadfsAuthority", h.SsoadfsAuthority) - populate(objectMap, "startVMOnConnect", h.StartVMOnConnect) - populate(objectMap, "vmTemplate", h.VMTemplate) - populate(objectMap, "validationEnvironment", h.ValidationEnvironment) + populate(objectMap, "description", d.Description) + populate(objectMap, "friendlyName", d.FriendlyName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type HostPoolPatchProperties. -func (h *HostPoolPatchProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DesktopPatchProperties. +func (d *DesktopPatchProperties) 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", h, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &d.Description) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &d.FriendlyName) + 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 DesktopProperties. +func (d DesktopProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", d.Description) + populate(objectMap, "friendlyName", d.FriendlyName) + populateByteArray(objectMap, "iconContent", d.IconContent, func() any { + return runtime.EncodeByteArray(d.IconContent, runtime.Base64StdFormat) + }) + populate(objectMap, "iconHash", d.IconHash) + populate(objectMap, "objectId", d.ObjectID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DesktopProperties. +func (d *DesktopProperties) 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 "description": + err = unpopulate(val, "Description", &d.Description) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &d.FriendlyName) + delete(rawMsg, key) + case "iconContent": + if val != nil && string(val) != "null" { + err = runtime.DecodeByteArray(string(val), &d.IconContent, runtime.Base64StdFormat) + } + delete(rawMsg, key) + case "iconHash": + err = unpopulate(val, "IconHash", &d.IconHash) + delete(rawMsg, key) + case "objectId": + err = unpopulate(val, "ObjectID", &d.ObjectID) + 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 DiskInfoPatchProperties. +func (d DiskInfoPatchProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DiskInfoPatchProperties. +func (d *DiskInfoPatchProperties) 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 "type": + err = unpopulate(val, "Type", &d.Type) + 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 DiskInfoProperties. +func (d DiskInfoProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DiskInfoProperties. +func (d *DiskInfoProperties) 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 "type": + err = unpopulate(val, "Type", &d.Type) + 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 DomainInfoPatchProperties. +func (d DomainInfoPatchProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "activeDirectoryInfo", d.ActiveDirectoryInfo) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DomainInfoPatchProperties. +func (d *DomainInfoPatchProperties) 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 "activeDirectoryInfo": + err = unpopulate(val, "ActiveDirectoryInfo", &d.ActiveDirectoryInfo) + 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 DomainInfoProperties. +func (d DomainInfoProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "activeDirectoryInfo", d.ActiveDirectoryInfo) + populate(objectMap, "azureActiveDirectoryInfo", d.AzureActiveDirectoryInfo) + populate(objectMap, "joinType", d.JoinType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DomainInfoProperties. +func (d *DomainInfoProperties) 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 "activeDirectoryInfo": + err = unpopulate(val, "ActiveDirectoryInfo", &d.ActiveDirectoryInfo) + delete(rawMsg, key) + case "azureActiveDirectoryInfo": + err = unpopulate(val, "AzureActiveDirectoryInfo", &d.AzureActiveDirectoryInfo) + delete(rawMsg, key) + case "joinType": + err = unpopulate(val, "JoinType", &d.JoinType) + 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) + populateAny(objectMap, "info", e.Info) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorAdditionalInfo. +func (e *ErrorAdditionalInfo) 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 "info": + err = unpopulate(val, "Info", &e.Info) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &e.Type) + 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 ErrorDetail. +func (e ErrorDetail) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "additionalInfo", e.AdditionalInfo) + populate(objectMap, "code", e.Code) + populate(objectMap, "details", e.Details) + populate(objectMap, "message", e.Message) + populate(objectMap, "target", e.Target) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetail. +func (e *ErrorDetail) 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 "additionalInfo": + err = unpopulate(val, "AdditionalInfo", &e.AdditionalInfo) + delete(rawMsg, key) + case "code": + err = unpopulate(val, "Code", &e.Code) + delete(rawMsg, key) + case "details": + err = unpopulate(val, "Details", &e.Details) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &e.Message) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &e.Target) + 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 ExpandMsixImage. +func (e ExpandMsixImage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", e.ID) + populate(objectMap, "name", e.Name) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "systemData", e.SystemData) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpandMsixImage. +func (e *ExpandMsixImage) 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 "id": + err = unpopulate(val, "ID", &e.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &e.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &e.Type) + 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 ExpandMsixImageList. +func (e ExpandMsixImageList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", e.NextLink) + populate(objectMap, "value", e.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpandMsixImageList. +func (e *ExpandMsixImageList) 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 "nextLink": + err = unpopulate(val, "NextLink", &e.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &e.Value) + 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 ExpandMsixImageProperties. +func (e ExpandMsixImageProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateDateTimeRFC3339(objectMap, "certificateExpiry", e.CertificateExpiry) + populate(objectMap, "certificateName", e.CertificateName) + populate(objectMap, "displayName", e.DisplayName) + populate(objectMap, "imagePath", e.ImagePath) + populate(objectMap, "isActive", e.IsActive) + populate(objectMap, "isRegularRegistration", e.IsRegularRegistration) + populateDateTimeRFC3339(objectMap, "lastUpdated", e.LastUpdated) + populate(objectMap, "packageAlias", e.PackageAlias) + populate(objectMap, "packageApplications", e.PackageApplications) + populate(objectMap, "packageDependencies", e.PackageDependencies) + populate(objectMap, "packageFamilyName", e.PackageFamilyName) + populate(objectMap, "packageFullName", e.PackageFullName) + populate(objectMap, "packageName", e.PackageName) + populate(objectMap, "packageRelativePath", e.PackageRelativePath) + populate(objectMap, "version", e.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpandMsixImageProperties. +func (e *ExpandMsixImageProperties) 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 "certificateExpiry": + err = unpopulateDateTimeRFC3339(val, "CertificateExpiry", &e.CertificateExpiry) + delete(rawMsg, key) + case "certificateName": + err = unpopulate(val, "CertificateName", &e.CertificateName) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &e.DisplayName) + delete(rawMsg, key) + case "imagePath": + err = unpopulate(val, "ImagePath", &e.ImagePath) + delete(rawMsg, key) + case "isActive": + err = unpopulate(val, "IsActive", &e.IsActive) + delete(rawMsg, key) + case "isRegularRegistration": + err = unpopulate(val, "IsRegularRegistration", &e.IsRegularRegistration) + delete(rawMsg, key) + case "lastUpdated": + err = unpopulateDateTimeRFC3339(val, "LastUpdated", &e.LastUpdated) + delete(rawMsg, key) + case "packageAlias": + err = unpopulate(val, "PackageAlias", &e.PackageAlias) + delete(rawMsg, key) + case "packageApplications": + err = unpopulate(val, "PackageApplications", &e.PackageApplications) + delete(rawMsg, key) + case "packageDependencies": + err = unpopulate(val, "PackageDependencies", &e.PackageDependencies) + delete(rawMsg, key) + case "packageFamilyName": + err = unpopulate(val, "PackageFamilyName", &e.PackageFamilyName) + delete(rawMsg, key) + case "packageFullName": + err = unpopulate(val, "PackageFullName", &e.PackageFullName) + delete(rawMsg, key) + case "packageName": + err = unpopulate(val, "PackageName", &e.PackageName) + delete(rawMsg, key) + case "packageRelativePath": + err = unpopulate(val, "PackageRelativePath", &e.PackageRelativePath) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &e.Version) + 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 HostPool. +func (h HostPool) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", h.Etag) + populate(objectMap, "id", h.ID) + populate(objectMap, "identity", h.Identity) + populate(objectMap, "kind", h.Kind) + populate(objectMap, "location", h.Location) + populate(objectMap, "managedBy", h.ManagedBy) + populate(objectMap, "name", h.Name) + populate(objectMap, "plan", h.Plan) + populate(objectMap, "properties", h.Properties) + populate(objectMap, "sku", h.SKU) + populate(objectMap, "systemData", h.SystemData) + populate(objectMap, "tags", h.Tags) + populate(objectMap, "type", h.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HostPool. +func (h *HostPool) 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", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &h.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &h.ID) + delete(rawMsg, key) + case "identity": + err = unpopulate(val, "Identity", &h.Identity) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &h.Kind) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &h.Location) + delete(rawMsg, key) + case "managedBy": + err = unpopulate(val, "ManagedBy", &h.ManagedBy) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &h.Name) + delete(rawMsg, key) + case "plan": + err = unpopulate(val, "Plan", &h.Plan) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &h.Properties) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &h.SKU) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &h.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &h.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &h.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type HostPoolList. +func (h HostPoolList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", h.NextLink) + populate(objectMap, "value", h.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HostPoolList. +func (h *HostPoolList) 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", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &h.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &h.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type HostPoolPatch. +func (h HostPoolPatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", h.ID) + populate(objectMap, "name", h.Name) + populate(objectMap, "properties", h.Properties) + populate(objectMap, "systemData", h.SystemData) + populate(objectMap, "tags", h.Tags) + populate(objectMap, "type", h.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HostPoolPatch. +func (h *HostPoolPatch) 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", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &h.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &h.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &h.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &h.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &h.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &h.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type HostPoolPatchProperties. +func (h HostPoolPatchProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "agentUpdate", h.AgentUpdate) + populate(objectMap, "customRdpProperty", h.CustomRdpProperty) + populate(objectMap, "description", h.Description) + populate(objectMap, "directUDP", h.DirectUDP) + populate(objectMap, "friendlyName", h.FriendlyName) + populate(objectMap, "loadBalancerType", h.LoadBalancerType) + populate(objectMap, "managedPrivateUDP", h.ManagedPrivateUDP) + populate(objectMap, "maxSessionLimit", h.MaxSessionLimit) + populate(objectMap, "personalDesktopAssignmentType", h.PersonalDesktopAssignmentType) + populate(objectMap, "preferredAppGroupType", h.PreferredAppGroupType) + populate(objectMap, "publicNetworkAccess", h.PublicNetworkAccess) + populate(objectMap, "publicUDP", h.PublicUDP) + populate(objectMap, "registrationInfo", h.RegistrationInfo) + populate(objectMap, "relayUDP", h.RelayUDP) + populate(objectMap, "ring", h.Ring) + populate(objectMap, "ssoClientId", h.SsoClientID) + populate(objectMap, "ssoClientSecretKeyVaultPath", h.SsoClientSecretKeyVaultPath) + populate(objectMap, "ssoSecretType", h.SsoSecretType) + populate(objectMap, "ssoadfsAuthority", h.SsoadfsAuthority) + populate(objectMap, "startVMOnConnect", h.StartVMOnConnect) + populate(objectMap, "vmTemplate", h.VMTemplate) + populate(objectMap, "validationEnvironment", h.ValidationEnvironment) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HostPoolPatchProperties. +func (h *HostPoolPatchProperties) 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", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "agentUpdate": + err = unpopulate(val, "AgentUpdate", &h.AgentUpdate) + delete(rawMsg, key) + case "customRdpProperty": + err = unpopulate(val, "CustomRdpProperty", &h.CustomRdpProperty) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &h.Description) + delete(rawMsg, key) + case "directUDP": + err = unpopulate(val, "DirectUDP", &h.DirectUDP) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &h.FriendlyName) + delete(rawMsg, key) + case "loadBalancerType": + err = unpopulate(val, "LoadBalancerType", &h.LoadBalancerType) + delete(rawMsg, key) + case "managedPrivateUDP": + err = unpopulate(val, "ManagedPrivateUDP", &h.ManagedPrivateUDP) + delete(rawMsg, key) + case "maxSessionLimit": + err = unpopulate(val, "MaxSessionLimit", &h.MaxSessionLimit) + delete(rawMsg, key) + case "personalDesktopAssignmentType": + err = unpopulate(val, "PersonalDesktopAssignmentType", &h.PersonalDesktopAssignmentType) + delete(rawMsg, key) + case "preferredAppGroupType": + err = unpopulate(val, "PreferredAppGroupType", &h.PreferredAppGroupType) + delete(rawMsg, key) + case "publicNetworkAccess": + err = unpopulate(val, "PublicNetworkAccess", &h.PublicNetworkAccess) + delete(rawMsg, key) + case "publicUDP": + err = unpopulate(val, "PublicUDP", &h.PublicUDP) + delete(rawMsg, key) + case "registrationInfo": + err = unpopulate(val, "RegistrationInfo", &h.RegistrationInfo) + delete(rawMsg, key) + case "relayUDP": + err = unpopulate(val, "RelayUDP", &h.RelayUDP) + delete(rawMsg, key) + case "ring": + err = unpopulate(val, "Ring", &h.Ring) + delete(rawMsg, key) + case "ssoClientId": + err = unpopulate(val, "SsoClientID", &h.SsoClientID) + delete(rawMsg, key) + case "ssoClientSecretKeyVaultPath": + err = unpopulate(val, "SsoClientSecretKeyVaultPath", &h.SsoClientSecretKeyVaultPath) + delete(rawMsg, key) + case "ssoSecretType": + err = unpopulate(val, "SsoSecretType", &h.SsoSecretType) + delete(rawMsg, key) + case "ssoadfsAuthority": + err = unpopulate(val, "SsoadfsAuthority", &h.SsoadfsAuthority) + delete(rawMsg, key) + case "startVMOnConnect": + err = unpopulate(val, "StartVMOnConnect", &h.StartVMOnConnect) + delete(rawMsg, key) + case "vmTemplate": + err = unpopulate(val, "VMTemplate", &h.VMTemplate) + delete(rawMsg, key) + case "validationEnvironment": + err = unpopulate(val, "ValidationEnvironment", &h.ValidationEnvironment) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type HostPoolProperties. +func (h HostPoolProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "agentUpdate", h.AgentUpdate) + populate(objectMap, "appAttachPackageReferences", h.AppAttachPackageReferences) + populate(objectMap, "applicationGroupReferences", h.ApplicationGroupReferences) + populate(objectMap, "cloudPcResource", h.CloudPcResource) + populate(objectMap, "customRdpProperty", h.CustomRdpProperty) + populate(objectMap, "description", h.Description) + populate(objectMap, "directUDP", h.DirectUDP) + populate(objectMap, "friendlyName", h.FriendlyName) + populate(objectMap, "hostPoolType", h.HostPoolType) + populate(objectMap, "loadBalancerType", h.LoadBalancerType) + populate(objectMap, "managedPrivateUDP", h.ManagedPrivateUDP) + populate(objectMap, "managementType", h.ManagementType) + populate(objectMap, "maxSessionLimit", h.MaxSessionLimit) + populate(objectMap, "objectId", h.ObjectID) + populate(objectMap, "personalDesktopAssignmentType", h.PersonalDesktopAssignmentType) + populate(objectMap, "preferredAppGroupType", h.PreferredAppGroupType) + populate(objectMap, "privateEndpointConnections", h.PrivateEndpointConnections) + populate(objectMap, "publicNetworkAccess", h.PublicNetworkAccess) + populate(objectMap, "publicUDP", h.PublicUDP) + populate(objectMap, "registrationInfo", h.RegistrationInfo) + populate(objectMap, "relayUDP", h.RelayUDP) + populate(objectMap, "ring", h.Ring) + populate(objectMap, "ssoClientId", h.SsoClientID) + populate(objectMap, "ssoClientSecretKeyVaultPath", h.SsoClientSecretKeyVaultPath) + populate(objectMap, "ssoSecretType", h.SsoSecretType) + populate(objectMap, "ssoadfsAuthority", h.SsoadfsAuthority) + populate(objectMap, "startVMOnConnect", h.StartVMOnConnect) + populate(objectMap, "vmTemplate", h.VMTemplate) + populate(objectMap, "validationEnvironment", h.ValidationEnvironment) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HostPoolProperties. +func (h *HostPoolProperties) 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", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "agentUpdate": + err = unpopulate(val, "AgentUpdate", &h.AgentUpdate) + delete(rawMsg, key) + case "appAttachPackageReferences": + err = unpopulate(val, "AppAttachPackageReferences", &h.AppAttachPackageReferences) + delete(rawMsg, key) + case "applicationGroupReferences": + err = unpopulate(val, "ApplicationGroupReferences", &h.ApplicationGroupReferences) + delete(rawMsg, key) + case "cloudPcResource": + err = unpopulate(val, "CloudPcResource", &h.CloudPcResource) + delete(rawMsg, key) + case "customRdpProperty": + err = unpopulate(val, "CustomRdpProperty", &h.CustomRdpProperty) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &h.Description) + delete(rawMsg, key) + case "directUDP": + err = unpopulate(val, "DirectUDP", &h.DirectUDP) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &h.FriendlyName) + delete(rawMsg, key) + case "hostPoolType": + err = unpopulate(val, "HostPoolType", &h.HostPoolType) + delete(rawMsg, key) + case "loadBalancerType": + err = unpopulate(val, "LoadBalancerType", &h.LoadBalancerType) + delete(rawMsg, key) + case "managedPrivateUDP": + err = unpopulate(val, "ManagedPrivateUDP", &h.ManagedPrivateUDP) + delete(rawMsg, key) + case "managementType": + err = unpopulate(val, "ManagementType", &h.ManagementType) + delete(rawMsg, key) + case "maxSessionLimit": + err = unpopulate(val, "MaxSessionLimit", &h.MaxSessionLimit) + delete(rawMsg, key) + case "objectId": + err = unpopulate(val, "ObjectID", &h.ObjectID) + delete(rawMsg, key) + case "personalDesktopAssignmentType": + err = unpopulate(val, "PersonalDesktopAssignmentType", &h.PersonalDesktopAssignmentType) + delete(rawMsg, key) + case "preferredAppGroupType": + err = unpopulate(val, "PreferredAppGroupType", &h.PreferredAppGroupType) + delete(rawMsg, key) + case "privateEndpointConnections": + err = unpopulate(val, "PrivateEndpointConnections", &h.PrivateEndpointConnections) + delete(rawMsg, key) + case "publicNetworkAccess": + err = unpopulate(val, "PublicNetworkAccess", &h.PublicNetworkAccess) + delete(rawMsg, key) + case "publicUDP": + err = unpopulate(val, "PublicUDP", &h.PublicUDP) + delete(rawMsg, key) + case "registrationInfo": + err = unpopulate(val, "RegistrationInfo", &h.RegistrationInfo) + delete(rawMsg, key) + case "relayUDP": + err = unpopulate(val, "RelayUDP", &h.RelayUDP) + delete(rawMsg, key) + case "ring": + err = unpopulate(val, "Ring", &h.Ring) + delete(rawMsg, key) + case "ssoClientId": + err = unpopulate(val, "SsoClientID", &h.SsoClientID) + delete(rawMsg, key) + case "ssoClientSecretKeyVaultPath": + err = unpopulate(val, "SsoClientSecretKeyVaultPath", &h.SsoClientSecretKeyVaultPath) + delete(rawMsg, key) + case "ssoSecretType": + err = unpopulate(val, "SsoSecretType", &h.SsoSecretType) + delete(rawMsg, key) + case "ssoadfsAuthority": + err = unpopulate(val, "SsoadfsAuthority", &h.SsoadfsAuthority) + delete(rawMsg, key) + case "startVMOnConnect": + err = unpopulate(val, "StartVMOnConnect", &h.StartVMOnConnect) + delete(rawMsg, key) + case "vmTemplate": + err = unpopulate(val, "VMTemplate", &h.VMTemplate) + delete(rawMsg, key) + case "validationEnvironment": + err = unpopulate(val, "ValidationEnvironment", &h.ValidationEnvironment) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type HostPoolUpdateConfigurationPatchProperties. +func (h HostPoolUpdateConfigurationPatchProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "deleteOriginalVm", h.DeleteOriginalVM) + populate(objectMap, "logOffDelayMinutes", h.LogOffDelayMinutes) + populate(objectMap, "logOffMessage", h.LogOffMessage) + populate(objectMap, "maxVmsRemoved", h.MaxVMsRemoved) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HostPoolUpdateConfigurationPatchProperties. +func (h *HostPoolUpdateConfigurationPatchProperties) 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", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "deleteOriginalVm": + err = unpopulate(val, "DeleteOriginalVM", &h.DeleteOriginalVM) + delete(rawMsg, key) + case "logOffDelayMinutes": + err = unpopulate(val, "LogOffDelayMinutes", &h.LogOffDelayMinutes) + delete(rawMsg, key) + case "logOffMessage": + err = unpopulate(val, "LogOffMessage", &h.LogOffMessage) + delete(rawMsg, key) + case "maxVmsRemoved": + err = unpopulate(val, "MaxVMsRemoved", &h.MaxVMsRemoved) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type HostPoolUpdateConfigurationProperties. +func (h HostPoolUpdateConfigurationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "deleteOriginalVm", h.DeleteOriginalVM) + populate(objectMap, "logOffDelayMinutes", h.LogOffDelayMinutes) + populate(objectMap, "logOffMessage", h.LogOffMessage) + populate(objectMap, "maxVmsRemoved", h.MaxVMsRemoved) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HostPoolUpdateConfigurationProperties. +func (h *HostPoolUpdateConfigurationProperties) 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", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "deleteOriginalVm": + err = unpopulate(val, "DeleteOriginalVM", &h.DeleteOriginalVM) + delete(rawMsg, key) + case "logOffDelayMinutes": + err = unpopulate(val, "LogOffDelayMinutes", &h.LogOffDelayMinutes) + delete(rawMsg, key) + case "logOffMessage": + err = unpopulate(val, "LogOffMessage", &h.LogOffMessage) + delete(rawMsg, key) + case "maxVmsRemoved": + err = unpopulate(val, "MaxVMsRemoved", &h.MaxVMsRemoved) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type HostPoolUpdateControlParameter. +func (h HostPoolUpdateControlParameter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "action", h.Action) + populate(objectMap, "cancelMessage", h.CancelMessage) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HostPoolUpdateControlParameter. +func (h *HostPoolUpdateControlParameter) 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", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "action": + err = unpopulate(val, "Action", &h.Action) + delete(rawMsg, key) + case "cancelMessage": + err = unpopulate(val, "CancelMessage", &h.CancelMessage) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ImageInfoPatchProperties. +func (i ImageInfoPatchProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "customInfo", i.CustomInfo) + populate(objectMap, "type", i.ImageType) + populate(objectMap, "marketplaceInfo", i.MarketplaceInfo) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ImageInfoPatchProperties. +func (i *ImageInfoPatchProperties) 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", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "customInfo": + err = unpopulate(val, "CustomInfo", &i.CustomInfo) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "ImageType", &i.ImageType) + delete(rawMsg, key) + case "marketplaceInfo": + err = unpopulate(val, "MarketplaceInfo", &i.MarketplaceInfo) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ImageInfoProperties. +func (i ImageInfoProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "customInfo", i.CustomInfo) + populate(objectMap, "type", i.ImageType) + populate(objectMap, "marketplaceInfo", i.MarketplaceInfo) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ImageInfoProperties. +func (i *ImageInfoProperties) 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", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "customInfo": + err = unpopulate(val, "CustomInfo", &i.CustomInfo) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "ImageType", &i.ImageType) + delete(rawMsg, key) + case "marketplaceInfo": + err = unpopulate(val, "MarketplaceInfo", &i.MarketplaceInfo) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ImportPackageInfoRequest. +func (i ImportPackageInfoRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "packageArchitecture", i.PackageArchitecture) + populate(objectMap, "path", i.Path) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ImportPackageInfoRequest. +func (i *ImportPackageInfoRequest) 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", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "packageArchitecture": + err = unpopulate(val, "PackageArchitecture", &i.PackageArchitecture) + delete(rawMsg, key) + case "path": + err = unpopulate(val, "Path", &i.Path) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type KeyVaultCredentialsPatchProperties. +func (k KeyVaultCredentialsPatchProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "passwordKeyVaultSecretUri", k.PasswordKeyVaultSecretURI) + populate(objectMap, "usernameKeyVaultSecretUri", k.UsernameKeyVaultSecretURI) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KeyVaultCredentialsPatchProperties. +func (k *KeyVaultCredentialsPatchProperties) 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", k, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "passwordKeyVaultSecretUri": + err = unpopulate(val, "PasswordKeyVaultSecretURI", &k.PasswordKeyVaultSecretURI) + delete(rawMsg, key) + case "usernameKeyVaultSecretUri": + err = unpopulate(val, "UsernameKeyVaultSecretURI", &k.UsernameKeyVaultSecretURI) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type KeyVaultCredentialsProperties. +func (k KeyVaultCredentialsProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "passwordKeyVaultSecretUri", k.PasswordKeyVaultSecretURI) + populate(objectMap, "usernameKeyVaultSecretUri", k.UsernameKeyVaultSecretURI) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KeyVaultCredentialsProperties. +func (k *KeyVaultCredentialsProperties) 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", k, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "passwordKeyVaultSecretUri": + err = unpopulate(val, "PasswordKeyVaultSecretURI", &k.PasswordKeyVaultSecretURI) + delete(rawMsg, key) + case "usernameKeyVaultSecretUri": + err = unpopulate(val, "UsernameKeyVaultSecretURI", &k.UsernameKeyVaultSecretURI) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LogSpecification. +func (l LogSpecification) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "blobDuration", l.BlobDuration) + populate(objectMap, "displayName", l.DisplayName) + populate(objectMap, "name", l.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LogSpecification. +func (l *LogSpecification) 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", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "blobDuration": + err = unpopulate(val, "BlobDuration", &l.BlobDuration) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &l.DisplayName) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &l.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MSIXImageURI. +func (m MSIXImageURI) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "uri", m.URI) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MSIXImageURI. +func (m *MSIXImageURI) 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 "uri": + err = unpopulate(val, "URI", &m.URI) + 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 MSIXPackage. +func (m MSIXPackage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", m.ID) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "systemData", m.SystemData) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MSIXPackage. +func (m *MSIXPackage) 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 "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &m.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + 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 MSIXPackageList. +func (m MSIXPackageList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MSIXPackageList. +func (m *MSIXPackageList) 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 "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + 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 MSIXPackagePatch. +func (m MSIXPackagePatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", m.ID) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "systemData", m.SystemData) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MSIXPackagePatch. +func (m *MSIXPackagePatch) 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 "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &m.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + 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 MSIXPackagePatchProperties. +func (m MSIXPackagePatchProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "displayName", m.DisplayName) + populate(objectMap, "isActive", m.IsActive) + populate(objectMap, "isRegularRegistration", m.IsRegularRegistration) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MSIXPackagePatchProperties. +func (m *MSIXPackagePatchProperties) 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 "displayName": + err = unpopulate(val, "DisplayName", &m.DisplayName) + delete(rawMsg, key) + case "isActive": + err = unpopulate(val, "IsActive", &m.IsActive) + delete(rawMsg, key) + case "isRegularRegistration": + err = unpopulate(val, "IsRegularRegistration", &m.IsRegularRegistration) + 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 MSIXPackageProperties. +func (m MSIXPackageProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "displayName", m.DisplayName) + populate(objectMap, "imagePath", m.ImagePath) + populate(objectMap, "isActive", m.IsActive) + populate(objectMap, "isRegularRegistration", m.IsRegularRegistration) + populateDateTimeRFC3339(objectMap, "lastUpdated", m.LastUpdated) + populate(objectMap, "packageApplications", m.PackageApplications) + populate(objectMap, "packageDependencies", m.PackageDependencies) + populate(objectMap, "packageFamilyName", m.PackageFamilyName) + populate(objectMap, "packageName", m.PackageName) + populate(objectMap, "packageRelativePath", m.PackageRelativePath) + populate(objectMap, "version", m.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MSIXPackageProperties. +func (m *MSIXPackageProperties) 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 "displayName": + err = unpopulate(val, "DisplayName", &m.DisplayName) + delete(rawMsg, key) + case "imagePath": + err = unpopulate(val, "ImagePath", &m.ImagePath) + delete(rawMsg, key) + case "isActive": + err = unpopulate(val, "IsActive", &m.IsActive) + delete(rawMsg, key) + case "isRegularRegistration": + err = unpopulate(val, "IsRegularRegistration", &m.IsRegularRegistration) + delete(rawMsg, key) + case "lastUpdated": + err = unpopulateDateTimeRFC3339(val, "LastUpdated", &m.LastUpdated) + delete(rawMsg, key) + case "packageApplications": + err = unpopulate(val, "PackageApplications", &m.PackageApplications) + delete(rawMsg, key) + case "packageDependencies": + err = unpopulate(val, "PackageDependencies", &m.PackageDependencies) + delete(rawMsg, key) + case "packageFamilyName": + err = unpopulate(val, "PackageFamilyName", &m.PackageFamilyName) + delete(rawMsg, key) + case "packageName": + err = unpopulate(val, "PackageName", &m.PackageName) + delete(rawMsg, key) + case "packageRelativePath": + err = unpopulate(val, "PackageRelativePath", &m.PackageRelativePath) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &m.Version) + 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 MaintenanceWindowPatchProperties. +func (m MaintenanceWindowPatchProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "dayOfWeek", m.DayOfWeek) + populate(objectMap, "hour", m.Hour) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MaintenanceWindowPatchProperties. +func (m *MaintenanceWindowPatchProperties) 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 "dayOfWeek": + err = unpopulate(val, "DayOfWeek", &m.DayOfWeek) + delete(rawMsg, key) + case "hour": + err = unpopulate(val, "Hour", &m.Hour) + 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 MaintenanceWindowProperties. +func (m MaintenanceWindowProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "dayOfWeek", m.DayOfWeek) + populate(objectMap, "hour", m.Hour) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MaintenanceWindowProperties. +func (m *MaintenanceWindowProperties) 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 "agentUpdate": - err = unpopulate(val, "AgentUpdate", &h.AgentUpdate) - delete(rawMsg, key) - case "customRdpProperty": - err = unpopulate(val, "CustomRdpProperty", &h.CustomRdpProperty) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &h.Description) - delete(rawMsg, key) - case "friendlyName": - err = unpopulate(val, "FriendlyName", &h.FriendlyName) - delete(rawMsg, key) - case "loadBalancerType": - err = unpopulate(val, "LoadBalancerType", &h.LoadBalancerType) + case "dayOfWeek": + err = unpopulate(val, "DayOfWeek", &m.DayOfWeek) delete(rawMsg, key) - case "maxSessionLimit": - err = unpopulate(val, "MaxSessionLimit", &h.MaxSessionLimit) + case "hour": + err = unpopulate(val, "Hour", &m.Hour) delete(rawMsg, key) - case "personalDesktopAssignmentType": - err = unpopulate(val, "PersonalDesktopAssignmentType", &h.PersonalDesktopAssignmentType) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, 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 "preferredAppGroupType": - err = unpopulate(val, "PreferredAppGroupType", &h.PreferredAppGroupType) + case "tenantId": + err = unpopulate(val, "TenantID", &m.TenantID) delete(rawMsg, key) - case "publicNetworkAccess": - err = unpopulate(val, "PublicNetworkAccess", &h.PublicNetworkAccess) + case "type": + err = unpopulate(val, "Type", &m.Type) delete(rawMsg, key) - case "registrationInfo": - err = unpopulate(val, "RegistrationInfo", &h.RegistrationInfo) + case "userAssignedIdentities": + err = unpopulate(val, "UserAssignedIdentities", &m.UserAssignedIdentities) delete(rawMsg, key) - case "ring": - err = unpopulate(val, "Ring", &h.Ring) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MarketplaceInfoPatchProperties. +func (m MarketplaceInfoPatchProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "exactVersion", m.ExactVersion) + populate(objectMap, "offer", m.Offer) + populate(objectMap, "publisher", m.Publisher) + populate(objectMap, "sku", m.SKU) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MarketplaceInfoPatchProperties. +func (m *MarketplaceInfoPatchProperties) 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 "exactVersion": + err = unpopulate(val, "ExactVersion", &m.ExactVersion) delete(rawMsg, key) - case "ssoClientId": - err = unpopulate(val, "SsoClientID", &h.SsoClientID) + case "offer": + err = unpopulate(val, "Offer", &m.Offer) delete(rawMsg, key) - case "ssoClientSecretKeyVaultPath": - err = unpopulate(val, "SsoClientSecretKeyVaultPath", &h.SsoClientSecretKeyVaultPath) + case "publisher": + err = unpopulate(val, "Publisher", &m.Publisher) delete(rawMsg, key) - case "ssoSecretType": - err = unpopulate(val, "SsoSecretType", &h.SsoSecretType) + case "sku": + err = unpopulate(val, "SKU", &m.SKU) delete(rawMsg, key) - case "ssoadfsAuthority": - err = unpopulate(val, "SsoadfsAuthority", &h.SsoadfsAuthority) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MarketplaceInfoProperties. +func (m MarketplaceInfoProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "exactVersion", m.ExactVersion) + populate(objectMap, "offer", m.Offer) + populate(objectMap, "publisher", m.Publisher) + populate(objectMap, "sku", m.SKU) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MarketplaceInfoProperties. +func (m *MarketplaceInfoProperties) 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 "exactVersion": + err = unpopulate(val, "ExactVersion", &m.ExactVersion) delete(rawMsg, key) - case "startVMOnConnect": - err = unpopulate(val, "StartVMOnConnect", &h.StartVMOnConnect) + case "offer": + err = unpopulate(val, "Offer", &m.Offer) delete(rawMsg, key) - case "vmTemplate": - err = unpopulate(val, "VMTemplate", &h.VMTemplate) + case "publisher": + err = unpopulate(val, "Publisher", &m.Publisher) delete(rawMsg, key) - case "validationEnvironment": - err = unpopulate(val, "ValidationEnvironment", &h.ValidationEnvironment) + case "sku": + err = unpopulate(val, "SKU", &m.SKU) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type HostPoolProperties. -func (h HostPoolProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MsixPackageApplications. +func (m MsixPackageApplications) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "agentUpdate", h.AgentUpdate) - populate(objectMap, "applicationGroupReferences", h.ApplicationGroupReferences) - populate(objectMap, "cloudPcResource", h.CloudPcResource) - populate(objectMap, "customRdpProperty", h.CustomRdpProperty) - populate(objectMap, "description", h.Description) - populate(objectMap, "friendlyName", h.FriendlyName) - populate(objectMap, "hostPoolType", h.HostPoolType) - populate(objectMap, "loadBalancerType", h.LoadBalancerType) - populate(objectMap, "maxSessionLimit", h.MaxSessionLimit) - populate(objectMap, "objectId", h.ObjectID) - populate(objectMap, "personalDesktopAssignmentType", h.PersonalDesktopAssignmentType) - populate(objectMap, "preferredAppGroupType", h.PreferredAppGroupType) - populate(objectMap, "privateEndpointConnections", h.PrivateEndpointConnections) - populate(objectMap, "publicNetworkAccess", h.PublicNetworkAccess) - populate(objectMap, "registrationInfo", h.RegistrationInfo) - populate(objectMap, "ring", h.Ring) - populate(objectMap, "ssoClientId", h.SsoClientID) - populate(objectMap, "ssoClientSecretKeyVaultPath", h.SsoClientSecretKeyVaultPath) - populate(objectMap, "ssoSecretType", h.SsoSecretType) - populate(objectMap, "ssoadfsAuthority", h.SsoadfsAuthority) - populate(objectMap, "startVMOnConnect", h.StartVMOnConnect) - populate(objectMap, "vmTemplate", h.VMTemplate) - populate(objectMap, "validationEnvironment", h.ValidationEnvironment) + populate(objectMap, "appId", m.AppID) + populate(objectMap, "appUserModelID", m.AppUserModelID) + populate(objectMap, "description", m.Description) + populate(objectMap, "friendlyName", m.FriendlyName) + populate(objectMap, "iconImageName", m.IconImageName) + populateByteArray(objectMap, "rawIcon", m.RawIcon, func() any { + return runtime.EncodeByteArray(m.RawIcon, runtime.Base64StdFormat) + }) + populateByteArray(objectMap, "rawPng", m.RawPNG, func() any { + return runtime.EncodeByteArray(m.RawPNG, runtime.Base64StdFormat) + }) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type HostPoolProperties. -func (h *HostPoolProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MsixPackageApplications. +func (m *MsixPackageApplications) 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", h, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { - case "agentUpdate": - err = unpopulate(val, "AgentUpdate", &h.AgentUpdate) - delete(rawMsg, key) - case "applicationGroupReferences": - err = unpopulate(val, "ApplicationGroupReferences", &h.ApplicationGroupReferences) - delete(rawMsg, key) - case "cloudPcResource": - err = unpopulate(val, "CloudPcResource", &h.CloudPcResource) + case "appId": + err = unpopulate(val, "AppID", &m.AppID) delete(rawMsg, key) - case "customRdpProperty": - err = unpopulate(val, "CustomRdpProperty", &h.CustomRdpProperty) + case "appUserModelID": + err = unpopulate(val, "AppUserModelID", &m.AppUserModelID) delete(rawMsg, key) case "description": - err = unpopulate(val, "Description", &h.Description) + err = unpopulate(val, "Description", &m.Description) delete(rawMsg, key) case "friendlyName": - err = unpopulate(val, "FriendlyName", &h.FriendlyName) - delete(rawMsg, key) - case "hostPoolType": - err = unpopulate(val, "HostPoolType", &h.HostPoolType) - delete(rawMsg, key) - case "loadBalancerType": - err = unpopulate(val, "LoadBalancerType", &h.LoadBalancerType) - delete(rawMsg, key) - case "maxSessionLimit": - err = unpopulate(val, "MaxSessionLimit", &h.MaxSessionLimit) - delete(rawMsg, key) - case "objectId": - err = unpopulate(val, "ObjectID", &h.ObjectID) - delete(rawMsg, key) - case "personalDesktopAssignmentType": - err = unpopulate(val, "PersonalDesktopAssignmentType", &h.PersonalDesktopAssignmentType) - delete(rawMsg, key) - case "preferredAppGroupType": - err = unpopulate(val, "PreferredAppGroupType", &h.PreferredAppGroupType) - delete(rawMsg, key) - case "privateEndpointConnections": - err = unpopulate(val, "PrivateEndpointConnections", &h.PrivateEndpointConnections) - delete(rawMsg, key) - case "publicNetworkAccess": - err = unpopulate(val, "PublicNetworkAccess", &h.PublicNetworkAccess) - delete(rawMsg, key) - case "registrationInfo": - err = unpopulate(val, "RegistrationInfo", &h.RegistrationInfo) + err = unpopulate(val, "FriendlyName", &m.FriendlyName) delete(rawMsg, key) - case "ring": - err = unpopulate(val, "Ring", &h.Ring) + case "iconImageName": + err = unpopulate(val, "IconImageName", &m.IconImageName) delete(rawMsg, key) - case "ssoClientId": - err = unpopulate(val, "SsoClientID", &h.SsoClientID) + case "rawIcon": + if val != nil && string(val) != "null" { + err = runtime.DecodeByteArray(string(val), &m.RawIcon, runtime.Base64StdFormat) + } delete(rawMsg, key) - case "ssoClientSecretKeyVaultPath": - err = unpopulate(val, "SsoClientSecretKeyVaultPath", &h.SsoClientSecretKeyVaultPath) + case "rawPng": + if val != nil && string(val) != "null" { + err = runtime.DecodeByteArray(string(val), &m.RawPNG, runtime.Base64StdFormat) + } delete(rawMsg, key) - case "ssoSecretType": - err = unpopulate(val, "SsoSecretType", &h.SsoSecretType) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MsixPackageDependencies. +func (m MsixPackageDependencies) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "dependencyName", m.DependencyName) + populate(objectMap, "minVersion", m.MinVersion) + populate(objectMap, "publisher", m.Publisher) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MsixPackageDependencies. +func (m *MsixPackageDependencies) 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 "dependencyName": + err = unpopulate(val, "DependencyName", &m.DependencyName) delete(rawMsg, key) - case "ssoadfsAuthority": - err = unpopulate(val, "SsoadfsAuthority", &h.SsoadfsAuthority) + case "minVersion": + err = unpopulate(val, "MinVersion", &m.MinVersion) delete(rawMsg, key) - case "startVMOnConnect": - err = unpopulate(val, "StartVMOnConnect", &h.StartVMOnConnect) + case "publisher": + err = unpopulate(val, "Publisher", &m.Publisher) delete(rawMsg, key) - case "vmTemplate": - err = unpopulate(val, "VMTemplate", &h.VMTemplate) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkInfoPatchProperties. +func (n NetworkInfoPatchProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "securityGroupId", n.SecurityGroupID) + populate(objectMap, "subnetId", n.SubnetID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkInfoPatchProperties. +func (n *NetworkInfoPatchProperties) 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", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "securityGroupId": + err = unpopulate(val, "SecurityGroupID", &n.SecurityGroupID) delete(rawMsg, key) - case "validationEnvironment": - err = unpopulate(val, "ValidationEnvironment", &h.ValidationEnvironment) + case "subnetId": + err = unpopulate(val, "SubnetID", &n.SubnetID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type LogSpecification. -func (l LogSpecification) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NetworkInfoProperties. +func (n NetworkInfoProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "blobDuration", l.BlobDuration) - populate(objectMap, "displayName", l.DisplayName) - populate(objectMap, "name", l.Name) + populate(objectMap, "securityGroupId", n.SecurityGroupID) + populate(objectMap, "subnetId", n.SubnetID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type LogSpecification. -func (l *LogSpecification) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkInfoProperties. +func (n *NetworkInfoProperties) 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", l, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } for key, val := range rawMsg { var err error switch key { - case "blobDuration": - err = unpopulate(val, "BlobDuration", &l.BlobDuration) + case "securityGroupId": + err = unpopulate(val, "SecurityGroupID", &n.SecurityGroupID) delete(rawMsg, key) - case "displayName": - err = unpopulate(val, "DisplayName", &l.DisplayName) + case "subnetId": + err = unpopulate(val, "SubnetID", &n.SubnetID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationProperties. +func (o OperationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "serviceSpecification", o.ServiceSpecification) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationProperties. +func (o *OperationProperties) 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 "serviceSpecification": + err = unpopulate(val, "ServiceSpecification", &o.ServiceSpecification) 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 Plan. +func (p Plan) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", p.Name) + populate(objectMap, "product", p.Product) + populate(objectMap, "promotionCode", p.PromotionCode) + populate(objectMap, "publisher", p.Publisher) + populate(objectMap, "version", p.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Plan. +func (p *Plan) 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 "name": - err = unpopulate(val, "Name", &l.Name) + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "product": + err = unpopulate(val, "Product", &p.Product) + delete(rawMsg, key) + case "promotionCode": + err = unpopulate(val, "PromotionCode", &p.PromotionCode) + delete(rawMsg, key) + case "publisher": + err = unpopulate(val, "Publisher", &p.Publisher) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &p.Version) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MSIXImageURI. -func (m MSIXImageURI) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpoint. +func (p PrivateEndpoint) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "uri", m.URI) + populate(objectMap, "id", p.ID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MSIXImageURI. -func (m *MSIXImageURI) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpoint. +func (p *PrivateEndpoint) 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) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "uri": - err = unpopulate(val, "URI", &m.URI) + case "id": + err = unpopulate(val, "ID", &p.ID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MSIXPackage. -func (m MSIXPackage) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnection. +func (p PrivateEndpointConnection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", m.ID) - populate(objectMap, "name", m.Name) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "systemData", m.SystemData) - populate(objectMap, "type", m.Type) + 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 MSIXPackage. -func (m *MSIXPackage) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnection. +func (p *PrivateEndpointConnection) 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) + 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", &m.ID) + err = unpopulate(val, "ID", &p.ID) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &m.Name) + err = unpopulate(val, "Name", &p.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &m.Properties) + err = unpopulate(val, "Properties", &p.Properties) delete(rawMsg, key) case "systemData": - err = unpopulate(val, "SystemData", &m.SystemData) + err = unpopulate(val, "SystemData", &p.SystemData) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &m.Type) + err = unpopulate(val, "Type", &p.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MSIXPackageList. -func (m MSIXPackageList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionListResultWithSystemData. +func (p PrivateEndpointConnectionListResultWithSystemData) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", m.NextLink) - populate(objectMap, "value", m.Value) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MSIXPackageList. -func (m *MSIXPackageList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionListResultWithSystemData. +func (p *PrivateEndpointConnectionListResultWithSystemData) 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) + 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", &m.NextLink) + err = unpopulate(val, "NextLink", &p.NextLink) delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &m.Value) + err = unpopulate(val, "Value", &p.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MSIXPackagePatch. -func (m MSIXPackagePatch) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionProperties. +func (p PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", m.ID) - populate(objectMap, "name", m.Name) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "type", m.Type) + populate(objectMap, "groupIds", p.GroupIDs) + populate(objectMap, "privateEndpoint", p.PrivateEndpoint) + populate(objectMap, "privateLinkServiceConnectionState", p.PrivateLinkServiceConnectionState) + populate(objectMap, "provisioningState", p.ProvisioningState) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MSIXPackagePatch. -func (m *MSIXPackagePatch) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionProperties. +func (p *PrivateEndpointConnectionProperties) 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) + 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", &m.ID) + case "groupIds": + err = unpopulate(val, "GroupIDs", &p.GroupIDs) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &m.Name) + case "privateEndpoint": + err = unpopulate(val, "PrivateEndpoint", &p.PrivateEndpoint) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &m.Properties) + case "privateLinkServiceConnectionState": + err = unpopulate(val, "PrivateLinkServiceConnectionState", &p.PrivateLinkServiceConnectionState) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &m.Type) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MSIXPackagePatchProperties. -func (m MSIXPackagePatchProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionWithSystemData. +func (p PrivateEndpointConnectionWithSystemData) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "displayName", m.DisplayName) - populate(objectMap, "isActive", m.IsActive) - populate(objectMap, "isRegularRegistration", m.IsRegularRegistration) + 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 MSIXPackagePatchProperties. -func (m *MSIXPackagePatchProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionWithSystemData. +func (p *PrivateEndpointConnectionWithSystemData) 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) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "displayName": - err = unpopulate(val, "DisplayName", &m.DisplayName) + case "id": + err = unpopulate(val, "ID", &p.ID) delete(rawMsg, key) - case "isActive": - err = unpopulate(val, "IsActive", &m.IsActive) + case "name": + err = unpopulate(val, "Name", &p.Name) delete(rawMsg, key) - case "isRegularRegistration": - err = unpopulate(val, "IsRegularRegistration", &m.IsRegularRegistration) + 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) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MSIXPackageProperties. -func (m MSIXPackageProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResource. +func (p PrivateLinkResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "displayName", m.DisplayName) - populate(objectMap, "imagePath", m.ImagePath) - populate(objectMap, "isActive", m.IsActive) - populate(objectMap, "isRegularRegistration", m.IsRegularRegistration) - populateDateTimeRFC3339(objectMap, "lastUpdated", m.LastUpdated) - populate(objectMap, "packageApplications", m.PackageApplications) - populate(objectMap, "packageDependencies", m.PackageDependencies) - populate(objectMap, "packageFamilyName", m.PackageFamilyName) - populate(objectMap, "packageName", m.PackageName) - populate(objectMap, "packageRelativePath", m.PackageRelativePath) - populate(objectMap, "version", m.Version) + 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 MSIXPackageProperties. -func (m *MSIXPackageProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResource. +func (p *PrivateLinkResource) 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) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "displayName": - err = unpopulate(val, "DisplayName", &m.DisplayName) - delete(rawMsg, key) - case "imagePath": - err = unpopulate(val, "ImagePath", &m.ImagePath) - delete(rawMsg, key) - case "isActive": - err = unpopulate(val, "IsActive", &m.IsActive) - delete(rawMsg, key) - case "isRegularRegistration": - err = unpopulate(val, "IsRegularRegistration", &m.IsRegularRegistration) - delete(rawMsg, key) - case "lastUpdated": - err = unpopulateDateTimeRFC3339(val, "LastUpdated", &m.LastUpdated) - delete(rawMsg, key) - case "packageApplications": - err = unpopulate(val, "PackageApplications", &m.PackageApplications) - delete(rawMsg, key) - case "packageDependencies": - err = unpopulate(val, "PackageDependencies", &m.PackageDependencies) + case "id": + err = unpopulate(val, "ID", &p.ID) delete(rawMsg, key) - case "packageFamilyName": - err = unpopulate(val, "PackageFamilyName", &m.PackageFamilyName) + case "name": + err = unpopulate(val, "Name", &p.Name) delete(rawMsg, key) - case "packageName": - err = unpopulate(val, "PackageName", &m.PackageName) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) delete(rawMsg, key) - case "packageRelativePath": - err = unpopulate(val, "PackageRelativePath", &m.PackageRelativePath) + case "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &m.Version) + case "type": + err = unpopulate(val, "Type", &p.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MaintenanceWindowPatchProperties. -func (m MaintenanceWindowPatchProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceListResult. +func (p PrivateLinkResourceListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "dayOfWeek", m.DayOfWeek) - populate(objectMap, "hour", m.Hour) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MaintenanceWindowPatchProperties. -func (m *MaintenanceWindowPatchProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceListResult. +func (p *PrivateLinkResourceListResult) 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) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "dayOfWeek": - err = unpopulate(val, "DayOfWeek", &m.DayOfWeek) + case "nextLink": + err = unpopulate(val, "NextLink", &p.NextLink) delete(rawMsg, key) - case "hour": - err = unpopulate(val, "Hour", &m.Hour) + case "value": + err = unpopulate(val, "Value", &p.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MaintenanceWindowProperties. -func (m MaintenanceWindowProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceProperties. +func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "dayOfWeek", m.DayOfWeek) - populate(objectMap, "hour", m.Hour) + populate(objectMap, "groupId", p.GroupID) + populate(objectMap, "requiredMembers", p.RequiredMembers) + populate(objectMap, "requiredZoneNames", p.RequiredZoneNames) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MaintenanceWindowProperties. -func (m *MaintenanceWindowProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceProperties. +func (p *PrivateLinkResourceProperties) 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) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "dayOfWeek": - err = unpopulate(val, "DayOfWeek", &m.DayOfWeek) + case "groupId": + err = unpopulate(val, "GroupID", &p.GroupID) delete(rawMsg, key) - case "hour": - err = unpopulate(val, "Hour", &m.Hour) + case "requiredMembers": + err = unpopulate(val, "RequiredMembers", &p.RequiredMembers) + delete(rawMsg, key) + case "requiredZoneNames": + err = unpopulate(val, "RequiredZoneNames", &p.RequiredZoneNames) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MsixPackageApplications. -func (m MsixPackageApplications) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkServiceConnectionState. +func (p PrivateLinkServiceConnectionState) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "appId", m.AppID) - populate(objectMap, "appUserModelID", m.AppUserModelID) - populate(objectMap, "description", m.Description) - populate(objectMap, "friendlyName", m.FriendlyName) - populate(objectMap, "iconImageName", m.IconImageName) - populateByteArray(objectMap, "rawIcon", m.RawIcon, runtime.Base64StdFormat) - populateByteArray(objectMap, "rawPng", m.RawPNG, runtime.Base64StdFormat) + populate(objectMap, "actionsRequired", p.ActionsRequired) + populate(objectMap, "description", p.Description) + populate(objectMap, "status", p.Status) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MsixPackageApplications. -func (m *MsixPackageApplications) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServiceConnectionState. +func (p *PrivateLinkServiceConnectionState) 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) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "appId": - err = unpopulate(val, "AppID", &m.AppID) - delete(rawMsg, key) - case "appUserModelID": - err = unpopulate(val, "AppUserModelID", &m.AppUserModelID) + case "actionsRequired": + err = unpopulate(val, "ActionsRequired", &p.ActionsRequired) delete(rawMsg, key) case "description": - err = unpopulate(val, "Description", &m.Description) - delete(rawMsg, key) - case "friendlyName": - err = unpopulate(val, "FriendlyName", &m.FriendlyName) - delete(rawMsg, key) - case "iconImageName": - err = unpopulate(val, "IconImageName", &m.IconImageName) - delete(rawMsg, key) - case "rawIcon": - err = runtime.DecodeByteArray(string(val), &m.RawIcon, runtime.Base64StdFormat) + err = unpopulate(val, "Description", &p.Description) delete(rawMsg, key) - case "rawPng": - err = runtime.DecodeByteArray(string(val), &m.RawPNG, runtime.Base64StdFormat) + case "status": + err = unpopulate(val, "Status", &p.Status) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MsixPackageDependencies. -func (m MsixPackageDependencies) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RegistrationInfo. +func (r RegistrationInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "dependencyName", m.DependencyName) - populate(objectMap, "minVersion", m.MinVersion) - populate(objectMap, "publisher", m.Publisher) + populateDateTimeRFC3339(objectMap, "expirationTime", r.ExpirationTime) + populate(objectMap, "registrationTokenOperation", r.RegistrationTokenOperation) + populate(objectMap, "token", r.Token) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MsixPackageDependencies. -func (m *MsixPackageDependencies) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RegistrationInfo. +func (r *RegistrationInfo) 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) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "dependencyName": - err = unpopulate(val, "DependencyName", &m.DependencyName) + case "expirationTime": + err = unpopulateDateTimeRFC3339(val, "ExpirationTime", &r.ExpirationTime) delete(rawMsg, key) - case "minVersion": - err = unpopulate(val, "MinVersion", &m.MinVersion) + case "registrationTokenOperation": + err = unpopulate(val, "RegistrationTokenOperation", &r.RegistrationTokenOperation) delete(rawMsg, key) - case "publisher": - err = unpopulate(val, "Publisher", &m.Publisher) + case "token": + err = unpopulate(val, "Token", &r.Token) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OperationProperties. -func (o OperationProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RegistrationInfoPatch. +func (r RegistrationInfoPatch) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "serviceSpecification", o.ServiceSpecification) + populateDateTimeRFC3339(objectMap, "expirationTime", r.ExpirationTime) + populate(objectMap, "registrationTokenOperation", r.RegistrationTokenOperation) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationProperties. -func (o *OperationProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RegistrationInfoPatch. +func (r *RegistrationInfoPatch) 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) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "serviceSpecification": - err = unpopulate(val, "ServiceSpecification", &o.ServiceSpecification) + case "expirationTime": + err = unpopulateDateTimeRFC3339(val, "ExpirationTime", &r.ExpirationTime) + delete(rawMsg, key) + case "registrationTokenOperation": + err = unpopulate(val, "RegistrationTokenOperation", &r.RegistrationTokenOperation) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateEndpoint. -func (p PrivateEndpoint) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RegistrationTokenList. +func (r RegistrationTokenList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", p.ID) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpoint. -func (p *PrivateEndpoint) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RegistrationTokenList. +func (r *RegistrationTokenList) 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) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &p.ID) + case "nextLink": + err = unpopulate(val, "NextLink", &r.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &r.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnection. -func (p PrivateEndpointConnection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RegistrationTokenMinimal. +func (r RegistrationTokenMinimal) 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, "type", p.Type) + populateDateTimeRFC3339(objectMap, "expirationTime", r.ExpirationTime) + populate(objectMap, "token", r.Token) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnection. -func (p *PrivateEndpointConnection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RegistrationTokenMinimal. +func (r *RegistrationTokenMinimal) 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) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &p.Properties) + case "expirationTime": + err = unpopulateDateTimeRFC3339(val, "ExpirationTime", &r.ExpirationTime) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) + case "token": + err = unpopulate(val, "Token", &r.Token) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionListResultWithSystemData. -func (p PrivateEndpointConnectionListResultWithSystemData) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ResourceProviderOperation. +func (r ResourceProviderOperation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", p.NextLink) - populate(objectMap, "value", p.Value) + populate(objectMap, "display", r.Display) + populate(objectMap, "isDataAction", r.IsDataAction) + populate(objectMap, "name", r.Name) + populate(objectMap, "properties", r.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionListResultWithSystemData. -func (p *PrivateEndpointConnectionListResultWithSystemData) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderOperation. +func (r *ResourceProviderOperation) 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) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &p.NextLink) + case "display": + err = unpopulate(val, "Display", &r.Display) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &p.Value) + case "isDataAction": + err = unpopulate(val, "IsDataAction", &r.IsDataAction) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &r.Properties) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionProperties. -func (p PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ResourceProviderOperationDisplay. +func (r ResourceProviderOperationDisplay) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "privateEndpoint", p.PrivateEndpoint) - populate(objectMap, "privateLinkServiceConnectionState", p.PrivateLinkServiceConnectionState) - populate(objectMap, "provisioningState", p.ProvisioningState) + populate(objectMap, "description", r.Description) + populate(objectMap, "operation", r.Operation) + populate(objectMap, "provider", r.Provider) + populate(objectMap, "resource", r.Resource) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionProperties. -func (p *PrivateEndpointConnectionProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderOperationDisplay. +func (r *ResourceProviderOperationDisplay) 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) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "privateEndpoint": - err = unpopulate(val, "PrivateEndpoint", &p.PrivateEndpoint) + case "description": + err = unpopulate(val, "Description", &r.Description) delete(rawMsg, key) - case "privateLinkServiceConnectionState": - err = unpopulate(val, "PrivateLinkServiceConnectionState", &p.PrivateLinkServiceConnectionState) + case "operation": + err = unpopulate(val, "Operation", &r.Operation) delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) + case "provider": + err = unpopulate(val, "Provider", &r.Provider) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &r.Resource) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionWithSystemData. -func (p PrivateEndpointConnectionWithSystemData) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ResourceProviderOperationList. +func (r ResourceProviderOperationList) 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) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionWithSystemData. -func (p *PrivateEndpointConnectionWithSystemData) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderOperationList. +func (r *ResourceProviderOperationList) 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) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &p.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &p.SystemData) + case "nextLink": + err = unpopulate(val, "NextLink", &r.NextLink) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) + case "value": + err = unpopulate(val, "Value", &r.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResource. -func (p PrivateLinkResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SKU. +func (s SKU) 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, "type", p.Type) + populate(objectMap, "capacity", s.Capacity) + populate(objectMap, "family", s.Family) + populate(objectMap, "name", s.Name) + populate(objectMap, "size", s.Size) + populate(objectMap, "tier", s.Tier) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResource. -func (p *PrivateLinkResource) 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", p, 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", &p.ID) + case "capacity": + err = unpopulate(val, "Capacity", &s.Capacity) + delete(rawMsg, key) + case "family": + err = unpopulate(val, "Family", &s.Family) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &p.Name) + err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &p.Properties) + case "size": + err = unpopulate(val, "Size", &s.Size) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) + case "tier": + err = unpopulate(val, "Tier", &s.Tier) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceListResult. -func (p PrivateLinkResourceListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ScalingHostPoolReference. +func (s ScalingHostPoolReference) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", p.NextLink) - populate(objectMap, "value", p.Value) + populate(objectMap, "hostPoolArmPath", s.HostPoolArmPath) + populate(objectMap, "scalingPlanEnabled", s.ScalingPlanEnabled) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceListResult. -func (p *PrivateLinkResourceListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ScalingHostPoolReference. +func (s *ScalingHostPoolReference) 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) + 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", &p.NextLink) + case "hostPoolArmPath": + err = unpopulate(val, "HostPoolArmPath", &s.HostPoolArmPath) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &p.Value) + case "scalingPlanEnabled": + err = unpopulate(val, "ScalingPlanEnabled", &s.ScalingPlanEnabled) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceProperties. -func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ScalingPlan. +func (s ScalingPlan) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "groupId", p.GroupID) - populate(objectMap, "requiredMembers", p.RequiredMembers) - populate(objectMap, "requiredZoneNames", p.RequiredZoneNames) + populate(objectMap, "etag", s.Etag) + populate(objectMap, "id", s.ID) + populate(objectMap, "identity", s.Identity) + populate(objectMap, "kind", s.Kind) + populate(objectMap, "location", s.Location) + populate(objectMap, "managedBy", s.ManagedBy) + populate(objectMap, "name", s.Name) + populate(objectMap, "plan", s.Plan) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "sku", s.SKU) + populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "tags", s.Tags) + populate(objectMap, "type", s.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceProperties. -func (p *PrivateLinkResourceProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ScalingPlan. +func (s *ScalingPlan) 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) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "groupId": - err = unpopulate(val, "GroupID", &p.GroupID) + case "etag": + err = unpopulate(val, "Etag", &s.Etag) delete(rawMsg, key) - case "requiredMembers": - err = unpopulate(val, "RequiredMembers", &p.RequiredMembers) + case "id": + err = unpopulate(val, "ID", &s.ID) delete(rawMsg, key) - case "requiredZoneNames": - err = unpopulate(val, "RequiredZoneNames", &p.RequiredZoneNames) + case "identity": + err = unpopulate(val, "Identity", &s.Identity) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &s.Kind) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &s.Location) + delete(rawMsg, key) + case "managedBy": + err = unpopulate(val, "ManagedBy", &s.ManagedBy) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "plan": + err = unpopulate(val, "Plan", &s.Plan) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &s.SKU) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &s.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkServiceConnectionState. -func (p PrivateLinkServiceConnectionState) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ScalingPlanList. +func (s ScalingPlanList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "actionsRequired", p.ActionsRequired) - populate(objectMap, "description", p.Description) - populate(objectMap, "status", p.Status) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServiceConnectionState. -func (p *PrivateLinkServiceConnectionState) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ScalingPlanList. +func (s *ScalingPlanList) 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) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "actionsRequired": - err = unpopulate(val, "ActionsRequired", &p.ActionsRequired) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &p.Description) + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &p.Status) + case "value": + err = unpopulate(val, "Value", &s.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type RegistrationInfo. -func (r RegistrationInfo) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ScalingPlanPatch. +func (s ScalingPlanPatch) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateDateTimeRFC3339(objectMap, "expirationTime", r.ExpirationTime) - populate(objectMap, "registrationTokenOperation", r.RegistrationTokenOperation) - populate(objectMap, "token", r.Token) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "tags", s.Tags) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RegistrationInfo. -func (r *RegistrationInfo) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ScalingPlanPatch. +func (s *ScalingPlanPatch) 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", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "expirationTime": - err = unpopulateDateTimeRFC3339(val, "ExpirationTime", &r.ExpirationTime) - delete(rawMsg, key) - case "registrationTokenOperation": - err = unpopulate(val, "RegistrationTokenOperation", &r.RegistrationTokenOperation) + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &s.Properties) delete(rawMsg, key) - case "token": - err = unpopulate(val, "Token", &r.Token) + case "tags": + err = unpopulate(val, "Tags", &s.Tags) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type RegistrationInfoPatch. -func (r RegistrationInfoPatch) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ScalingPlanPatchProperties. +func (s ScalingPlanPatchProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateDateTimeRFC3339(objectMap, "expirationTime", r.ExpirationTime) - populate(objectMap, "registrationTokenOperation", r.RegistrationTokenOperation) + populate(objectMap, "description", s.Description) + populate(objectMap, "exclusionTag", s.ExclusionTag) + populate(objectMap, "friendlyName", s.FriendlyName) + populate(objectMap, "hostPoolReferences", s.HostPoolReferences) + populate(objectMap, "schedules", s.Schedules) + populate(objectMap, "timeZone", s.TimeZone) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RegistrationInfoPatch. -func (r *RegistrationInfoPatch) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ScalingPlanPatchProperties. +func (s *ScalingPlanPatchProperties) 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", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "expirationTime": - err = unpopulateDateTimeRFC3339(val, "ExpirationTime", &r.ExpirationTime) + case "description": + err = unpopulate(val, "Description", &s.Description) delete(rawMsg, key) - case "registrationTokenOperation": - err = unpopulate(val, "RegistrationTokenOperation", &r.RegistrationTokenOperation) + case "exclusionTag": + err = unpopulate(val, "ExclusionTag", &s.ExclusionTag) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &s.FriendlyName) + delete(rawMsg, key) + case "hostPoolReferences": + err = unpopulate(val, "HostPoolReferences", &s.HostPoolReferences) + delete(rawMsg, key) + case "schedules": + err = unpopulate(val, "Schedules", &s.Schedules) + delete(rawMsg, key) + case "timeZone": + err = unpopulate(val, "TimeZone", &s.TimeZone) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ResourceModelWithAllowedPropertySetIdentity. -func (r ResourceModelWithAllowedPropertySetIdentity) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ScalingPlanPersonalSchedule. +func (s ScalingPlanPersonalSchedule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "principalId", r.PrincipalID) - populate(objectMap, "tenantId", r.TenantID) - objectMap["type"] = "SystemAssigned" + 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 ResourceModelWithAllowedPropertySetIdentity. -func (r *ResourceModelWithAllowedPropertySetIdentity) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ScalingPlanPersonalSchedule. +func (s *ScalingPlanPersonalSchedule) 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", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "principalId": - err = unpopulate(val, "PrincipalID", &r.PrincipalID) + case "id": + err = unpopulate(val, "ID", &s.ID) delete(rawMsg, key) - case "tenantId": - err = unpopulate(val, "TenantID", &r.TenantID) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &r.Type) + err = unpopulate(val, "Type", &s.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ResourceModelWithAllowedPropertySetPlan. -func (r ResourceModelWithAllowedPropertySetPlan) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ScalingPlanPersonalScheduleList. +func (s ScalingPlanPersonalScheduleList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "name", r.Name) - populate(objectMap, "product", r.Product) - populate(objectMap, "promotionCode", r.PromotionCode) - populate(objectMap, "publisher", r.Publisher) - populate(objectMap, "version", r.Version) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceModelWithAllowedPropertySetPlan. -func (r *ResourceModelWithAllowedPropertySetPlan) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ScalingPlanPersonalScheduleList. +func (s *ScalingPlanPersonalScheduleList) 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", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "product": - err = unpopulate(val, "Product", &r.Product) - delete(rawMsg, key) - case "promotionCode": - err = unpopulate(val, "PromotionCode", &r.PromotionCode) - delete(rawMsg, key) - case "publisher": - err = unpopulate(val, "Publisher", &r.Publisher) + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &r.Version) + case "value": + err = unpopulate(val, "Value", &s.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ResourceModelWithAllowedPropertySetSKU. -func (r ResourceModelWithAllowedPropertySetSKU) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ScalingPlanPersonalSchedulePatch. +func (s ScalingPlanPersonalSchedulePatch) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "capacity", r.Capacity) - populate(objectMap, "family", r.Family) - populate(objectMap, "name", r.Name) - populate(objectMap, "size", r.Size) - populate(objectMap, "tier", r.Tier) + populate(objectMap, "properties", s.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceModelWithAllowedPropertySetSKU. -func (r *ResourceModelWithAllowedPropertySetSKU) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ScalingPlanPersonalSchedulePatch. +func (s *ScalingPlanPersonalSchedulePatch) 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", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "capacity": - err = unpopulate(val, "Capacity", &r.Capacity) - delete(rawMsg, key) - case "family": - err = unpopulate(val, "Family", &r.Family) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "size": - err = unpopulate(val, "Size", &r.Size) - delete(rawMsg, key) - case "tier": - err = unpopulate(val, "Tier", &r.Tier) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ResourceProviderOperation. -func (r ResourceProviderOperation) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ScalingPlanPersonalScheduleProperties. +func (s ScalingPlanPersonalScheduleProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "display", r.Display) - populate(objectMap, "isDataAction", r.IsDataAction) - populate(objectMap, "name", r.Name) - populate(objectMap, "properties", r.Properties) + populate(objectMap, "daysOfWeek", s.DaysOfWeek) + populate(objectMap, "offPeakActionOnDisconnect", s.OffPeakActionOnDisconnect) + populate(objectMap, "offPeakActionOnLogoff", s.OffPeakActionOnLogoff) + populate(objectMap, "offPeakMinutesToWaitOnDisconnect", s.OffPeakMinutesToWaitOnDisconnect) + populate(objectMap, "offPeakMinutesToWaitOnLogoff", s.OffPeakMinutesToWaitOnLogoff) + populate(objectMap, "offPeakStartTime", s.OffPeakStartTime) + populate(objectMap, "offPeakStartVMOnConnect", s.OffPeakStartVMOnConnect) + populate(objectMap, "peakActionOnDisconnect", s.PeakActionOnDisconnect) + populate(objectMap, "peakActionOnLogoff", s.PeakActionOnLogoff) + populate(objectMap, "peakMinutesToWaitOnDisconnect", s.PeakMinutesToWaitOnDisconnect) + populate(objectMap, "peakMinutesToWaitOnLogoff", s.PeakMinutesToWaitOnLogoff) + populate(objectMap, "peakStartTime", s.PeakStartTime) + populate(objectMap, "peakStartVMOnConnect", s.PeakStartVMOnConnect) + populate(objectMap, "rampDownActionOnDisconnect", s.RampDownActionOnDisconnect) + populate(objectMap, "rampDownActionOnLogoff", s.RampDownActionOnLogoff) + populate(objectMap, "rampDownMinutesToWaitOnDisconnect", s.RampDownMinutesToWaitOnDisconnect) + populate(objectMap, "rampDownMinutesToWaitOnLogoff", s.RampDownMinutesToWaitOnLogoff) + populate(objectMap, "rampDownStartTime", s.RampDownStartTime) + populate(objectMap, "rampDownStartVMOnConnect", s.RampDownStartVMOnConnect) + populate(objectMap, "rampUpActionOnDisconnect", s.RampUpActionOnDisconnect) + populate(objectMap, "rampUpActionOnLogoff", s.RampUpActionOnLogoff) + populate(objectMap, "rampUpAutoStartHosts", s.RampUpAutoStartHosts) + populate(objectMap, "rampUpMinutesToWaitOnDisconnect", s.RampUpMinutesToWaitOnDisconnect) + populate(objectMap, "rampUpMinutesToWaitOnLogoff", s.RampUpMinutesToWaitOnLogoff) + populate(objectMap, "rampUpStartTime", s.RampUpStartTime) + populate(objectMap, "rampUpStartVMOnConnect", s.RampUpStartVMOnConnect) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderOperation. -func (r *ResourceProviderOperation) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ScalingPlanPersonalScheduleProperties. +func (s *ScalingPlanPersonalScheduleProperties) 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", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "display": - err = unpopulate(val, "Display", &r.Display) + case "daysOfWeek": + err = unpopulate(val, "DaysOfWeek", &s.DaysOfWeek) delete(rawMsg, key) - case "isDataAction": - err = unpopulate(val, "IsDataAction", &r.IsDataAction) + case "offPeakActionOnDisconnect": + err = unpopulate(val, "OffPeakActionOnDisconnect", &s.OffPeakActionOnDisconnect) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) + case "offPeakActionOnLogoff": + err = unpopulate(val, "OffPeakActionOnLogoff", &s.OffPeakActionOnLogoff) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &r.Properties) + case "offPeakMinutesToWaitOnDisconnect": + err = unpopulate(val, "OffPeakMinutesToWaitOnDisconnect", &s.OffPeakMinutesToWaitOnDisconnect) + delete(rawMsg, key) + case "offPeakMinutesToWaitOnLogoff": + err = unpopulate(val, "OffPeakMinutesToWaitOnLogoff", &s.OffPeakMinutesToWaitOnLogoff) + delete(rawMsg, key) + case "offPeakStartTime": + err = unpopulate(val, "OffPeakStartTime", &s.OffPeakStartTime) + delete(rawMsg, key) + case "offPeakStartVMOnConnect": + err = unpopulate(val, "OffPeakStartVMOnConnect", &s.OffPeakStartVMOnConnect) + delete(rawMsg, key) + case "peakActionOnDisconnect": + err = unpopulate(val, "PeakActionOnDisconnect", &s.PeakActionOnDisconnect) + delete(rawMsg, key) + case "peakActionOnLogoff": + err = unpopulate(val, "PeakActionOnLogoff", &s.PeakActionOnLogoff) + delete(rawMsg, key) + case "peakMinutesToWaitOnDisconnect": + err = unpopulate(val, "PeakMinutesToWaitOnDisconnect", &s.PeakMinutesToWaitOnDisconnect) + delete(rawMsg, key) + case "peakMinutesToWaitOnLogoff": + err = unpopulate(val, "PeakMinutesToWaitOnLogoff", &s.PeakMinutesToWaitOnLogoff) + delete(rawMsg, key) + case "peakStartTime": + err = unpopulate(val, "PeakStartTime", &s.PeakStartTime) + delete(rawMsg, key) + case "peakStartVMOnConnect": + err = unpopulate(val, "PeakStartVMOnConnect", &s.PeakStartVMOnConnect) + delete(rawMsg, key) + case "rampDownActionOnDisconnect": + err = unpopulate(val, "RampDownActionOnDisconnect", &s.RampDownActionOnDisconnect) + delete(rawMsg, key) + case "rampDownActionOnLogoff": + err = unpopulate(val, "RampDownActionOnLogoff", &s.RampDownActionOnLogoff) + delete(rawMsg, key) + case "rampDownMinutesToWaitOnDisconnect": + err = unpopulate(val, "RampDownMinutesToWaitOnDisconnect", &s.RampDownMinutesToWaitOnDisconnect) + delete(rawMsg, key) + case "rampDownMinutesToWaitOnLogoff": + err = unpopulate(val, "RampDownMinutesToWaitOnLogoff", &s.RampDownMinutesToWaitOnLogoff) + delete(rawMsg, key) + case "rampDownStartTime": + err = unpopulate(val, "RampDownStartTime", &s.RampDownStartTime) + delete(rawMsg, key) + case "rampDownStartVMOnConnect": + err = unpopulate(val, "RampDownStartVMOnConnect", &s.RampDownStartVMOnConnect) + delete(rawMsg, key) + case "rampUpActionOnDisconnect": + err = unpopulate(val, "RampUpActionOnDisconnect", &s.RampUpActionOnDisconnect) + delete(rawMsg, key) + case "rampUpActionOnLogoff": + err = unpopulate(val, "RampUpActionOnLogoff", &s.RampUpActionOnLogoff) + delete(rawMsg, key) + case "rampUpAutoStartHosts": + err = unpopulate(val, "RampUpAutoStartHosts", &s.RampUpAutoStartHosts) + delete(rawMsg, key) + case "rampUpMinutesToWaitOnDisconnect": + err = unpopulate(val, "RampUpMinutesToWaitOnDisconnect", &s.RampUpMinutesToWaitOnDisconnect) + delete(rawMsg, key) + case "rampUpMinutesToWaitOnLogoff": + err = unpopulate(val, "RampUpMinutesToWaitOnLogoff", &s.RampUpMinutesToWaitOnLogoff) + delete(rawMsg, key) + case "rampUpStartTime": + err = unpopulate(val, "RampUpStartTime", &s.RampUpStartTime) + delete(rawMsg, key) + case "rampUpStartVMOnConnect": + err = unpopulate(val, "RampUpStartVMOnConnect", &s.RampUpStartVMOnConnect) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ResourceProviderOperationDisplay. -func (r ResourceProviderOperationDisplay) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "description", r.Description) - populate(objectMap, "operation", r.Operation) - populate(objectMap, "provider", r.Provider) - populate(objectMap, "resource", r.Resource) +// MarshalJSON implements the json.Marshaller interface for type ScalingPlanPooledSchedule. +func (s ScalingPlanPooledSchedule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 ResourceProviderOperationDisplay. -func (r *ResourceProviderOperationDisplay) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ScalingPlanPooledSchedule. +func (s *ScalingPlanPooledSchedule) 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", r, err) + 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", &r.Description) + case "id": + err = unpopulate(val, "ID", &s.ID) delete(rawMsg, key) - case "operation": - err = unpopulate(val, "Operation", &r.Operation) + case "name": + err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) - case "provider": - err = unpopulate(val, "Provider", &r.Provider) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) delete(rawMsg, key) - case "resource": - err = unpopulate(val, "Resource", &r.Resource) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ResourceProviderOperationList. -func (r ResourceProviderOperationList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ScalingPlanPooledScheduleList. +func (s ScalingPlanPooledScheduleList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", r.NextLink) - populate(objectMap, "value", r.Value) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderOperationList. -func (r *ResourceProviderOperationList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ScalingPlanPooledScheduleList. +func (s *ScalingPlanPooledScheduleList) 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", r, err) + 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", &r.NextLink) + err = unpopulate(val, "NextLink", &s.NextLink) delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &r.Value) + err = unpopulate(val, "Value", &s.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ScalingHostPoolReference. -func (s ScalingHostPoolReference) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ScalingPlanPooledSchedulePatch. +func (s ScalingPlanPooledSchedulePatch) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "hostPoolArmPath", s.HostPoolArmPath) - populate(objectMap, "scalingPlanEnabled", s.ScalingPlanEnabled) + 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 ScalingHostPoolReference. -func (s *ScalingHostPoolReference) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ScalingPlanPooledSchedulePatch. +func (s *ScalingPlanPooledSchedulePatch) 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) @@ -2347,11 +4311,20 @@ func (s *ScalingHostPoolReference) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "hostPoolArmPath": - err = unpopulate(val, "HostPoolArmPath", &s.HostPoolArmPath) + case "id": + err = unpopulate(val, "ID", &s.ID) delete(rawMsg, key) - case "scalingPlanEnabled": - err = unpopulate(val, "ScalingPlanEnabled", &s.ScalingPlanEnabled) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) delete(rawMsg, key) } if err != nil { @@ -2361,27 +4334,31 @@ func (s *ScalingHostPoolReference) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ScalingPlan. -func (s ScalingPlan) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ScalingPlanPooledScheduleProperties. +func (s ScalingPlanPooledScheduleProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "etag", s.Etag) - populate(objectMap, "id", s.ID) - populate(objectMap, "identity", s.Identity) - populate(objectMap, "kind", s.Kind) - populate(objectMap, "location", s.Location) - populate(objectMap, "managedBy", s.ManagedBy) - populate(objectMap, "name", s.Name) - populate(objectMap, "plan", s.Plan) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "sku", s.SKU) - populate(objectMap, "systemData", s.SystemData) - populate(objectMap, "tags", s.Tags) - populate(objectMap, "type", s.Type) + populate(objectMap, "daysOfWeek", s.DaysOfWeek) + populate(objectMap, "offPeakLoadBalancingAlgorithm", s.OffPeakLoadBalancingAlgorithm) + populate(objectMap, "offPeakStartTime", s.OffPeakStartTime) + populate(objectMap, "peakLoadBalancingAlgorithm", s.PeakLoadBalancingAlgorithm) + populate(objectMap, "peakStartTime", s.PeakStartTime) + populate(objectMap, "rampDownCapacityThresholdPct", s.RampDownCapacityThresholdPct) + populate(objectMap, "rampDownForceLogoffUsers", s.RampDownForceLogoffUsers) + populate(objectMap, "rampDownLoadBalancingAlgorithm", s.RampDownLoadBalancingAlgorithm) + populate(objectMap, "rampDownMinimumHostsPct", s.RampDownMinimumHostsPct) + populate(objectMap, "rampDownNotificationMessage", s.RampDownNotificationMessage) + populate(objectMap, "rampDownStartTime", s.RampDownStartTime) + populate(objectMap, "rampDownStopHostsWhen", s.RampDownStopHostsWhen) + populate(objectMap, "rampDownWaitTimeMinutes", s.RampDownWaitTimeMinutes) + populate(objectMap, "rampUpCapacityThresholdPct", s.RampUpCapacityThresholdPct) + populate(objectMap, "rampUpLoadBalancingAlgorithm", s.RampUpLoadBalancingAlgorithm) + populate(objectMap, "rampUpMinimumHostsPct", s.RampUpMinimumHostsPct) + populate(objectMap, "rampUpStartTime", s.RampUpStartTime) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ScalingPlan. -func (s *ScalingPlan) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ScalingPlanPooledScheduleProperties. +func (s *ScalingPlanPooledScheduleProperties) 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) @@ -2389,44 +4366,56 @@ func (s *ScalingPlan) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "etag": - err = unpopulate(val, "Etag", &s.Etag) + case "daysOfWeek": + err = unpopulate(val, "DaysOfWeek", &s.DaysOfWeek) delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &s.ID) + case "offPeakLoadBalancingAlgorithm": + err = unpopulate(val, "OffPeakLoadBalancingAlgorithm", &s.OffPeakLoadBalancingAlgorithm) delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &s.Identity) + case "offPeakStartTime": + err = unpopulate(val, "OffPeakStartTime", &s.OffPeakStartTime) delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &s.Kind) + case "peakLoadBalancingAlgorithm": + err = unpopulate(val, "PeakLoadBalancingAlgorithm", &s.PeakLoadBalancingAlgorithm) delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &s.Location) + case "peakStartTime": + err = unpopulate(val, "PeakStartTime", &s.PeakStartTime) delete(rawMsg, key) - case "managedBy": - err = unpopulate(val, "ManagedBy", &s.ManagedBy) + case "rampDownCapacityThresholdPct": + err = unpopulate(val, "RampDownCapacityThresholdPct", &s.RampDownCapacityThresholdPct) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) + case "rampDownForceLogoffUsers": + err = unpopulate(val, "RampDownForceLogoffUsers", &s.RampDownForceLogoffUsers) delete(rawMsg, key) - case "plan": - err = unpopulate(val, "Plan", &s.Plan) + case "rampDownLoadBalancingAlgorithm": + err = unpopulate(val, "RampDownLoadBalancingAlgorithm", &s.RampDownLoadBalancingAlgorithm) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &s.Properties) + case "rampDownMinimumHostsPct": + err = unpopulate(val, "RampDownMinimumHostsPct", &s.RampDownMinimumHostsPct) delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &s.SKU) + case "rampDownNotificationMessage": + err = unpopulate(val, "RampDownNotificationMessage", &s.RampDownNotificationMessage) delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &s.SystemData) + case "rampDownStartTime": + err = unpopulate(val, "RampDownStartTime", &s.RampDownStartTime) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &s.Tags) + case "rampDownStopHostsWhen": + err = unpopulate(val, "RampDownStopHostsWhen", &s.RampDownStopHostsWhen) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) + case "rampDownWaitTimeMinutes": + err = unpopulate(val, "RampDownWaitTimeMinutes", &s.RampDownWaitTimeMinutes) + delete(rawMsg, key) + case "rampUpCapacityThresholdPct": + err = unpopulate(val, "RampUpCapacityThresholdPct", &s.RampUpCapacityThresholdPct) + delete(rawMsg, key) + case "rampUpLoadBalancingAlgorithm": + err = unpopulate(val, "RampUpLoadBalancingAlgorithm", &s.RampUpLoadBalancingAlgorithm) + delete(rawMsg, key) + case "rampUpMinimumHostsPct": + err = unpopulate(val, "RampUpMinimumHostsPct", &s.RampUpMinimumHostsPct) + delete(rawMsg, key) + case "rampUpStartTime": + err = unpopulate(val, "RampUpStartTime", &s.RampUpStartTime) delete(rawMsg, key) } if err != nil { @@ -2436,16 +4425,22 @@ func (s *ScalingPlan) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ScalingPlanList. -func (s ScalingPlanList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ScalingPlanProperties. +func (s ScalingPlanProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) + populate(objectMap, "description", s.Description) + populate(objectMap, "exclusionTag", s.ExclusionTag) + populate(objectMap, "friendlyName", s.FriendlyName) + populate(objectMap, "hostPoolReferences", s.HostPoolReferences) + populate(objectMap, "hostPoolType", s.HostPoolType) + populate(objectMap, "objectId", s.ObjectID) + populate(objectMap, "schedules", s.Schedules) + populate(objectMap, "timeZone", s.TimeZone) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ScalingPlanList. -func (s *ScalingPlanList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ScalingPlanProperties. +func (s *ScalingPlanProperties) 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) @@ -2453,11 +4448,29 @@ func (s *ScalingPlanList) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &s.NextLink) + case "description": + err = unpopulate(val, "Description", &s.Description) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &s.Value) + case "exclusionTag": + err = unpopulate(val, "ExclusionTag", &s.ExclusionTag) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &s.FriendlyName) + delete(rawMsg, key) + case "hostPoolReferences": + err = unpopulate(val, "HostPoolReferences", &s.HostPoolReferences) + delete(rawMsg, key) + case "hostPoolType": + err = unpopulate(val, "HostPoolType", &s.HostPoolType) + delete(rawMsg, key) + case "objectId": + err = unpopulate(val, "ObjectID", &s.ObjectID) + delete(rawMsg, key) + case "schedules": + err = unpopulate(val, "Schedules", &s.Schedules) + delete(rawMsg, key) + case "timeZone": + err = unpopulate(val, "TimeZone", &s.TimeZone) delete(rawMsg, key) } if err != nil { @@ -2467,16 +4480,32 @@ func (s *ScalingPlanList) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ScalingPlanPatch. -func (s ScalingPlanPatch) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ScalingSchedule. +func (s ScalingSchedule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "tags", s.Tags) + populate(objectMap, "daysOfWeek", s.DaysOfWeek) + populate(objectMap, "name", s.Name) + populate(objectMap, "offPeakLoadBalancingAlgorithm", s.OffPeakLoadBalancingAlgorithm) + populate(objectMap, "offPeakStartTime", s.OffPeakStartTime) + populate(objectMap, "peakLoadBalancingAlgorithm", s.PeakLoadBalancingAlgorithm) + populate(objectMap, "peakStartTime", s.PeakStartTime) + populate(objectMap, "rampDownCapacityThresholdPct", s.RampDownCapacityThresholdPct) + populate(objectMap, "rampDownForceLogoffUsers", s.RampDownForceLogoffUsers) + populate(objectMap, "rampDownLoadBalancingAlgorithm", s.RampDownLoadBalancingAlgorithm) + populate(objectMap, "rampDownMinimumHostsPct", s.RampDownMinimumHostsPct) + populate(objectMap, "rampDownNotificationMessage", s.RampDownNotificationMessage) + populate(objectMap, "rampDownStartTime", s.RampDownStartTime) + populate(objectMap, "rampDownStopHostsWhen", s.RampDownStopHostsWhen) + populate(objectMap, "rampDownWaitTimeMinutes", s.RampDownWaitTimeMinutes) + populate(objectMap, "rampUpCapacityThresholdPct", s.RampUpCapacityThresholdPct) + populate(objectMap, "rampUpLoadBalancingAlgorithm", s.RampUpLoadBalancingAlgorithm) + populate(objectMap, "rampUpMinimumHostsPct", s.RampUpMinimumHostsPct) + populate(objectMap, "rampUpStartTime", s.RampUpStartTime) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ScalingPlanPatch. -func (s *ScalingPlanPatch) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ScalingSchedule. +func (s *ScalingSchedule) 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) @@ -2484,11 +4513,59 @@ func (s *ScalingPlanPatch) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "properties": - err = unpopulate(val, "Properties", &s.Properties) + case "daysOfWeek": + err = unpopulate(val, "DaysOfWeek", &s.DaysOfWeek) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &s.Tags) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "offPeakLoadBalancingAlgorithm": + err = unpopulate(val, "OffPeakLoadBalancingAlgorithm", &s.OffPeakLoadBalancingAlgorithm) + delete(rawMsg, key) + case "offPeakStartTime": + err = unpopulate(val, "OffPeakStartTime", &s.OffPeakStartTime) + delete(rawMsg, key) + case "peakLoadBalancingAlgorithm": + err = unpopulate(val, "PeakLoadBalancingAlgorithm", &s.PeakLoadBalancingAlgorithm) + delete(rawMsg, key) + case "peakStartTime": + err = unpopulate(val, "PeakStartTime", &s.PeakStartTime) + delete(rawMsg, key) + case "rampDownCapacityThresholdPct": + err = unpopulate(val, "RampDownCapacityThresholdPct", &s.RampDownCapacityThresholdPct) + delete(rawMsg, key) + case "rampDownForceLogoffUsers": + err = unpopulate(val, "RampDownForceLogoffUsers", &s.RampDownForceLogoffUsers) + delete(rawMsg, key) + case "rampDownLoadBalancingAlgorithm": + err = unpopulate(val, "RampDownLoadBalancingAlgorithm", &s.RampDownLoadBalancingAlgorithm) + delete(rawMsg, key) + case "rampDownMinimumHostsPct": + err = unpopulate(val, "RampDownMinimumHostsPct", &s.RampDownMinimumHostsPct) + delete(rawMsg, key) + case "rampDownNotificationMessage": + err = unpopulate(val, "RampDownNotificationMessage", &s.RampDownNotificationMessage) + delete(rawMsg, key) + case "rampDownStartTime": + err = unpopulate(val, "RampDownStartTime", &s.RampDownStartTime) + delete(rawMsg, key) + case "rampDownStopHostsWhen": + err = unpopulate(val, "RampDownStopHostsWhen", &s.RampDownStopHostsWhen) + delete(rawMsg, key) + case "rampDownWaitTimeMinutes": + err = unpopulate(val, "RampDownWaitTimeMinutes", &s.RampDownWaitTimeMinutes) + delete(rawMsg, key) + case "rampUpCapacityThresholdPct": + err = unpopulate(val, "RampUpCapacityThresholdPct", &s.RampUpCapacityThresholdPct) + delete(rawMsg, key) + case "rampUpLoadBalancingAlgorithm": + err = unpopulate(val, "RampUpLoadBalancingAlgorithm", &s.RampUpLoadBalancingAlgorithm) + delete(rawMsg, key) + case "rampUpMinimumHostsPct": + err = unpopulate(val, "RampUpMinimumHostsPct", &s.RampUpMinimumHostsPct) + delete(rawMsg, key) + case "rampUpStartTime": + err = unpopulate(val, "RampUpStartTime", &s.RampUpStartTime) delete(rawMsg, key) } if err != nil { @@ -2498,20 +4575,17 @@ func (s *ScalingPlanPatch) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ScalingPlanPatchProperties. -func (s ScalingPlanPatchProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SecurityInfoPatchProperties. +func (s SecurityInfoPatchProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", s.Description) - populate(objectMap, "exclusionTag", s.ExclusionTag) - populate(objectMap, "friendlyName", s.FriendlyName) - populate(objectMap, "hostPoolReferences", s.HostPoolReferences) - populate(objectMap, "schedules", s.Schedules) - populate(objectMap, "timeZone", s.TimeZone) + populate(objectMap, "secureBootEnabled", s.SecureBootEnabled) + populate(objectMap, "type", s.Type) + populate(objectMap, "vTpmEnabled", s.VTpmEnabled) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ScalingPlanPatchProperties. -func (s *ScalingPlanPatchProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityInfoPatchProperties. +func (s *SecurityInfoPatchProperties) 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) @@ -2519,23 +4593,14 @@ func (s *ScalingPlanPatchProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "description": - err = unpopulate(val, "Description", &s.Description) - delete(rawMsg, key) - case "exclusionTag": - err = unpopulate(val, "ExclusionTag", &s.ExclusionTag) - delete(rawMsg, key) - case "friendlyName": - err = unpopulate(val, "FriendlyName", &s.FriendlyName) - delete(rawMsg, key) - case "hostPoolReferences": - err = unpopulate(val, "HostPoolReferences", &s.HostPoolReferences) + case "secureBootEnabled": + err = unpopulate(val, "SecureBootEnabled", &s.SecureBootEnabled) delete(rawMsg, key) - case "schedules": - err = unpopulate(val, "Schedules", &s.Schedules) + case "type": + err = unpopulate(val, "Type", &s.Type) delete(rawMsg, key) - case "timeZone": - err = unpopulate(val, "TimeZone", &s.TimeZone) + case "vTpmEnabled": + err = unpopulate(val, "VTpmEnabled", &s.VTpmEnabled) delete(rawMsg, key) } if err != nil { @@ -2545,19 +4610,17 @@ func (s *ScalingPlanPatchProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ScalingPlanPersonalSchedule. -func (s ScalingPlanPersonalSchedule) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SecurityInfoProperties. +func (s SecurityInfoProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", s.ID) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "secureBootEnabled", s.SecureBootEnabled) populate(objectMap, "type", s.Type) + populate(objectMap, "vTpmEnabled", s.VTpmEnabled) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ScalingPlanPersonalSchedule. -func (s *ScalingPlanPersonalSchedule) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityInfoProperties. +func (s *SecurityInfoProperties) 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) @@ -2565,21 +4628,15 @@ func (s *ScalingPlanPersonalSchedule) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &s.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &s.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &s.SystemData) + case "secureBootEnabled": + err = unpopulate(val, "SecureBootEnabled", &s.SecureBootEnabled) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &s.Type) delete(rawMsg, key) + case "vTpmEnabled": + err = unpopulate(val, "VTpmEnabled", &s.VTpmEnabled) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -2588,16 +4645,16 @@ func (s *ScalingPlanPersonalSchedule) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ScalingPlanPersonalScheduleList. -func (s ScalingPlanPersonalScheduleList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SendMessage. +func (s SendMessage) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) + populate(objectMap, "messageBody", s.MessageBody) + populate(objectMap, "messageTitle", s.MessageTitle) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ScalingPlanPersonalScheduleList. -func (s *ScalingPlanPersonalScheduleList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SendMessage. +func (s *SendMessage) 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) @@ -2605,11 +4662,11 @@ func (s *ScalingPlanPersonalScheduleList) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &s.NextLink) + case "messageBody": + err = unpopulate(val, "MessageBody", &s.MessageBody) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &s.Value) + case "messageTitle": + err = unpopulate(val, "MessageTitle", &s.MessageTitle) delete(rawMsg, key) } if err != nil { @@ -2619,15 +4676,15 @@ func (s *ScalingPlanPersonalScheduleList) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ScalingPlanPersonalSchedulePatch. -func (s ScalingPlanPersonalSchedulePatch) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServiceSpecification. +func (s ServiceSpecification) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", s.Properties) + populate(objectMap, "logSpecifications", s.LogSpecifications) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ScalingPlanPersonalSchedulePatch. -func (s *ScalingPlanPersonalSchedulePatch) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceSpecification. +func (s *ServiceSpecification) 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) @@ -2635,8 +4692,8 @@ func (s *ScalingPlanPersonalSchedulePatch) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "properties": - err = unpopulate(val, "Properties", &s.Properties) + case "logSpecifications": + err = unpopulate(val, "LogSpecifications", &s.LogSpecifications) delete(rawMsg, key) } if err != nil { @@ -2646,40 +4703,19 @@ func (s *ScalingPlanPersonalSchedulePatch) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ScalingPlanPersonalScheduleProperties. -func (s ScalingPlanPersonalScheduleProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SessionHost. +func (s SessionHost) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "daysOfWeek", s.DaysOfWeek) - populate(objectMap, "offPeakActionOnDisconnect", s.OffPeakActionOnDisconnect) - populate(objectMap, "offPeakActionOnLogoff", s.OffPeakActionOnLogoff) - populate(objectMap, "offPeakMinutesToWaitOnDisconnect", s.OffPeakMinutesToWaitOnDisconnect) - populate(objectMap, "offPeakMinutesToWaitOnLogoff", s.OffPeakMinutesToWaitOnLogoff) - populate(objectMap, "offPeakStartTime", s.OffPeakStartTime) - populate(objectMap, "offPeakStartVMOnConnect", s.OffPeakStartVMOnConnect) - populate(objectMap, "peakActionOnDisconnect", s.PeakActionOnDisconnect) - populate(objectMap, "peakActionOnLogoff", s.PeakActionOnLogoff) - populate(objectMap, "peakMinutesToWaitOnDisconnect", s.PeakMinutesToWaitOnDisconnect) - populate(objectMap, "peakMinutesToWaitOnLogoff", s.PeakMinutesToWaitOnLogoff) - populate(objectMap, "peakStartTime", s.PeakStartTime) - populate(objectMap, "peakStartVMOnConnect", s.PeakStartVMOnConnect) - populate(objectMap, "rampDownActionOnDisconnect", s.RampDownActionOnDisconnect) - populate(objectMap, "rampDownActionOnLogoff", s.RampDownActionOnLogoff) - populate(objectMap, "rampDownMinutesToWaitOnDisconnect", s.RampDownMinutesToWaitOnDisconnect) - populate(objectMap, "rampDownMinutesToWaitOnLogoff", s.RampDownMinutesToWaitOnLogoff) - populate(objectMap, "rampDownStartTime", s.RampDownStartTime) - populate(objectMap, "rampDownStartVMOnConnect", s.RampDownStartVMOnConnect) - populate(objectMap, "rampUpActionOnDisconnect", s.RampUpActionOnDisconnect) - populate(objectMap, "rampUpActionOnLogoff", s.RampUpActionOnLogoff) - populate(objectMap, "rampUpAutoStartHosts", s.RampUpAutoStartHosts) - populate(objectMap, "rampUpMinutesToWaitOnDisconnect", s.RampUpMinutesToWaitOnDisconnect) - populate(objectMap, "rampUpMinutesToWaitOnLogoff", s.RampUpMinutesToWaitOnLogoff) - populate(objectMap, "rampUpStartTime", s.RampUpStartTime) - populate(objectMap, "rampUpStartVMOnConnect", s.RampUpStartVMOnConnect) + 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 ScalingPlanPersonalScheduleProperties. -func (s *ScalingPlanPersonalScheduleProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SessionHost. +func (s *SessionHost) 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) @@ -2687,83 +4723,20 @@ func (s *ScalingPlanPersonalScheduleProperties) UnmarshalJSON(data []byte) error for key, val := range rawMsg { var err error switch key { - case "daysOfWeek": - err = unpopulate(val, "DaysOfWeek", &s.DaysOfWeek) - delete(rawMsg, key) - case "offPeakActionOnDisconnect": - err = unpopulate(val, "OffPeakActionOnDisconnect", &s.OffPeakActionOnDisconnect) - delete(rawMsg, key) - case "offPeakActionOnLogoff": - err = unpopulate(val, "OffPeakActionOnLogoff", &s.OffPeakActionOnLogoff) - delete(rawMsg, key) - case "offPeakMinutesToWaitOnDisconnect": - err = unpopulate(val, "OffPeakMinutesToWaitOnDisconnect", &s.OffPeakMinutesToWaitOnDisconnect) - delete(rawMsg, key) - case "offPeakMinutesToWaitOnLogoff": - err = unpopulate(val, "OffPeakMinutesToWaitOnLogoff", &s.OffPeakMinutesToWaitOnLogoff) - delete(rawMsg, key) - case "offPeakStartTime": - err = unpopulate(val, "OffPeakStartTime", &s.OffPeakStartTime) - delete(rawMsg, key) - case "offPeakStartVMOnConnect": - err = unpopulate(val, "OffPeakStartVMOnConnect", &s.OffPeakStartVMOnConnect) - delete(rawMsg, key) - case "peakActionOnDisconnect": - err = unpopulate(val, "PeakActionOnDisconnect", &s.PeakActionOnDisconnect) - delete(rawMsg, key) - case "peakActionOnLogoff": - err = unpopulate(val, "PeakActionOnLogoff", &s.PeakActionOnLogoff) - delete(rawMsg, key) - case "peakMinutesToWaitOnDisconnect": - err = unpopulate(val, "PeakMinutesToWaitOnDisconnect", &s.PeakMinutesToWaitOnDisconnect) - delete(rawMsg, key) - case "peakMinutesToWaitOnLogoff": - err = unpopulate(val, "PeakMinutesToWaitOnLogoff", &s.PeakMinutesToWaitOnLogoff) - delete(rawMsg, key) - case "peakStartTime": - err = unpopulate(val, "PeakStartTime", &s.PeakStartTime) - delete(rawMsg, key) - case "peakStartVMOnConnect": - err = unpopulate(val, "PeakStartVMOnConnect", &s.PeakStartVMOnConnect) - delete(rawMsg, key) - case "rampDownActionOnDisconnect": - err = unpopulate(val, "RampDownActionOnDisconnect", &s.RampDownActionOnDisconnect) - delete(rawMsg, key) - case "rampDownActionOnLogoff": - err = unpopulate(val, "RampDownActionOnLogoff", &s.RampDownActionOnLogoff) - delete(rawMsg, key) - case "rampDownMinutesToWaitOnDisconnect": - err = unpopulate(val, "RampDownMinutesToWaitOnDisconnect", &s.RampDownMinutesToWaitOnDisconnect) - delete(rawMsg, key) - case "rampDownMinutesToWaitOnLogoff": - err = unpopulate(val, "RampDownMinutesToWaitOnLogoff", &s.RampDownMinutesToWaitOnLogoff) - delete(rawMsg, key) - case "rampDownStartTime": - err = unpopulate(val, "RampDownStartTime", &s.RampDownStartTime) - delete(rawMsg, key) - case "rampDownStartVMOnConnect": - err = unpopulate(val, "RampDownStartVMOnConnect", &s.RampDownStartVMOnConnect) - delete(rawMsg, key) - case "rampUpActionOnDisconnect": - err = unpopulate(val, "RampUpActionOnDisconnect", &s.RampUpActionOnDisconnect) - delete(rawMsg, key) - case "rampUpActionOnLogoff": - err = unpopulate(val, "RampUpActionOnLogoff", &s.RampUpActionOnLogoff) - delete(rawMsg, key) - case "rampUpAutoStartHosts": - err = unpopulate(val, "RampUpAutoStartHosts", &s.RampUpAutoStartHosts) + case "id": + err = unpopulate(val, "ID", &s.ID) delete(rawMsg, key) - case "rampUpMinutesToWaitOnDisconnect": - err = unpopulate(val, "RampUpMinutesToWaitOnDisconnect", &s.RampUpMinutesToWaitOnDisconnect) + case "name": + err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) - case "rampUpMinutesToWaitOnLogoff": - err = unpopulate(val, "RampUpMinutesToWaitOnLogoff", &s.RampUpMinutesToWaitOnLogoff) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) delete(rawMsg, key) - case "rampUpStartTime": - err = unpopulate(val, "RampUpStartTime", &s.RampUpStartTime) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) delete(rawMsg, key) - case "rampUpStartVMOnConnect": - err = unpopulate(val, "RampUpStartVMOnConnect", &s.RampUpStartVMOnConnect) + case "type": + err = unpopulate(val, "Type", &s.Type) delete(rawMsg, key) } if err != nil { @@ -2773,8 +4746,8 @@ func (s *ScalingPlanPersonalScheduleProperties) UnmarshalJSON(data []byte) error return nil } -// MarshalJSON implements the json.Marshaller interface for type ScalingPlanPooledSchedule. -func (s ScalingPlanPooledSchedule) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SessionHostConfiguration. +func (s SessionHostConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", s.ID) populate(objectMap, "name", s.Name) @@ -2784,8 +4757,8 @@ func (s ScalingPlanPooledSchedule) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ScalingPlanPooledSchedule. -func (s *ScalingPlanPooledSchedule) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SessionHostConfiguration. +func (s *SessionHostConfiguration) 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) @@ -2816,16 +4789,16 @@ func (s *ScalingPlanPooledSchedule) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ScalingPlanPooledScheduleList. -func (s ScalingPlanPooledScheduleList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SessionHostConfigurationList. +func (s SessionHostConfigurationList) 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 ScalingPlanPooledScheduleList. -func (s *ScalingPlanPooledScheduleList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SessionHostConfigurationList. +func (s *SessionHostConfigurationList) 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) @@ -2847,18 +4820,15 @@ func (s *ScalingPlanPooledScheduleList) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ScalingPlanPooledSchedulePatch. -func (s ScalingPlanPooledSchedulePatch) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SessionHostConfigurationPatch. +func (s SessionHostConfigurationPatch) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", s.ID) - populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) - populate(objectMap, "type", s.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ScalingPlanPooledSchedulePatch. -func (s *ScalingPlanPooledSchedulePatch) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SessionHostConfigurationPatch. +func (s *SessionHostConfigurationPatch) 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) @@ -2866,18 +4836,9 @@ func (s *ScalingPlanPooledSchedulePatch) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &s.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) - delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &s.Properties) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) - delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -2886,31 +4847,29 @@ func (s *ScalingPlanPooledSchedulePatch) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ScalingPlanPooledScheduleProperties. -func (s ScalingPlanPooledScheduleProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SessionHostConfigurationPatchProperties. +func (s SessionHostConfigurationPatchProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "daysOfWeek", s.DaysOfWeek) - populate(objectMap, "offPeakLoadBalancingAlgorithm", s.OffPeakLoadBalancingAlgorithm) - populate(objectMap, "offPeakStartTime", s.OffPeakStartTime) - populate(objectMap, "peakLoadBalancingAlgorithm", s.PeakLoadBalancingAlgorithm) - populate(objectMap, "peakStartTime", s.PeakStartTime) - populate(objectMap, "rampDownCapacityThresholdPct", s.RampDownCapacityThresholdPct) - populate(objectMap, "rampDownForceLogoffUsers", s.RampDownForceLogoffUsers) - populate(objectMap, "rampDownLoadBalancingAlgorithm", s.RampDownLoadBalancingAlgorithm) - populate(objectMap, "rampDownMinimumHostsPct", s.RampDownMinimumHostsPct) - populate(objectMap, "rampDownNotificationMessage", s.RampDownNotificationMessage) - populate(objectMap, "rampDownStartTime", s.RampDownStartTime) - populate(objectMap, "rampDownStopHostsWhen", s.RampDownStopHostsWhen) - populate(objectMap, "rampDownWaitTimeMinutes", s.RampDownWaitTimeMinutes) - populate(objectMap, "rampUpCapacityThresholdPct", s.RampUpCapacityThresholdPct) - populate(objectMap, "rampUpLoadBalancingAlgorithm", s.RampUpLoadBalancingAlgorithm) - populate(objectMap, "rampUpMinimumHostsPct", s.RampUpMinimumHostsPct) - populate(objectMap, "rampUpStartTime", s.RampUpStartTime) + populate(objectMap, "availabilityZones", s.AvailabilityZones) + populate(objectMap, "bootDiagnosticsInfo", s.BootDiagnosticsInfo) + populate(objectMap, "customConfigurationScriptUrl", s.CustomConfigurationScriptURL) + populate(objectMap, "diskInfo", s.DiskInfo) + populate(objectMap, "domainInfo", s.DomainInfo) + populate(objectMap, "friendlyName", s.FriendlyName) + populate(objectMap, "imageInfo", s.ImageInfo) + populate(objectMap, "networkInfo", s.NetworkInfo) + populate(objectMap, "securityInfo", s.SecurityInfo) + populate(objectMap, "vmAdminCredentials", s.VMAdminCredentials) + populate(objectMap, "vmLocation", s.VMLocation) + populate(objectMap, "vmNamePrefix", s.VMNamePrefix) + populate(objectMap, "vmResourceGroup", s.VMResourceGroup) + populate(objectMap, "vmSizeId", s.VMSizeID) + populate(objectMap, "vmTags", s.VMTags) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ScalingPlanPooledScheduleProperties. -func (s *ScalingPlanPooledScheduleProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SessionHostConfigurationPatchProperties. +func (s *SessionHostConfigurationPatchProperties) 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) @@ -2918,56 +4877,50 @@ func (s *ScalingPlanPooledScheduleProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "daysOfWeek": - err = unpopulate(val, "DaysOfWeek", &s.DaysOfWeek) + case "availabilityZones": + err = unpopulate(val, "AvailabilityZones", &s.AvailabilityZones) delete(rawMsg, key) - case "offPeakLoadBalancingAlgorithm": - err = unpopulate(val, "OffPeakLoadBalancingAlgorithm", &s.OffPeakLoadBalancingAlgorithm) - delete(rawMsg, key) - case "offPeakStartTime": - err = unpopulate(val, "OffPeakStartTime", &s.OffPeakStartTime) - delete(rawMsg, key) - case "peakLoadBalancingAlgorithm": - err = unpopulate(val, "PeakLoadBalancingAlgorithm", &s.PeakLoadBalancingAlgorithm) + case "bootDiagnosticsInfo": + err = unpopulate(val, "BootDiagnosticsInfo", &s.BootDiagnosticsInfo) delete(rawMsg, key) - case "peakStartTime": - err = unpopulate(val, "PeakStartTime", &s.PeakStartTime) + case "customConfigurationScriptUrl": + err = unpopulate(val, "CustomConfigurationScriptURL", &s.CustomConfigurationScriptURL) delete(rawMsg, key) - case "rampDownCapacityThresholdPct": - err = unpopulate(val, "RampDownCapacityThresholdPct", &s.RampDownCapacityThresholdPct) + case "diskInfo": + err = unpopulate(val, "DiskInfo", &s.DiskInfo) delete(rawMsg, key) - case "rampDownForceLogoffUsers": - err = unpopulate(val, "RampDownForceLogoffUsers", &s.RampDownForceLogoffUsers) + case "domainInfo": + err = unpopulate(val, "DomainInfo", &s.DomainInfo) delete(rawMsg, key) - case "rampDownLoadBalancingAlgorithm": - err = unpopulate(val, "RampDownLoadBalancingAlgorithm", &s.RampDownLoadBalancingAlgorithm) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &s.FriendlyName) delete(rawMsg, key) - case "rampDownMinimumHostsPct": - err = unpopulate(val, "RampDownMinimumHostsPct", &s.RampDownMinimumHostsPct) + case "imageInfo": + err = unpopulate(val, "ImageInfo", &s.ImageInfo) delete(rawMsg, key) - case "rampDownNotificationMessage": - err = unpopulate(val, "RampDownNotificationMessage", &s.RampDownNotificationMessage) + case "networkInfo": + err = unpopulate(val, "NetworkInfo", &s.NetworkInfo) delete(rawMsg, key) - case "rampDownStartTime": - err = unpopulate(val, "RampDownStartTime", &s.RampDownStartTime) + case "securityInfo": + err = unpopulate(val, "SecurityInfo", &s.SecurityInfo) delete(rawMsg, key) - case "rampDownStopHostsWhen": - err = unpopulate(val, "RampDownStopHostsWhen", &s.RampDownStopHostsWhen) + case "vmAdminCredentials": + err = unpopulate(val, "VMAdminCredentials", &s.VMAdminCredentials) delete(rawMsg, key) - case "rampDownWaitTimeMinutes": - err = unpopulate(val, "RampDownWaitTimeMinutes", &s.RampDownWaitTimeMinutes) + case "vmLocation": + err = unpopulate(val, "VMLocation", &s.VMLocation) delete(rawMsg, key) - case "rampUpCapacityThresholdPct": - err = unpopulate(val, "RampUpCapacityThresholdPct", &s.RampUpCapacityThresholdPct) + case "vmNamePrefix": + err = unpopulate(val, "VMNamePrefix", &s.VMNamePrefix) delete(rawMsg, key) - case "rampUpLoadBalancingAlgorithm": - err = unpopulate(val, "RampUpLoadBalancingAlgorithm", &s.RampUpLoadBalancingAlgorithm) + case "vmResourceGroup": + err = unpopulate(val, "VMResourceGroup", &s.VMResourceGroup) delete(rawMsg, key) - case "rampUpMinimumHostsPct": - err = unpopulate(val, "RampUpMinimumHostsPct", &s.RampUpMinimumHostsPct) + case "vmSizeId": + err = unpopulate(val, "VMSizeID", &s.VMSizeID) delete(rawMsg, key) - case "rampUpStartTime": - err = unpopulate(val, "RampUpStartTime", &s.RampUpStartTime) + case "vmTags": + err = unpopulate(val, "VMTags", &s.VMTags) delete(rawMsg, key) } if err != nil { @@ -2977,22 +4930,31 @@ func (s *ScalingPlanPooledScheduleProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ScalingPlanProperties. -func (s ScalingPlanProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SessionHostConfigurationProperties. +func (s SessionHostConfigurationProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", s.Description) - populate(objectMap, "exclusionTag", s.ExclusionTag) + populate(objectMap, "availabilityZones", s.AvailabilityZones) + populate(objectMap, "bootDiagnosticsInfo", s.BootDiagnosticsInfo) + populate(objectMap, "customConfigurationScriptUrl", s.CustomConfigurationScriptURL) + populate(objectMap, "diskInfo", s.DiskInfo) + populate(objectMap, "domainInfo", s.DomainInfo) populate(objectMap, "friendlyName", s.FriendlyName) - populate(objectMap, "hostPoolReferences", s.HostPoolReferences) - populate(objectMap, "hostPoolType", s.HostPoolType) - populate(objectMap, "objectId", s.ObjectID) - populate(objectMap, "schedules", s.Schedules) - populate(objectMap, "timeZone", s.TimeZone) + populate(objectMap, "imageInfo", s.ImageInfo) + populate(objectMap, "networkInfo", s.NetworkInfo) + populate(objectMap, "provisioningState", s.ProvisioningState) + populate(objectMap, "securityInfo", s.SecurityInfo) + populate(objectMap, "vmAdminCredentials", s.VMAdminCredentials) + populate(objectMap, "vmLocation", s.VMLocation) + populate(objectMap, "vmNamePrefix", s.VMNamePrefix) + populate(objectMap, "vmResourceGroup", s.VMResourceGroup) + populate(objectMap, "vmSizeId", s.VMSizeID) + populate(objectMap, "vmTags", s.VMTags) + populateDateTimeRFC3339(objectMap, "version", s.Version) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ScalingPlanProperties. -func (s *ScalingPlanProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SessionHostConfigurationProperties. +func (s *SessionHostConfigurationProperties) 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) @@ -3000,29 +4962,200 @@ func (s *ScalingPlanProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "description": - err = unpopulate(val, "Description", &s.Description) + case "availabilityZones": + err = unpopulate(val, "AvailabilityZones", &s.AvailabilityZones) delete(rawMsg, key) - case "exclusionTag": - err = unpopulate(val, "ExclusionTag", &s.ExclusionTag) + case "bootDiagnosticsInfo": + err = unpopulate(val, "BootDiagnosticsInfo", &s.BootDiagnosticsInfo) + delete(rawMsg, key) + case "customConfigurationScriptUrl": + err = unpopulate(val, "CustomConfigurationScriptURL", &s.CustomConfigurationScriptURL) + delete(rawMsg, key) + case "diskInfo": + err = unpopulate(val, "DiskInfo", &s.DiskInfo) + delete(rawMsg, key) + case "domainInfo": + err = unpopulate(val, "DomainInfo", &s.DomainInfo) delete(rawMsg, key) case "friendlyName": err = unpopulate(val, "FriendlyName", &s.FriendlyName) delete(rawMsg, key) - case "hostPoolReferences": - err = unpopulate(val, "HostPoolReferences", &s.HostPoolReferences) + case "imageInfo": + err = unpopulate(val, "ImageInfo", &s.ImageInfo) delete(rawMsg, key) - case "hostPoolType": - err = unpopulate(val, "HostPoolType", &s.HostPoolType) + case "networkInfo": + err = unpopulate(val, "NetworkInfo", &s.NetworkInfo) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + delete(rawMsg, key) + case "securityInfo": + err = unpopulate(val, "SecurityInfo", &s.SecurityInfo) + delete(rawMsg, key) + case "vmAdminCredentials": + err = unpopulate(val, "VMAdminCredentials", &s.VMAdminCredentials) + delete(rawMsg, key) + case "vmLocation": + err = unpopulate(val, "VMLocation", &s.VMLocation) + delete(rawMsg, key) + case "vmNamePrefix": + err = unpopulate(val, "VMNamePrefix", &s.VMNamePrefix) + delete(rawMsg, key) + case "vmResourceGroup": + err = unpopulate(val, "VMResourceGroup", &s.VMResourceGroup) + delete(rawMsg, key) + case "vmSizeId": + err = unpopulate(val, "VMSizeID", &s.VMSizeID) + delete(rawMsg, key) + case "vmTags": + err = unpopulate(val, "VMTags", &s.VMTags) + delete(rawMsg, key) + case "version": + err = unpopulateDateTimeRFC3339(val, "Version", &s.Version) + 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 SessionHostHealthCheckFailureDetails. +func (s SessionHostHealthCheckFailureDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "errorCode", s.ErrorCode) + populateDateTimeRFC3339(objectMap, "lastHealthCheckDateTime", s.LastHealthCheckDateTime) + populate(objectMap, "message", s.Message) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SessionHostHealthCheckFailureDetails. +func (s *SessionHostHealthCheckFailureDetails) 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 "errorCode": + err = unpopulate(val, "ErrorCode", &s.ErrorCode) + delete(rawMsg, key) + case "lastHealthCheckDateTime": + err = unpopulateDateTimeRFC3339(val, "LastHealthCheckDateTime", &s.LastHealthCheckDateTime) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &s.Message) + 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 SessionHostHealthCheckReport. +func (s SessionHostHealthCheckReport) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "additionalFailureDetails", s.AdditionalFailureDetails) + populate(objectMap, "healthCheckName", s.HealthCheckName) + populate(objectMap, "healthCheckResult", s.HealthCheckResult) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SessionHostHealthCheckReport. +func (s *SessionHostHealthCheckReport) 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 "additionalFailureDetails": + err = unpopulate(val, "AdditionalFailureDetails", &s.AdditionalFailureDetails) + delete(rawMsg, key) + case "healthCheckName": + err = unpopulate(val, "HealthCheckName", &s.HealthCheckName) + delete(rawMsg, key) + case "healthCheckResult": + err = unpopulate(val, "HealthCheckResult", &s.HealthCheckResult) + 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 SessionHostList. +func (s SessionHostList) 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 SessionHostList. +func (s *SessionHostList) 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 { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SessionHostManagement. +func (s SessionHostManagement) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 SessionHostManagement. +func (s *SessionHostManagement) 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 "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) - case "objectId": - err = unpopulate(val, "ObjectID", &s.ObjectID) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) delete(rawMsg, key) - case "schedules": - err = unpopulate(val, "Schedules", &s.Schedules) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) delete(rawMsg, key) - case "timeZone": - err = unpopulate(val, "TimeZone", &s.TimeZone) + case "type": + err = unpopulate(val, "Type", &s.Type) delete(rawMsg, key) } if err != nil { @@ -3032,32 +5165,16 @@ func (s *ScalingPlanProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ScalingSchedule. -func (s ScalingSchedule) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SessionHostManagementList. +func (s SessionHostManagementList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "daysOfWeek", s.DaysOfWeek) - populate(objectMap, "name", s.Name) - populate(objectMap, "offPeakLoadBalancingAlgorithm", s.OffPeakLoadBalancingAlgorithm) - populate(objectMap, "offPeakStartTime", s.OffPeakStartTime) - populate(objectMap, "peakLoadBalancingAlgorithm", s.PeakLoadBalancingAlgorithm) - populate(objectMap, "peakStartTime", s.PeakStartTime) - populate(objectMap, "rampDownCapacityThresholdPct", s.RampDownCapacityThresholdPct) - populate(objectMap, "rampDownForceLogoffUsers", s.RampDownForceLogoffUsers) - populate(objectMap, "rampDownLoadBalancingAlgorithm", s.RampDownLoadBalancingAlgorithm) - populate(objectMap, "rampDownMinimumHostsPct", s.RampDownMinimumHostsPct) - populate(objectMap, "rampDownNotificationMessage", s.RampDownNotificationMessage) - populate(objectMap, "rampDownStartTime", s.RampDownStartTime) - populate(objectMap, "rampDownStopHostsWhen", s.RampDownStopHostsWhen) - populate(objectMap, "rampDownWaitTimeMinutes", s.RampDownWaitTimeMinutes) - populate(objectMap, "rampUpCapacityThresholdPct", s.RampUpCapacityThresholdPct) - populate(objectMap, "rampUpLoadBalancingAlgorithm", s.RampUpLoadBalancingAlgorithm) - populate(objectMap, "rampUpMinimumHostsPct", s.RampUpMinimumHostsPct) - populate(objectMap, "rampUpStartTime", s.RampUpStartTime) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ScalingSchedule. -func (s *ScalingSchedule) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SessionHostManagementList. +func (s *SessionHostManagementList) 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) @@ -3065,59 +5182,11 @@ func (s *ScalingSchedule) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "daysOfWeek": - err = unpopulate(val, "DaysOfWeek", &s.DaysOfWeek) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) - delete(rawMsg, key) - case "offPeakLoadBalancingAlgorithm": - err = unpopulate(val, "OffPeakLoadBalancingAlgorithm", &s.OffPeakLoadBalancingAlgorithm) - delete(rawMsg, key) - case "offPeakStartTime": - err = unpopulate(val, "OffPeakStartTime", &s.OffPeakStartTime) - delete(rawMsg, key) - case "peakLoadBalancingAlgorithm": - err = unpopulate(val, "PeakLoadBalancingAlgorithm", &s.PeakLoadBalancingAlgorithm) - delete(rawMsg, key) - case "peakStartTime": - err = unpopulate(val, "PeakStartTime", &s.PeakStartTime) - delete(rawMsg, key) - case "rampDownCapacityThresholdPct": - err = unpopulate(val, "RampDownCapacityThresholdPct", &s.RampDownCapacityThresholdPct) - delete(rawMsg, key) - case "rampDownForceLogoffUsers": - err = unpopulate(val, "RampDownForceLogoffUsers", &s.RampDownForceLogoffUsers) - delete(rawMsg, key) - case "rampDownLoadBalancingAlgorithm": - err = unpopulate(val, "RampDownLoadBalancingAlgorithm", &s.RampDownLoadBalancingAlgorithm) - delete(rawMsg, key) - case "rampDownMinimumHostsPct": - err = unpopulate(val, "RampDownMinimumHostsPct", &s.RampDownMinimumHostsPct) - delete(rawMsg, key) - case "rampDownNotificationMessage": - err = unpopulate(val, "RampDownNotificationMessage", &s.RampDownNotificationMessage) - delete(rawMsg, key) - case "rampDownStartTime": - err = unpopulate(val, "RampDownStartTime", &s.RampDownStartTime) - delete(rawMsg, key) - case "rampDownStopHostsWhen": - err = unpopulate(val, "RampDownStopHostsWhen", &s.RampDownStopHostsWhen) - delete(rawMsg, key) - case "rampDownWaitTimeMinutes": - err = unpopulate(val, "RampDownWaitTimeMinutes", &s.RampDownWaitTimeMinutes) - delete(rawMsg, key) - case "rampUpCapacityThresholdPct": - err = unpopulate(val, "RampUpCapacityThresholdPct", &s.RampUpCapacityThresholdPct) - delete(rawMsg, key) - case "rampUpLoadBalancingAlgorithm": - err = unpopulate(val, "RampUpLoadBalancingAlgorithm", &s.RampUpLoadBalancingAlgorithm) - delete(rawMsg, key) - case "rampUpMinimumHostsPct": - err = unpopulate(val, "RampUpMinimumHostsPct", &s.RampUpMinimumHostsPct) + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) delete(rawMsg, key) - case "rampUpStartTime": - err = unpopulate(val, "RampUpStartTime", &s.RampUpStartTime) + case "value": + err = unpopulate(val, "Value", &s.Value) delete(rawMsg, key) } if err != nil { @@ -3127,16 +5196,19 @@ func (s *ScalingSchedule) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SendMessage. -func (s SendMessage) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SessionHostManagementOperationProgress. +func (s SessionHostManagementOperationProgress) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "messageBody", s.MessageBody) - populate(objectMap, "messageTitle", s.MessageTitle) + populateDateTimeRFC3339(objectMap, "executionStartTime", s.ExecutionStartTime) + populate(objectMap, "sessionHostsCompleted", s.SessionHostsCompleted) + populate(objectMap, "sessionHostsInProgress", s.SessionHostsInProgress) + populate(objectMap, "sessionHostsRollbackFailed", s.SessionHostsRollbackFailed) + populate(objectMap, "totalSessionHosts", s.TotalSessionHosts) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SendMessage. -func (s *SendMessage) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SessionHostManagementOperationProgress. +func (s *SessionHostManagementOperationProgress) 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) @@ -3144,11 +5216,20 @@ func (s *SendMessage) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "messageBody": - err = unpopulate(val, "MessageBody", &s.MessageBody) + case "executionStartTime": + err = unpopulateDateTimeRFC3339(val, "ExecutionStartTime", &s.ExecutionStartTime) delete(rawMsg, key) - case "messageTitle": - err = unpopulate(val, "MessageTitle", &s.MessageTitle) + case "sessionHostsCompleted": + err = unpopulate(val, "SessionHostsCompleted", &s.SessionHostsCompleted) + delete(rawMsg, key) + case "sessionHostsInProgress": + err = unpopulate(val, "SessionHostsInProgress", &s.SessionHostsInProgress) + delete(rawMsg, key) + case "sessionHostsRollbackFailed": + err = unpopulate(val, "SessionHostsRollbackFailed", &s.SessionHostsRollbackFailed) + delete(rawMsg, key) + case "totalSessionHosts": + err = unpopulate(val, "TotalSessionHosts", &s.TotalSessionHosts) delete(rawMsg, key) } if err != nil { @@ -3158,15 +5239,15 @@ func (s *SendMessage) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServiceSpecification. -func (s ServiceSpecification) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SessionHostManagementPatch. +func (s SessionHostManagementPatch) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "logSpecifications", s.LogSpecifications) + populate(objectMap, "properties", s.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceSpecification. -func (s *ServiceSpecification) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SessionHostManagementPatch. +func (s *SessionHostManagementPatch) 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) @@ -3174,8 +5255,8 @@ func (s *ServiceSpecification) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "logSpecifications": - err = unpopulate(val, "LogSpecifications", &s.LogSpecifications) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) delete(rawMsg, key) } if err != nil { @@ -3185,19 +5266,16 @@ func (s *ServiceSpecification) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SessionHost. -func (s SessionHost) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SessionHostManagementPatchProperties. +func (s SessionHostManagementPatchProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - 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) + populate(objectMap, "scheduledDateTimeZone", s.ScheduledDateTimeZone) + populate(objectMap, "update", s.Update) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SessionHost. -func (s *SessionHost) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SessionHostManagementPatchProperties. +func (s *SessionHostManagementPatchProperties) 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) @@ -3205,20 +5283,11 @@ func (s *SessionHost) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &s.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &s.Properties) + case "scheduledDateTimeZone": + err = unpopulate(val, "ScheduledDateTimeZone", &s.ScheduledDateTimeZone) delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &s.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) + case "update": + err = unpopulate(val, "Update", &s.Update) delete(rawMsg, key) } if err != nil { @@ -3228,17 +5297,16 @@ func (s *SessionHost) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SessionHostHealthCheckFailureDetails. -func (s SessionHostHealthCheckFailureDetails) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SessionHostManagementProperties. +func (s SessionHostManagementProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "errorCode", s.ErrorCode) - populateDateTimeRFC3339(objectMap, "lastHealthCheckDateTime", s.LastHealthCheckDateTime) - populate(objectMap, "message", s.Message) + populate(objectMap, "scheduledDateTimeZone", s.ScheduledDateTimeZone) + populate(objectMap, "update", s.Update) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SessionHostHealthCheckFailureDetails. -func (s *SessionHostHealthCheckFailureDetails) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SessionHostManagementProperties. +func (s *SessionHostManagementProperties) 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) @@ -3246,14 +5314,11 @@ func (s *SessionHostHealthCheckFailureDetails) UnmarshalJSON(data []byte) error for key, val := range rawMsg { var err error switch key { - case "errorCode": - err = unpopulate(val, "ErrorCode", &s.ErrorCode) - delete(rawMsg, key) - case "lastHealthCheckDateTime": - err = unpopulateDateTimeRFC3339(val, "LastHealthCheckDateTime", &s.LastHealthCheckDateTime) + case "scheduledDateTimeZone": + err = unpopulate(val, "ScheduledDateTimeZone", &s.ScheduledDateTimeZone) delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &s.Message) + case "update": + err = unpopulate(val, "Update", &s.Update) delete(rawMsg, key) } if err != nil { @@ -3263,17 +5328,22 @@ func (s *SessionHostHealthCheckFailureDetails) UnmarshalJSON(data []byte) error return nil } -// MarshalJSON implements the json.Marshaller interface for type SessionHostHealthCheckReport. -func (s SessionHostHealthCheckReport) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SessionHostManagementUpdateStatus. +func (s SessionHostManagementUpdateStatus) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "additionalFailureDetails", s.AdditionalFailureDetails) - populate(objectMap, "healthCheckName", s.HealthCheckName) - populate(objectMap, "healthCheckResult", s.HealthCheckResult) + populateDateTimeRFC3339(objectMap, "endTime", s.EndTime) + populate(objectMap, "error", s.Error) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "percentComplete", s.PercentComplete) + populate(objectMap, "properties", s.Properties) + populateDateTimeRFC3339(objectMap, "startTime", s.StartTime) + populate(objectMap, "status", s.Status) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SessionHostHealthCheckReport. -func (s *SessionHostHealthCheckReport) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SessionHostManagementUpdateStatus. +func (s *SessionHostManagementUpdateStatus) 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) @@ -3281,14 +5351,29 @@ func (s *SessionHostHealthCheckReport) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "additionalFailureDetails": - err = unpopulate(val, "AdditionalFailureDetails", &s.AdditionalFailureDetails) + case "endTime": + err = unpopulateDateTimeRFC3339(val, "EndTime", &s.EndTime) delete(rawMsg, key) - case "healthCheckName": - err = unpopulate(val, "HealthCheckName", &s.HealthCheckName) + case "error": + err = unpopulate(val, "Error", &s.Error) delete(rawMsg, key) - case "healthCheckResult": - err = unpopulate(val, "HealthCheckResult", &s.HealthCheckResult) + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "percentComplete": + err = unpopulate(val, "PercentComplete", &s.PercentComplete) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "startTime": + err = unpopulateDateTimeRFC3339(val, "StartTime", &s.StartTime) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &s.Status) delete(rawMsg, key) } if err != nil { @@ -3298,16 +5383,18 @@ func (s *SessionHostHealthCheckReport) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SessionHostList. -func (s SessionHostList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SessionHostManagementUpdateStatusProperties. +func (s SessionHostManagementUpdateStatusProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) + populate(objectMap, "correlationId", s.CorrelationID) + populate(objectMap, "progress", s.Progress) + populateDateTimeRFC3339(objectMap, "scheduledDateTime", s.ScheduledDateTime) + populate(objectMap, "sessionHostManagement", s.SessionHostManagement) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SessionHostList. -func (s *SessionHostList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SessionHostManagementUpdateStatusProperties. +func (s *SessionHostManagementUpdateStatusProperties) 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) @@ -3315,11 +5402,17 @@ func (s *SessionHostList) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &s.NextLink) + case "correlationId": + err = unpopulate(val, "CorrelationID", &s.CorrelationID) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &s.Value) + case "progress": + err = unpopulate(val, "Progress", &s.Progress) + delete(rawMsg, key) + case "scheduledDateTime": + err = unpopulateDateTimeRFC3339(val, "ScheduledDateTime", &s.ScheduledDateTime) + delete(rawMsg, key) + case "sessionHostManagement": + err = unpopulate(val, "SessionHostManagement", &s.SessionHostManagement) delete(rawMsg, key) } if err != nil { @@ -3335,6 +5428,7 @@ func (s SessionHostPatch) MarshalJSON() ([]byte, error) { 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) } @@ -3357,6 +5451,9 @@ func (s *SessionHostPatch) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &s.Properties) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &s.Type) delete(rawMsg, key) @@ -3411,10 +5508,12 @@ func (s SessionHostProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "assignedUser", s.AssignedUser) populate(objectMap, "friendlyName", s.FriendlyName) populateDateTimeRFC3339(objectMap, "lastHeartBeat", s.LastHeartBeat) + populateDateTimeRFC3339(objectMap, "lastSessionHostUpdateTime", s.LastSessionHostUpdateTime) populateDateTimeRFC3339(objectMap, "lastUpdateTime", s.LastUpdateTime) populate(objectMap, "osVersion", s.OSVersion) populate(objectMap, "objectId", s.ObjectID) populate(objectMap, "resourceId", s.ResourceID) + populate(objectMap, "sessionHostConfiguration", s.SessionHostConfiguration) populate(objectMap, "sessionHostHealthCheckResults", s.SessionHostHealthCheckResults) populate(objectMap, "sessions", s.Sessions) populate(objectMap, "status", s.Status) @@ -3450,6 +5549,9 @@ func (s *SessionHostProperties) UnmarshalJSON(data []byte) error { case "lastHeartBeat": err = unpopulateDateTimeRFC3339(val, "LastHeartBeat", &s.LastHeartBeat) delete(rawMsg, key) + case "lastSessionHostUpdateTime": + err = unpopulateDateTimeRFC3339(val, "LastSessionHostUpdateTime", &s.LastSessionHostUpdateTime) + delete(rawMsg, key) case "lastUpdateTime": err = unpopulateDateTimeRFC3339(val, "LastUpdateTime", &s.LastUpdateTime) delete(rawMsg, key) @@ -3462,6 +5564,9 @@ func (s *SessionHostProperties) UnmarshalJSON(data []byte) error { case "resourceId": err = unpopulate(val, "ResourceID", &s.ResourceID) delete(rawMsg, key) + case "sessionHostConfiguration": + err = unpopulate(val, "SessionHostConfiguration", &s.SessionHostConfiguration) + delete(rawMsg, key) case "sessionHostHealthCheckResults": err = unpopulate(val, "SessionHostHealthCheckResults", &s.SessionHostHealthCheckResults) delete(rawMsg, key) @@ -3500,6 +5605,7 @@ func (s StartMenuItem) MarshalJSON() ([]byte, error) { 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) } @@ -3522,6 +5628,9 @@ func (s *StartMenuItem) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &s.Properties) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &s.Type) delete(rawMsg, key) @@ -3685,6 +5794,72 @@ func (t *Time) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type UpdateSessionHostsRequestBody. +func (u UpdateSessionHostsRequestBody) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateDateTimeRFC3339(objectMap, "scheduledDateTime", u.ScheduledDateTime) + populate(objectMap, "scheduledDateTimeZone", u.ScheduledDateTimeZone) + populate(objectMap, "update", u.Update) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UpdateSessionHostsRequestBody. +func (u *UpdateSessionHostsRequestBody) 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 "scheduledDateTime": + err = unpopulateDateTimeRFC3339(val, "ScheduledDateTime", &u.ScheduledDateTime) + delete(rawMsg, key) + case "scheduledDateTimeZone": + err = unpopulate(val, "ScheduledDateTimeZone", &u.ScheduledDateTimeZone) + delete(rawMsg, key) + case "update": + err = unpopulate(val, "Update", &u.Update) + 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 { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type UserSession. func (u UserSession) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -4043,18 +6218,28 @@ func populate(m map[string]any, k string, v any) { } } -func populateByteArray(m map[string]any, k string, b []byte, f runtime.Base64Encoding) { +func populateAny(m map[string]any, k string, v any) { + if v == nil { + return + } else if azcore.IsNullValue(v) { + m[k] = nil + } else { + m[k] = v + } +} + +func populateByteArray[T any](m map[string]any, k string, b []T, convert func() any) { if azcore.IsNullValue(b) { m[k] = nil } else if len(b) == 0 { return } else { - m[k] = runtime.EncodeByteArray(b, f) + m[k] = convert() } } func unpopulate(data json.RawMessage, fn string, v any) error { - if data == nil { + if data == nil || string(data) == "null" { return nil } if err := json.Unmarshal(data, v); err != nil { diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/msiximages_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/msiximages_client.go index ce27604b8214..319a732e7f30 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/msiximages_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/msiximages_client.go @@ -28,7 +28,7 @@ type MsixImagesClient struct { } // NewMsixImagesClient creates a new instance of MsixImagesClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewMsixImagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*MsixImagesClient, error) { @@ -45,7 +45,7 @@ func NewMsixImagesClient(subscriptionID string, credential azcore.TokenCredentia // NewExpandPager - Expands and Lists MSIX packages in an Image, given the Image Path. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - hostPoolName - The name of the host pool within the specified resource group // - msixImageURI - Object containing URI to MSIX Image @@ -93,7 +93,7 @@ func (client *MsixImagesClient) expandCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-08-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, msixImageURI); err != nil { diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/msiximages_client_example_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/msiximages_client_example_test.go deleted file mode 100644 index 18b56f73c101..000000000000 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/msiximages_client_example_test.go +++ /dev/null @@ -1,127 +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 armdesktopvirtualization_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/desktopvirtualization/armdesktopvirtualization/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/MsixImage_Expand_Post.json -func ExampleMsixImagesClient_NewExpandPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewMsixImagesClient().NewExpandPager("resourceGroup1", "hostpool1", armdesktopvirtualization.MSIXImageURI{ - URI: to.Ptr("imagepath"), - }, 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.ExpandMsixImageList = armdesktopvirtualization.ExpandMsixImageList{ - // Value: []*armdesktopvirtualization.ExpandMsixImage{ - // { - // Name: to.Ptr("hostpool1/expandmsiximage"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/hostpools/expandmsiximage"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourcegroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostpools/hostpool1/expandmsiximage"), - // Properties: &armdesktopvirtualization.ExpandMsixImageProperties{ - // DisplayName: to.Ptr("displayname"), - // ImagePath: to.Ptr("imagepath"), - // IsActive: to.Ptr(false), - // IsRegularRegistration: to.Ptr(false), - // LastUpdated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2008-09-22T14:01:54.957Z"); return t}()), - // PackageAlias: to.Ptr("msixpackagealias"), - // PackageApplications: []*armdesktopvirtualization.MsixPackageApplications{ - // { - // Description: to.Ptr("PackageApplicationDescription"), - // AppID: to.Ptr("AppId"), - // AppUserModelID: to.Ptr("AppUserModelId"), - // FriendlyName: to.Ptr("FriendlyName"), - // IconImageName: to.Ptr("Iconimagename"), - // RawIcon: []byte("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo"), - // RawPNG: []byte("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo"), - // }}, - // PackageDependencies: []*armdesktopvirtualization.MsixPackageDependencies{ - // }, - // PackageFamilyName: to.Ptr("MsixPackage_FamilyName"), - // PackageFullName: to.Ptr("MsixPackage_FullName"), - // PackageName: to.Ptr("MsixPackageName"), - // PackageRelativePath: to.Ptr("packagerelativepath"), - // Version: to.Ptr("packageversion"), - // }, - // }, - // { - // Name: to.Ptr("hostpool1/expandmsiximage"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/hostpools/expandmsiximage"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourcegroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostpools/hostpool1/expandmsiximage"), - // Properties: &armdesktopvirtualization.ExpandMsixImageProperties{ - // DisplayName: to.Ptr("displayname2"), - // ImagePath: to.Ptr("imagepath"), - // IsActive: to.Ptr(false), - // IsRegularRegistration: to.Ptr(false), - // LastUpdated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2008-09-22T14:01:54.957Z"); return t}()), - // PackageAlias: to.Ptr("msixpackagealias2"), - // PackageApplications: []*armdesktopvirtualization.MsixPackageApplications{ - // { - // Description: to.Ptr("PackageApplicationDescription1"), - // AppID: to.Ptr("AppId1"), - // AppUserModelID: to.Ptr("AppUserModelId1"), - // FriendlyName: to.Ptr("FriendlyName1"), - // IconImageName: to.Ptr("Iconimagename1"), - // RawIcon: []byte("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo"), - // RawPNG: []byte("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo"), - // }, - // { - // Description: to.Ptr("PackageApplicationDescription2"), - // AppID: to.Ptr("AppId2"), - // AppUserModelID: to.Ptr("AppUserModelId2"), - // FriendlyName: to.Ptr("FriendlyName2"), - // IconImageName: to.Ptr("Iconimagename2"), - // RawIcon: []byte("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo"), - // RawPNG: []byte("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo"), - // }}, - // PackageDependencies: []*armdesktopvirtualization.MsixPackageDependencies{ - // { - // DependencyName: to.Ptr("MsixPackageDependency1"), - // MinVersion: to.Ptr("ver1"), - // Publisher: to.Ptr("PublisherName1"), - // }, - // { - // DependencyName: to.Ptr("MsixPackageDependency2"), - // MinVersion: to.Ptr("ver2"), - // Publisher: to.Ptr("PublisherName2"), - // }}, - // PackageFamilyName: to.Ptr("MsixPackage_FamilyName2"), - // PackageFullName: to.Ptr("MsixPackage_FullName2"), - // PackageName: to.Ptr("MsixPackageName2"), - // PackageRelativePath: to.Ptr("packagerelativepath2"), - // Version: to.Ptr("packageversion"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/msixpackages_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/msixpackages_client.go index 07359fd6ce4a..4f46f40f2b84 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/msixpackages_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/msixpackages_client.go @@ -29,7 +29,7 @@ type MSIXPackagesClient struct { } // NewMSIXPackagesClient creates a new instance of MSIXPackagesClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewMSIXPackagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*MSIXPackagesClient, error) { @@ -47,7 +47,7 @@ func NewMSIXPackagesClient(subscriptionID string, credential azcore.TokenCredent // CreateOrUpdate - Create or update a MSIX package. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - hostPoolName - The name of the host pool within the specified resource group // - msixPackageFullName - The version specific package full name of the MSIX package within specified hostpool @@ -100,7 +100,7 @@ func (client *MSIXPackagesClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-08-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, msixPackage); err != nil { @@ -121,7 +121,7 @@ func (client *MSIXPackagesClient) createOrUpdateHandleResponse(resp *http.Respon // Delete - Remove an MSIX Package. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - hostPoolName - The name of the host pool within the specified resource group // - msixPackageFullName - The version specific package full name of the MSIX package within specified hostpool @@ -171,7 +171,7 @@ func (client *MSIXPackagesClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-08-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -180,7 +180,7 @@ func (client *MSIXPackagesClient) deleteCreateRequest(ctx context.Context, resou // Get - Get a msixpackage. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - hostPoolName - The name of the host pool within the specified resource group // - msixPackageFullName - The version specific package full name of the MSIX package within specified hostpool @@ -231,7 +231,7 @@ func (client *MSIXPackagesClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-08-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -248,7 +248,7 @@ func (client *MSIXPackagesClient) getHandleResponse(resp *http.Response) (MSIXPa // NewListPager - List MSIX packages in hostpool. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - hostPoolName - The name of the host pool within the specified resource group // - options - MSIXPackagesClientListOptions contains the optional parameters for the MSIXPackagesClient.NewListPager method. @@ -295,15 +295,15 @@ func (client *MSIXPackagesClient) listCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") - if options != nil && options.PageSize != nil { - reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) + reqQP.Set("api-version", "2024-04-08-preview") + if options != nil && options.InitialSkip != nil { + reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) } if options != nil && options.IsDescending != nil { reqQP.Set("isDescending", strconv.FormatBool(*options.IsDescending)) } - if options != nil && options.InitialSkip != nil { - reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) + if options != nil && options.PageSize != nil { + reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} @@ -322,7 +322,7 @@ func (client *MSIXPackagesClient) listHandleResponse(resp *http.Response) (MSIXP // Update - Update an MSIX Package. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - hostPoolName - The name of the host pool within the specified resource group // - msixPackageFullName - The version specific package full name of the MSIX package within specified hostpool @@ -373,7 +373,7 @@ func (client *MSIXPackagesClient) updateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-08-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.MsixPackage != nil { diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/msixpackages_client_example_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/msixpackages_client_example_test.go deleted file mode 100644 index fc8827f5f346..000000000000 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/msixpackages_client_example_test.go +++ /dev/null @@ -1,364 +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 armdesktopvirtualization_test - -import ( - "context" - "log" - - "time" - - "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/desktopvirtualization/armdesktopvirtualization/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/MsixPackage_Get.json -func ExampleMSIXPackagesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMSIXPackagesClient().Get(ctx, "resourceGroup1", "hostpool1", "packagefullname", 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.MSIXPackage = armdesktopvirtualization.MSIXPackage{ - // Name: to.Ptr("hostpool1/MsixPackageFullName"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/hostpools/msixpackages"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourcegroups/resourcegroup1/providers/Microsoft.DesktopVirtualization/hostpools/hostpool1/msixpackages/msixPackageFullName"), - // Properties: &armdesktopvirtualization.MSIXPackageProperties{ - // DisplayName: to.Ptr("dis"), - // ImagePath: to.Ptr("imagepath"), - // IsActive: to.Ptr(false), - // IsRegularRegistration: to.Ptr(false), - // LastUpdated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2008-09-22T14:01:54.957Z"); return t}()), - // PackageApplications: []*armdesktopvirtualization.MsixPackageApplications{ - // { - // Description: to.Ptr("desc"), - // AppID: to.Ptr("Application_Id"), - // AppUserModelID: to.Ptr("Application_ModelID"), - // FriendlyName: to.Ptr("fri"), - // IconImageName: to.Ptr("Apptile"), - // RawIcon: []byte("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo"), - // RawPNG: []byte("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo"), - // }}, - // PackageDependencies: []*armdesktopvirtualization.MsixPackageDependencies{ - // { - // DependencyName: to.Ptr("MsixPackage_Dependency_Name"), - // MinVersion: to.Ptr("packageDep_version"), - // Publisher: to.Ptr("MsixPackage_Dependency_Publisher"), - // }}, - // PackageFamilyName: to.Ptr("MsixPackage_FamilyName"), - // PackageName: to.Ptr("MsixPackage_Name"), - // PackageRelativePath: to.Ptr("MsixPackage_RelativePackageRoot"), - // Version: to.Ptr("version"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/MsixPackage_Create.json -func ExampleMSIXPackagesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMSIXPackagesClient().CreateOrUpdate(ctx, "resourceGroup1", "hostpool1", "msixpackagefullname", armdesktopvirtualization.MSIXPackage{ - Properties: &armdesktopvirtualization.MSIXPackageProperties{ - DisplayName: to.Ptr("displayname"), - ImagePath: to.Ptr("imagepath"), - IsActive: to.Ptr(false), - IsRegularRegistration: to.Ptr(false), - LastUpdated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2008-09-22T14:01:54.957Z"); return t }()), - PackageApplications: []*armdesktopvirtualization.MsixPackageApplications{ - { - Description: to.Ptr("application-desc"), - AppID: to.Ptr("ApplicationId"), - AppUserModelID: to.Ptr("AppUserModelId"), - FriendlyName: to.Ptr("friendlyname"), - IconImageName: to.Ptr("Apptile"), - RawIcon: []byte("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo"), - RawPNG: []byte("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo"), - }}, - PackageDependencies: []*armdesktopvirtualization.MsixPackageDependencies{ - { - DependencyName: to.Ptr("MsixTest_Dependency_Name"), - MinVersion: to.Ptr("version"), - Publisher: to.Ptr("PublishedName"), - }}, - PackageFamilyName: to.Ptr("MsixPackage_FamilyName"), - PackageName: to.Ptr("MsixPackage_name"), - PackageRelativePath: to.Ptr("packagerelativepath"), - Version: to.Ptr("version"), - }, - }, 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.MSIXPackage = armdesktopvirtualization.MSIXPackage{ - // Name: to.Ptr("hostpool1/MsixPackageFullName"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/hostpools/msixpackages"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourcegroups/resourcegroup1/providers/Microsoft.DesktopVirtualization/hostpools/hostpool1/msixpackages/msixPackageFullName"), - // Properties: &armdesktopvirtualization.MSIXPackageProperties{ - // DisplayName: to.Ptr("dis"), - // ImagePath: to.Ptr("imagepath"), - // IsActive: to.Ptr(false), - // IsRegularRegistration: to.Ptr(false), - // LastUpdated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2008-09-22T14:01:54.957Z"); return t}()), - // PackageApplications: []*armdesktopvirtualization.MsixPackageApplications{ - // { - // Description: to.Ptr("desc"), - // AppID: to.Ptr("Application_Id"), - // AppUserModelID: to.Ptr("Application_ModelID"), - // FriendlyName: to.Ptr("fri"), - // IconImageName: to.Ptr("Apptile"), - // RawIcon: []byte("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo"), - // RawPNG: []byte("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo"), - // }}, - // PackageDependencies: []*armdesktopvirtualization.MsixPackageDependencies{ - // { - // DependencyName: to.Ptr("MsixPackage_Dependency_Name"), - // MinVersion: to.Ptr("packageDep_version"), - // Publisher: to.Ptr("MsixPackage_Dependency_Publisher"), - // }}, - // PackageFamilyName: to.Ptr("MsixPackage_FamilyName"), - // PackageName: to.Ptr("MsixPackage_Name"), - // PackageRelativePath: to.Ptr("MsixPackage_RelativePackageRoot"), - // Version: to.Ptr("version"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/MsixPackage_Delete.json -func ExampleMSIXPackagesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewMSIXPackagesClient().Delete(ctx, "resourceGroup1", "hostpool1", "packagefullname", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/MsixPackage_Update.json -func ExampleMSIXPackagesClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMSIXPackagesClient().Update(ctx, "resourceGroup1", "hostpool1", "msixpackagefullname", &armdesktopvirtualization.MSIXPackagesClientUpdateOptions{MsixPackage: &armdesktopvirtualization.MSIXPackagePatch{ - Properties: &armdesktopvirtualization.MSIXPackagePatchProperties{ - DisplayName: to.Ptr("displayname"), - IsActive: to.Ptr(true), - IsRegularRegistration: to.Ptr(false), - }, - }, - }) - 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.MSIXPackage = armdesktopvirtualization.MSIXPackage{ - // Name: to.Ptr("hostpool1/MsixPackageFullName"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/hostpools/msixpackages"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourcegroups/resourcegroup1/providers/Microsoft.DesktopVirtualization/hostpools/hostpool1/msixpackages/msixPackageFullName"), - // Properties: &armdesktopvirtualization.MSIXPackageProperties{ - // DisplayName: to.Ptr("dis"), - // ImagePath: to.Ptr("imagepath"), - // IsActive: to.Ptr(true), - // IsRegularRegistration: to.Ptr(false), - // LastUpdated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2008-09-22T14:01:54.957Z"); return t}()), - // PackageApplications: []*armdesktopvirtualization.MsixPackageApplications{ - // { - // Description: to.Ptr("desc"), - // AppID: to.Ptr("Application_Id"), - // AppUserModelID: to.Ptr("Application_ModelID"), - // FriendlyName: to.Ptr("fri"), - // IconImageName: to.Ptr("Apptile"), - // RawIcon: []byte("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo"), - // RawPNG: []byte("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo"), - // }}, - // PackageDependencies: []*armdesktopvirtualization.MsixPackageDependencies{ - // { - // DependencyName: to.Ptr("MsixPackage_Dependency_Name"), - // MinVersion: to.Ptr("packageDep_version"), - // Publisher: to.Ptr("MsixPackage_Dependency_Publisher"), - // }}, - // PackageFamilyName: to.Ptr("MsixPackage_FamilyName"), - // PackageName: to.Ptr("MsixPackage_Name"), - // PackageRelativePath: to.Ptr("MsixPackage_RelativePackageRoot"), - // Version: to.Ptr("version"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/MsixPackage_List.json -func ExampleMSIXPackagesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewMSIXPackagesClient().NewListPager("resourceGroup1", "hostpool1", &armdesktopvirtualization.MSIXPackagesClientListOptions{PageSize: to.Ptr[int32](10), - IsDescending: to.Ptr(true), - InitialSkip: to.Ptr[int32](0), - }) - 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.MSIXPackageList = armdesktopvirtualization.MSIXPackageList{ - // Value: []*armdesktopvirtualization.MSIXPackage{ - // { - // Name: to.Ptr("hostpool1/MsixPackageFullName"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/hostpools/msixpackages"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourcegroups/resourcegroup1/providers/Microsoft.DesktopVirtualization/hostpools/hostpool1/msixpackages/msixPackageFullName"), - // Properties: &armdesktopvirtualization.MSIXPackageProperties{ - // DisplayName: to.Ptr("dis"), - // ImagePath: to.Ptr("imagepath"), - // IsActive: to.Ptr(false), - // IsRegularRegistration: to.Ptr(false), - // LastUpdated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2008-09-22T14:01:54.957Z"); return t}()), - // PackageApplications: []*armdesktopvirtualization.MsixPackageApplications{ - // { - // Description: to.Ptr("desc"), - // AppID: to.Ptr("Application_Id"), - // AppUserModelID: to.Ptr("Application_ModelID"), - // FriendlyName: to.Ptr("fri"), - // IconImageName: to.Ptr("Apptile"), - // RawIcon: []byte("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo"), - // RawPNG: []byte("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo"), - // }}, - // PackageDependencies: []*armdesktopvirtualization.MsixPackageDependencies{ - // { - // DependencyName: to.Ptr("MsixPackage_Dependency_Name"), - // MinVersion: to.Ptr("packageDep_version"), - // Publisher: to.Ptr("MsixPackage_Dependency_Publisher"), - // }}, - // PackageFamilyName: to.Ptr("MsixPackage_FamilyName"), - // PackageName: to.Ptr("MsixPackage_Name"), - // PackageRelativePath: to.Ptr("MsixPackage_RelativePackageRoot"), - // Version: to.Ptr("version"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }, - // { - // Name: to.Ptr("hostpool1/MsixPackageFullName2"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/hostpools/msixpackages"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourcegroups/resourcegroup1/providers/Microsoft.DesktopVirtualization/hostpools/hostpool1/msixpackages/msixPackageFullName2"), - // Properties: &armdesktopvirtualization.MSIXPackageProperties{ - // DisplayName: to.Ptr("dis2"), - // ImagePath: to.Ptr("imagepath2"), - // IsActive: to.Ptr(false), - // IsRegularRegistration: to.Ptr(false), - // LastUpdated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2008-09-22T14:01:54.957Z"); return t}()), - // PackageApplications: []*armdesktopvirtualization.MsixPackageApplications{ - // { - // Description: to.Ptr("desc2"), - // AppID: to.Ptr("Application_Id2"), - // AppUserModelID: to.Ptr("Application_ModelID2"), - // FriendlyName: to.Ptr("fri2"), - // IconImageName: to.Ptr("Apptile2"), - // RawIcon: []byte("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo"), - // RawPNG: []byte("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo"), - // }}, - // PackageDependencies: []*armdesktopvirtualization.MsixPackageDependencies{ - // { - // DependencyName: to.Ptr("MsixPackage_Dependency_Name2"), - // MinVersion: to.Ptr("packageDep_version2"), - // Publisher: to.Ptr("MsixPackage_Dependency_Publisher2"), - // }}, - // PackageFamilyName: to.Ptr("MsixPackage_FamilyName2"), - // PackageName: to.Ptr("MsixPackage_Name2"), - // PackageRelativePath: to.Ptr("MsixPackage_RelativePackageRoot2"), - // Version: to.Ptr("version2"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/operations_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/operations_client.go index 214e41560db5..c583536186df 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/operations_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/operations_client.go @@ -39,7 +39,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - List all of the available operations the Desktop Virtualization resource provider supports. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -72,7 +72,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-08-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/operations_client_example_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/operations_client_example_test.go deleted file mode 100644 index 89c6fb04ff49..000000000000 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/operations_client_example_test.go +++ /dev/null @@ -1,83 +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 armdesktopvirtualization_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/OperationDescription_List.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().NewListPager(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.ResourceProviderOperationList = armdesktopvirtualization.ResourceProviderOperationList{ - // Value: []*armdesktopvirtualization.ResourceProviderOperation{ - // { - // Name: to.Ptr("Microsoft.DesktopVirtualization/hostpools/read"), - // Display: &armdesktopvirtualization.ResourceProviderOperationDisplay{ - // Description: to.Ptr("Read hostpool"), - // Operation: to.Ptr("Read hostpool"), - // Provider: to.Ptr("Microsoft.DesktopVirtualization"), - // Resource: to.Ptr("hostpools"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.DesktopVirtualization/hostpools/write"), - // Display: &armdesktopvirtualization.ResourceProviderOperationDisplay{ - // Description: to.Ptr("Write hostpool"), - // Operation: to.Ptr("Write hostpool"), - // Provider: to.Ptr("Microsoft.DesktopVirtualization"), - // Resource: to.Ptr("hostpools"), - // }, - // IsDataAction: to.Ptr(false), - // Properties: &armdesktopvirtualization.OperationProperties{ - // ServiceSpecification: &armdesktopvirtualization.ServiceSpecification{ - // LogSpecifications: []*armdesktopvirtualization.LogSpecification{ - // { - // Name: to.Ptr(""), - // DisplayName: to.Ptr(""), - // }, - // { - // Name: to.Ptr(""), - // DisplayName: to.Ptr(""), - // }, - // { - // Name: to.Ptr(""), - // DisplayName: to.Ptr(""), - // }}, - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/options.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/options.go index fcf371cb656f..c7650aa95c64 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/options.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/options.go @@ -8,6 +8,62 @@ package armdesktopvirtualization +// ActiveSessionHostConfigurationsClientGetOptions contains the optional parameters for the ActiveSessionHostConfigurationsClient.Get +// method. +type ActiveSessionHostConfigurationsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ActiveSessionHostConfigurationsClientListByHostPoolOptions contains the optional parameters for the ActiveSessionHostConfigurationsClient.NewListByHostPoolPager +// method. +type ActiveSessionHostConfigurationsClientListByHostPoolOptions struct { + // placeholder for future optional parameters +} + +// AppAttachPackageClientCreateOrUpdateOptions contains the optional parameters for the AppAttachPackageClient.CreateOrUpdate +// method. +type AppAttachPackageClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// AppAttachPackageClientDeleteOptions contains the optional parameters for the AppAttachPackageClient.Delete method. +type AppAttachPackageClientDeleteOptions struct { + // Force flag to delete App Attach package. + Force *bool +} + +// AppAttachPackageClientGetOptions contains the optional parameters for the AppAttachPackageClient.Get method. +type AppAttachPackageClientGetOptions struct { + // placeholder for future optional parameters +} + +// AppAttachPackageClientListByResourceGroupOptions contains the optional parameters for the AppAttachPackageClient.NewListByResourceGroupPager +// method. +type AppAttachPackageClientListByResourceGroupOptions struct { + // OData filter expression. Valid properties for filtering are package name, host pool, package owner name, and custom data. + Filter *string +} + +// AppAttachPackageClientListBySubscriptionOptions contains the optional parameters for the AppAttachPackageClient.NewListBySubscriptionPager +// method. +type AppAttachPackageClientListBySubscriptionOptions struct { + // OData filter expression. Valid properties for filtering are package name, resource group, host pool, package owner name, + // and custom data. + Filter *string +} + +// AppAttachPackageClientUpdateOptions contains the optional parameters for the AppAttachPackageClient.Update method. +type AppAttachPackageClientUpdateOptions struct { + // Object containing App Attach Package definition. + AppAttachPackagePatch *AppAttachPackagePatch +} + +// AppAttachPackageInfoClientImportOptions contains the optional parameters for the AppAttachPackageInfoClient.NewImportPager +// method. +type AppAttachPackageInfoClientImportOptions struct { + // placeholder for future optional parameters +} + // ApplicationGroupsClientCreateOrUpdateOptions contains the optional parameters for the ApplicationGroupsClient.CreateOrUpdate // method. type ApplicationGroupsClientCreateOrUpdateOptions struct { @@ -86,6 +142,13 @@ type ApplicationsClientUpdateOptions struct { Application *ApplicationPatch } +// ControlSessionHostUpdateClientBeginPostOptions contains the optional parameters for the ControlSessionHostUpdateClient.BeginPost +// method. +type ControlSessionHostUpdateClientBeginPostOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // DesktopsClientGetOptions contains the optional parameters for the DesktopsClient.Get method. type DesktopsClientGetOptions struct { // placeholder for future optional parameters @@ -150,6 +213,12 @@ type HostPoolsClientListOptions struct { PageSize *int32 } +// HostPoolsClientListRegistrationTokensOptions contains the optional parameters for the HostPoolsClient.ListRegistrationTokens +// method. +type HostPoolsClientListRegistrationTokensOptions struct { + // placeholder for future optional parameters +} + // HostPoolsClientRetrieveRegistrationTokenOptions contains the optional parameters for the HostPoolsClient.RetrieveRegistrationToken // method. type HostPoolsClientRetrieveRegistrationTokenOptions struct { @@ -162,6 +231,13 @@ type HostPoolsClientUpdateOptions struct { HostPool *HostPoolPatch } +// InitiateSessionHostUpdateClientPostOptions contains the optional parameters for the InitiateSessionHostUpdateClient.Post +// method. +type InitiateSessionHostUpdateClientPostOptions struct { + // Object containing the definition for properties to be used in the sessionHostUpdate validation. + UpdateSessionHostsRequestBody *UpdateSessionHostsRequestBody +} + // MSIXPackagesClientCreateOrUpdateOptions contains the optional parameters for the MSIXPackagesClient.CreateOrUpdate method. type MSIXPackagesClientCreateOrUpdateOptions struct { // placeholder for future optional parameters @@ -422,6 +498,71 @@ type ScalingPlansClientUpdateOptions struct { ScalingPlan *ScalingPlanPatch } +// SessionHostClientRetryProvisioningOptions contains the optional parameters for the SessionHostClient.RetryProvisioning +// method. +type SessionHostClientRetryProvisioningOptions struct { + // placeholder for future optional parameters +} + +// SessionHostConfigurationsClientBeginCreateOrUpdateOptions contains the optional parameters for the SessionHostConfigurationsClient.BeginCreateOrUpdate +// method. +type SessionHostConfigurationsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SessionHostConfigurationsClientBeginUpdateOptions contains the optional parameters for the SessionHostConfigurationsClient.BeginUpdate +// method. +type SessionHostConfigurationsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string + + // Object containing SessionHostConfiguration definitions. + SessionHostConfiguration *SessionHostConfigurationPatch +} + +// SessionHostConfigurationsClientGetOptions contains the optional parameters for the SessionHostConfigurationsClient.Get +// method. +type SessionHostConfigurationsClientGetOptions struct { + // placeholder for future optional parameters +} + +// SessionHostConfigurationsClientListByHostPoolOptions contains the optional parameters for the SessionHostConfigurationsClient.NewListByHostPoolPager +// method. +type SessionHostConfigurationsClientListByHostPoolOptions struct { + // placeholder for future optional parameters +} + +// SessionHostManagementsClientCreateOrUpdateOptions contains the optional parameters for the SessionHostManagementsClient.CreateOrUpdate +// method. +type SessionHostManagementsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// SessionHostManagementsClientGetOptions contains the optional parameters for the SessionHostManagementsClient.Get method. +type SessionHostManagementsClientGetOptions struct { + // placeholder for future optional parameters +} + +// SessionHostManagementsClientListByHostPoolOptions contains the optional parameters for the SessionHostManagementsClient.NewListByHostPoolPager +// method. +type SessionHostManagementsClientListByHostPoolOptions struct { + // placeholder for future optional parameters +} + +// SessionHostManagementsClientUpdateOptions contains the optional parameters for the SessionHostManagementsClient.Update +// method. +type SessionHostManagementsClientUpdateOptions struct { + // Object containing SessionHostManagement definitions. + SessionHostManagement *SessionHostManagementPatch +} + +// SessionHostManagementsUpdateStatusClientGetOptions contains the optional parameters for the SessionHostManagementsUpdateStatusClient.Get +// method. +type SessionHostManagementsUpdateStatusClientGetOptions struct { + // placeholder for future optional parameters +} + // SessionHostsClientDeleteOptions contains the optional parameters for the SessionHostsClient.Delete method. type SessionHostsClientDeleteOptions struct { // Force flag to force sessionHost deletion even when userSession exists. @@ -443,6 +584,9 @@ type SessionHostsClientListOptions struct { // Number of items per page. PageSize *int32 + + // The path to the VM. + VMPath *string } // SessionHostsClientUpdateOptions contains the optional parameters for the SessionHostsClient.Update method. diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/privateendpointconnections_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/privateendpointconnections_client.go index c66d0ebcf708..8fac9576525f 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/privateendpointconnections_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/privateendpointconnections_client.go @@ -29,7 +29,7 @@ type PrivateEndpointConnectionsClient struct { } // NewPrivateEndpointConnectionsClient creates a new instance of PrivateEndpointConnectionsClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateEndpointConnectionsClient, error) { @@ -47,10 +47,10 @@ func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcor // DeleteByHostPool - Remove a connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - hostPoolName - The name of the host pool within the specified resource group -// - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource +// - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource. // - options - PrivateEndpointConnectionsClientDeleteByHostPoolOptions contains the optional parameters for the PrivateEndpointConnectionsClient.DeleteByHostPool // method. func (client *PrivateEndpointConnectionsClient) DeleteByHostPool(ctx context.Context, resourceGroupName string, hostPoolName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientDeleteByHostPoolOptions) (PrivateEndpointConnectionsClientDeleteByHostPoolResponse, error) { @@ -98,7 +98,7 @@ func (client *PrivateEndpointConnectionsClient) deleteByHostPoolCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-08-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -107,10 +107,10 @@ func (client *PrivateEndpointConnectionsClient) deleteByHostPoolCreateRequest(ct // DeleteByWorkspace - Remove a connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - The name of the workspace -// - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource +// - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource. // - options - PrivateEndpointConnectionsClientDeleteByWorkspaceOptions contains the optional parameters for the PrivateEndpointConnectionsClient.DeleteByWorkspace // method. func (client *PrivateEndpointConnectionsClient) DeleteByWorkspace(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientDeleteByWorkspaceOptions) (PrivateEndpointConnectionsClientDeleteByWorkspaceResponse, error) { @@ -158,7 +158,7 @@ func (client *PrivateEndpointConnectionsClient) deleteByWorkspaceCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-08-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -167,10 +167,10 @@ func (client *PrivateEndpointConnectionsClient) deleteByWorkspaceCreateRequest(c // GetByHostPool - Get a private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - hostPoolName - The name of the host pool within the specified resource group -// - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource +// - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource. // - options - PrivateEndpointConnectionsClientGetByHostPoolOptions contains the optional parameters for the PrivateEndpointConnectionsClient.GetByHostPool // method. func (client *PrivateEndpointConnectionsClient) GetByHostPool(ctx context.Context, resourceGroupName string, hostPoolName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientGetByHostPoolOptions) (PrivateEndpointConnectionsClientGetByHostPoolResponse, error) { @@ -219,7 +219,7 @@ func (client *PrivateEndpointConnectionsClient) getByHostPoolCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-08-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -237,10 +237,10 @@ func (client *PrivateEndpointConnectionsClient) getByHostPoolHandleResponse(resp // GetByWorkspace - Get a private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - The name of the workspace -// - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource +// - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource. // - options - PrivateEndpointConnectionsClientGetByWorkspaceOptions contains the optional parameters for the PrivateEndpointConnectionsClient.GetByWorkspace // method. func (client *PrivateEndpointConnectionsClient) GetByWorkspace(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientGetByWorkspaceOptions) (PrivateEndpointConnectionsClientGetByWorkspaceResponse, error) { @@ -289,7 +289,7 @@ func (client *PrivateEndpointConnectionsClient) getByWorkspaceCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-08-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -306,7 +306,7 @@ func (client *PrivateEndpointConnectionsClient) getByWorkspaceHandleResponse(res // NewListByHostPoolPager - List private endpoint connections associated with hostpool. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - hostPoolName - The name of the host pool within the specified resource group // - options - PrivateEndpointConnectionsClientListByHostPoolOptions contains the optional parameters for the PrivateEndpointConnectionsClient.NewListByHostPoolPager @@ -354,15 +354,15 @@ func (client *PrivateEndpointConnectionsClient) listByHostPoolCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") - if options != nil && options.PageSize != nil { - reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) + reqQP.Set("api-version", "2024-04-08-preview") + if options != nil && options.InitialSkip != nil { + reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) } if options != nil && options.IsDescending != nil { reqQP.Set("isDescending", strconv.FormatBool(*options.IsDescending)) } - if options != nil && options.InitialSkip != nil { - reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) + if options != nil && options.PageSize != nil { + reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} @@ -380,7 +380,7 @@ func (client *PrivateEndpointConnectionsClient) listByHostPoolHandleResponse(res // NewListByWorkspacePager - List private endpoint connections. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - The name of the workspace // - options - PrivateEndpointConnectionsClientListByWorkspaceOptions contains the optional parameters for the PrivateEndpointConnectionsClient.NewListByWorkspacePager @@ -428,7 +428,7 @@ func (client *PrivateEndpointConnectionsClient) listByWorkspaceCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-08-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -446,10 +446,10 @@ func (client *PrivateEndpointConnectionsClient) listByWorkspaceHandleResponse(re // UpdateByHostPool - Approve or reject a private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - hostPoolName - The name of the host pool within the specified resource group -// - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource +// - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource. // - connection - Object containing the updated connection. // - options - PrivateEndpointConnectionsClientUpdateByHostPoolOptions contains the optional parameters for the PrivateEndpointConnectionsClient.UpdateByHostPool // method. @@ -499,7 +499,7 @@ func (client *PrivateEndpointConnectionsClient) updateByHostPoolCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-08-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, connection); err != nil { @@ -520,10 +520,10 @@ func (client *PrivateEndpointConnectionsClient) updateByHostPoolHandleResponse(r // UpdateByWorkspace - Approve or reject a private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - The name of the workspace -// - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource +// - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource. // - connection - Object containing the updated connection. // - options - PrivateEndpointConnectionsClientUpdateByWorkspaceOptions contains the optional parameters for the PrivateEndpointConnectionsClient.UpdateByWorkspace // method. @@ -573,7 +573,7 @@ func (client *PrivateEndpointConnectionsClient) updateByWorkspaceCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-08-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, connection); err != nil { diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/privateendpointconnections_client_example_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/privateendpointconnections_client_example_test.go deleted file mode 100644 index 1515c2563bd6..000000000000 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/privateendpointconnections_client_example_test.go +++ /dev/null @@ -1,352 +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 armdesktopvirtualization_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/desktopvirtualization/armdesktopvirtualization/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/PrivateEndpointConnection_ListByWorkspace.json -func ExamplePrivateEndpointConnectionsClient_NewListByWorkspacePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrivateEndpointConnectionsClient().NewListByWorkspacePager("resourceGroup1", "workspace1", 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.PrivateEndpointConnectionListResultWithSystemData = armdesktopvirtualization.PrivateEndpointConnectionListResultWithSystemData{ - // Value: []*armdesktopvirtualization.PrivateEndpointConnectionWithSystemData{ - // { - // Name: to.Ptr("workspace1.377103f1-5179-4bdf-8556-4cdd3207cc5b"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/workspaces/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/workspaces/workspace1/privateEndpointConnections/workspace1.377103f1-5179-4bdf-8556-4cdd3207cc5b"), - // Properties: &armdesktopvirtualization.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armdesktopvirtualization.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup2/providers/Microsoft.Network/privateEndpoints/endpointName1"), - // }, - // PrivateLinkServiceConnectionState: &armdesktopvirtualization.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Auto-Approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armdesktopvirtualization.PrivateEndpointServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armdesktopvirtualization.PrivateEndpointConnectionProvisioningStateSucceeded), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/PrivateEndpointConnection_GetByWorkspace.json -func ExamplePrivateEndpointConnectionsClient_GetByWorkspace() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateEndpointConnectionsClient().GetByWorkspace(ctx, "resourceGroup1", "workspace1", "workspace1.377103f1-5179-4bdf-8556-4cdd3207cc5b", 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.PrivateEndpointConnectionWithSystemData = armdesktopvirtualization.PrivateEndpointConnectionWithSystemData{ - // Name: to.Ptr("workspace1.377103f1-5179-4bdf-8556-4cdd3207cc5b"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/workspaces/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/workspaces/workspace1/privateEndpointConnections/workspace1.377103f1-5179-4bdf-8556-4cdd3207cc5b"), - // Properties: &armdesktopvirtualization.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armdesktopvirtualization.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup2/providers/Microsoft.Network/privateEndpoints/endpointName1"), - // }, - // PrivateLinkServiceConnectionState: &armdesktopvirtualization.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Auto-Approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armdesktopvirtualization.PrivateEndpointServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armdesktopvirtualization.PrivateEndpointConnectionProvisioningStateSucceeded), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/PrivateEndpointConnection_DeleteByWorkspace.json -func ExamplePrivateEndpointConnectionsClient_DeleteByWorkspace() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewPrivateEndpointConnectionsClient().DeleteByWorkspace(ctx, "resourceGroup1", "workspace1", "workspace1.377103f1-5179-4bdf-8556-4cdd3207cc5b", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/PrivateEndpointConnection_UpdateByWorkspace.json -func ExamplePrivateEndpointConnectionsClient_UpdateByWorkspace() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateEndpointConnectionsClient().UpdateByWorkspace(ctx, "resourceGroup1", "workspace1", "workspace1.377103f1-5179-4bdf-8556-4cdd3207cc5b", armdesktopvirtualization.PrivateEndpointConnection{ - Properties: &armdesktopvirtualization.PrivateEndpointConnectionProperties{ - PrivateLinkServiceConnectionState: &armdesktopvirtualization.PrivateLinkServiceConnectionState{ - Description: to.Ptr("Approved by admin@consoto.com"), - ActionsRequired: to.Ptr("None"), - Status: to.Ptr(armdesktopvirtualization.PrivateEndpointServiceConnectionStatusApproved), - }, - }, - }, 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.PrivateEndpointConnectionWithSystemData = armdesktopvirtualization.PrivateEndpointConnectionWithSystemData{ - // Name: to.Ptr("workspace1.377103f1-5179-4bdf-8556-4cdd3207cc5b"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/workspaces/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/workspaces/workspace1/privateEndpointConnections/workspace1.377103f1-5179-4bdf-8556-4cdd3207cc5b"), - // Properties: &armdesktopvirtualization.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armdesktopvirtualization.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup2/providers/Microsoft.Network/privateEndpoints/endpointName1"), - // }, - // PrivateLinkServiceConnectionState: &armdesktopvirtualization.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Approved by admin@consoto.com"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armdesktopvirtualization.PrivateEndpointServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armdesktopvirtualization.PrivateEndpointConnectionProvisioningStateSucceeded), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/PrivateEndpointConnection_ListByHostPool.json -func ExamplePrivateEndpointConnectionsClient_NewListByHostPoolPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrivateEndpointConnectionsClient().NewListByHostPoolPager("resourceGroup1", "hostPool1", &armdesktopvirtualization.PrivateEndpointConnectionsClientListByHostPoolOptions{PageSize: nil, - IsDescending: nil, - InitialSkip: 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.PrivateEndpointConnectionListResultWithSystemData = armdesktopvirtualization.PrivateEndpointConnectionListResultWithSystemData{ - // Value: []*armdesktopvirtualization.PrivateEndpointConnectionWithSystemData{ - // { - // Name: to.Ptr("hostPool1.377103f1-5179-4bdf-8556-4cdd3207cc5b"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/hostpools/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostpools/hostPool1/privateEndpointConnections/hostPool1.377103f1-5179-4bdf-8556-4cdd3207cc5b"), - // Properties: &armdesktopvirtualization.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armdesktopvirtualization.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup2/providers/Microsoft.Network/privateEndpoints/endpointName1"), - // }, - // PrivateLinkServiceConnectionState: &armdesktopvirtualization.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Auto-Approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armdesktopvirtualization.PrivateEndpointServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armdesktopvirtualization.PrivateEndpointConnectionProvisioningStateSucceeded), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/PrivateEndpointConnection_GetByHostPool.json -func ExamplePrivateEndpointConnectionsClient_GetByHostPool() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateEndpointConnectionsClient().GetByHostPool(ctx, "resourceGroup1", "hostPool1", "hostPool1.377103f1-5179-4bdf-8556-4cdd3207cc5b", 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.PrivateEndpointConnectionWithSystemData = armdesktopvirtualization.PrivateEndpointConnectionWithSystemData{ - // Name: to.Ptr("hostPool1.377103f1-5179-4bdf-8556-4cdd3207cc5b"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/hostpools/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostpools/hostPool1/privateEndpointConnections/hostPool1.377103f1-5179-4bdf-8556-4cdd3207cc5b"), - // Properties: &armdesktopvirtualization.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armdesktopvirtualization.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup2/providers/Microsoft.Network/privateEndpoints/endpointName1"), - // }, - // PrivateLinkServiceConnectionState: &armdesktopvirtualization.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Auto-Approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armdesktopvirtualization.PrivateEndpointServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armdesktopvirtualization.PrivateEndpointConnectionProvisioningStateSucceeded), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/PrivateEndpointConnection_DeleteByHostPool.json -func ExamplePrivateEndpointConnectionsClient_DeleteByHostPool() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewPrivateEndpointConnectionsClient().DeleteByHostPool(ctx, "resourceGroup1", "hostPool1", "hostPool1.377103f1-5179-4bdf-8556-4cdd3207cc5b", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/PrivateEndpointConnection_UpdateByHostPool.json -func ExamplePrivateEndpointConnectionsClient_UpdateByHostPool() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateEndpointConnectionsClient().UpdateByHostPool(ctx, "resourceGroup1", "hostPool1", "hostPool1.377103f1-5179-4bdf-8556-4cdd3207cc5b", armdesktopvirtualization.PrivateEndpointConnection{ - Properties: &armdesktopvirtualization.PrivateEndpointConnectionProperties{ - PrivateLinkServiceConnectionState: &armdesktopvirtualization.PrivateLinkServiceConnectionState{ - Description: to.Ptr("Approved by admin@consoto.com"), - ActionsRequired: to.Ptr("None"), - Status: to.Ptr(armdesktopvirtualization.PrivateEndpointServiceConnectionStatusApproved), - }, - }, - }, 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.PrivateEndpointConnectionWithSystemData = armdesktopvirtualization.PrivateEndpointConnectionWithSystemData{ - // Name: to.Ptr("hostPool1.377103f1-5179-4bdf-8556-4cdd3207cc5b"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/hostpools/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostpools/hostPool1/privateEndpointConnections/hostPool1.377103f1-5179-4bdf-8556-4cdd3207cc5b"), - // Properties: &armdesktopvirtualization.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armdesktopvirtualization.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup2/providers/Microsoft.Network/privateEndpoints/endpointName1"), - // }, - // PrivateLinkServiceConnectionState: &armdesktopvirtualization.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Approved by admin@consoto.com"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armdesktopvirtualization.PrivateEndpointServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armdesktopvirtualization.PrivateEndpointConnectionProvisioningStateSucceeded), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // } -} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/privatelinkresources_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/privatelinkresources_client.go index fde5e1452281..c59b0d5205e8 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/privatelinkresources_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/privatelinkresources_client.go @@ -29,7 +29,7 @@ type PrivateLinkResourcesClient struct { } // NewPrivateLinkResourcesClient creates a new instance of PrivateLinkResourcesClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateLinkResourcesClient, error) { @@ -46,7 +46,7 @@ func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.Toke // NewListByHostPoolPager - List the private link resources available for this hostpool. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - hostPoolName - The name of the host pool within the specified resource group // - options - PrivateLinkResourcesClientListByHostPoolOptions contains the optional parameters for the PrivateLinkResourcesClient.NewListByHostPoolPager @@ -94,15 +94,15 @@ func (client *PrivateLinkResourcesClient) listByHostPoolCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") - if options != nil && options.PageSize != nil { - reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) + reqQP.Set("api-version", "2024-04-08-preview") + if options != nil && options.InitialSkip != nil { + reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) } if options != nil && options.IsDescending != nil { reqQP.Set("isDescending", strconv.FormatBool(*options.IsDescending)) } - if options != nil && options.InitialSkip != nil { - reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) + if options != nil && options.PageSize != nil { + reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} @@ -120,7 +120,7 @@ func (client *PrivateLinkResourcesClient) listByHostPoolHandleResponse(resp *htt // NewListByWorkspacePager - List the private link resources available for this workspace. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - The name of the workspace // - options - PrivateLinkResourcesClientListByWorkspaceOptions contains the optional parameters for the PrivateLinkResourcesClient.NewListByWorkspacePager @@ -168,15 +168,15 @@ func (client *PrivateLinkResourcesClient) listByWorkspaceCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") - if options != nil && options.PageSize != nil { - reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) + reqQP.Set("api-version", "2024-04-08-preview") + if options != nil && options.InitialSkip != nil { + reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) } if options != nil && options.IsDescending != nil { reqQP.Set("isDescending", strconv.FormatBool(*options.IsDescending)) } - if options != nil && options.InitialSkip != nil { - reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) + if options != nil && options.PageSize != nil { + reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/privatelinkresources_client_example_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/privatelinkresources_client_example_test.go deleted file mode 100644 index bda58a08b98a..000000000000 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/privatelinkresources_client_example_test.go +++ /dev/null @@ -1,110 +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 armdesktopvirtualization_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/PrivateLinkResources_ListByWorkspace.json -func ExamplePrivateLinkResourcesClient_NewListByWorkspacePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrivateLinkResourcesClient().NewListByWorkspacePager("resourceGroup1", "workspace1", &armdesktopvirtualization.PrivateLinkResourcesClientListByWorkspaceOptions{PageSize: nil, - IsDescending: nil, - InitialSkip: 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.PrivateLinkResourceListResult = armdesktopvirtualization.PrivateLinkResourceListResult{ - // Value: []*armdesktopvirtualization.PrivateLinkResource{ - // { - // Name: to.Ptr("workspace"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/workspaces/privateLinkResources"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/workspaces/workspace1/privateLinkResources/workspace"), - // Properties: &armdesktopvirtualization.PrivateLinkResourceProperties{ - // GroupID: to.Ptr("workspace"), - // RequiredMembers: []*string{ - // to.Ptr("rdbroker"), - // to.Ptr("rddiagnostics"), - // to.Ptr("rdweb"), - // to.Ptr("rdgateway")}, - // RequiredZoneNames: []*string{ - // to.Ptr("privatelink.wvd.microsoft.com")}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/PrivateLinkResources_ListByHostPool.json -func ExamplePrivateLinkResourcesClient_NewListByHostPoolPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrivateLinkResourcesClient().NewListByHostPoolPager("resourceGroup1", "hostPool1", &armdesktopvirtualization.PrivateLinkResourcesClientListByHostPoolOptions{PageSize: nil, - IsDescending: nil, - InitialSkip: 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.PrivateLinkResourceListResult = armdesktopvirtualization.PrivateLinkResourceListResult{ - // Value: []*armdesktopvirtualization.PrivateLinkResource{ - // { - // Name: to.Ptr("hostpool"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/hostpools/privateLinkResources"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostpools/hostPool1/privateLinkResources/hostpool"), - // Properties: &armdesktopvirtualization.PrivateLinkResourceProperties{ - // GroupID: to.Ptr("hostpool"), - // RequiredMembers: []*string{ - // to.Ptr("rdbroker"), - // to.Ptr("rddiagnostics"), - // to.Ptr("rdweb"), - // to.Ptr("rdgateway")}, - // RequiredZoneNames: []*string{ - // to.Ptr("privatelink.wvd.microsoft.com")}, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/response_types.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/responses.go similarity index 74% rename from sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/response_types.go rename to sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/responses.go index b02da3f1a5ba..543574568c99 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/response_types.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/responses.go @@ -8,6 +8,60 @@ package armdesktopvirtualization +// ActiveSessionHostConfigurationsClientGetResponse contains the response from method ActiveSessionHostConfigurationsClient.Get. +type ActiveSessionHostConfigurationsClientGetResponse struct { + // Represents a ActiveSessionHostConfiguration definition. This has all of the sessionHostConfiguration properties except + // provisioningState + ActiveSessionHostConfiguration +} + +// ActiveSessionHostConfigurationsClientListByHostPoolResponse contains the response from method ActiveSessionHostConfigurationsClient.NewListByHostPoolPager. +type ActiveSessionHostConfigurationsClientListByHostPoolResponse struct { + // List of ActiveSessionHostConfiguration definitions. + ActiveSessionHostConfigurationList +} + +// AppAttachPackageClientCreateOrUpdateResponse contains the response from method AppAttachPackageClient.CreateOrUpdate. +type AppAttachPackageClientCreateOrUpdateResponse struct { + // Schema for App Attach Package properties. + AppAttachPackage +} + +// AppAttachPackageClientDeleteResponse contains the response from method AppAttachPackageClient.Delete. +type AppAttachPackageClientDeleteResponse struct { + // placeholder for future response values +} + +// AppAttachPackageClientGetResponse contains the response from method AppAttachPackageClient.Get. +type AppAttachPackageClientGetResponse struct { + // Schema for App Attach Package properties. + AppAttachPackage +} + +// AppAttachPackageClientListByResourceGroupResponse contains the response from method AppAttachPackageClient.NewListByResourceGroupPager. +type AppAttachPackageClientListByResourceGroupResponse struct { + // List of App Attach Package definitions. + AppAttachPackageList +} + +// AppAttachPackageClientListBySubscriptionResponse contains the response from method AppAttachPackageClient.NewListBySubscriptionPager. +type AppAttachPackageClientListBySubscriptionResponse struct { + // List of App Attach Package definitions. + AppAttachPackageList +} + +// AppAttachPackageClientUpdateResponse contains the response from method AppAttachPackageClient.Update. +type AppAttachPackageClientUpdateResponse struct { + // Schema for App Attach Package properties. + AppAttachPackage +} + +// AppAttachPackageInfoClientImportResponse contains the response from method AppAttachPackageInfoClient.NewImportPager. +type AppAttachPackageInfoClientImportResponse struct { + // List of App Attach Package definitions. + AppAttachPackageList +} + // ApplicationGroupsClientCreateOrUpdateResponse contains the response from method ApplicationGroupsClient.CreateOrUpdate. type ApplicationGroupsClientCreateOrUpdateResponse struct { // Represents a ApplicationGroup definition. @@ -72,6 +126,11 @@ type ApplicationsClientUpdateResponse struct { Application } +// ControlSessionHostUpdateClientPostResponse contains the response from method ControlSessionHostUpdateClient.BeginPost. +type ControlSessionHostUpdateClientPostResponse struct { + // placeholder for future response values +} + // DesktopsClientGetResponse contains the response from method DesktopsClient.Get. type DesktopsClientGetResponse struct { // Schema for Desktop properties. @@ -113,6 +172,12 @@ type HostPoolsClientListByResourceGroupResponse struct { HostPoolList } +// HostPoolsClientListRegistrationTokensResponse contains the response from method HostPoolsClient.ListRegistrationTokens. +type HostPoolsClientListRegistrationTokensResponse struct { + // List of RegistrationToken definitions. + RegistrationTokenList +} + // HostPoolsClientListResponse contains the response from method HostPoolsClient.NewListPager. type HostPoolsClientListResponse struct { // List of HostPool definitions. @@ -131,6 +196,11 @@ type HostPoolsClientUpdateResponse struct { HostPool } +// InitiateSessionHostUpdateClientPostResponse contains the response from method InitiateSessionHostUpdateClient.Post. +type InitiateSessionHostUpdateClientPostResponse struct { + // placeholder for future response values +} + // MSIXPackagesClientCreateOrUpdateResponse contains the response from method MSIXPackagesClient.CreateOrUpdate. type MSIXPackagesClientCreateOrUpdateResponse struct { // Schema for MSIX Package properties. @@ -329,6 +399,65 @@ type ScalingPlansClientUpdateResponse struct { ScalingPlan } +// SessionHostClientRetryProvisioningResponse contains the response from method SessionHostClient.RetryProvisioning. +type SessionHostClientRetryProvisioningResponse struct { + // placeholder for future response values +} + +// SessionHostConfigurationsClientCreateOrUpdateResponse contains the response from method SessionHostConfigurationsClient.BeginCreateOrUpdate. +type SessionHostConfigurationsClientCreateOrUpdateResponse struct { + // Represents a SessionHostConfiguration definition. + SessionHostConfiguration +} + +// SessionHostConfigurationsClientGetResponse contains the response from method SessionHostConfigurationsClient.Get. +type SessionHostConfigurationsClientGetResponse struct { + // Represents a SessionHostConfiguration definition. + SessionHostConfiguration +} + +// SessionHostConfigurationsClientListByHostPoolResponse contains the response from method SessionHostConfigurationsClient.NewListByHostPoolPager. +type SessionHostConfigurationsClientListByHostPoolResponse struct { + // List of SessionHostConfiguration definitions. + SessionHostConfigurationList +} + +// SessionHostConfigurationsClientUpdateResponse contains the response from method SessionHostConfigurationsClient.BeginUpdate. +type SessionHostConfigurationsClientUpdateResponse struct { + // Represents a SessionHostConfiguration definition. + SessionHostConfiguration +} + +// SessionHostManagementsClientCreateOrUpdateResponse contains the response from method SessionHostManagementsClient.CreateOrUpdate. +type SessionHostManagementsClientCreateOrUpdateResponse struct { + // Represents a SessionHostManagement definition. + SessionHostManagement +} + +// SessionHostManagementsClientGetResponse contains the response from method SessionHostManagementsClient.Get. +type SessionHostManagementsClientGetResponse struct { + // Represents a SessionHostManagement definition. + SessionHostManagement +} + +// SessionHostManagementsClientListByHostPoolResponse contains the response from method SessionHostManagementsClient.NewListByHostPoolPager. +type SessionHostManagementsClientListByHostPoolResponse struct { + // List of SessionHostManagement definitions. + SessionHostManagementList +} + +// SessionHostManagementsClientUpdateResponse contains the response from method SessionHostManagementsClient.Update. +type SessionHostManagementsClientUpdateResponse struct { + // Represents a SessionHostManagement definition. + SessionHostManagement +} + +// SessionHostManagementsUpdateStatusClientGetResponse contains the response from method SessionHostManagementsUpdateStatusClient.Get. +type SessionHostManagementsUpdateStatusClientGetResponse struct { + // The current status of the session host update async operation. + SessionHostManagementUpdateStatus +} + // SessionHostsClientDeleteResponse contains the response from method SessionHostsClient.Delete. type SessionHostsClientDeleteResponse struct { // placeholder for future response values diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/scalingplanpersonalschedules_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/scalingplanpersonalschedules_client.go index f8268b53d2e0..3199c570e830 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/scalingplanpersonalschedules_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/scalingplanpersonalschedules_client.go @@ -29,7 +29,7 @@ type ScalingPlanPersonalSchedulesClient struct { } // NewScalingPlanPersonalSchedulesClient creates a new instance of ScalingPlanPersonalSchedulesClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewScalingPlanPersonalSchedulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ScalingPlanPersonalSchedulesClient, error) { @@ -47,7 +47,7 @@ func NewScalingPlanPersonalSchedulesClient(subscriptionID string, credential azc // Create - Create or update a ScalingPlanPersonalSchedule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - scalingPlanName - The name of the scaling plan. // - scalingPlanScheduleName - The name of the ScalingPlanSchedule @@ -100,7 +100,7 @@ func (client *ScalingPlanPersonalSchedulesClient) createCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-08-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, scalingPlanSchedule); err != nil { @@ -121,7 +121,7 @@ func (client *ScalingPlanPersonalSchedulesClient) createHandleResponse(resp *htt // Delete - Remove a ScalingPlanPersonalSchedule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - scalingPlanName - The name of the scaling plan. // - scalingPlanScheduleName - The name of the ScalingPlanSchedule @@ -172,7 +172,7 @@ func (client *ScalingPlanPersonalSchedulesClient) deleteCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-08-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -181,7 +181,7 @@ func (client *ScalingPlanPersonalSchedulesClient) deleteCreateRequest(ctx contex // Get - Get a ScalingPlanPersonalSchedule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - scalingPlanName - The name of the scaling plan. // - scalingPlanScheduleName - The name of the ScalingPlanSchedule @@ -233,7 +233,7 @@ func (client *ScalingPlanPersonalSchedulesClient) getCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-08-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -250,7 +250,7 @@ func (client *ScalingPlanPersonalSchedulesClient) getHandleResponse(resp *http.R // NewListPager - List ScalingPlanPersonalSchedules. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - scalingPlanName - The name of the scaling plan. // - options - ScalingPlanPersonalSchedulesClientListOptions contains the optional parameters for the ScalingPlanPersonalSchedulesClient.NewListPager @@ -298,15 +298,15 @@ func (client *ScalingPlanPersonalSchedulesClient) listCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") - if options != nil && options.PageSize != nil { - reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) + reqQP.Set("api-version", "2024-04-08-preview") + if options != nil && options.InitialSkip != nil { + reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) } if options != nil && options.IsDescending != nil { reqQP.Set("isDescending", strconv.FormatBool(*options.IsDescending)) } - if options != nil && options.InitialSkip != nil { - reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) + if options != nil && options.PageSize != nil { + reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} @@ -325,7 +325,7 @@ func (client *ScalingPlanPersonalSchedulesClient) listHandleResponse(resp *http. // Update - Update a ScalingPlanPersonalSchedule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - scalingPlanName - The name of the scaling plan. // - scalingPlanScheduleName - The name of the ScalingPlanSchedule @@ -377,7 +377,7 @@ func (client *ScalingPlanPersonalSchedulesClient) updateCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-08-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.ScalingPlanSchedule != nil { diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/scalingplanpersonalschedules_client_example_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/scalingplanpersonalschedules_client_example_test.go deleted file mode 100644 index b424b2607326..000000000000 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/scalingplanpersonalschedules_client_example_test.go +++ /dev/null @@ -1,488 +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 armdesktopvirtualization_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/desktopvirtualization/armdesktopvirtualization/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlanPersonalSchedule_Get.json -func ExampleScalingPlanPersonalSchedulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewScalingPlanPersonalSchedulesClient().Get(ctx, "resourceGroup1", "PersonalScalingPlan1", "PersonalScalingPlanSchedule", 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.ScalingPlanPersonalSchedule = armdesktopvirtualization.ScalingPlanPersonalSchedule{ - // Name: to.Ptr("PersonalScalingPlanSchedule"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/scalingPlans/personalSchedules"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/scalingPlans/scalingPlan1/personalSchedules/PersonalScalingPlanScheduleWeekdays1"), - // Properties: &armdesktopvirtualization.ScalingPlanPersonalScheduleProperties{ - // DaysOfWeek: []*armdesktopvirtualization.DayOfWeek{ - // to.Ptr(armdesktopvirtualization.DayOfWeekMonday), - // to.Ptr(armdesktopvirtualization.DayOfWeekTuesday), - // to.Ptr(armdesktopvirtualization.DayOfWeekWednesday), - // to.Ptr(armdesktopvirtualization.DayOfWeekThursday), - // to.Ptr(armdesktopvirtualization.DayOfWeekFriday)}, - // OffPeakActionOnDisconnect: to.Ptr(armdesktopvirtualization.SessionHandlingOperationNone), - // OffPeakActionOnLogoff: to.Ptr(armdesktopvirtualization.SessionHandlingOperationDeallocate), - // OffPeakMinutesToWaitOnDisconnect: to.Ptr[int32](10), - // OffPeakMinutesToWaitOnLogoff: to.Ptr[int32](10), - // OffPeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](20), - // Minute: to.Ptr[int32](0), - // }, - // OffPeakStartVMOnConnect: to.Ptr(armdesktopvirtualization.SetStartVMOnConnectEnable), - // PeakActionOnDisconnect: to.Ptr(armdesktopvirtualization.SessionHandlingOperationNone), - // PeakActionOnLogoff: to.Ptr(armdesktopvirtualization.SessionHandlingOperationDeallocate), - // PeakMinutesToWaitOnDisconnect: to.Ptr[int32](10), - // PeakMinutesToWaitOnLogoff: to.Ptr[int32](10), - // PeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](8), - // Minute: to.Ptr[int32](0), - // }, - // PeakStartVMOnConnect: to.Ptr(armdesktopvirtualization.SetStartVMOnConnectEnable), - // RampDownActionOnDisconnect: to.Ptr(armdesktopvirtualization.SessionHandlingOperationNone), - // RampDownActionOnLogoff: to.Ptr(armdesktopvirtualization.SessionHandlingOperationDeallocate), - // RampDownMinutesToWaitOnDisconnect: to.Ptr[int32](10), - // RampDownMinutesToWaitOnLogoff: to.Ptr[int32](10), - // RampDownStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](18), - // Minute: to.Ptr[int32](0), - // }, - // RampDownStartVMOnConnect: to.Ptr(armdesktopvirtualization.SetStartVMOnConnectEnable), - // RampUpActionOnDisconnect: to.Ptr(armdesktopvirtualization.SessionHandlingOperationNone), - // RampUpActionOnLogoff: to.Ptr(armdesktopvirtualization.SessionHandlingOperationNone), - // RampUpAutoStartHosts: to.Ptr(armdesktopvirtualization.StartupBehaviorAll), - // RampUpMinutesToWaitOnDisconnect: to.Ptr[int32](10), - // RampUpMinutesToWaitOnLogoff: to.Ptr[int32](10), - // RampUpStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](6), - // Minute: to.Ptr[int32](0), - // }, - // RampUpStartVMOnConnect: to.Ptr(armdesktopvirtualization.SetStartVMOnConnectEnable), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlanPersonalSchedule_Create.json -func ExampleScalingPlanPersonalSchedulesClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewScalingPlanPersonalSchedulesClient().Create(ctx, "resourceGroup1", "scalingPlan1", "scalingPlanScheduleWeekdays1", armdesktopvirtualization.ScalingPlanPersonalSchedule{ - Properties: &armdesktopvirtualization.ScalingPlanPersonalScheduleProperties{ - DaysOfWeek: []*armdesktopvirtualization.DayOfWeek{ - to.Ptr(armdesktopvirtualization.DayOfWeekMonday), - to.Ptr(armdesktopvirtualization.DayOfWeekTuesday), - to.Ptr(armdesktopvirtualization.DayOfWeekWednesday), - to.Ptr(armdesktopvirtualization.DayOfWeekThursday), - to.Ptr(armdesktopvirtualization.DayOfWeekFriday)}, - OffPeakActionOnDisconnect: to.Ptr(armdesktopvirtualization.SessionHandlingOperationNone), - OffPeakActionOnLogoff: to.Ptr(armdesktopvirtualization.SessionHandlingOperationDeallocate), - OffPeakMinutesToWaitOnDisconnect: to.Ptr[int32](10), - OffPeakMinutesToWaitOnLogoff: to.Ptr[int32](10), - OffPeakStartTime: &armdesktopvirtualization.Time{ - Hour: to.Ptr[int32](20), - Minute: to.Ptr[int32](0), - }, - OffPeakStartVMOnConnect: to.Ptr(armdesktopvirtualization.SetStartVMOnConnectEnable), - PeakActionOnDisconnect: to.Ptr(armdesktopvirtualization.SessionHandlingOperationNone), - PeakActionOnLogoff: to.Ptr(armdesktopvirtualization.SessionHandlingOperationDeallocate), - PeakMinutesToWaitOnDisconnect: to.Ptr[int32](10), - PeakMinutesToWaitOnLogoff: to.Ptr[int32](10), - PeakStartTime: &armdesktopvirtualization.Time{ - Hour: to.Ptr[int32](8), - Minute: to.Ptr[int32](0), - }, - PeakStartVMOnConnect: to.Ptr(armdesktopvirtualization.SetStartVMOnConnectEnable), - RampDownActionOnDisconnect: to.Ptr(armdesktopvirtualization.SessionHandlingOperationNone), - RampDownActionOnLogoff: to.Ptr(armdesktopvirtualization.SessionHandlingOperationDeallocate), - RampDownMinutesToWaitOnDisconnect: to.Ptr[int32](10), - RampDownMinutesToWaitOnLogoff: to.Ptr[int32](10), - RampDownStartTime: &armdesktopvirtualization.Time{ - Hour: to.Ptr[int32](18), - Minute: to.Ptr[int32](0), - }, - RampDownStartVMOnConnect: to.Ptr(armdesktopvirtualization.SetStartVMOnConnectEnable), - RampUpActionOnDisconnect: to.Ptr(armdesktopvirtualization.SessionHandlingOperationNone), - RampUpActionOnLogoff: to.Ptr(armdesktopvirtualization.SessionHandlingOperationNone), - RampUpAutoStartHosts: to.Ptr(armdesktopvirtualization.StartupBehaviorAll), - RampUpMinutesToWaitOnDisconnect: to.Ptr[int32](10), - RampUpMinutesToWaitOnLogoff: to.Ptr[int32](10), - RampUpStartTime: &armdesktopvirtualization.Time{ - Hour: to.Ptr[int32](6), - Minute: to.Ptr[int32](0), - }, - RampUpStartVMOnConnect: to.Ptr(armdesktopvirtualization.SetStartVMOnConnectEnable), - }, - }, 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.ScalingPlanPersonalSchedule = armdesktopvirtualization.ScalingPlanPersonalSchedule{ - // Name: to.Ptr("scalingPlanScheduleWeekdays1"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/scalingPlans/personalSchedules"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/scalingPlans/scalingPlan1/personalSchedules/scalingPlanScheduleWeekdays1"), - // Properties: &armdesktopvirtualization.ScalingPlanPersonalScheduleProperties{ - // DaysOfWeek: []*armdesktopvirtualization.DayOfWeek{ - // to.Ptr(armdesktopvirtualization.DayOfWeekMonday), - // to.Ptr(armdesktopvirtualization.DayOfWeekTuesday), - // to.Ptr(armdesktopvirtualization.DayOfWeekWednesday), - // to.Ptr(armdesktopvirtualization.DayOfWeekThursday), - // to.Ptr(armdesktopvirtualization.DayOfWeekFriday)}, - // OffPeakActionOnDisconnect: to.Ptr(armdesktopvirtualization.SessionHandlingOperationNone), - // OffPeakActionOnLogoff: to.Ptr(armdesktopvirtualization.SessionHandlingOperationDeallocate), - // OffPeakMinutesToWaitOnDisconnect: to.Ptr[int32](10), - // OffPeakMinutesToWaitOnLogoff: to.Ptr[int32](10), - // OffPeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](20), - // Minute: to.Ptr[int32](0), - // }, - // OffPeakStartVMOnConnect: to.Ptr(armdesktopvirtualization.SetStartVMOnConnectEnable), - // PeakActionOnDisconnect: to.Ptr(armdesktopvirtualization.SessionHandlingOperationNone), - // PeakActionOnLogoff: to.Ptr(armdesktopvirtualization.SessionHandlingOperationDeallocate), - // PeakMinutesToWaitOnDisconnect: to.Ptr[int32](10), - // PeakMinutesToWaitOnLogoff: to.Ptr[int32](10), - // PeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](8), - // Minute: to.Ptr[int32](0), - // }, - // PeakStartVMOnConnect: to.Ptr(armdesktopvirtualization.SetStartVMOnConnectEnable), - // RampDownActionOnDisconnect: to.Ptr(armdesktopvirtualization.SessionHandlingOperationNone), - // RampDownActionOnLogoff: to.Ptr(armdesktopvirtualization.SessionHandlingOperationDeallocate), - // RampDownMinutesToWaitOnDisconnect: to.Ptr[int32](10), - // RampDownMinutesToWaitOnLogoff: to.Ptr[int32](10), - // RampDownStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](18), - // Minute: to.Ptr[int32](0), - // }, - // RampDownStartVMOnConnect: to.Ptr(armdesktopvirtualization.SetStartVMOnConnectEnable), - // RampUpActionOnDisconnect: to.Ptr(armdesktopvirtualization.SessionHandlingOperationNone), - // RampUpActionOnLogoff: to.Ptr(armdesktopvirtualization.SessionHandlingOperationNone), - // RampUpAutoStartHosts: to.Ptr(armdesktopvirtualization.StartupBehaviorAll), - // RampUpMinutesToWaitOnDisconnect: to.Ptr[int32](10), - // RampUpMinutesToWaitOnLogoff: to.Ptr[int32](10), - // RampUpStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](6), - // Minute: to.Ptr[int32](0), - // }, - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlanPersonalSchedule_Delete.json -func ExampleScalingPlanPersonalSchedulesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewScalingPlanPersonalSchedulesClient().Delete(ctx, "resourceGroup1", "scalingPlan1", "scalingPlanScheduleWeekdays1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlanPersonalSchedule_Update.json -func ExampleScalingPlanPersonalSchedulesClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewScalingPlanPersonalSchedulesClient().Update(ctx, "resourceGroup1", "scalingPlan1", "scalingPlanScheduleWeekdays1", &armdesktopvirtualization.ScalingPlanPersonalSchedulesClientUpdateOptions{ScalingPlanSchedule: &armdesktopvirtualization.ScalingPlanPersonalSchedulePatch{ - Properties: &armdesktopvirtualization.ScalingPlanPersonalScheduleProperties{ - OffPeakActionOnDisconnect: to.Ptr(armdesktopvirtualization.SessionHandlingOperationNone), - OffPeakActionOnLogoff: to.Ptr(armdesktopvirtualization.SessionHandlingOperationDeallocate), - OffPeakMinutesToWaitOnDisconnect: to.Ptr[int32](10), - OffPeakMinutesToWaitOnLogoff: to.Ptr[int32](10), - OffPeakStartTime: &armdesktopvirtualization.Time{ - Hour: to.Ptr[int32](20), - Minute: to.Ptr[int32](0), - }, - OffPeakStartVMOnConnect: to.Ptr(armdesktopvirtualization.SetStartVMOnConnectDisable), - PeakActionOnDisconnect: to.Ptr(armdesktopvirtualization.SessionHandlingOperationNone), - PeakActionOnLogoff: to.Ptr(armdesktopvirtualization.SessionHandlingOperationDeallocate), - PeakMinutesToWaitOnDisconnect: to.Ptr[int32](10), - PeakMinutesToWaitOnLogoff: to.Ptr[int32](10), - PeakStartTime: &armdesktopvirtualization.Time{ - Hour: to.Ptr[int32](8), - Minute: to.Ptr[int32](0), - }, - RampDownActionOnDisconnect: to.Ptr(armdesktopvirtualization.SessionHandlingOperationNone), - RampDownActionOnLogoff: to.Ptr(armdesktopvirtualization.SessionHandlingOperationDeallocate), - RampDownMinutesToWaitOnDisconnect: to.Ptr[int32](10), - RampDownMinutesToWaitOnLogoff: to.Ptr[int32](10), - RampDownStartTime: &armdesktopvirtualization.Time{ - Hour: to.Ptr[int32](18), - Minute: to.Ptr[int32](0), - }, - }, - }, - }) - 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.ScalingPlanPersonalSchedule = armdesktopvirtualization.ScalingPlanPersonalSchedule{ - // Name: to.Ptr("scalingPlanScheduleWeekdays1"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/scalingPlans/personalSchedules"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/scalingPlans/scalingPlan1/personalSchedules/scalingPlanScheduleWeekdays1"), - // Properties: &armdesktopvirtualization.ScalingPlanPersonalScheduleProperties{ - // DaysOfWeek: []*armdesktopvirtualization.DayOfWeek{ - // to.Ptr(armdesktopvirtualization.DayOfWeekMonday), - // to.Ptr(armdesktopvirtualization.DayOfWeekTuesday), - // to.Ptr(armdesktopvirtualization.DayOfWeekWednesday), - // to.Ptr(armdesktopvirtualization.DayOfWeekThursday), - // to.Ptr(armdesktopvirtualization.DayOfWeekFriday)}, - // OffPeakActionOnDisconnect: to.Ptr(armdesktopvirtualization.SessionHandlingOperationNone), - // OffPeakActionOnLogoff: to.Ptr(armdesktopvirtualization.SessionHandlingOperationDeallocate), - // OffPeakMinutesToWaitOnDisconnect: to.Ptr[int32](10), - // OffPeakMinutesToWaitOnLogoff: to.Ptr[int32](10), - // OffPeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](20), - // Minute: to.Ptr[int32](0), - // }, - // OffPeakStartVMOnConnect: to.Ptr(armdesktopvirtualization.SetStartVMOnConnectDisable), - // PeakActionOnDisconnect: to.Ptr(armdesktopvirtualization.SessionHandlingOperationNone), - // PeakActionOnLogoff: to.Ptr(armdesktopvirtualization.SessionHandlingOperationDeallocate), - // PeakMinutesToWaitOnDisconnect: to.Ptr[int32](10), - // PeakMinutesToWaitOnLogoff: to.Ptr[int32](10), - // PeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](8), - // Minute: to.Ptr[int32](0), - // }, - // PeakStartVMOnConnect: to.Ptr(armdesktopvirtualization.SetStartVMOnConnectEnable), - // RampDownActionOnDisconnect: to.Ptr(armdesktopvirtualization.SessionHandlingOperationNone), - // RampDownActionOnLogoff: to.Ptr(armdesktopvirtualization.SessionHandlingOperationDeallocate), - // RampDownMinutesToWaitOnDisconnect: to.Ptr[int32](10), - // RampDownMinutesToWaitOnLogoff: to.Ptr[int32](10), - // RampDownStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](18), - // Minute: to.Ptr[int32](0), - // }, - // RampDownStartVMOnConnect: to.Ptr(armdesktopvirtualization.SetStartVMOnConnectEnable), - // RampUpActionOnDisconnect: to.Ptr(armdesktopvirtualization.SessionHandlingOperationNone), - // RampUpActionOnLogoff: to.Ptr(armdesktopvirtualization.SessionHandlingOperationNone), - // RampUpAutoStartHosts: to.Ptr(armdesktopvirtualization.StartupBehaviorAll), - // RampUpMinutesToWaitOnDisconnect: to.Ptr[int32](10), - // RampUpMinutesToWaitOnLogoff: to.Ptr[int32](10), - // RampUpStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](6), - // Minute: to.Ptr[int32](0), - // }, - // RampUpStartVMOnConnect: to.Ptr(armdesktopvirtualization.SetStartVMOnConnectEnable), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlanPersonalSchedule_List.json -func ExampleScalingPlanPersonalSchedulesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewScalingPlanPersonalSchedulesClient().NewListPager("resourceGroup1", "scalingPlan", &armdesktopvirtualization.ScalingPlanPersonalSchedulesClientListOptions{PageSize: to.Ptr[int32](10), - IsDescending: to.Ptr(true), - InitialSkip: to.Ptr[int32](0), - }) - 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.ScalingPlanPersonalScheduleList = armdesktopvirtualization.ScalingPlanPersonalScheduleList{ - // Value: []*armdesktopvirtualization.ScalingPlanPersonalSchedule{ - // { - // Name: to.Ptr("scalingPlanScheduleWeekday"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/scalingPlans/personalSchedules"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/scalingPlans/scalingPlan1/personalSchedules/scalingPlanScheduleWeekdays1"), - // Properties: &armdesktopvirtualization.ScalingPlanPersonalScheduleProperties{ - // DaysOfWeek: []*armdesktopvirtualization.DayOfWeek{ - // to.Ptr(armdesktopvirtualization.DayOfWeekMonday), - // to.Ptr(armdesktopvirtualization.DayOfWeekTuesday), - // to.Ptr(armdesktopvirtualization.DayOfWeekWednesday), - // to.Ptr(armdesktopvirtualization.DayOfWeekThursday), - // to.Ptr(armdesktopvirtualization.DayOfWeekFriday)}, - // OffPeakActionOnDisconnect: to.Ptr(armdesktopvirtualization.SessionHandlingOperationNone), - // OffPeakActionOnLogoff: to.Ptr(armdesktopvirtualization.SessionHandlingOperationDeallocate), - // OffPeakMinutesToWaitOnDisconnect: to.Ptr[int32](10), - // OffPeakMinutesToWaitOnLogoff: to.Ptr[int32](10), - // OffPeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](20), - // Minute: to.Ptr[int32](0), - // }, - // OffPeakStartVMOnConnect: to.Ptr(armdesktopvirtualization.SetStartVMOnConnectEnable), - // PeakActionOnDisconnect: to.Ptr(armdesktopvirtualization.SessionHandlingOperationNone), - // PeakActionOnLogoff: to.Ptr(armdesktopvirtualization.SessionHandlingOperationDeallocate), - // PeakMinutesToWaitOnDisconnect: to.Ptr[int32](10), - // PeakMinutesToWaitOnLogoff: to.Ptr[int32](10), - // PeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](8), - // Minute: to.Ptr[int32](0), - // }, - // PeakStartVMOnConnect: to.Ptr(armdesktopvirtualization.SetStartVMOnConnectEnable), - // RampDownActionOnDisconnect: to.Ptr(armdesktopvirtualization.SessionHandlingOperationNone), - // RampDownActionOnLogoff: to.Ptr(armdesktopvirtualization.SessionHandlingOperationDeallocate), - // RampDownMinutesToWaitOnDisconnect: to.Ptr[int32](10), - // RampDownMinutesToWaitOnLogoff: to.Ptr[int32](10), - // RampDownStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](18), - // Minute: to.Ptr[int32](0), - // }, - // RampDownStartVMOnConnect: to.Ptr(armdesktopvirtualization.SetStartVMOnConnectEnable), - // RampUpActionOnDisconnect: to.Ptr(armdesktopvirtualization.SessionHandlingOperationNone), - // RampUpActionOnLogoff: to.Ptr(armdesktopvirtualization.SessionHandlingOperationNone), - // RampUpAutoStartHosts: to.Ptr(armdesktopvirtualization.StartupBehaviorAll), - // RampUpMinutesToWaitOnDisconnect: to.Ptr[int32](10), - // RampUpMinutesToWaitOnLogoff: to.Ptr[int32](10), - // RampUpStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](6), - // Minute: to.Ptr[int32](0), - // }, - // RampUpStartVMOnConnect: to.Ptr(armdesktopvirtualization.SetStartVMOnConnectEnable), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }, - // { - // Name: to.Ptr("scalingPlanScheduleWeekend"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/scalingPlans/personalSchedules"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/scalingPlans/scalingPlan1/personalSchedules/scalingPlanScheduleWeekends1"), - // Properties: &armdesktopvirtualization.ScalingPlanPersonalScheduleProperties{ - // DaysOfWeek: []*armdesktopvirtualization.DayOfWeek{ - // to.Ptr(armdesktopvirtualization.DayOfWeekSaturday), - // to.Ptr(armdesktopvirtualization.DayOfWeekSunday)}, - // OffPeakActionOnDisconnect: to.Ptr(armdesktopvirtualization.SessionHandlingOperationDeallocate), - // OffPeakActionOnLogoff: to.Ptr(armdesktopvirtualization.SessionHandlingOperationDeallocate), - // OffPeakMinutesToWaitOnDisconnect: to.Ptr[int32](10), - // OffPeakMinutesToWaitOnLogoff: to.Ptr[int32](10), - // OffPeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](16), - // Minute: to.Ptr[int32](0), - // }, - // OffPeakStartVMOnConnect: to.Ptr(armdesktopvirtualization.SetStartVMOnConnectEnable), - // PeakActionOnDisconnect: to.Ptr(armdesktopvirtualization.SessionHandlingOperationDeallocate), - // PeakActionOnLogoff: to.Ptr(armdesktopvirtualization.SessionHandlingOperationDeallocate), - // PeakMinutesToWaitOnDisconnect: to.Ptr[int32](10), - // PeakMinutesToWaitOnLogoff: to.Ptr[int32](10), - // PeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](10), - // Minute: to.Ptr[int32](0), - // }, - // PeakStartVMOnConnect: to.Ptr(armdesktopvirtualization.SetStartVMOnConnectEnable), - // RampDownActionOnDisconnect: to.Ptr(armdesktopvirtualization.SessionHandlingOperationDeallocate), - // RampDownActionOnLogoff: to.Ptr(armdesktopvirtualization.SessionHandlingOperationDeallocate), - // RampDownMinutesToWaitOnDisconnect: to.Ptr[int32](10), - // RampDownMinutesToWaitOnLogoff: to.Ptr[int32](10), - // RampDownStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](14), - // Minute: to.Ptr[int32](0), - // }, - // RampDownStartVMOnConnect: to.Ptr(armdesktopvirtualization.SetStartVMOnConnectEnable), - // RampUpActionOnDisconnect: to.Ptr(armdesktopvirtualization.SessionHandlingOperationNone), - // RampUpActionOnLogoff: to.Ptr(armdesktopvirtualization.SessionHandlingOperationNone), - // RampUpAutoStartHosts: to.Ptr(armdesktopvirtualization.StartupBehaviorAll), - // RampUpMinutesToWaitOnDisconnect: to.Ptr[int32](10), - // RampUpMinutesToWaitOnLogoff: to.Ptr[int32](10), - // RampUpStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](6), - // Minute: to.Ptr[int32](0), - // }, - // RampUpStartVMOnConnect: to.Ptr(armdesktopvirtualization.SetStartVMOnConnectEnable), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/scalingplanpooledschedules_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/scalingplanpooledschedules_client.go index 033733d3df31..7fdad1fd9064 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/scalingplanpooledschedules_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/scalingplanpooledschedules_client.go @@ -29,7 +29,7 @@ type ScalingPlanPooledSchedulesClient struct { } // NewScalingPlanPooledSchedulesClient creates a new instance of ScalingPlanPooledSchedulesClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewScalingPlanPooledSchedulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ScalingPlanPooledSchedulesClient, error) { @@ -47,7 +47,7 @@ func NewScalingPlanPooledSchedulesClient(subscriptionID string, credential azcor // Create - Create or update a ScalingPlanPooledSchedule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - scalingPlanName - The name of the scaling plan. // - scalingPlanScheduleName - The name of the ScalingPlanSchedule @@ -100,7 +100,7 @@ func (client *ScalingPlanPooledSchedulesClient) createCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-08-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, scalingPlanSchedule); err != nil { @@ -121,7 +121,7 @@ func (client *ScalingPlanPooledSchedulesClient) createHandleResponse(resp *http. // Delete - Remove a ScalingPlanPooledSchedule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - scalingPlanName - The name of the scaling plan. // - scalingPlanScheduleName - The name of the ScalingPlanSchedule @@ -172,7 +172,7 @@ func (client *ScalingPlanPooledSchedulesClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-08-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -181,7 +181,7 @@ func (client *ScalingPlanPooledSchedulesClient) deleteCreateRequest(ctx context. // Get - Get a ScalingPlanPooledSchedule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - scalingPlanName - The name of the scaling plan. // - scalingPlanScheduleName - The name of the ScalingPlanSchedule @@ -233,7 +233,7 @@ func (client *ScalingPlanPooledSchedulesClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-08-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -250,7 +250,7 @@ func (client *ScalingPlanPooledSchedulesClient) getHandleResponse(resp *http.Res // NewListPager - List ScalingPlanPooledSchedules. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - scalingPlanName - The name of the scaling plan. // - options - ScalingPlanPooledSchedulesClientListOptions contains the optional parameters for the ScalingPlanPooledSchedulesClient.NewListPager @@ -298,15 +298,15 @@ func (client *ScalingPlanPooledSchedulesClient) listCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") - if options != nil && options.PageSize != nil { - reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) + reqQP.Set("api-version", "2024-04-08-preview") + if options != nil && options.InitialSkip != nil { + reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) } if options != nil && options.IsDescending != nil { reqQP.Set("isDescending", strconv.FormatBool(*options.IsDescending)) } - if options != nil && options.InitialSkip != nil { - reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) + if options != nil && options.PageSize != nil { + reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} @@ -325,7 +325,7 @@ func (client *ScalingPlanPooledSchedulesClient) listHandleResponse(resp *http.Re // Update - Update a ScalingPlanPooledSchedule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - scalingPlanName - The name of the scaling plan. // - scalingPlanScheduleName - The name of the ScalingPlanSchedule @@ -377,7 +377,7 @@ func (client *ScalingPlanPooledSchedulesClient) updateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-08-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.ScalingPlanSchedule != nil { diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/scalingplanpooledschedules_client_example_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/scalingplanpooledschedules_client_example_test.go deleted file mode 100644 index 89408761a854..000000000000 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/scalingplanpooledschedules_client_example_test.go +++ /dev/null @@ -1,419 +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 armdesktopvirtualization_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/desktopvirtualization/armdesktopvirtualization/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlanPooledSchedule_Get.json -func ExampleScalingPlanPooledSchedulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewScalingPlanPooledSchedulesClient().Get(ctx, "resourceGroup1", "scalingPlan1", "scalingPlanScheduleWeekdays1", 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.ScalingPlanPooledSchedule = armdesktopvirtualization.ScalingPlanPooledSchedule{ - // Name: to.Ptr("scalingPlanScheduleWeekdays1"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/scalingPlans/pooledSchedules"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/scalingPlans/scalingPlan1/pooledSchedules/scalingPlanScheduleWeekdays1"), - // Properties: &armdesktopvirtualization.ScalingPlanPooledScheduleProperties{ - // DaysOfWeek: []*armdesktopvirtualization.DayOfWeek{ - // to.Ptr(armdesktopvirtualization.DayOfWeekMonday), - // to.Ptr(armdesktopvirtualization.DayOfWeekTuesday), - // to.Ptr(armdesktopvirtualization.DayOfWeekWednesday), - // to.Ptr(armdesktopvirtualization.DayOfWeekThursday), - // to.Ptr(armdesktopvirtualization.DayOfWeekFriday)}, - // OffPeakLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // OffPeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](20), - // Minute: to.Ptr[int32](0), - // }, - // PeakLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmBreadthFirst), - // PeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](8), - // Minute: to.Ptr[int32](0), - // }, - // RampDownCapacityThresholdPct: to.Ptr[int32](50), - // RampDownForceLogoffUsers: to.Ptr(true), - // RampDownLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // RampDownMinimumHostsPct: to.Ptr[int32](20), - // RampDownNotificationMessage: to.Ptr("message"), - // RampDownStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](18), - // Minute: to.Ptr[int32](0), - // }, - // RampDownWaitTimeMinutes: to.Ptr[int32](30), - // RampUpCapacityThresholdPct: to.Ptr[int32](80), - // RampUpLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // RampUpMinimumHostsPct: to.Ptr[int32](20), - // RampUpStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](6), - // Minute: to.Ptr[int32](0), - // }, - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlanPooledSchedule_Create.json -func ExampleScalingPlanPooledSchedulesClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewScalingPlanPooledSchedulesClient().Create(ctx, "resourceGroup1", "scalingPlan1", "scalingPlanScheduleWeekdays1", armdesktopvirtualization.ScalingPlanPooledSchedule{ - Properties: &armdesktopvirtualization.ScalingPlanPooledScheduleProperties{ - DaysOfWeek: []*armdesktopvirtualization.DayOfWeek{ - to.Ptr(armdesktopvirtualization.DayOfWeekMonday), - to.Ptr(armdesktopvirtualization.DayOfWeekTuesday), - to.Ptr(armdesktopvirtualization.DayOfWeekWednesday), - to.Ptr(armdesktopvirtualization.DayOfWeekThursday), - to.Ptr(armdesktopvirtualization.DayOfWeekFriday)}, - OffPeakLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - OffPeakStartTime: &armdesktopvirtualization.Time{ - Hour: to.Ptr[int32](20), - Minute: to.Ptr[int32](0), - }, - PeakLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmBreadthFirst), - PeakStartTime: &armdesktopvirtualization.Time{ - Hour: to.Ptr[int32](8), - Minute: to.Ptr[int32](0), - }, - RampDownCapacityThresholdPct: to.Ptr[int32](50), - RampDownForceLogoffUsers: to.Ptr(true), - RampDownLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - RampDownMinimumHostsPct: to.Ptr[int32](20), - RampDownNotificationMessage: to.Ptr("message"), - RampDownStartTime: &armdesktopvirtualization.Time{ - Hour: to.Ptr[int32](18), - Minute: to.Ptr[int32](0), - }, - RampDownWaitTimeMinutes: to.Ptr[int32](30), - RampUpCapacityThresholdPct: to.Ptr[int32](80), - RampUpLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - RampUpMinimumHostsPct: to.Ptr[int32](20), - RampUpStartTime: &armdesktopvirtualization.Time{ - Hour: to.Ptr[int32](6), - Minute: to.Ptr[int32](0), - }, - }, - }, 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.ScalingPlanPooledSchedule = armdesktopvirtualization.ScalingPlanPooledSchedule{ - // Name: to.Ptr("scalingPlanScheduleWeekdays1"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/scalingPlans/pooledSchedules"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/scalingPlans/scalingPlan1/pooledSchedules/scalingPlanScheduleWeekdays1"), - // Properties: &armdesktopvirtualization.ScalingPlanPooledScheduleProperties{ - // DaysOfWeek: []*armdesktopvirtualization.DayOfWeek{ - // to.Ptr(armdesktopvirtualization.DayOfWeekMonday), - // to.Ptr(armdesktopvirtualization.DayOfWeekTuesday), - // to.Ptr(armdesktopvirtualization.DayOfWeekWednesday), - // to.Ptr(armdesktopvirtualization.DayOfWeekThursday), - // to.Ptr(armdesktopvirtualization.DayOfWeekFriday)}, - // OffPeakLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // OffPeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](20), - // Minute: to.Ptr[int32](0), - // }, - // PeakLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmBreadthFirst), - // PeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](8), - // Minute: to.Ptr[int32](0), - // }, - // RampDownCapacityThresholdPct: to.Ptr[int32](50), - // RampDownForceLogoffUsers: to.Ptr(true), - // RampDownLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // RampDownMinimumHostsPct: to.Ptr[int32](20), - // RampDownNotificationMessage: to.Ptr("message"), - // RampDownStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](18), - // Minute: to.Ptr[int32](0), - // }, - // RampDownWaitTimeMinutes: to.Ptr[int32](30), - // RampUpCapacityThresholdPct: to.Ptr[int32](80), - // RampUpLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // RampUpMinimumHostsPct: to.Ptr[int32](20), - // RampUpStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](6), - // Minute: to.Ptr[int32](0), - // }, - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlanPooledSchedule_Delete.json -func ExampleScalingPlanPooledSchedulesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewScalingPlanPooledSchedulesClient().Delete(ctx, "resourceGroup1", "scalingPlan1", "scalingPlanScheduleWeekdays1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlanPooledSchedule_Update.json -func ExampleScalingPlanPooledSchedulesClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewScalingPlanPooledSchedulesClient().Update(ctx, "resourceGroup1", "scalingPlan1", "scalingPlanScheduleWeekdays1", &armdesktopvirtualization.ScalingPlanPooledSchedulesClientUpdateOptions{ScalingPlanSchedule: &armdesktopvirtualization.ScalingPlanPooledSchedulePatch{ - Properties: &armdesktopvirtualization.ScalingPlanPooledScheduleProperties{ - DaysOfWeek: []*armdesktopvirtualization.DayOfWeek{ - to.Ptr(armdesktopvirtualization.DayOfWeekMonday), - to.Ptr(armdesktopvirtualization.DayOfWeekTuesday), - to.Ptr(armdesktopvirtualization.DayOfWeekWednesday), - to.Ptr(armdesktopvirtualization.DayOfWeekThursday), - to.Ptr(armdesktopvirtualization.DayOfWeekFriday)}, - PeakStartTime: &armdesktopvirtualization.Time{ - Hour: to.Ptr[int32](8), - Minute: to.Ptr[int32](0), - }, - RampDownLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - RampDownMinimumHostsPct: to.Ptr[int32](20), - RampDownWaitTimeMinutes: to.Ptr[int32](30), - RampUpCapacityThresholdPct: to.Ptr[int32](80), - RampUpLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - }, - }, - }) - 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.ScalingPlanPooledSchedule = armdesktopvirtualization.ScalingPlanPooledSchedule{ - // Name: to.Ptr("scalingPlanScheduleWeekdays1"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/scalingPlans/pooledSchedules"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/scalingPlans/scalingPlan1/pooledSchedules/scalingPlanScheduleWeekdays1"), - // Properties: &armdesktopvirtualization.ScalingPlanPooledScheduleProperties{ - // DaysOfWeek: []*armdesktopvirtualization.DayOfWeek{ - // to.Ptr(armdesktopvirtualization.DayOfWeekMonday), - // to.Ptr(armdesktopvirtualization.DayOfWeekTuesday), - // to.Ptr(armdesktopvirtualization.DayOfWeekWednesday), - // to.Ptr(armdesktopvirtualization.DayOfWeekThursday), - // to.Ptr(armdesktopvirtualization.DayOfWeekFriday)}, - // OffPeakLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // OffPeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](20), - // Minute: to.Ptr[int32](0), - // }, - // PeakLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmBreadthFirst), - // PeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](8), - // Minute: to.Ptr[int32](0), - // }, - // RampDownCapacityThresholdPct: to.Ptr[int32](50), - // RampDownForceLogoffUsers: to.Ptr(true), - // RampDownLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // RampDownMinimumHostsPct: to.Ptr[int32](20), - // RampDownNotificationMessage: to.Ptr("message"), - // RampDownStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](18), - // Minute: to.Ptr[int32](0), - // }, - // RampDownWaitTimeMinutes: to.Ptr[int32](30), - // RampUpCapacityThresholdPct: to.Ptr[int32](80), - // RampUpLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // RampUpMinimumHostsPct: to.Ptr[int32](20), - // RampUpStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](6), - // Minute: to.Ptr[int32](0), - // }, - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlanPooledSchedule_List.json -func ExampleScalingPlanPooledSchedulesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewScalingPlanPooledSchedulesClient().NewListPager("resourceGroup1", "scalingPlan1", &armdesktopvirtualization.ScalingPlanPooledSchedulesClientListOptions{PageSize: to.Ptr[int32](10), - IsDescending: to.Ptr(true), - InitialSkip: to.Ptr[int32](0), - }) - 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.ScalingPlanPooledScheduleList = armdesktopvirtualization.ScalingPlanPooledScheduleList{ - // Value: []*armdesktopvirtualization.ScalingPlanPooledSchedule{ - // { - // Name: to.Ptr("scalingPlanScheduleWeekdays1"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/scalingPlans/pooledSchedules"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/scalingPlans/scalingPlan1/pooledSchedules/scalingPlanScheduleWeekdays1"), - // Properties: &armdesktopvirtualization.ScalingPlanPooledScheduleProperties{ - // DaysOfWeek: []*armdesktopvirtualization.DayOfWeek{ - // to.Ptr(armdesktopvirtualization.DayOfWeekMonday), - // to.Ptr(armdesktopvirtualization.DayOfWeekTuesday), - // to.Ptr(armdesktopvirtualization.DayOfWeekWednesday), - // to.Ptr(armdesktopvirtualization.DayOfWeekThursday), - // to.Ptr(armdesktopvirtualization.DayOfWeekFriday)}, - // OffPeakLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // OffPeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](20), - // Minute: to.Ptr[int32](0), - // }, - // PeakLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmBreadthFirst), - // PeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](8), - // Minute: to.Ptr[int32](0), - // }, - // RampDownCapacityThresholdPct: to.Ptr[int32](50), - // RampDownForceLogoffUsers: to.Ptr(true), - // RampDownLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // RampDownMinimumHostsPct: to.Ptr[int32](20), - // RampDownNotificationMessage: to.Ptr("message"), - // RampDownStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](18), - // Minute: to.Ptr[int32](0), - // }, - // RampDownWaitTimeMinutes: to.Ptr[int32](30), - // RampUpCapacityThresholdPct: to.Ptr[int32](80), - // RampUpLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // RampUpMinimumHostsPct: to.Ptr[int32](20), - // RampUpStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](6), - // Minute: to.Ptr[int32](0), - // }, - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }, - // { - // Name: to.Ptr("scalingPlanScheduleWeekends1"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/scalingPlans/pooledSchedules"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/scalingPlans/scalingPlan1/pooledSchedules/scalingPlanScheduleWeekends1"), - // Properties: &armdesktopvirtualization.ScalingPlanPooledScheduleProperties{ - // DaysOfWeek: []*armdesktopvirtualization.DayOfWeek{ - // to.Ptr(armdesktopvirtualization.DayOfWeekSaturday), - // to.Ptr(armdesktopvirtualization.DayOfWeekSunday)}, - // OffPeakLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // OffPeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](20), - // Minute: to.Ptr[int32](0), - // }, - // PeakLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmBreadthFirst), - // PeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](8), - // Minute: to.Ptr[int32](0), - // }, - // RampDownCapacityThresholdPct: to.Ptr[int32](100), - // RampDownForceLogoffUsers: to.Ptr(true), - // RampDownLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // RampDownMinimumHostsPct: to.Ptr[int32](0), - // RampDownNotificationMessage: to.Ptr("message"), - // RampDownStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](18), - // Minute: to.Ptr[int32](0), - // }, - // RampDownWaitTimeMinutes: to.Ptr[int32](30), - // RampUpCapacityThresholdPct: to.Ptr[int32](90), - // RampUpLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // RampUpMinimumHostsPct: to.Ptr[int32](10), - // RampUpStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](6), - // Minute: to.Ptr[int32](0), - // }, - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/scalingplans_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/scalingplans_client.go index 1e0ccf5694d2..bf1e45cb9d7f 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/scalingplans_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/scalingplans_client.go @@ -29,7 +29,7 @@ type ScalingPlansClient struct { } // NewScalingPlansClient creates a new instance of ScalingPlansClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewScalingPlansClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ScalingPlansClient, error) { @@ -47,7 +47,7 @@ func NewScalingPlansClient(subscriptionID string, credential azcore.TokenCredent // Create - Create or update a scaling plan. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - scalingPlanName - The name of the scaling plan. // - scalingPlan - Object containing scaling plan definitions. @@ -94,7 +94,7 @@ func (client *ScalingPlansClient) createCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-08-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, scalingPlan); err != nil { @@ -115,7 +115,7 @@ func (client *ScalingPlansClient) createHandleResponse(resp *http.Response) (Sca // Delete - Remove a scaling plan. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - scalingPlanName - The name of the scaling plan. // - options - ScalingPlansClientDeleteOptions contains the optional parameters for the ScalingPlansClient.Delete method. @@ -160,7 +160,7 @@ func (client *ScalingPlansClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-08-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -169,7 +169,7 @@ func (client *ScalingPlansClient) deleteCreateRequest(ctx context.Context, resou // Get - Get a scaling plan. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - scalingPlanName - The name of the scaling plan. // - options - ScalingPlansClientGetOptions contains the optional parameters for the ScalingPlansClient.Get method. @@ -215,7 +215,7 @@ func (client *ScalingPlansClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-08-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -232,7 +232,7 @@ func (client *ScalingPlansClient) getHandleResponse(resp *http.Response) (Scalin // NewListByHostPoolPager - List scaling plan associated with hostpool. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - hostPoolName - The name of the host pool within the specified resource group // - options - ScalingPlansClientListByHostPoolOptions contains the optional parameters for the ScalingPlansClient.NewListByHostPoolPager @@ -280,15 +280,15 @@ func (client *ScalingPlansClient) listByHostPoolCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") - if options != nil && options.PageSize != nil { - reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) + reqQP.Set("api-version", "2024-04-08-preview") + if options != nil && options.InitialSkip != nil { + reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) } if options != nil && options.IsDescending != nil { reqQP.Set("isDescending", strconv.FormatBool(*options.IsDescending)) } - if options != nil && options.InitialSkip != nil { - reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) + if options != nil && options.PageSize != nil { + reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} @@ -306,7 +306,7 @@ func (client *ScalingPlansClient) listByHostPoolHandleResponse(resp *http.Respon // NewListByResourceGroupPager - List scaling plans. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - ScalingPlansClientListByResourceGroupOptions contains the optional parameters for the ScalingPlansClient.NewListByResourceGroupPager // method. @@ -349,15 +349,15 @@ func (client *ScalingPlansClient) listByResourceGroupCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") - if options != nil && options.PageSize != nil { - reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) + reqQP.Set("api-version", "2024-04-08-preview") + if options != nil && options.InitialSkip != nil { + reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) } if options != nil && options.IsDescending != nil { reqQP.Set("isDescending", strconv.FormatBool(*options.IsDescending)) } - if options != nil && options.InitialSkip != nil { - reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) + if options != nil && options.PageSize != nil { + reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} @@ -375,7 +375,7 @@ func (client *ScalingPlansClient) listByResourceGroupHandleResponse(resp *http.R // NewListBySubscriptionPager - List scaling plans in subscription. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - options - ScalingPlansClientListBySubscriptionOptions contains the optional parameters for the ScalingPlansClient.NewListBySubscriptionPager // method. func (client *ScalingPlansClient) NewListBySubscriptionPager(options *ScalingPlansClientListBySubscriptionOptions) *runtime.Pager[ScalingPlansClientListBySubscriptionResponse] { @@ -413,15 +413,15 @@ func (client *ScalingPlansClient) listBySubscriptionCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") - if options != nil && options.PageSize != nil { - reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) + reqQP.Set("api-version", "2024-04-08-preview") + if options != nil && options.InitialSkip != nil { + reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) } if options != nil && options.IsDescending != nil { reqQP.Set("isDescending", strconv.FormatBool(*options.IsDescending)) } - if options != nil && options.InitialSkip != nil { - reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) + if options != nil && options.PageSize != nil { + reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} @@ -440,7 +440,7 @@ func (client *ScalingPlansClient) listBySubscriptionHandleResponse(resp *http.Re // Update - Update a scaling plan. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - scalingPlanName - The name of the scaling plan. // - options - ScalingPlansClientUpdateOptions contains the optional parameters for the ScalingPlansClient.Update method. @@ -486,7 +486,7 @@ func (client *ScalingPlansClient) updateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-08-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.ScalingPlan != nil { diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/scalingplans_client_example_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/scalingplans_client_example_test.go deleted file mode 100644 index 81141d2276b4..000000000000 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/scalingplans_client_example_test.go +++ /dev/null @@ -1,786 +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 armdesktopvirtualization_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/desktopvirtualization/armdesktopvirtualization/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlan_Get.json -func ExampleScalingPlansClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewScalingPlansClient().Get(ctx, "resourceGroup1", "scalingPlan1", 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.ScalingPlan = armdesktopvirtualization.ScalingPlan{ - // Name: to.Ptr("workspace1"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/scalingPlans"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/scalingPlans/scalingPlan1"), - // Location: to.Ptr("centralus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armdesktopvirtualization.ScalingPlanProperties{ - // Description: to.Ptr("Description of scaling plan"), - // ExclusionTag: to.Ptr("value"), - // FriendlyName: to.Ptr("Scaling Plan 1"), - // HostPoolReferences: []*armdesktopvirtualization.ScalingHostPoolReference{ - // { - // HostPoolArmPath: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1"), - // ScalingPlanEnabled: to.Ptr(true), - // }}, - // HostPoolType: to.Ptr(armdesktopvirtualization.ScalingHostPoolTypePooled), - // ObjectID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // Schedules: []*armdesktopvirtualization.ScalingSchedule{ - // { - // Name: to.Ptr("schedule1"), - // DaysOfWeek: []*armdesktopvirtualization.ScalingScheduleDaysOfWeekItem{ - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemMonday), - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemTuesday), - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemWednesday), - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemThursday), - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemFriday)}, - // OffPeakLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // OffPeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](20), - // Minute: to.Ptr[int32](0), - // }, - // PeakLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmBreadthFirst), - // PeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](8), - // Minute: to.Ptr[int32](0), - // }, - // RampDownCapacityThresholdPct: to.Ptr[int32](50), - // RampDownForceLogoffUsers: to.Ptr(true), - // RampDownLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // RampDownMinimumHostsPct: to.Ptr[int32](20), - // RampDownNotificationMessage: to.Ptr("message"), - // RampDownStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](18), - // Minute: to.Ptr[int32](0), - // }, - // RampDownWaitTimeMinutes: to.Ptr[int32](30), - // RampUpCapacityThresholdPct: to.Ptr[int32](80), - // RampUpLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // RampUpMinimumHostsPct: to.Ptr[int32](20), - // RampUpStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](6), - // Minute: to.Ptr[int32](0), - // }, - // }}, - // TimeZone: to.Ptr("Central Standard Time"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlan_Create.json -func ExampleScalingPlansClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewScalingPlansClient().Create(ctx, "resourceGroup1", "scalingPlan1", armdesktopvirtualization.ScalingPlan{ - Location: to.Ptr("centralus"), - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - Properties: &armdesktopvirtualization.ScalingPlanProperties{ - Description: to.Ptr("Description of Scaling Plan"), - ExclusionTag: to.Ptr("value"), - FriendlyName: to.Ptr("Scaling Plan 1"), - HostPoolReferences: []*armdesktopvirtualization.ScalingHostPoolReference{ - { - HostPoolArmPath: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1"), - ScalingPlanEnabled: to.Ptr(true), - }}, - HostPoolType: to.Ptr(armdesktopvirtualization.ScalingHostPoolTypePooled), - Schedules: []*armdesktopvirtualization.ScalingSchedule{ - { - Name: to.Ptr("schedule1"), - DaysOfWeek: []*armdesktopvirtualization.ScalingScheduleDaysOfWeekItem{ - to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemMonday), - to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemTuesday), - to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemWednesday), - to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemThursday), - to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemFriday)}, - OffPeakLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - OffPeakStartTime: &armdesktopvirtualization.Time{ - Hour: to.Ptr[int32](20), - Minute: to.Ptr[int32](0), - }, - PeakLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmBreadthFirst), - PeakStartTime: &armdesktopvirtualization.Time{ - Hour: to.Ptr[int32](8), - Minute: to.Ptr[int32](0), - }, - RampDownCapacityThresholdPct: to.Ptr[int32](50), - RampDownForceLogoffUsers: to.Ptr(true), - RampDownLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - RampDownMinimumHostsPct: to.Ptr[int32](20), - RampDownNotificationMessage: to.Ptr("message"), - RampDownStartTime: &armdesktopvirtualization.Time{ - Hour: to.Ptr[int32](18), - Minute: to.Ptr[int32](0), - }, - RampDownWaitTimeMinutes: to.Ptr[int32](30), - RampUpCapacityThresholdPct: to.Ptr[int32](80), - RampUpLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - RampUpMinimumHostsPct: to.Ptr[int32](20), - RampUpStartTime: &armdesktopvirtualization.Time{ - Hour: to.Ptr[int32](6), - Minute: to.Ptr[int32](0), - }, - }}, - TimeZone: to.Ptr("Central Standard Time"), - }, - }, 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.ScalingPlan = armdesktopvirtualization.ScalingPlan{ - // Name: to.Ptr("scalingPlan1"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/scalingPlans"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/scalingPlans/scalingPlan1"), - // Location: to.Ptr("centralus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armdesktopvirtualization.ScalingPlanProperties{ - // Description: to.Ptr("Description of Scaling Plan"), - // ExclusionTag: to.Ptr("value"), - // FriendlyName: to.Ptr("Scaling Plan 1"), - // HostPoolReferences: []*armdesktopvirtualization.ScalingHostPoolReference{ - // { - // HostPoolArmPath: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1"), - // ScalingPlanEnabled: to.Ptr(true), - // }}, - // HostPoolType: to.Ptr(armdesktopvirtualization.ScalingHostPoolTypePooled), - // ObjectID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // Schedules: []*armdesktopvirtualization.ScalingSchedule{ - // { - // Name: to.Ptr("schedule1"), - // DaysOfWeek: []*armdesktopvirtualization.ScalingScheduleDaysOfWeekItem{ - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemMonday), - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemTuesday), - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemWednesday), - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemThursday), - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemFriday)}, - // OffPeakLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // OffPeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](20), - // Minute: to.Ptr[int32](0), - // }, - // PeakLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmBreadthFirst), - // PeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](8), - // Minute: to.Ptr[int32](0), - // }, - // RampDownCapacityThresholdPct: to.Ptr[int32](50), - // RampDownForceLogoffUsers: to.Ptr(true), - // RampDownLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // RampDownMinimumHostsPct: to.Ptr[int32](20), - // RampDownNotificationMessage: to.Ptr("message"), - // RampDownStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](18), - // Minute: to.Ptr[int32](0), - // }, - // RampDownWaitTimeMinutes: to.Ptr[int32](30), - // RampUpCapacityThresholdPct: to.Ptr[int32](80), - // RampUpLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // RampUpMinimumHostsPct: to.Ptr[int32](20), - // RampUpStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](6), - // Minute: to.Ptr[int32](0), - // }, - // }}, - // TimeZone: to.Ptr("Central Standard Time"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlan_Delete.json -func ExampleScalingPlansClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewScalingPlansClient().Delete(ctx, "resourceGroup1", "scalingPlan1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlan_Update.json -func ExampleScalingPlansClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewScalingPlansClient().Update(ctx, "resourceGroup1", "scalingPlan1", &armdesktopvirtualization.ScalingPlansClientUpdateOptions{ScalingPlan: 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.ScalingPlan = armdesktopvirtualization.ScalingPlan{ - // Name: to.Ptr("scalingPlan1"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/scalingPlans"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/scalingPlans/scalingPlan1"), - // Location: to.Ptr("centralus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armdesktopvirtualization.ScalingPlanProperties{ - // Description: to.Ptr("Description of Scaling Plan"), - // ExclusionTag: to.Ptr("value"), - // FriendlyName: to.Ptr("Scaling Plan 1"), - // HostPoolReferences: []*armdesktopvirtualization.ScalingHostPoolReference{ - // { - // HostPoolArmPath: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1"), - // ScalingPlanEnabled: to.Ptr(true), - // }}, - // HostPoolType: to.Ptr(armdesktopvirtualization.ScalingHostPoolTypePooled), - // ObjectID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // Schedules: []*armdesktopvirtualization.ScalingSchedule{ - // { - // Name: to.Ptr("schedule1"), - // DaysOfWeek: []*armdesktopvirtualization.ScalingScheduleDaysOfWeekItem{ - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemMonday), - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemTuesday), - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemWednesday), - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemThursday), - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemFriday)}, - // OffPeakLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // OffPeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](20), - // Minute: to.Ptr[int32](0), - // }, - // PeakLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmBreadthFirst), - // PeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](8), - // Minute: to.Ptr[int32](0), - // }, - // RampDownCapacityThresholdPct: to.Ptr[int32](50), - // RampDownForceLogoffUsers: to.Ptr(true), - // RampDownLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // RampDownMinimumHostsPct: to.Ptr[int32](20), - // RampDownNotificationMessage: to.Ptr("message"), - // RampDownStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](18), - // Minute: to.Ptr[int32](0), - // }, - // RampDownWaitTimeMinutes: to.Ptr[int32](30), - // RampUpCapacityThresholdPct: to.Ptr[int32](80), - // RampUpLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // RampUpMinimumHostsPct: to.Ptr[int32](20), - // RampUpStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](6), - // Minute: to.Ptr[int32](0), - // }, - // }}, - // TimeZone: to.Ptr("Central Standard Time"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlan_ListByResourceGroup.json -func ExampleScalingPlansClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewScalingPlansClient().NewListByResourceGroupPager("resourceGroup1", &armdesktopvirtualization.ScalingPlansClientListByResourceGroupOptions{PageSize: to.Ptr[int32](10), - IsDescending: to.Ptr(true), - InitialSkip: to.Ptr[int32](0), - }) - 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.ScalingPlanList = armdesktopvirtualization.ScalingPlanList{ - // Value: []*armdesktopvirtualization.ScalingPlan{ - // { - // Name: to.Ptr("scalingPlan1"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/scalingPlans"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/scalingPlans/scalingPlan1"), - // Location: to.Ptr("centralus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armdesktopvirtualization.ScalingPlanProperties{ - // Description: to.Ptr("Description of Scaling Plan"), - // ExclusionTag: to.Ptr("value"), - // FriendlyName: to.Ptr("Scaling Plan 1"), - // HostPoolReferences: []*armdesktopvirtualization.ScalingHostPoolReference{ - // { - // HostPoolArmPath: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1"), - // ScalingPlanEnabled: to.Ptr(true), - // }}, - // HostPoolType: to.Ptr(armdesktopvirtualization.ScalingHostPoolTypePooled), - // ObjectID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // Schedules: []*armdesktopvirtualization.ScalingSchedule{ - // { - // Name: to.Ptr("schedule1"), - // DaysOfWeek: []*armdesktopvirtualization.ScalingScheduleDaysOfWeekItem{ - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemMonday), - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemTuesday), - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemWednesday), - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemThursday), - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemFriday)}, - // OffPeakLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // OffPeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](20), - // Minute: to.Ptr[int32](0), - // }, - // PeakLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmBreadthFirst), - // PeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](8), - // Minute: to.Ptr[int32](0), - // }, - // RampDownCapacityThresholdPct: to.Ptr[int32](50), - // RampDownForceLogoffUsers: to.Ptr(true), - // RampDownLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // RampDownMinimumHostsPct: to.Ptr[int32](20), - // RampDownNotificationMessage: to.Ptr("message"), - // RampDownStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](18), - // Minute: to.Ptr[int32](0), - // }, - // RampDownWaitTimeMinutes: to.Ptr[int32](30), - // RampUpCapacityThresholdPct: to.Ptr[int32](80), - // RampUpLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // RampUpMinimumHostsPct: to.Ptr[int32](20), - // RampUpStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](6), - // Minute: to.Ptr[int32](0), - // }, - // }}, - // TimeZone: to.Ptr("Central Standard Time"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }, - // { - // Name: to.Ptr("scalingPlan2"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/scalingPlans"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/scalingPlans/scalingPlan2"), - // Location: to.Ptr("centralus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armdesktopvirtualization.ScalingPlanProperties{ - // Description: to.Ptr("Description of Scaling Plan"), - // ExclusionTag: to.Ptr("value"), - // FriendlyName: to.Ptr("Scaling Plan 1"), - // HostPoolReferences: []*armdesktopvirtualization.ScalingHostPoolReference{ - // { - // HostPoolArmPath: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1"), - // ScalingPlanEnabled: to.Ptr(true), - // }}, - // HostPoolType: to.Ptr(armdesktopvirtualization.ScalingHostPoolTypePooled), - // ObjectID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // Schedules: []*armdesktopvirtualization.ScalingSchedule{ - // { - // Name: to.Ptr("schedule1"), - // DaysOfWeek: []*armdesktopvirtualization.ScalingScheduleDaysOfWeekItem{ - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemMonday), - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemTuesday), - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemWednesday), - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemThursday), - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemFriday)}, - // OffPeakLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // OffPeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](20), - // Minute: to.Ptr[int32](0), - // }, - // PeakLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmBreadthFirst), - // PeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](8), - // Minute: to.Ptr[int32](0), - // }, - // RampDownCapacityThresholdPct: to.Ptr[int32](50), - // RampDownForceLogoffUsers: to.Ptr(false), - // RampDownLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // RampDownMinimumHostsPct: to.Ptr[int32](20), - // RampDownStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](18), - // Minute: to.Ptr[int32](0), - // }, - // RampDownStopHostsWhen: to.Ptr(armdesktopvirtualization.StopHostsWhenZeroSessions), - // RampUpCapacityThresholdPct: to.Ptr[int32](80), - // RampUpLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // RampUpMinimumHostsPct: to.Ptr[int32](20), - // RampUpStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](6), - // Minute: to.Ptr[int32](0), - // }, - // }}, - // TimeZone: to.Ptr("Central Standard Time"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlan_ListBySubscription.json -func ExampleScalingPlansClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewScalingPlansClient().NewListBySubscriptionPager(&armdesktopvirtualization.ScalingPlansClientListBySubscriptionOptions{PageSize: to.Ptr[int32](10), - IsDescending: to.Ptr(true), - InitialSkip: to.Ptr[int32](0), - }) - 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.ScalingPlanList = armdesktopvirtualization.ScalingPlanList{ - // Value: []*armdesktopvirtualization.ScalingPlan{ - // { - // Name: to.Ptr("scalingPlan1"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/scalingPlans"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/scalingPlans/scalingPlan1"), - // Location: to.Ptr("centralus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armdesktopvirtualization.ScalingPlanProperties{ - // Description: to.Ptr("Description of Scaling Plan"), - // ExclusionTag: to.Ptr("value"), - // FriendlyName: to.Ptr("Scaling Plan 1"), - // HostPoolReferences: []*armdesktopvirtualization.ScalingHostPoolReference{ - // { - // HostPoolArmPath: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1"), - // ScalingPlanEnabled: to.Ptr(true), - // }}, - // HostPoolType: to.Ptr(armdesktopvirtualization.ScalingHostPoolTypePooled), - // ObjectID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // Schedules: []*armdesktopvirtualization.ScalingSchedule{ - // { - // Name: to.Ptr("schedule1"), - // DaysOfWeek: []*armdesktopvirtualization.ScalingScheduleDaysOfWeekItem{ - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemMonday), - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemTuesday), - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemWednesday), - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemThursday), - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemFriday)}, - // OffPeakLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // OffPeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](20), - // Minute: to.Ptr[int32](0), - // }, - // PeakLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmBreadthFirst), - // PeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](8), - // Minute: to.Ptr[int32](0), - // }, - // RampDownCapacityThresholdPct: to.Ptr[int32](50), - // RampDownForceLogoffUsers: to.Ptr(true), - // RampDownLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // RampDownMinimumHostsPct: to.Ptr[int32](20), - // RampDownNotificationMessage: to.Ptr("message"), - // RampDownStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](18), - // Minute: to.Ptr[int32](0), - // }, - // RampDownWaitTimeMinutes: to.Ptr[int32](30), - // RampUpCapacityThresholdPct: to.Ptr[int32](80), - // RampUpLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // RampUpMinimumHostsPct: to.Ptr[int32](20), - // RampUpStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](6), - // Minute: to.Ptr[int32](0), - // }, - // }}, - // TimeZone: to.Ptr("Central Standard Time"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }, - // { - // Name: to.Ptr("scalingPlan2"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/scalingPlans"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/scalingPlans/scalingPlan2"), - // Location: to.Ptr("centralus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armdesktopvirtualization.ScalingPlanProperties{ - // Description: to.Ptr("Description of Scaling Plan"), - // ExclusionTag: to.Ptr("value"), - // FriendlyName: to.Ptr("Scaling Plan 1"), - // HostPoolReferences: []*armdesktopvirtualization.ScalingHostPoolReference{ - // { - // HostPoolArmPath: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1"), - // ScalingPlanEnabled: to.Ptr(true), - // }}, - // HostPoolType: to.Ptr(armdesktopvirtualization.ScalingHostPoolTypePooled), - // ObjectID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // Schedules: []*armdesktopvirtualization.ScalingSchedule{ - // { - // Name: to.Ptr("schedule1"), - // DaysOfWeek: []*armdesktopvirtualization.ScalingScheduleDaysOfWeekItem{ - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemMonday), - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemTuesday), - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemWednesday), - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemThursday), - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemFriday)}, - // OffPeakLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // OffPeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](20), - // Minute: to.Ptr[int32](0), - // }, - // PeakLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmBreadthFirst), - // PeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](8), - // Minute: to.Ptr[int32](0), - // }, - // RampDownCapacityThresholdPct: to.Ptr[int32](50), - // RampDownForceLogoffUsers: to.Ptr(false), - // RampDownLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // RampDownMinimumHostsPct: to.Ptr[int32](20), - // RampDownStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](18), - // Minute: to.Ptr[int32](0), - // }, - // RampDownStopHostsWhen: to.Ptr(armdesktopvirtualization.StopHostsWhenZeroActiveSessions), - // RampUpCapacityThresholdPct: to.Ptr[int32](80), - // RampUpLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // RampUpMinimumHostsPct: to.Ptr[int32](20), - // RampUpStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](6), - // Minute: to.Ptr[int32](0), - // }, - // }}, - // TimeZone: to.Ptr("Central Standard Time"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlan_ListByHostPool.json -func ExampleScalingPlansClient_NewListByHostPoolPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewScalingPlansClient().NewListByHostPoolPager("resourceGroup1", "hostPool1", &armdesktopvirtualization.ScalingPlansClientListByHostPoolOptions{PageSize: to.Ptr[int32](10), - IsDescending: to.Ptr(true), - InitialSkip: to.Ptr[int32](0), - }) - 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.ScalingPlanList = armdesktopvirtualization.ScalingPlanList{ - // Value: []*armdesktopvirtualization.ScalingPlan{ - // { - // Name: to.Ptr("scalingPlan1"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/scalingPlans"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/scalingPlans/scalingPlan1"), - // Location: to.Ptr("centralus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armdesktopvirtualization.ScalingPlanProperties{ - // Description: to.Ptr("Description of Scaling Plan"), - // ExclusionTag: to.Ptr("value"), - // FriendlyName: to.Ptr("Scaling Plan 1"), - // HostPoolReferences: []*armdesktopvirtualization.ScalingHostPoolReference{ - // { - // HostPoolArmPath: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1"), - // ScalingPlanEnabled: to.Ptr(true), - // }}, - // HostPoolType: to.Ptr(armdesktopvirtualization.ScalingHostPoolTypePooled), - // ObjectID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // Schedules: []*armdesktopvirtualization.ScalingSchedule{ - // { - // Name: to.Ptr("schedule1"), - // DaysOfWeek: []*armdesktopvirtualization.ScalingScheduleDaysOfWeekItem{ - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemMonday), - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemTuesday), - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemWednesday), - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemThursday), - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemFriday)}, - // OffPeakLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // OffPeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](20), - // Minute: to.Ptr[int32](0), - // }, - // PeakLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmBreadthFirst), - // PeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](8), - // Minute: to.Ptr[int32](0), - // }, - // RampDownCapacityThresholdPct: to.Ptr[int32](50), - // RampDownForceLogoffUsers: to.Ptr(true), - // RampDownLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // RampDownMinimumHostsPct: to.Ptr[int32](20), - // RampDownNotificationMessage: to.Ptr("message"), - // RampDownStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](18), - // Minute: to.Ptr[int32](0), - // }, - // RampDownWaitTimeMinutes: to.Ptr[int32](30), - // RampUpCapacityThresholdPct: to.Ptr[int32](80), - // RampUpLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // RampUpMinimumHostsPct: to.Ptr[int32](20), - // RampUpStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](6), - // Minute: to.Ptr[int32](0), - // }, - // }}, - // TimeZone: to.Ptr("Central Standard Time"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/sessionhost_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/sessionhost_client.go new file mode 100644 index 000000000000..d75f228d41ba --- /dev/null +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/sessionhost_client.go @@ -0,0 +1,104 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armdesktopvirtualization + +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" +) + +// SessionHostClient contains the methods for the SessionHost group. +// Don't use this type directly, use NewSessionHostClient() instead. +type SessionHostClient struct { + internal *arm.Client + subscriptionID string +} + +// NewSessionHostClient creates a new instance of SessionHostClient with the specified values. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewSessionHostClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SessionHostClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &SessionHostClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// RetryProvisioning - Retry provisioning on a SessionHost. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-04-08-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - hostPoolName - The name of the host pool within the specified resource group +// - sessionHostName - The name of the session host within the specified host pool +// - options - SessionHostClientRetryProvisioningOptions contains the optional parameters for the SessionHostClient.RetryProvisioning +// method. +func (client *SessionHostClient) RetryProvisioning(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string, options *SessionHostClientRetryProvisioningOptions) (SessionHostClientRetryProvisioningResponse, error) { + var err error + const operationName = "SessionHostClient.RetryProvisioning" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.retryProvisioningCreateRequest(ctx, resourceGroupName, hostPoolName, sessionHostName, options) + if err != nil { + return SessionHostClientRetryProvisioningResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return SessionHostClientRetryProvisioningResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SessionHostClientRetryProvisioningResponse{}, err + } + return SessionHostClientRetryProvisioningResponse{}, nil +} + +// retryProvisioningCreateRequest creates the RetryProvisioning request. +func (client *SessionHostClient) retryProvisioningCreateRequest(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string, options *SessionHostClientRetryProvisioningOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/retryProvisioning" + 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 hostPoolName == "" { + return nil, errors.New("parameter hostPoolName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{hostPoolName}", url.PathEscape(hostPoolName)) + if sessionHostName == "" { + return nil, errors.New("parameter sessionHostName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{sessionHostName}", url.PathEscape(sessionHostName)) + 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", "2024-04-08-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/sessionhostconfigurations_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/sessionhostconfigurations_client.go new file mode 100644 index 000000000000..0227764762ff --- /dev/null +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/sessionhostconfigurations_client.go @@ -0,0 +1,338 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armdesktopvirtualization + +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" +) + +// SessionHostConfigurationsClient contains the methods for the SessionHostConfigurations group. +// Don't use this type directly, use NewSessionHostConfigurationsClient() instead. +type SessionHostConfigurationsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewSessionHostConfigurationsClient creates a new instance of SessionHostConfigurationsClient with the specified values. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewSessionHostConfigurationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SessionHostConfigurationsClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &SessionHostConfigurationsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Create or update a SessionHostConfiguration. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-04-08-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - hostPoolName - The name of the host pool within the specified resource group +// - sessionHostConfiguration - Object containing SessionHostConfiguration definitions. +// - options - SessionHostConfigurationsClientBeginCreateOrUpdateOptions contains the optional parameters for the SessionHostConfigurationsClient.BeginCreateOrUpdate +// method. +func (client *SessionHostConfigurationsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostConfiguration SessionHostConfiguration, options *SessionHostConfigurationsClientBeginCreateOrUpdateOptions) (*runtime.Poller[SessionHostConfigurationsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, hostPoolName, sessionHostConfiguration, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SessionHostConfigurationsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[SessionHostConfigurationsClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// CreateOrUpdate - Create or update a SessionHostConfiguration. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-04-08-preview +func (client *SessionHostConfigurationsClient) createOrUpdate(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostConfiguration SessionHostConfiguration, options *SessionHostConfigurationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + const operationName = "SessionHostConfigurationsClient.BeginCreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, hostPoolName, sessionHostConfiguration, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *SessionHostConfigurationsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostConfiguration SessionHostConfiguration, options *SessionHostConfigurationsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostConfigurations/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 hostPoolName == "" { + return nil, errors.New("parameter hostPoolName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{hostPoolName}", url.PathEscape(hostPoolName)) + 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", "2024-04-08-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, sessionHostConfiguration); err != nil { + return nil, err + } + return req, nil +} + +// Get - Get a SessionHostConfiguration. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-04-08-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - hostPoolName - The name of the host pool within the specified resource group +// - options - SessionHostConfigurationsClientGetOptions contains the optional parameters for the SessionHostConfigurationsClient.Get +// method. +func (client *SessionHostConfigurationsClient) Get(ctx context.Context, resourceGroupName string, hostPoolName string, options *SessionHostConfigurationsClientGetOptions) (SessionHostConfigurationsClientGetResponse, error) { + var err error + const operationName = "SessionHostConfigurationsClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, hostPoolName, options) + if err != nil { + return SessionHostConfigurationsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return SessionHostConfigurationsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SessionHostConfigurationsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *SessionHostConfigurationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, hostPoolName string, options *SessionHostConfigurationsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostConfigurations/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 hostPoolName == "" { + return nil, errors.New("parameter hostPoolName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{hostPoolName}", url.PathEscape(hostPoolName)) + 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", "2024-04-08-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *SessionHostConfigurationsClient) getHandleResponse(resp *http.Response) (SessionHostConfigurationsClientGetResponse, error) { + result := SessionHostConfigurationsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SessionHostConfiguration); err != nil { + return SessionHostConfigurationsClientGetResponse{}, err + } + return result, nil +} + +// NewListByHostPoolPager - List sessionHostConfigurations. +// +// Generated from API version 2024-04-08-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - hostPoolName - The name of the host pool within the specified resource group +// - options - SessionHostConfigurationsClientListByHostPoolOptions contains the optional parameters for the SessionHostConfigurationsClient.NewListByHostPoolPager +// method. +func (client *SessionHostConfigurationsClient) NewListByHostPoolPager(resourceGroupName string, hostPoolName string, options *SessionHostConfigurationsClientListByHostPoolOptions) *runtime.Pager[SessionHostConfigurationsClientListByHostPoolResponse] { + return runtime.NewPager(runtime.PagingHandler[SessionHostConfigurationsClientListByHostPoolResponse]{ + More: func(page SessionHostConfigurationsClientListByHostPoolResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *SessionHostConfigurationsClientListByHostPoolResponse) (SessionHostConfigurationsClientListByHostPoolResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "SessionHostConfigurationsClient.NewListByHostPoolPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listByHostPoolCreateRequest(ctx, resourceGroupName, hostPoolName, options) + }, nil) + if err != nil { + return SessionHostConfigurationsClientListByHostPoolResponse{}, err + } + return client.listByHostPoolHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listByHostPoolCreateRequest creates the ListByHostPool request. +func (client *SessionHostConfigurationsClient) listByHostPoolCreateRequest(ctx context.Context, resourceGroupName string, hostPoolName string, options *SessionHostConfigurationsClientListByHostPoolOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostConfigurations" + 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 hostPoolName == "" { + return nil, errors.New("parameter hostPoolName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{hostPoolName}", url.PathEscape(hostPoolName)) + 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", "2024-04-08-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByHostPoolHandleResponse handles the ListByHostPool response. +func (client *SessionHostConfigurationsClient) listByHostPoolHandleResponse(resp *http.Response) (SessionHostConfigurationsClientListByHostPoolResponse, error) { + result := SessionHostConfigurationsClientListByHostPoolResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SessionHostConfigurationList); err != nil { + return SessionHostConfigurationsClientListByHostPoolResponse{}, err + } + return result, nil +} + +// BeginUpdate - Update a SessionHostConfiguration. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-04-08-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - hostPoolName - The name of the host pool within the specified resource group +// - options - SessionHostConfigurationsClientBeginUpdateOptions contains the optional parameters for the SessionHostConfigurationsClient.BeginUpdate +// method. +func (client *SessionHostConfigurationsClient) BeginUpdate(ctx context.Context, resourceGroupName string, hostPoolName string, options *SessionHostConfigurationsClientBeginUpdateOptions) (*runtime.Poller[SessionHostConfigurationsClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, resourceGroupName, hostPoolName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SessionHostConfigurationsClientUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[SessionHostConfigurationsClientUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Update - Update a SessionHostConfiguration. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-04-08-preview +func (client *SessionHostConfigurationsClient) update(ctx context.Context, resourceGroupName string, hostPoolName string, options *SessionHostConfigurationsClientBeginUpdateOptions) (*http.Response, error) { + var err error + const operationName = "SessionHostConfigurationsClient.BeginUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.updateCreateRequest(ctx, resourceGroupName, hostPoolName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// updateCreateRequest creates the Update request. +func (client *SessionHostConfigurationsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, hostPoolName string, options *SessionHostConfigurationsClientBeginUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostConfigurations/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 hostPoolName == "" { + return nil, errors.New("parameter hostPoolName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{hostPoolName}", url.PathEscape(hostPoolName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-04-08-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if options != nil && options.SessionHostConfiguration != nil { + if err := runtime.MarshalAsJSON(req, *options.SessionHostConfiguration); err != nil { + return nil, err + } + return req, nil + } + return req, nil +} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/sessionhostmanagements_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/sessionhostmanagements_client.go new file mode 100644 index 000000000000..fd099cb3d7f8 --- /dev/null +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/sessionhostmanagements_client.go @@ -0,0 +1,314 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armdesktopvirtualization + +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" +) + +// SessionHostManagementsClient contains the methods for the SessionHostManagements group. +// Don't use this type directly, use NewSessionHostManagementsClient() instead. +type SessionHostManagementsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewSessionHostManagementsClient creates a new instance of SessionHostManagementsClient with the specified values. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewSessionHostManagementsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SessionHostManagementsClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &SessionHostManagementsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// CreateOrUpdate - Create or update a SessionHostManagement. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-04-08-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - hostPoolName - The name of the host pool within the specified resource group +// - sessionHostManagement - Object containing SessionHostManagement definitions. +// - options - SessionHostManagementsClientCreateOrUpdateOptions contains the optional parameters for the SessionHostManagementsClient.CreateOrUpdate +// method. +func (client *SessionHostManagementsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostManagement SessionHostManagement, options *SessionHostManagementsClientCreateOrUpdateOptions) (SessionHostManagementsClientCreateOrUpdateResponse, error) { + var err error + const operationName = "SessionHostManagementsClient.CreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, hostPoolName, sessionHostManagement, options) + if err != nil { + return SessionHostManagementsClientCreateOrUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return SessionHostManagementsClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return SessionHostManagementsClientCreateOrUpdateResponse{}, err + } + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *SessionHostManagementsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostManagement SessionHostManagement, options *SessionHostManagementsClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostManagements/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 hostPoolName == "" { + return nil, errors.New("parameter hostPoolName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{hostPoolName}", url.PathEscape(hostPoolName)) + 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", "2024-04-08-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, sessionHostManagement); err != nil { + return nil, err + } + return req, nil +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *SessionHostManagementsClient) createOrUpdateHandleResponse(resp *http.Response) (SessionHostManagementsClientCreateOrUpdateResponse, error) { + result := SessionHostManagementsClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SessionHostManagement); err != nil { + return SessionHostManagementsClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Get - Get a SessionHostManagement. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-04-08-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - hostPoolName - The name of the host pool within the specified resource group +// - options - SessionHostManagementsClientGetOptions contains the optional parameters for the SessionHostManagementsClient.Get +// method. +func (client *SessionHostManagementsClient) Get(ctx context.Context, resourceGroupName string, hostPoolName string, options *SessionHostManagementsClientGetOptions) (SessionHostManagementsClientGetResponse, error) { + var err error + const operationName = "SessionHostManagementsClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, hostPoolName, options) + if err != nil { + return SessionHostManagementsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return SessionHostManagementsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SessionHostManagementsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *SessionHostManagementsClient) getCreateRequest(ctx context.Context, resourceGroupName string, hostPoolName string, options *SessionHostManagementsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostManagements/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 hostPoolName == "" { + return nil, errors.New("parameter hostPoolName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{hostPoolName}", url.PathEscape(hostPoolName)) + 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", "2024-04-08-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *SessionHostManagementsClient) getHandleResponse(resp *http.Response) (SessionHostManagementsClientGetResponse, error) { + result := SessionHostManagementsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SessionHostManagement); err != nil { + return SessionHostManagementsClientGetResponse{}, err + } + return result, nil +} + +// NewListByHostPoolPager - List SessionHostManagements by hostPool. +// +// Generated from API version 2024-04-08-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - hostPoolName - The name of the host pool within the specified resource group +// - options - SessionHostManagementsClientListByHostPoolOptions contains the optional parameters for the SessionHostManagementsClient.NewListByHostPoolPager +// method. +func (client *SessionHostManagementsClient) NewListByHostPoolPager(resourceGroupName string, hostPoolName string, options *SessionHostManagementsClientListByHostPoolOptions) *runtime.Pager[SessionHostManagementsClientListByHostPoolResponse] { + return runtime.NewPager(runtime.PagingHandler[SessionHostManagementsClientListByHostPoolResponse]{ + More: func(page SessionHostManagementsClientListByHostPoolResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *SessionHostManagementsClientListByHostPoolResponse) (SessionHostManagementsClientListByHostPoolResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "SessionHostManagementsClient.NewListByHostPoolPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listByHostPoolCreateRequest(ctx, resourceGroupName, hostPoolName, options) + }, nil) + if err != nil { + return SessionHostManagementsClientListByHostPoolResponse{}, err + } + return client.listByHostPoolHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listByHostPoolCreateRequest creates the ListByHostPool request. +func (client *SessionHostManagementsClient) listByHostPoolCreateRequest(ctx context.Context, resourceGroupName string, hostPoolName string, options *SessionHostManagementsClientListByHostPoolOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostManagements" + 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 hostPoolName == "" { + return nil, errors.New("parameter hostPoolName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{hostPoolName}", url.PathEscape(hostPoolName)) + 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", "2024-04-08-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByHostPoolHandleResponse handles the ListByHostPool response. +func (client *SessionHostManagementsClient) listByHostPoolHandleResponse(resp *http.Response) (SessionHostManagementsClientListByHostPoolResponse, error) { + result := SessionHostManagementsClientListByHostPoolResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SessionHostManagementList); err != nil { + return SessionHostManagementsClientListByHostPoolResponse{}, err + } + return result, nil +} + +// Update - Update a SessionHostManagement. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-04-08-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - hostPoolName - The name of the host pool within the specified resource group +// - options - SessionHostManagementsClientUpdateOptions contains the optional parameters for the SessionHostManagementsClient.Update +// method. +func (client *SessionHostManagementsClient) Update(ctx context.Context, resourceGroupName string, hostPoolName string, options *SessionHostManagementsClientUpdateOptions) (SessionHostManagementsClientUpdateResponse, error) { + var err error + const operationName = "SessionHostManagementsClient.Update" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.updateCreateRequest(ctx, resourceGroupName, hostPoolName, options) + if err != nil { + return SessionHostManagementsClientUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return SessionHostManagementsClientUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SessionHostManagementsClientUpdateResponse{}, err + } + resp, err := client.updateHandleResponse(httpResp) + return resp, err +} + +// updateCreateRequest creates the Update request. +func (client *SessionHostManagementsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, hostPoolName string, options *SessionHostManagementsClientUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostManagements/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 hostPoolName == "" { + return nil, errors.New("parameter hostPoolName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{hostPoolName}", url.PathEscape(hostPoolName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-04-08-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if options != nil && options.SessionHostManagement != nil { + if err := runtime.MarshalAsJSON(req, *options.SessionHostManagement); err != nil { + return nil, err + } + return req, nil + } + return req, nil +} + +// updateHandleResponse handles the Update response. +func (client *SessionHostManagementsClient) updateHandleResponse(resp *http.Response) (SessionHostManagementsClientUpdateResponse, error) { + result := SessionHostManagementsClientUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SessionHostManagement); err != nil { + return SessionHostManagementsClientUpdateResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/sessionhostmanagementsupdatestatus_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/sessionhostmanagementsupdatestatus_client.go new file mode 100644 index 000000000000..b5c12f1a2fd7 --- /dev/null +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/sessionhostmanagementsupdatestatus_client.go @@ -0,0 +1,109 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armdesktopvirtualization + +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" +) + +// SessionHostManagementsUpdateStatusClient contains the methods for the SessionHostManagementsUpdateStatus group. +// Don't use this type directly, use NewSessionHostManagementsUpdateStatusClient() instead. +type SessionHostManagementsUpdateStatusClient struct { + internal *arm.Client + subscriptionID string +} + +// NewSessionHostManagementsUpdateStatusClient creates a new instance of SessionHostManagementsUpdateStatusClient with the specified values. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewSessionHostManagementsUpdateStatusClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SessionHostManagementsUpdateStatusClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &SessionHostManagementsUpdateStatusClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Get - Get the session host update status for a given hostpool. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-04-08-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - hostPoolName - The name of the host pool within the specified resource group +// - options - SessionHostManagementsUpdateStatusClientGetOptions contains the optional parameters for the SessionHostManagementsUpdateStatusClient.Get +// method. +func (client *SessionHostManagementsUpdateStatusClient) Get(ctx context.Context, resourceGroupName string, hostPoolName string, options *SessionHostManagementsUpdateStatusClientGetOptions) (SessionHostManagementsUpdateStatusClientGetResponse, error) { + var err error + const operationName = "SessionHostManagementsUpdateStatusClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, hostPoolName, options) + if err != nil { + return SessionHostManagementsUpdateStatusClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return SessionHostManagementsUpdateStatusClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SessionHostManagementsUpdateStatusClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *SessionHostManagementsUpdateStatusClient) getCreateRequest(ctx context.Context, resourceGroupName string, hostPoolName string, options *SessionHostManagementsUpdateStatusClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostManagements/default/sessionHostUpdateStatuses/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 hostPoolName == "" { + return nil, errors.New("parameter hostPoolName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{hostPoolName}", url.PathEscape(hostPoolName)) + 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", "2024-04-08-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *SessionHostManagementsUpdateStatusClient) getHandleResponse(resp *http.Response) (SessionHostManagementsUpdateStatusClientGetResponse, error) { + result := SessionHostManagementsUpdateStatusClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SessionHostManagementUpdateStatus); err != nil { + return SessionHostManagementsUpdateStatusClientGetResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/sessionhosts_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/sessionhosts_client.go index 7292fc1a3ca2..2de8bfc5e13b 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/sessionhosts_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/sessionhosts_client.go @@ -29,7 +29,7 @@ type SessionHostsClient struct { } // NewSessionHostsClient creates a new instance of SessionHostsClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewSessionHostsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SessionHostsClient, error) { @@ -47,7 +47,7 @@ func NewSessionHostsClient(subscriptionID string, credential azcore.TokenCredent // Delete - Remove a SessionHost. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - hostPoolName - The name of the host pool within the specified resource group // - sessionHostName - The name of the session host within the specified host pool @@ -97,7 +97,7 @@ func (client *SessionHostsClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-08-preview") if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } @@ -109,7 +109,7 @@ func (client *SessionHostsClient) deleteCreateRequest(ctx context.Context, resou // Get - Get a session host. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - hostPoolName - The name of the host pool within the specified resource group // - sessionHostName - The name of the session host within the specified host pool @@ -160,7 +160,7 @@ func (client *SessionHostsClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-08-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -177,7 +177,7 @@ func (client *SessionHostsClient) getHandleResponse(resp *http.Response) (Sessio // NewListPager - List sessionHosts. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - hostPoolName - The name of the host pool within the specified resource group // - options - SessionHostsClientListOptions contains the optional parameters for the SessionHostsClient.NewListPager method. @@ -224,15 +224,18 @@ func (client *SessionHostsClient) listCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") - if options != nil && options.PageSize != nil { - reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) + reqQP.Set("api-version", "2024-04-08-preview") + if options != nil && options.InitialSkip != nil { + reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) } if options != nil && options.IsDescending != nil { reqQP.Set("isDescending", strconv.FormatBool(*options.IsDescending)) } - if options != nil && options.InitialSkip != nil { - reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) + if options != nil && options.PageSize != nil { + reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) + } + if options != nil && options.VMPath != nil { + reqQP.Set("vmPath", *options.VMPath) } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} @@ -251,7 +254,7 @@ func (client *SessionHostsClient) listHandleResponse(resp *http.Response) (Sessi // Update - Update a session host. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - hostPoolName - The name of the host pool within the specified resource group // - sessionHostName - The name of the session host within the specified host pool @@ -302,7 +305,7 @@ func (client *SessionHostsClient) updateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-08-preview") if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/sessionhosts_client_example_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/sessionhosts_client_example_test.go deleted file mode 100644 index 175864f77c74..000000000000 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/sessionhosts_client_example_test.go +++ /dev/null @@ -1,279 +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 armdesktopvirtualization_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/desktopvirtualization/armdesktopvirtualization/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/SessionHost_Get.json -func ExampleSessionHostsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSessionHostsClient().Get(ctx, "resourceGroup1", "hostPool1", "sessionHost1.microsoft.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.SessionHost = armdesktopvirtualization.SessionHost{ - // Name: to.Ptr("sessionHost1.microsoft.com"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/hostPools/sessionHosts"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1/sessionHosts/sessionHost1.microsoft.com"), - // Properties: &armdesktopvirtualization.SessionHostProperties{ - // AgentVersion: to.Ptr("1.0.0.1391"), - // AllowNewSession: to.Ptr(true), - // AssignedUser: to.Ptr("user1@microsoft.com"), - // FriendlyName: to.Ptr("friendly"), - // LastHeartBeat: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2008-09-22T14:01:54.957Z"); return t}()), - // LastUpdateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2008-09-22T14:01:54.957Z"); return t}()), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // OSVersion: to.Ptr("10.0.17763"), - // ResourceID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.Compute/virtualMachines/sessionHost1"), - // SessionHostHealthCheckResults: []*armdesktopvirtualization.SessionHostHealthCheckReport{ - // { - // AdditionalFailureDetails: &armdesktopvirtualization.SessionHostHealthCheckFailureDetails{ - // ErrorCode: to.Ptr[int32](0), - // LastHealthCheckDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-14T02:09:37.623Z"); return t}()), - // Message: to.Ptr("SessionHost healthy: is joined to domain ≤wvdarmtest1.net≥"), - // }, - // HealthCheckName: to.Ptr(armdesktopvirtualization.HealthCheckNameDomainJoinedCheck), - // HealthCheckResult: to.Ptr(armdesktopvirtualization.HealthCheckResultHealthCheckSucceeded), - // }}, - // Sessions: to.Ptr[int32](1), - // Status: to.Ptr(armdesktopvirtualization.StatusAvailable), - // StatusTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2008-09-22T14:01:54.957Z"); return t}()), - // SxSStackVersion: to.Ptr("rdp-sxs190816002"), - // UpdateErrorMessage: to.Ptr(""), - // UpdateState: to.Ptr(armdesktopvirtualization.UpdateStateSucceeded), - // VirtualMachineID: to.Ptr("29491b54-c033-4dec-b09a-18bf0ebafaef"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/SessionHost_Delete.json -func ExampleSessionHostsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewSessionHostsClient().Delete(ctx, "resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", &armdesktopvirtualization.SessionHostsClientDeleteOptions{Force: to.Ptr(true)}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/SessionHost_Update.json -func ExampleSessionHostsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSessionHostsClient().Update(ctx, "resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", &armdesktopvirtualization.SessionHostsClientUpdateOptions{Force: to.Ptr(true), - SessionHost: &armdesktopvirtualization.SessionHostPatch{ - Properties: &armdesktopvirtualization.SessionHostPatchProperties{ - AllowNewSession: to.Ptr(true), - AssignedUser: to.Ptr("user1@microsoft.com"), - FriendlyName: to.Ptr("friendly"), - }, - }, - }) - 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.SessionHost = armdesktopvirtualization.SessionHost{ - // Name: to.Ptr("sessionHost1.microsoft.com"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/hostPools/sessionhosts"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1/sessionHosts/sessionHost1.microsoft.com"), - // Properties: &armdesktopvirtualization.SessionHostProperties{ - // AgentVersion: to.Ptr("1.0.0.1391"), - // AllowNewSession: to.Ptr(true), - // AssignedUser: to.Ptr("user1@microsoft.com"), - // FriendlyName: to.Ptr("friendly"), - // LastHeartBeat: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-01-11T19:27:13.610Z"); return t}()), - // LastUpdateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2008-09-22T14:01:54.957Z"); return t}()), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // OSVersion: to.Ptr("10.0.17763"), - // ResourceID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.Compute/virtualMachines/sessionHost1"), - // SessionHostHealthCheckResults: []*armdesktopvirtualization.SessionHostHealthCheckReport{ - // { - // AdditionalFailureDetails: &armdesktopvirtualization.SessionHostHealthCheckFailureDetails{ - // ErrorCode: to.Ptr[int32](0), - // LastHealthCheckDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-14T02:09:37.623Z"); return t}()), - // Message: to.Ptr("SessionHost healthy: is joined to domain ≤wvdarmtest1.net≥"), - // }, - // HealthCheckName: to.Ptr(armdesktopvirtualization.HealthCheckNameDomainJoinedCheck), - // HealthCheckResult: to.Ptr(armdesktopvirtualization.HealthCheckResultHealthCheckSucceeded), - // }}, - // Sessions: to.Ptr[int32](1), - // Status: to.Ptr(armdesktopvirtualization.StatusAvailable), - // StatusTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-01-24T20:00:08.289Z"); return t}()), - // SxSStackVersion: to.Ptr("rdp-sxs190816002"), - // UpdateErrorMessage: to.Ptr(""), - // UpdateState: to.Ptr(armdesktopvirtualization.UpdateStateSucceeded), - // VirtualMachineID: to.Ptr("29491b54-c033-4dec-b09a-18bf0ebafaef"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/SessionHost_List.json -func ExampleSessionHostsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSessionHostsClient().NewListPager("resourceGroup1", "hostPool1", &armdesktopvirtualization.SessionHostsClientListOptions{PageSize: to.Ptr[int32](10), - IsDescending: to.Ptr(true), - InitialSkip: to.Ptr[int32](0), - }) - 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.SessionHostList = armdesktopvirtualization.SessionHostList{ - // Value: []*armdesktopvirtualization.SessionHost{ - // { - // Name: to.Ptr("sessionHost1.microsoft.com"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/hostPools/sessionhosts"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1/sessionHosts/sessionHost1.microsoft.com"), - // Properties: &armdesktopvirtualization.SessionHostProperties{ - // AgentVersion: to.Ptr("1.0.0.1391"), - // AllowNewSession: to.Ptr(true), - // AssignedUser: to.Ptr("user1@microsoft.com"), - // FriendlyName: to.Ptr("friendly"), - // LastHeartBeat: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2008-09-22T14:01:54.957Z"); return t}()), - // LastUpdateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2008-09-22T14:01:54.957Z"); return t}()), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // OSVersion: to.Ptr("10.0.17763"), - // ResourceID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.Compute/virtualMachines/sessionHost1"), - // SessionHostHealthCheckResults: []*armdesktopvirtualization.SessionHostHealthCheckReport{ - // { - // AdditionalFailureDetails: &armdesktopvirtualization.SessionHostHealthCheckFailureDetails{ - // ErrorCode: to.Ptr[int32](0), - // LastHealthCheckDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-14T02:09:37.623Z"); return t}()), - // Message: to.Ptr("SessionHost healthy: is joined to domain ≤wvdarmtest1.net≥"), - // }, - // HealthCheckName: to.Ptr(armdesktopvirtualization.HealthCheckNameDomainJoinedCheck), - // HealthCheckResult: to.Ptr(armdesktopvirtualization.HealthCheckResultHealthCheckSucceeded), - // }}, - // Sessions: to.Ptr[int32](1), - // Status: to.Ptr(armdesktopvirtualization.StatusAvailable), - // StatusTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2008-09-22T14:01:54.957Z"); return t}()), - // SxSStackVersion: to.Ptr("rdp-sxs190816002"), - // UpdateErrorMessage: to.Ptr(""), - // UpdateState: to.Ptr(armdesktopvirtualization.UpdateStateSucceeded), - // VirtualMachineID: to.Ptr("29491b54-c033-4dec-b09a-18bf0ebafaef"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }, - // { - // Name: to.Ptr("sessionHost2.microsoft.com"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/hostPools/sessionhosts"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1/sessionHosts/sessionHost2microsoft.com"), - // Properties: &armdesktopvirtualization.SessionHostProperties{ - // AgentVersion: to.Ptr("1.0.0.1391"), - // AllowNewSession: to.Ptr(true), - // AssignedUser: to.Ptr("user2@microsoft.com"), - // FriendlyName: to.Ptr("friendly"), - // LastHeartBeat: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2008-09-22T14:01:54.957Z"); return t}()), - // LastUpdateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2008-09-22T14:01:54.957Z"); return t}()), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // OSVersion: to.Ptr("10.0.17763"), - // ResourceID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.Compute/virtualMachines/sessionHost2"), - // SessionHostHealthCheckResults: []*armdesktopvirtualization.SessionHostHealthCheckReport{ - // { - // AdditionalFailureDetails: &armdesktopvirtualization.SessionHostHealthCheckFailureDetails{ - // ErrorCode: to.Ptr[int32](0), - // LastHealthCheckDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-14T02:09:37.623Z"); return t}()), - // Message: to.Ptr("SessionHost healthy: is joined to domain ≤wvdarmtest1.net≥"), - // }, - // HealthCheckName: to.Ptr(armdesktopvirtualization.HealthCheckNameDomainJoinedCheck), - // HealthCheckResult: to.Ptr(armdesktopvirtualization.HealthCheckResultHealthCheckSucceeded), - // }}, - // Sessions: to.Ptr[int32](1), - // Status: to.Ptr(armdesktopvirtualization.StatusAvailable), - // StatusTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2008-09-22T14:01:54.957Z"); return t}()), - // SxSStackVersion: to.Ptr("rdp-sxs190816002"), - // UpdateErrorMessage: to.Ptr(""), - // UpdateState: to.Ptr(armdesktopvirtualization.UpdateStateSucceeded), - // VirtualMachineID: to.Ptr("39491b54-c033-4dec-b09a-18bf0ebafaef"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/startmenuitems_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/startmenuitems_client.go index ecb34a1edb78..7011c2f00817 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/startmenuitems_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/startmenuitems_client.go @@ -29,7 +29,7 @@ type StartMenuItemsClient struct { } // NewStartMenuItemsClient creates a new instance of StartMenuItemsClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewStartMenuItemsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*StartMenuItemsClient, error) { @@ -46,7 +46,7 @@ func NewStartMenuItemsClient(subscriptionID string, credential azcore.TokenCrede // NewListPager - List start menu items in the given application group. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - applicationGroupName - The name of the application group // - options - StartMenuItemsClientListOptions contains the optional parameters for the StartMenuItemsClient.NewListPager method. @@ -93,15 +93,15 @@ func (client *StartMenuItemsClient) listCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") - if options != nil && options.PageSize != nil { - reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) + reqQP.Set("api-version", "2024-04-08-preview") + if options != nil && options.InitialSkip != nil { + reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) } if options != nil && options.IsDescending != nil { reqQP.Set("isDescending", strconv.FormatBool(*options.IsDescending)) } - if options != nil && options.InitialSkip != nil { - reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) + if options != nil && options.PageSize != nil { + reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/startmenuitems_client_example_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/startmenuitems_client_example_test.go deleted file mode 100644 index fbb394a94ca4..000000000000 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/startmenuitems_client_example_test.go +++ /dev/null @@ -1,73 +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 armdesktopvirtualization_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/StartMenuItem_List.json -func ExampleStartMenuItemsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewStartMenuItemsClient().NewListPager("resourceGroup1", "applicationGroup1", &armdesktopvirtualization.StartMenuItemsClientListOptions{PageSize: nil, - IsDescending: nil, - InitialSkip: 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.StartMenuItemList = armdesktopvirtualization.StartMenuItemList{ - // Value: []*armdesktopvirtualization.StartMenuItem{ - // { - // Name: to.Ptr("application1"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/applicationGroups/startMenuItems"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/applicationGroups/applicationGroup1/startMenuItem/application1"), - // Properties: &armdesktopvirtualization.StartMenuItemProperties{ - // AppAlias: to.Ptr("word"), - // CommandLineArguments: to.Ptr("arguments"), - // FilePath: to.Ptr("/path/to/file"), - // IconIndex: to.Ptr[int32](1), - // IconPath: to.Ptr("/path/to/icon"), - // }, - // }, - // { - // Name: to.Ptr("application2"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/applicationGroups/startMenuItems"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/applicationGroups/applicationGroup1/startMenuItem/application2"), - // Properties: &armdesktopvirtualization.StartMenuItemProperties{ - // AppAlias: to.Ptr("excel"), - // CommandLineArguments: to.Ptr("arguments"), - // FilePath: to.Ptr("/path/to/file"), - // IconIndex: to.Ptr[int32](1), - // IconPath: to.Ptr("/path/to/icon"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/time_rfc3339.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/time_rfc3339.go index 3eaa4672ec4a..20977df2306f 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/time_rfc3339.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/time_rfc3339.go @@ -19,12 +19,16 @@ import ( ) // Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. -var tzOffsetRegex = regexp.MustCompile(`(Z|z|\+|-)(\d+:\d+)*"*$`) +var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`) const ( - utcDateTimeJSON = `"2006-01-02T15:04:05.999999999"` - utcDateTime = "2006-01-02T15:04:05.999999999" - dateTimeJSON = `"` + time.RFC3339Nano + `"` + utcDateTime = "2006-01-02T15:04:05.999999999" + utcDateTimeJSON = `"` + utcDateTime + `"` + utcDateTimeNoT = "2006-01-02 15:04:05.999999999" + utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"` + dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00` + dateTimeJSON = `"` + time.RFC3339Nano + `"` + dateTimeJSONNoT = `"` + dateTimeNoT + `"` ) type dateTimeRFC3339 time.Time @@ -40,17 +44,33 @@ func (t dateTimeRFC3339) MarshalText() ([]byte, error) { } func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { - layout := utcDateTimeJSON - if tzOffsetRegex.Match(data) { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { layout = dateTimeJSON + } else if tzOffset { + layout = dateTimeJSONNoT + } else if hasT { + layout = utcDateTimeJSON + } else { + layout = utcDateTimeJSONNoT } return t.Parse(layout, string(data)) } func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { - layout := utcDateTime - if tzOffsetRegex.Match(data) { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { layout = time.RFC3339Nano + } else if tzOffset { + layout = dateTimeNoT + } else if hasT { + layout = utcDateTime + } else { + layout = utcDateTimeNoT } return t.Parse(layout, string(data)) } @@ -61,6 +81,10 @@ func (t *dateTimeRFC3339) Parse(layout, value string) error { return err } +func (t dateTimeRFC3339) String() string { + return time.Time(t).Format(time.RFC3339Nano) +} + func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { if t == nil { return @@ -74,7 +98,7 @@ func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { } func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || strings.EqualFold(string(data), "null") { + if data == nil || string(data) == "null" { return nil } var aux dateTimeRFC3339 diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/usersessions_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/usersessions_client.go index 4f59aca0963b..8c909cc5f4cc 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/usersessions_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/usersessions_client.go @@ -29,7 +29,7 @@ type UserSessionsClient struct { } // NewUserSessionsClient creates a new instance of UserSessionsClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewUserSessionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*UserSessionsClient, error) { @@ -47,7 +47,7 @@ func NewUserSessionsClient(subscriptionID string, credential azcore.TokenCredent // Delete - Remove a userSession. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - hostPoolName - The name of the host pool within the specified resource group // - sessionHostName - The name of the session host within the specified host pool @@ -102,7 +102,7 @@ func (client *UserSessionsClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-08-preview") if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } @@ -114,7 +114,7 @@ func (client *UserSessionsClient) deleteCreateRequest(ctx context.Context, resou // Disconnect - Disconnect a userSession. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - hostPoolName - The name of the host pool within the specified resource group // - sessionHostName - The name of the session host within the specified host pool @@ -169,7 +169,7 @@ func (client *UserSessionsClient) disconnectCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-08-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -178,7 +178,7 @@ func (client *UserSessionsClient) disconnectCreateRequest(ctx context.Context, r // Get - Get a userSession. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - hostPoolName - The name of the host pool within the specified resource group // - sessionHostName - The name of the session host within the specified host pool @@ -234,7 +234,7 @@ func (client *UserSessionsClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-08-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -251,7 +251,7 @@ func (client *UserSessionsClient) getHandleResponse(resp *http.Response) (UserSe // NewListPager - List userSessions. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - hostPoolName - The name of the host pool within the specified resource group // - sessionHostName - The name of the session host within the specified host pool @@ -303,15 +303,15 @@ func (client *UserSessionsClient) listCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") - if options != nil && options.PageSize != nil { - reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) + reqQP.Set("api-version", "2024-04-08-preview") + if options != nil && options.InitialSkip != nil { + reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) } if options != nil && options.IsDescending != nil { reqQP.Set("isDescending", strconv.FormatBool(*options.IsDescending)) } - if options != nil && options.InitialSkip != nil { - reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) + if options != nil && options.PageSize != nil { + reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} @@ -329,7 +329,7 @@ func (client *UserSessionsClient) listHandleResponse(resp *http.Response) (UserS // NewListByHostPoolPager - List userSessions. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - hostPoolName - The name of the host pool within the specified resource group // - options - UserSessionsClientListByHostPoolOptions contains the optional parameters for the UserSessionsClient.NewListByHostPoolPager @@ -377,18 +377,18 @@ func (client *UserSessionsClient) listByHostPoolCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - if options != nil && options.PageSize != nil { - reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) + reqQP.Set("api-version", "2024-04-08-preview") + if options != nil && options.InitialSkip != nil { + reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) } if options != nil && options.IsDescending != nil { reqQP.Set("isDescending", strconv.FormatBool(*options.IsDescending)) } - if options != nil && options.InitialSkip != nil { - reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) + if options != nil && options.PageSize != nil { + reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} @@ -407,7 +407,7 @@ func (client *UserSessionsClient) listByHostPoolHandleResponse(resp *http.Respon // SendMessage - Send a message to a user. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - hostPoolName - The name of the host pool within the specified resource group // - sessionHostName - The name of the session host within the specified host pool @@ -463,7 +463,7 @@ func (client *UserSessionsClient) sendMessageCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-08-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.SendMessage != nil { diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/usersessions_client_example_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/usersessions_client_example_test.go deleted file mode 100644 index e74dbbfec3d0..000000000000 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/usersessions_client_example_test.go +++ /dev/null @@ -1,262 +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 armdesktopvirtualization_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/desktopvirtualization/armdesktopvirtualization/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/UserSession_ListByHostPool.json -func ExampleUserSessionsClient_NewListByHostPoolPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewUserSessionsClient().NewListByHostPoolPager("resourceGroup1", "hostPool1", &armdesktopvirtualization.UserSessionsClientListByHostPoolOptions{Filter: to.Ptr("userPrincipalName eq 'user1@microsoft.com' and state eq 'active'"), - PageSize: to.Ptr[int32](10), - IsDescending: to.Ptr(true), - InitialSkip: to.Ptr[int32](0), - }) - 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.UserSessionList = armdesktopvirtualization.UserSessionList{ - // Value: []*armdesktopvirtualization.UserSession{ - // { - // Name: to.Ptr("1"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/hostPools/sessionHosts/userSessions"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1/sessionHosts/sessionHost1.microsoft.com/userSessions/1"), - // Properties: &armdesktopvirtualization.UserSessionProperties{ - // ActiveDirectoryUserName: to.Ptr("WVDARM\\user1"), - // ApplicationType: to.Ptr(armdesktopvirtualization.ApplicationTypeDesktop), - // CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2008-09-22T14:01:54.957Z"); return t}()), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // SessionState: to.Ptr(armdesktopvirtualization.SessionStateActive), - // UserPrincipalName: to.Ptr("user1@microsoft.com"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }, - // { - // Name: to.Ptr("2"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/hostPools/sessionHosts/userSessions"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1/sessionHosts/sessionHost1.microsoft.com/userSessions/2"), - // Properties: &armdesktopvirtualization.UserSessionProperties{ - // ActiveDirectoryUserName: to.Ptr("WVDARM\\user1"), - // ApplicationType: to.Ptr(armdesktopvirtualization.ApplicationTypeDesktop), - // CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2008-09-22T14:01:54.957Z"); return t}()), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // SessionState: to.Ptr(armdesktopvirtualization.SessionStateActive), - // UserPrincipalName: to.Ptr("user1@microsoft.com"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/UserSession_Get.json -func ExampleUserSessionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewUserSessionsClient().Get(ctx, "resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", "1", 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.UserSession = armdesktopvirtualization.UserSession{ - // Name: to.Ptr("1"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/hostPools/sessionHosts/userSessions"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1/sessionHosts/sessionHost1.microsoft.com/userSessions/1"), - // Properties: &armdesktopvirtualization.UserSessionProperties{ - // ActiveDirectoryUserName: to.Ptr("WVDARM\\user1"), - // ApplicationType: to.Ptr(armdesktopvirtualization.ApplicationTypeDesktop), - // CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2008-09-22T14:01:54.957Z"); return t}()), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // SessionState: to.Ptr(armdesktopvirtualization.SessionStateActive), - // UserPrincipalName: to.Ptr("user1@microsoft.com"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/UserSession_Delete.json -func ExampleUserSessionsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewUserSessionsClient().Delete(ctx, "resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", "1", &armdesktopvirtualization.UserSessionsClientDeleteOptions{Force: to.Ptr(true)}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/UserSession_List.json -func ExampleUserSessionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewUserSessionsClient().NewListPager("resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", &armdesktopvirtualization.UserSessionsClientListOptions{PageSize: to.Ptr[int32](10), - IsDescending: to.Ptr(true), - InitialSkip: to.Ptr[int32](0), - }) - 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.UserSessionList = armdesktopvirtualization.UserSessionList{ - // Value: []*armdesktopvirtualization.UserSession{ - // { - // Name: to.Ptr("1"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/hostPools/sessionHosts/userSessions"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1/sessionHosts/sessionHost1.microsoft.com/userSessions/1"), - // Properties: &armdesktopvirtualization.UserSessionProperties{ - // ActiveDirectoryUserName: to.Ptr("WVDARM\\user1"), - // ApplicationType: to.Ptr(armdesktopvirtualization.ApplicationTypeDesktop), - // CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2008-09-22T14:01:54.957Z"); return t}()), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // SessionState: to.Ptr(armdesktopvirtualization.SessionStateActive), - // UserPrincipalName: to.Ptr("user1@microsoft.com"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }, - // { - // Name: to.Ptr("2"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/hostPools/sessionHosts/userSessions"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1/sessionHosts/sessionHost1.microsoft.com/userSessions/2"), - // Properties: &armdesktopvirtualization.UserSessionProperties{ - // ActiveDirectoryUserName: to.Ptr("WVDARM\\user1"), - // ApplicationType: to.Ptr(armdesktopvirtualization.ApplicationTypeDesktop), - // CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2008-09-22T14:01:54.957Z"); return t}()), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // SessionState: to.Ptr(armdesktopvirtualization.SessionStateActive), - // UserPrincipalName: to.Ptr("user1@microsoft.com"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/UserSession_Disconnect_Post.json -func ExampleUserSessionsClient_Disconnect() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewUserSessionsClient().Disconnect(ctx, "resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", "1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/UserSession_SendMessage_Post.json -func ExampleUserSessionsClient_SendMessage() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewUserSessionsClient().SendMessage(ctx, "resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", "1", &armdesktopvirtualization.UserSessionsClientSendMessageOptions{SendMessage: &armdesktopvirtualization.SendMessage{ - MessageBody: to.Ptr("body"), - MessageTitle: to.Ptr("title"), - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/workspaces_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/workspaces_client.go index 5566650d99d3..b6f57efa30f5 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/workspaces_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/workspaces_client.go @@ -29,7 +29,7 @@ type WorkspacesClient struct { } // NewWorkspacesClient creates a new instance of WorkspacesClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewWorkspacesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*WorkspacesClient, error) { @@ -47,7 +47,7 @@ func NewWorkspacesClient(subscriptionID string, credential azcore.TokenCredentia // CreateOrUpdate - Create or update a workspace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - The name of the workspace // - workspace - Object containing Workspace definitions. @@ -95,7 +95,7 @@ func (client *WorkspacesClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-08-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, workspace); err != nil { @@ -116,7 +116,7 @@ func (client *WorkspacesClient) createOrUpdateHandleResponse(resp *http.Response // Delete - Remove a workspace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - The name of the workspace // - options - WorkspacesClientDeleteOptions contains the optional parameters for the WorkspacesClient.Delete method. @@ -161,7 +161,7 @@ func (client *WorkspacesClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-08-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -170,7 +170,7 @@ func (client *WorkspacesClient) deleteCreateRequest(ctx context.Context, resourc // Get - Get a workspace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - The name of the workspace // - options - WorkspacesClientGetOptions contains the optional parameters for the WorkspacesClient.Get method. @@ -216,7 +216,7 @@ func (client *WorkspacesClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-08-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -233,7 +233,7 @@ func (client *WorkspacesClient) getHandleResponse(resp *http.Response) (Workspac // NewListByResourceGroupPager - List workspaces. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - WorkspacesClientListByResourceGroupOptions contains the optional parameters for the WorkspacesClient.NewListByResourceGroupPager // method. @@ -276,15 +276,15 @@ func (client *WorkspacesClient) listByResourceGroupCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") - if options != nil && options.PageSize != nil { - reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) + reqQP.Set("api-version", "2024-04-08-preview") + if options != nil && options.InitialSkip != nil { + reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) } if options != nil && options.IsDescending != nil { reqQP.Set("isDescending", strconv.FormatBool(*options.IsDescending)) } - if options != nil && options.InitialSkip != nil { - reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) + if options != nil && options.PageSize != nil { + reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} @@ -302,7 +302,7 @@ func (client *WorkspacesClient) listByResourceGroupHandleResponse(resp *http.Res // NewListBySubscriptionPager - List workspaces in subscription. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - options - WorkspacesClientListBySubscriptionOptions contains the optional parameters for the WorkspacesClient.NewListBySubscriptionPager // method. func (client *WorkspacesClient) NewListBySubscriptionPager(options *WorkspacesClientListBySubscriptionOptions) *runtime.Pager[WorkspacesClientListBySubscriptionResponse] { @@ -340,7 +340,7 @@ func (client *WorkspacesClient) listBySubscriptionCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-08-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -358,7 +358,7 @@ func (client *WorkspacesClient) listBySubscriptionHandleResponse(resp *http.Resp // Update - Update a workspace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-08-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - The name of the workspace // - options - WorkspacesClientUpdateOptions contains the optional parameters for the WorkspacesClient.Update method. @@ -404,7 +404,7 @@ func (client *WorkspacesClient) updateCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-08-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Workspace != nil { diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/workspaces_client_example_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/workspaces_client_example_test.go deleted file mode 100644 index 8de508b51204..000000000000 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/workspaces_client_example_test.go +++ /dev/null @@ -1,343 +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 armdesktopvirtualization_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/desktopvirtualization/armdesktopvirtualization/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Workspace_Get.json -func ExampleWorkspacesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewWorkspacesClient().Get(ctx, "resourceGroup1", "workspace1", 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.Workspace = armdesktopvirtualization.Workspace{ - // Name: to.Ptr("workspace1"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/workspaces"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/workspaces/workspace1"), - // Location: to.Ptr("centralus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armdesktopvirtualization.WorkspaceProperties{ - // Description: to.Ptr("des1"), - // CloudPcResource: to.Ptr(false), - // FriendlyName: to.Ptr("friendly"), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Workspace_Create.json -func ExampleWorkspacesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewWorkspacesClient().CreateOrUpdate(ctx, "resourceGroup1", "workspace1", armdesktopvirtualization.Workspace{ - Location: to.Ptr("centralus"), - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - Properties: &armdesktopvirtualization.WorkspaceProperties{ - Description: to.Ptr("des1"), - FriendlyName: to.Ptr("friendly"), - }, - }, 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.Workspace = armdesktopvirtualization.Workspace{ - // Name: to.Ptr("workspace1"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/workspaces"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/workspaces/workspace1"), - // Location: to.Ptr("centralus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armdesktopvirtualization.WorkspaceProperties{ - // Description: to.Ptr("des1"), - // CloudPcResource: to.Ptr(false), - // FriendlyName: to.Ptr("friendly"), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Workspace_Delete.json -func ExampleWorkspacesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewWorkspacesClient().Delete(ctx, "resourceGroup1", "workspace1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Workspace_Update.json -func ExampleWorkspacesClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewWorkspacesClient().Update(ctx, "resourceGroup1", "workspace1", &armdesktopvirtualization.WorkspacesClientUpdateOptions{Workspace: &armdesktopvirtualization.WorkspacePatch{ - Properties: &armdesktopvirtualization.WorkspacePatchProperties{ - Description: to.Ptr("des1"), - FriendlyName: to.Ptr("friendly"), - }, - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, - }) - 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.Workspace = armdesktopvirtualization.Workspace{ - // Name: to.Ptr("workspace1"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/workspaces"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/workspaces/workspace1"), - // Location: to.Ptr("centralus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armdesktopvirtualization.WorkspaceProperties{ - // Description: to.Ptr("des1"), - // CloudPcResource: to.Ptr(false), - // FriendlyName: to.Ptr("friendly"), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Workspace_ListByResourceGroup.json -func ExampleWorkspacesClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewWorkspacesClient().NewListByResourceGroupPager("resourceGroup1", &armdesktopvirtualization.WorkspacesClientListByResourceGroupOptions{PageSize: to.Ptr[int32](10), - IsDescending: to.Ptr(true), - InitialSkip: to.Ptr[int32](0), - }) - 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.WorkspaceList = armdesktopvirtualization.WorkspaceList{ - // Value: []*armdesktopvirtualization.Workspace{ - // { - // Name: to.Ptr("workspace1"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/workspaces"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/workspaces/workspace1"), - // Location: to.Ptr("centralus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armdesktopvirtualization.WorkspaceProperties{ - // Description: to.Ptr("des1"), - // CloudPcResource: to.Ptr(false), - // FriendlyName: to.Ptr("friendly"), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }, - // { - // Name: to.Ptr("workspace2"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/workspaces"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/workspaces/workspace2"), - // Location: to.Ptr("centralus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armdesktopvirtualization.WorkspaceProperties{ - // Description: to.Ptr("des1"), - // CloudPcResource: to.Ptr(false), - // FriendlyName: to.Ptr("friendly"), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Workspace_ListBySubscription.json -func ExampleWorkspacesClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewWorkspacesClient().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.WorkspaceList = armdesktopvirtualization.WorkspaceList{ - // Value: []*armdesktopvirtualization.Workspace{ - // { - // Name: to.Ptr("workspace1"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/workspaces"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/workspaces/workspace1"), - // Location: to.Ptr("centralus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armdesktopvirtualization.WorkspaceProperties{ - // Description: to.Ptr("des1"), - // CloudPcResource: to.Ptr(false), - // FriendlyName: to.Ptr("friendly"), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }, - // { - // Name: to.Ptr("workspace2"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/workspaces"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/workspaces/workspace2"), - // Location: to.Ptr("centralus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armdesktopvirtualization.WorkspaceProperties{ - // Description: to.Ptr("des1"), - // CloudPcResource: to.Ptr(false), - // FriendlyName: to.Ptr("friendly"), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }}, - // } - } -}