diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/CHANGELOG.md b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/CHANGELOG.md index ee25001a6959..0c15bc8f4c58 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/CHANGELOG.md +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/CHANGELOG.md @@ -1,5 +1,153 @@ # Release History +## 3.0.0-beta.1 (2025-05-12) +### 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 `ScalingPlanPersonalSchedulePatch.Properties` has been changed from `*ScalingPlanPersonalScheduleProperties` to `*ScalingPlanPersonalSchedulePatchProperties` +- Type of `ScalingPlanPooledSchedulePatch.Properties` has been changed from `*ScalingPlanPooledScheduleProperties` to `*ScalingPlanPooledSchedulePatchProperties` +- Type of `ScalingSchedule.DaysOfWeek` has been changed from `[]*ScalingScheduleDaysOfWeekItem` to `[]*DayOfWeek` +- 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` +- Enum `ScalingScheduleDaysOfWeekItem` has been removed +- 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 `CanaryPolicy` with values `CanaryPolicyAlways`, `CanaryPolicyAuto`, `CanaryPolicyNever` +- New enum type `DiffDiskOption` with values `DiffDiskOptionLocal` +- New enum type `DiffDiskPlacement` with values `DiffDiskPlacementCacheDisk`, `DiffDiskPlacementResourceDisk` +- New enum type `DirectUDP` with values `DirectUDPDefault`, `DirectUDPDisabled`, `DirectUDPEnabled` +- New enum type `DomainJoinType` with values `DomainJoinTypeActiveDirectory`, `DomainJoinTypeAzureActiveDirectory` +- New enum type `FailedSessionHostCleanupPolicySHC` with values `FailedSessionHostCleanupPolicySHCKeepAll`, `FailedSessionHostCleanupPolicySHCKeepNone`, `FailedSessionHostCleanupPolicySHCKeepOne` +- New enum type `HostPoolProvisioningAction` with values `HostPoolProvisioningActionCancel` +- 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 `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 `ScalingMethod` with values `ScalingMethodCreateDeletePowerManage`, `ScalingMethodPowerManage` +- 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 `*ClientFactory.NewActiveSessionHostConfigurationsClient() *ActiveSessionHostConfigurationsClient` +- New function `*ClientFactory.NewControlSessionHostProvisioningClient() *ControlSessionHostProvisioningClient` +- 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 `*ClientFactory.NewSessionHostProvisioningStatusesClient() *SessionHostProvisioningStatusesClient` +- New function `NewControlSessionHostProvisioningClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ControlSessionHostProvisioningClient, error)` +- New function `*ControlSessionHostProvisioningClient.BeginPost(context.Context, string, string, HostPoolProvisioningControlParameter, *ControlSessionHostProvisioningClientBeginPostOptions) (*runtime.Poller[ControlSessionHostProvisioningClientPostResponse], error)` +- 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 `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 function `NewSessionHostProvisioningStatusesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*SessionHostProvisioningStatusesClient, error)` +- New function `*SessionHostProvisioningStatusesClient.Get(context.Context, string, string, *SessionHostProvisioningStatusesClientGetOptions) (SessionHostProvisioningStatusesClientGetResponse, error)` +- New struct `ActiveDirectoryInfoPatchProperties` +- New struct `ActiveDirectoryInfoProperties` +- New struct `ActiveSessionHostConfiguration` +- New struct `ActiveSessionHostConfigurationList` +- New struct `ActiveSessionHostConfigurationProperties` +- New struct `AzureActiveDirectoryInfoProperties` +- New struct `BootDiagnosticsInfoPatchProperties` +- New struct `BootDiagnosticsInfoProperties` +- New struct `CreateDeleteProperties` +- New struct `CustomInfoPatchProperties` +- New struct `CustomInfoProperties` +- New struct `DiffDiskProperties` +- New struct `DiskInfoProperties` +- New struct `DomainInfoPatchProperties` +- New struct `DomainInfoProperties` +- New struct `ErrorAdditionalInfo` +- New struct `ErrorDetail` +- New struct `HostPoolProvisioningControlParameter` +- New struct `HostPoolUpdateConfigurationPatchProperties` +- New struct `HostPoolUpdateConfigurationProperties` +- New struct `HostPoolUpdateControlParameter` +- New struct `ImageInfoPatchProperties` +- New struct `ImageInfoProperties` +- New struct `KeyVaultCredentialsPatchProperties` +- New struct `KeyVaultCredentialsProperties` +- New struct `ManagedDiskProperties` +- New struct `ManagedServiceIdentity` +- New struct `MarketplaceInfoPatchProperties` +- New struct `MarketplaceInfoProperties` +- New struct `NetworkInfoPatchProperties` +- New struct `NetworkInfoProperties` +- New struct `Plan` +- New struct `SKU` +- New struct `ScalingPlanPersonalSchedulePatchProperties` +- New struct `ScalingPlanPooledSchedulePatchProperties` +- 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 `SessionHostManagementProvisioningOperationProgress` +- New struct `SessionHostManagementProvisioningStatus` +- New struct `SessionHostManagementProvisioningStatusProperties` +- New struct `SessionHostManagementUpdateStatus` +- New struct `SessionHostManagementUpdateStatusProperties` +- New struct `SessionHostProvisioningConfigurationPatchProperties` +- New struct `SessionHostProvisioningConfigurationProperties` +- New struct `UpdateSessionHostsRequestBody` +- New struct `UserAssignedIdentity` +- New field `Force` in struct `AppAttachPackageClientDeleteOptions` +- New field `Tags` in struct `AppAttachPackagePatch` +- New field `CustomData`, `PackageLookbackURL` in struct `AppAttachPackagePatchProperties` +- New field `CustomData`, `PackageLookbackURL`, `PackageOwnerName` in struct `AppAttachPackageProperties` +- New field `DirectUDP`, `ManagedPrivateUDP`, `PublicUDP`, `RelayUDP` in struct `HostPoolPatchProperties` +- New field `DirectUDP`, `ManagedPrivateUDP`, `ManagementType`, `PublicUDP`, `RelayUDP` in struct `HostPoolProperties` +- New field `CreateDelete`, `Name`, `ScalingMethod` in struct `ScalingPlanPooledScheduleProperties` +- New field `CreateDelete`, `ScalingMethod` in struct `ScalingSchedule` +- New field `ActiveSessions`, `DisconnectedSessions`, `LastSessionHostUpdateTime`, `PendingSessions`, `SessionHostConfiguration` in struct `SessionHostProperties` +- New field `VMPath` in struct `SessionHostsClientListOptions` + + ## 2.3.0 (2024-09-24) ### Features Added diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/README.md b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/README.md index 520ee98f4124..8b24673db20c 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/README.md +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/README.md @@ -18,7 +18,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 @@ -55,7 +55,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, _ *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", "2025-03-01-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 index 29c76032da54..e53d3d492738 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/appattachpackage_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/appattachpackage_client.go @@ -1,6 +1,3 @@ -//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. @@ -17,6 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" "net/url" + "strconv" "strings" ) @@ -46,9 +44,9 @@ func NewAppAttachPackageClient(subscriptionID string, credential azcore.TokenCre // CreateOrUpdate - Create or update an App Attach package. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-03 +// Generated from API version 2025-03-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - appAttachPackageName - The name of the App Attach package +// - 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. @@ -75,7 +73,7 @@ func (client *AppAttachPackageClient) CreateOrUpdate(ctx context.Context, resour } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *AppAttachPackageClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, appAttachPackageName string, appAttachPackage AppAttachPackage, options *AppAttachPackageClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *AppAttachPackageClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, appAttachPackageName string, appAttachPackage AppAttachPackage, _ *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") @@ -94,7 +92,7 @@ func (client *AppAttachPackageClient) createOrUpdateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, appAttachPackage); err != nil { @@ -115,9 +113,9 @@ func (client *AppAttachPackageClient) createOrUpdateHandleResponse(resp *http.Re // Delete - Remove an App Attach Package. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-03 +// Generated from API version 2025-03-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - appAttachPackageName - The name of the App Attach package +// - 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 @@ -160,7 +158,10 @@ func (client *AppAttachPackageClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-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 @@ -169,9 +170,9 @@ func (client *AppAttachPackageClient) deleteCreateRequest(ctx context.Context, r // Get - Get an app attach package. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-03 +// Generated from API version 2025-03-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - appAttachPackageName - The name of the App Attach package +// - 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 @@ -196,7 +197,7 @@ func (client *AppAttachPackageClient) Get(ctx context.Context, resourceGroupName } // getCreateRequest creates the Get request. -func (client *AppAttachPackageClient) getCreateRequest(ctx context.Context, resourceGroupName string, appAttachPackageName string, options *AppAttachPackageClientGetOptions) (*policy.Request, error) { +func (client *AppAttachPackageClient) getCreateRequest(ctx context.Context, resourceGroupName string, appAttachPackageName string, _ *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") @@ -215,7 +216,7 @@ func (client *AppAttachPackageClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -232,7 +233,7 @@ func (client *AppAttachPackageClient) getHandleResponse(resp *http.Response) (Ap // NewListByResourceGroupPager - List App Attach packages in resource group. // -// Generated from API version 2024-04-03 +// Generated from API version 2025-03-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - AppAttachPackageClientListByResourceGroupOptions contains the optional parameters for the AppAttachPackageClient.NewListByResourceGroupPager // method. @@ -278,7 +279,7 @@ func (client *AppAttachPackageClient) listByResourceGroupCreateRequest(ctx conte if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -295,7 +296,7 @@ func (client *AppAttachPackageClient) listByResourceGroupHandleResponse(resp *ht // NewListBySubscriptionPager - List App Attach packages in subscription. // -// Generated from API version 2024-04-03 +// Generated from API version 2025-03-01-preview // - options - AppAttachPackageClientListBySubscriptionOptions contains the optional parameters for the AppAttachPackageClient.NewListBySubscriptionPager // method. func (client *AppAttachPackageClient) NewListBySubscriptionPager(options *AppAttachPackageClientListBySubscriptionOptions) *runtime.Pager[AppAttachPackageClientListBySubscriptionResponse] { @@ -336,7 +337,7 @@ func (client *AppAttachPackageClient) listBySubscriptionCreateRequest(ctx contex if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -354,9 +355,9 @@ func (client *AppAttachPackageClient) listBySubscriptionHandleResponse(resp *htt // Update - Update an App Attach Package // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-03 +// Generated from API version 2025-03-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - appAttachPackageName - The name of the App Attach package +// - 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 @@ -400,7 +401,7 @@ func (client *AppAttachPackageClient) updateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.AppAttachPackagePatch != nil { diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/appattachpackage_client_example_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/appattachpackage_client_example_test.go deleted file mode 100644 index f1842dfbf6dd..000000000000 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/appattachpackage_client_example_test.go +++ /dev/null @@ -1,563 +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/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/AppAttachPackage_Get.json -func ExampleAppAttachPackageClient_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.NewAppAttachPackageClient().Get(ctx, "resourceGroup1", "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.AppAttachPackage = armdesktopvirtualization.AppAttachPackage{ - // Name: to.Ptr("packageName"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/appattachpackages"), - // ID: to.Ptr("/subscriptions/d15725f7-6577-4a8c-95f1-3da903b42364/resourcegroups/charlesk-southcentralus/providers/Microsoft.DesktopVirtualization/appattachpackages/ModifierPackage"), - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-28T23:44:56.130Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-09T01:43:31.070Z"); return t}()), - // LastModifiedBy: to.Ptr("user1"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // Location: to.Ptr("southcentralus"), - // Tags: map[string]*string{ - // }, - // Properties: &armdesktopvirtualization.AppAttachPackageProperties{ - // FailHealthCheckOnStagingFailure: to.Ptr(armdesktopvirtualization.FailHealthCheckOnStagingFailureNeedsAssistance), - // HostPoolReferences: []*string{ - // }, - // Image: &armdesktopvirtualization.AppAttachPackageInfoProperties{ - // CertificateExpiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-02T17:18:19.123Z"); return t}()), - // CertificateName: to.Ptr("certName"), - // 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{ - // { - // DependencyName: to.Ptr("MsixPackage_Dependency_Name"), - // MinVersion: to.Ptr("packageDep_version"), - // Publisher: to.Ptr("MsixPackage_Dependency_Publisher"), - // }}, - // PackageFamilyName: to.Ptr("MsixPackage_FamilyName"), - // PackageFullName: to.Ptr("MsixPackage_FullName"), - // PackageName: to.Ptr("MsixPackageName"), - // PackageRelativePath: to.Ptr("packagerelativepath"), - // Version: to.Ptr("packageversion"), - // }, - // KeyVaultURL: to.Ptr(""), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/AppAttachPackage_Create.json -func ExampleAppAttachPackageClient_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.NewAppAttachPackageClient().CreateOrUpdate(ctx, "resourceGroup1", "msixpackagefullname", armdesktopvirtualization.AppAttachPackage{ - Location: to.Ptr("southcentralus"), - Properties: &armdesktopvirtualization.AppAttachPackageProperties{ - FailHealthCheckOnStagingFailure: to.Ptr(armdesktopvirtualization.FailHealthCheckOnStagingFailureNeedsAssistance), - HostPoolReferences: []*string{}, - Image: &armdesktopvirtualization.AppAttachPackageInfoProperties{ - CertificateExpiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-02T17:18:19.123Z"); return t }()), - CertificateName: to.Ptr("certName"), - 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{ - { - DependencyName: to.Ptr("MsixPackage_Dependency_Name"), - MinVersion: to.Ptr("packageDep_version"), - Publisher: to.Ptr("MsixPackage_Dependency_Publisher"), - }}, - PackageFamilyName: to.Ptr("MsixPackage_FamilyName"), - PackageFullName: to.Ptr("MsixPackage_FullName"), - PackageName: to.Ptr("MsixPackageName"), - PackageRelativePath: to.Ptr("packagerelativepath"), - Version: to.Ptr("packageversion"), - }, - KeyVaultURL: to.Ptr(""), - }, - }, 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.AppAttachPackage = armdesktopvirtualization.AppAttachPackage{ - // Name: to.Ptr("packageName"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/appattachpackages"), - // ID: to.Ptr("/subscriptions/d15725f7-6577-4a8c-95f1-3da903b42364/resourcegroups/charlesk-southcentralus/providers/Microsoft.DesktopVirtualization/appattachpackages/ModifierPackage"), - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-28T23:44:56.130Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-09T01:43:31.070Z"); return t}()), - // LastModifiedBy: to.Ptr("user1"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // Location: to.Ptr("southcentralus"), - // Tags: map[string]*string{ - // }, - // Properties: &armdesktopvirtualization.AppAttachPackageProperties{ - // FailHealthCheckOnStagingFailure: to.Ptr(armdesktopvirtualization.FailHealthCheckOnStagingFailureNeedsAssistance), - // HostPoolReferences: []*string{ - // }, - // Image: &armdesktopvirtualization.AppAttachPackageInfoProperties{ - // CertificateExpiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-02T17:18:19.123Z"); return t}()), - // CertificateName: to.Ptr("certName"), - // 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{ - // { - // DependencyName: to.Ptr("MsixPackage_Dependency_Name"), - // MinVersion: to.Ptr("packageDep_version"), - // Publisher: to.Ptr("MsixPackage_Dependency_Publisher"), - // }}, - // PackageFamilyName: to.Ptr("MsixPackage_FamilyName"), - // PackageFullName: to.Ptr("MsixPackage_FullName"), - // PackageName: to.Ptr("MsixPackageName"), - // PackageRelativePath: to.Ptr("packagerelativepath"), - // Version: to.Ptr("packageversion"), - // }, - // KeyVaultURL: to.Ptr(""), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/AppAttachPackage_Delete.json -func ExampleAppAttachPackageClient_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.NewAppAttachPackageClient().Delete(ctx, "resourceGroup1", "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/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/AppAttachPackage_Update.json -func ExampleAppAttachPackageClient_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.NewAppAttachPackageClient().Update(ctx, "resourceGroup1", "msixpackagefullname", &armdesktopvirtualization.AppAttachPackageClientUpdateOptions{AppAttachPackagePatch: 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.AppAttachPackage = armdesktopvirtualization.AppAttachPackage{ - // Name: to.Ptr("packageName"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/appattachpackages"), - // ID: to.Ptr("/subscriptions/d15725f7-6577-4a8c-95f1-3da903b42364/resourcegroups/charlesk-southcentralus/providers/Microsoft.DesktopVirtualization/appattachpackages/ModifierPackage"), - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-28T23:44:56.130Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-09T01:43:31.070Z"); return t}()), - // LastModifiedBy: to.Ptr("user1"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // Location: to.Ptr("southcentralus"), - // Tags: map[string]*string{ - // }, - // Properties: &armdesktopvirtualization.AppAttachPackageProperties{ - // FailHealthCheckOnStagingFailure: to.Ptr(armdesktopvirtualization.FailHealthCheckOnStagingFailureNeedsAssistance), - // HostPoolReferences: []*string{ - // }, - // Image: &armdesktopvirtualization.AppAttachPackageInfoProperties{ - // CertificateExpiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-02T17:18:19.123Z"); return t}()), - // CertificateName: to.Ptr("certName"), - // 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{ - // { - // DependencyName: to.Ptr("MsixPackage_Dependency_Name"), - // MinVersion: to.Ptr("packageDep_version"), - // Publisher: to.Ptr("MsixPackage_Dependency_Publisher"), - // }}, - // PackageFamilyName: to.Ptr("MsixPackage_FamilyName"), - // PackageFullName: to.Ptr("MsixPackage_FullName"), - // PackageName: to.Ptr("MsixPackageName"), - // PackageRelativePath: to.Ptr("packagerelativepath"), - // Version: to.Ptr("packageversion"), - // }, - // KeyVaultURL: to.Ptr(""), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/AppAttachPackage_ListByResourceGroup.json -func ExampleAppAttachPackageClient_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.NewAppAttachPackageClient().NewListByResourceGroupPager("resourceGroup1", &armdesktopvirtualization.AppAttachPackageClientListByResourceGroupOptions{Filter: to.Ptr("HostPoolName eq 'hostpool1'")}) - 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.AppAttachPackageList = armdesktopvirtualization.AppAttachPackageList{ - // Value: []*armdesktopvirtualization.AppAttachPackage{ - // { - // Name: to.Ptr("packageName"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/appattachpackages"), - // ID: to.Ptr("/subscriptions/d15725f7-6577-4a8c-95f1-3da903b42364/resourcegroups/charlesk-southcentralus/providers/Microsoft.DesktopVirtualization/appattachpackages/ModifierPackage"), - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-28T23:44:56.130Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-09T01:43:31.070Z"); return t}()), - // LastModifiedBy: to.Ptr("user1"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // Location: to.Ptr("southcentralus"), - // Tags: map[string]*string{ - // }, - // Properties: &armdesktopvirtualization.AppAttachPackageProperties{ - // FailHealthCheckOnStagingFailure: to.Ptr(armdesktopvirtualization.FailHealthCheckOnStagingFailureNeedsAssistance), - // HostPoolReferences: []*string{ - // }, - // Image: &armdesktopvirtualization.AppAttachPackageInfoProperties{ - // CertificateExpiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-02T17:18:19.123Z"); return t}()), - // CertificateName: to.Ptr("certName"), - // 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{ - // { - // DependencyName: to.Ptr("MsixPackage_Dependency_Name"), - // MinVersion: to.Ptr("packageDep_version"), - // Publisher: to.Ptr("MsixPackage_Dependency_Publisher"), - // }}, - // PackageFamilyName: to.Ptr("MsixPackage_FamilyName"), - // PackageFullName: to.Ptr("MsixPackage_FullName"), - // PackageName: to.Ptr("MsixPackageName"), - // PackageRelativePath: to.Ptr("packagerelativepath"), - // Version: to.Ptr("packageversion"), - // }, - // KeyVaultURL: to.Ptr(""), - // }, - // }, - // { - // Name: to.Ptr("packageName"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/appattachpackages"), - // ID: to.Ptr("/subscriptions/d15725f7-6577-4a8c-95f1-3da903b42364/resourcegroups/charlesk-southcentralus/providers/Microsoft.DesktopVirtualization/appattachpackages/ModifierPackage"), - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-28T23:44:56.130Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-09T01:43:31.070Z"); return t}()), - // LastModifiedBy: to.Ptr("user1"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // Location: to.Ptr("southcentralus"), - // Tags: map[string]*string{ - // }, - // Properties: &armdesktopvirtualization.AppAttachPackageProperties{ - // FailHealthCheckOnStagingFailure: to.Ptr(armdesktopvirtualization.FailHealthCheckOnStagingFailureNeedsAssistance), - // HostPoolReferences: []*string{ - // }, - // Image: &armdesktopvirtualization.AppAttachPackageInfoProperties{ - // CertificateExpiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-02T17:18:19.123Z"); return t}()), - // CertificateName: to.Ptr("certName"), - // 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{ - // { - // DependencyName: to.Ptr("MsixPackage_Dependency_Name"), - // MinVersion: to.Ptr("packageDep_version"), - // Publisher: to.Ptr("MsixPackage_Dependency_Publisher"), - // }}, - // PackageFamilyName: to.Ptr("MsixPackage_FamilyName"), - // PackageFullName: to.Ptr("MsixPackage_FullName"), - // PackageName: to.Ptr("MsixPackageName"), - // PackageRelativePath: to.Ptr("packagerelativepath"), - // Version: to.Ptr("packageversion"), - // }, - // KeyVaultURL: to.Ptr(""), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/AppAttachPackage_ListBySubscription.json -func ExampleAppAttachPackageClient_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.NewAppAttachPackageClient().NewListBySubscriptionPager(&armdesktopvirtualization.AppAttachPackageClientListBySubscriptionOptions{Filter: to.Ptr("HostPoolName eq 'hostpool1'")}) - 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.AppAttachPackageList = armdesktopvirtualization.AppAttachPackageList{ - // Value: []*armdesktopvirtualization.AppAttachPackage{ - // { - // Name: to.Ptr("packageName"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/appattachpackages"), - // ID: to.Ptr("/subscriptions/d15725f7-6577-4a8c-95f1-3da903b42364/resourcegroups/charlesk-southcentralus/providers/Microsoft.DesktopVirtualization/appattachpackages/ModifierPackage"), - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-28T23:44:56.130Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-09T01:43:31.070Z"); return t}()), - // LastModifiedBy: to.Ptr("user1"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // Location: to.Ptr("southcentralus"), - // Tags: map[string]*string{ - // }, - // Properties: &armdesktopvirtualization.AppAttachPackageProperties{ - // FailHealthCheckOnStagingFailure: to.Ptr(armdesktopvirtualization.FailHealthCheckOnStagingFailureNeedsAssistance), - // HostPoolReferences: []*string{ - // }, - // Image: &armdesktopvirtualization.AppAttachPackageInfoProperties{ - // CertificateExpiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-02T17:18:19.123Z"); return t}()), - // CertificateName: to.Ptr("certName"), - // 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{ - // { - // DependencyName: to.Ptr("MsixPackage_Dependency_Name"), - // MinVersion: to.Ptr("packageDep_version"), - // Publisher: to.Ptr("MsixPackage_Dependency_Publisher"), - // }}, - // PackageFamilyName: to.Ptr("MsixPackage_FamilyName"), - // PackageFullName: to.Ptr("MsixPackage_FullName"), - // PackageName: to.Ptr("MsixPackageName"), - // PackageRelativePath: to.Ptr("packagerelativepath"), - // Version: to.Ptr("packageversion"), - // }, - // KeyVaultURL: to.Ptr(""), - // }, - // }, - // { - // Name: to.Ptr("packageName"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/appattachpackages"), - // ID: to.Ptr("/subscriptions/d15725f7-6577-4a8c-95f1-3da903b42364/resourcegroups/charlesk-southcentralus/providers/Microsoft.DesktopVirtualization/appattachpackages/ModifierPackage"), - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-28T23:44:56.130Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-09T01:43:31.070Z"); return t}()), - // LastModifiedBy: to.Ptr("user1"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // Location: to.Ptr("southcentralus"), - // Tags: map[string]*string{ - // }, - // Properties: &armdesktopvirtualization.AppAttachPackageProperties{ - // FailHealthCheckOnStagingFailure: to.Ptr(armdesktopvirtualization.FailHealthCheckOnStagingFailureNeedsAssistance), - // HostPoolReferences: []*string{ - // }, - // Image: &armdesktopvirtualization.AppAttachPackageInfoProperties{ - // CertificateExpiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-02T17:18:19.123Z"); return t}()), - // CertificateName: to.Ptr("certName"), - // 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{ - // { - // DependencyName: to.Ptr("MsixPackage_Dependency_Name"), - // MinVersion: to.Ptr("packageDep_version"), - // Publisher: to.Ptr("MsixPackage_Dependency_Publisher"), - // }}, - // PackageFamilyName: to.Ptr("MsixPackage_FamilyName"), - // PackageFullName: to.Ptr("MsixPackage_FullName"), - // PackageName: to.Ptr("MsixPackageName"), - // PackageRelativePath: to.Ptr("packagerelativepath"), - // Version: to.Ptr("packageversion"), - // }, - // KeyVaultURL: to.Ptr(""), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/appattachpackageinfo_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/appattachpackageinfo_client.go index b85f717710d1..4ba96c23d3d3 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/appattachpackageinfo_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/appattachpackageinfo_client.go @@ -1,6 +1,3 @@ -//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. @@ -45,7 +42,7 @@ func NewAppAttachPackageInfoClient(subscriptionID string, credential azcore.Toke // NewImportPager - Gets information from a package given the path to the package. // -// Generated from API version 2024-04-03 +// Generated from API version 2025-03-01-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 @@ -75,7 +72,7 @@ func (client *AppAttachPackageInfoClient) NewImportPager(resourceGroupName strin } // importCreateRequest creates the Import request. -func (client *AppAttachPackageInfoClient) importCreateRequest(ctx context.Context, resourceGroupName string, hostPoolName string, importPackageInfoRequest ImportPackageInfoRequest, options *AppAttachPackageInfoClientImportOptions) (*policy.Request, error) { +func (client *AppAttachPackageInfoClient) importCreateRequest(ctx context.Context, resourceGroupName string, hostPoolName string, importPackageInfoRequest ImportPackageInfoRequest, _ *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") @@ -94,7 +91,7 @@ func (client *AppAttachPackageInfoClient) importCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, importPackageInfoRequest); err != nil { diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/appattachpackageinfo_client_example_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/appattachpackageinfo_client_example_test.go deleted file mode 100644 index c2ae33456a78..000000000000 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/appattachpackageinfo_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/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/AppAttachPackageInfo_Import_Post.json -func ExampleAppAttachPackageInfoClient_NewImportPager() { - 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.NewAppAttachPackageInfoClient().NewImportPager("resourceGroup1", "hostpool1", armdesktopvirtualization.ImportPackageInfoRequest{ - Path: to.Ptr("imagepath"), - PackageArchitecture: to.Ptr(armdesktopvirtualization.AppAttachPackageArchitecturesX64), - }, 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.AppAttachPackageList = armdesktopvirtualization.AppAttachPackageList{ - // Value: []*armdesktopvirtualization.AppAttachPackage{ - // { - // Name: to.Ptr("packageName"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/appattachpackages"), - // ID: to.Ptr("/subscriptions/d15725f7-6577-4a8c-95f1-3da903b42364/resourcegroups/charlesk-southcentralus/providers/Microsoft.DesktopVirtualization/appattachpackages/ModifierPackage"), - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-28T23:44:56.130Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-09T01:43:31.070Z"); return t}()), - // LastModifiedBy: to.Ptr("user1"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // Location: to.Ptr("southcentralus"), - // Tags: map[string]*string{ - // }, - // Properties: &armdesktopvirtualization.AppAttachPackageProperties{ - // FailHealthCheckOnStagingFailure: to.Ptr(armdesktopvirtualization.FailHealthCheckOnStagingFailureNeedsAssistance), - // HostPoolReferences: []*string{ - // }, - // Image: &armdesktopvirtualization.AppAttachPackageInfoProperties{ - // CertificateExpiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-02T17:18:19.123Z"); return t}()), - // CertificateName: to.Ptr("certName"), - // 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{ - // { - // DependencyName: to.Ptr("MsixPackage_Dependency_Name"), - // MinVersion: to.Ptr("packageDep_version"), - // Publisher: to.Ptr("MsixPackage_Dependency_Publisher"), - // }}, - // PackageFamilyName: to.Ptr("MsixPackage_FamilyName"), - // PackageFullName: to.Ptr("MsixPackage_FullName"), - // PackageName: to.Ptr("MsixPackageName"), - // PackageRelativePath: to.Ptr("packagerelativepath"), - // Version: to.Ptr("packageversion"), - // }, - // KeyVaultURL: to.Ptr(""), - // }, - // }, - // { - // Name: to.Ptr("packageName"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/appattachpackages"), - // ID: to.Ptr("/subscriptions/d15725f7-6577-4a8c-95f1-3da903b42364/resourcegroups/charlesk-southcentralus/providers/Microsoft.DesktopVirtualization/appattachpackages/ModifierPackage"), - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-28T23:44:56.130Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-09T01:43:31.070Z"); return t}()), - // LastModifiedBy: to.Ptr("user1"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // Location: to.Ptr("southcentralus"), - // Tags: map[string]*string{ - // }, - // Properties: &armdesktopvirtualization.AppAttachPackageProperties{ - // FailHealthCheckOnStagingFailure: to.Ptr(armdesktopvirtualization.FailHealthCheckOnStagingFailureNeedsAssistance), - // HostPoolReferences: []*string{ - // }, - // Image: &armdesktopvirtualization.AppAttachPackageInfoProperties{ - // CertificateExpiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-02T17:18:19.123Z"); return t}()), - // CertificateName: to.Ptr("certName"), - // 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{ - // { - // DependencyName: to.Ptr("MsixPackage_Dependency_Name"), - // MinVersion: to.Ptr("packageDep_version"), - // Publisher: to.Ptr("MsixPackage_Dependency_Publisher"), - // }}, - // PackageFamilyName: to.Ptr("MsixPackage_FamilyName"), - // PackageFullName: to.Ptr("MsixPackage_FullName"), - // PackageName: to.Ptr("MsixPackageName"), - // PackageRelativePath: to.Ptr("packagerelativepath"), - // Version: to.Ptr("packageversion"), - // }, - // KeyVaultURL: to.Ptr(""), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/applicationgroups_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/applicationgroups_client.go index 2fd802ca610f..bf0854b40442 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/applicationgroups_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/applicationgroups_client.go @@ -1,6 +1,3 @@ -//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. @@ -47,7 +44,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 2024-04-03 +// Generated from API version 2025-03-01-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. @@ -76,7 +73,7 @@ func (client *ApplicationGroupsClient) CreateOrUpdate(ctx context.Context, resou } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ApplicationGroupsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, applicationGroupName string, applicationGroup ApplicationGroup, options *ApplicationGroupsClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *ApplicationGroupsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, applicationGroupName string, applicationGroup ApplicationGroup, _ *ApplicationGroupsClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -95,7 +92,7 @@ func (client *ApplicationGroupsClient) createOrUpdateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, applicationGroup); err != nil { @@ -116,7 +113,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 2024-04-03 +// Generated from API version 2025-03-01-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 @@ -143,7 +140,7 @@ func (client *ApplicationGroupsClient) Delete(ctx context.Context, resourceGroup } // deleteCreateRequest creates the Delete request. -func (client *ApplicationGroupsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, applicationGroupName string, options *ApplicationGroupsClientDeleteOptions) (*policy.Request, error) { +func (client *ApplicationGroupsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, applicationGroupName string, _ *ApplicationGroupsClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -162,7 +159,7 @@ func (client *ApplicationGroupsClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -171,7 +168,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 2024-04-03 +// Generated from API version 2025-03-01-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. @@ -198,7 +195,7 @@ func (client *ApplicationGroupsClient) Get(ctx context.Context, resourceGroupNam } // getCreateRequest creates the Get request. -func (client *ApplicationGroupsClient) getCreateRequest(ctx context.Context, resourceGroupName string, applicationGroupName string, options *ApplicationGroupsClientGetOptions) (*policy.Request, error) { +func (client *ApplicationGroupsClient) getCreateRequest(ctx context.Context, resourceGroupName string, applicationGroupName string, _ *ApplicationGroupsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -217,7 +214,7 @@ func (client *ApplicationGroupsClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -234,7 +231,7 @@ func (client *ApplicationGroupsClient) getHandleResponse(resp *http.Response) (A // NewListByResourceGroupPager - List applicationGroups. // -// Generated from API version 2024-04-03 +// Generated from API version 2025-03-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - ApplicationGroupsClientListByResourceGroupOptions contains the optional parameters for the ApplicationGroupsClient.NewListByResourceGroupPager // method. @@ -280,7 +277,7 @@ func (client *ApplicationGroupsClient) listByResourceGroupCreateRequest(ctx cont if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-preview") if options != nil && options.InitialSkip != nil { reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) } @@ -306,7 +303,7 @@ func (client *ApplicationGroupsClient) listByResourceGroupHandleResponse(resp *h // NewListBySubscriptionPager - List applicationGroups in subscription. // -// Generated from API version 2024-04-03 +// Generated from API version 2025-03-01-preview // - options - ApplicationGroupsClientListBySubscriptionOptions contains the optional parameters for the ApplicationGroupsClient.NewListBySubscriptionPager // method. func (client *ApplicationGroupsClient) NewListBySubscriptionPager(options *ApplicationGroupsClientListBySubscriptionOptions) *runtime.Pager[ApplicationGroupsClientListBySubscriptionResponse] { @@ -347,7 +344,7 @@ func (client *ApplicationGroupsClient) listBySubscriptionCreateRequest(ctx conte if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -365,7 +362,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 2024-04-03 +// Generated from API version 2025-03-01-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 +409,7 @@ func (client *ApplicationGroupsClient) updateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-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 f96b0aa7ad0f..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/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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"), - // 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), - // }, - // 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"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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"), - // 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), - // }, - // 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"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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"), - // 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), - // }, - // 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"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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"), - // 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), - // }, - // 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"), - // }, - // }, - // { - // 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"), - // 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), - // }, - // 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"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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"), - // 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), - // }, - // 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"), - // }, - // }, - // { - // 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"), - // 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), - // }, - // 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"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/applications_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/applications_client.go index d6742799f755..7cb4f39b986f 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/applications_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/applications_client.go @@ -1,6 +1,3 @@ -//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. @@ -47,7 +44,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 2024-04-03 +// Generated from API version 2025-03-01-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 @@ -77,7 +74,7 @@ func (client *ApplicationsClient) CreateOrUpdate(ctx context.Context, resourceGr } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ApplicationsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, applicationGroupName string, applicationName string, application Application, options *ApplicationsClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *ApplicationsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, applicationGroupName string, applicationName string, application Application, _ *ApplicationsClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/applications/{applicationName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -100,7 +97,7 @@ func (client *ApplicationsClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, application); err != nil { @@ -121,7 +118,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 2024-04-03 +// Generated from API version 2025-03-01-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 @@ -148,7 +145,7 @@ func (client *ApplicationsClient) Delete(ctx context.Context, resourceGroupName } // deleteCreateRequest creates the Delete request. -func (client *ApplicationsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, applicationGroupName string, applicationName string, options *ApplicationsClientDeleteOptions) (*policy.Request, error) { +func (client *ApplicationsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, applicationGroupName string, applicationName string, _ *ApplicationsClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/applications/{applicationName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -171,7 +168,7 @@ func (client *ApplicationsClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -180,7 +177,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 2024-04-03 +// Generated from API version 2025-03-01-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 @@ -208,7 +205,7 @@ func (client *ApplicationsClient) Get(ctx context.Context, resourceGroupName str } // getCreateRequest creates the Get request. -func (client *ApplicationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, applicationGroupName string, applicationName string, options *ApplicationsClientGetOptions) (*policy.Request, error) { +func (client *ApplicationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, applicationGroupName string, applicationName string, _ *ApplicationsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/applications/{applicationName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -231,7 +228,7 @@ func (client *ApplicationsClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -248,7 +245,7 @@ func (client *ApplicationsClient) getHandleResponse(resp *http.Response) (Applic // NewListPager - List applications. // -// Generated from API version 2024-04-03 +// Generated from API version 2025-03-01-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,7 +292,7 @@ func (client *ApplicationsClient) listCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-preview") if options != nil && options.InitialSkip != nil { reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) } @@ -322,7 +319,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 2024-04-03 +// Generated from API version 2025-03-01-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 +370,7 @@ func (client *ApplicationsClient) updateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-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 4d9122d2660a..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/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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"), - // 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), - // }, - // 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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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"), - // 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), - // }, - // 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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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"), - // 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), - // }, - // 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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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"), - // 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), - // }, - // 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), - // }, - // }, - // { - // 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"), - // 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), - // }, - // 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), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/autorest.md b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/autorest.md index 3071ba7d7bbf..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/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/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.3.0 -tag: package-2024-04 +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 93da21c36237..b9cdb15d8477 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/client_factory.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/client_factory.go @@ -1,6 +1,3 @@ -//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. @@ -36,6 +33,14 @@ func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, }, 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{ @@ -68,6 +73,22 @@ func (c *ClientFactory) NewApplicationsClient() *ApplicationsClient { } } +// NewControlSessionHostProvisioningClient creates a new instance of ControlSessionHostProvisioningClient. +func (c *ClientFactory) NewControlSessionHostProvisioningClient() *ControlSessionHostProvisioningClient { + return &ControlSessionHostProvisioningClient{ + 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 { return &DesktopsClient{ @@ -84,6 +105,14 @@ func (c *ClientFactory) NewHostPoolsClient() *HostPoolsClient { } } +// 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 { return &MSIXPackagesClient{ @@ -147,6 +176,46 @@ func (c *ClientFactory) NewScalingPlansClient() *ScalingPlansClient { } } +// 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, + } +} + +// NewSessionHostProvisioningStatusesClient creates a new instance of SessionHostProvisioningStatusesClient. +func (c *ClientFactory) NewSessionHostProvisioningStatusesClient() *SessionHostProvisioningStatusesClient { + return &SessionHostProvisioningStatusesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + // NewSessionHostsClient creates a new instance of SessionHostsClient. func (c *ClientFactory) NewSessionHostsClient() *SessionHostsClient { return &SessionHostsClient{ diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/constants.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/constants.go index c1f2b3f0a7af..d9ced2bb8102 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/constants.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/constants.go @@ -1,6 +1,3 @@ -//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. @@ -10,7 +7,7 @@ package armdesktopvirtualization const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization" - moduleVersion = "v2.3.0" + moduleVersion = "v3.0.0-beta.1" ) // AppAttachPackageArchitectures - Possible device architectures that an app attach package can be configured for @@ -71,6 +68,24 @@ func PossibleApplicationTypeValues() []ApplicationType { } } +// CanaryPolicy - Policy on whether a Canary VM should be provisioned during a session host provisioning operation. +type CanaryPolicy string + +const ( + CanaryPolicyAlways CanaryPolicy = "Always" + CanaryPolicyAuto CanaryPolicy = "Auto" + CanaryPolicyNever CanaryPolicy = "Never" +) + +// PossibleCanaryPolicyValues returns the possible values for the CanaryPolicy const type. +func PossibleCanaryPolicyValues() []CanaryPolicy { + return []CanaryPolicy{ + CanaryPolicyAlways, + CanaryPolicyAuto, + CanaryPolicyNever, + } +} + // CommandLineSetting - Specifies whether this published application can be launched with command line arguments provided // by the client, command line arguments specified at publish time, or no command line arguments at all. type CommandLineSetting string @@ -136,6 +151,82 @@ func PossibleDayOfWeekValues() []DayOfWeek { } } +// DiffDiskOption - Specifies the ephemeral disk settings for operating system disk. +type DiffDiskOption string + +const ( + // DiffDiskOptionLocal - Operating system disk local setting + DiffDiskOptionLocal DiffDiskOption = "Local" +) + +// PossibleDiffDiskOptionValues returns the possible values for the DiffDiskOption const type. +func PossibleDiffDiskOptionValues() []DiffDiskOption { + return []DiffDiskOption{ + DiffDiskOptionLocal, + } +} + +// DiffDiskPlacement - Gets or sets specifies the ephemeral disk placement for operating system disk. The defaulting behavior +// is: CacheDisk if one is configured for the VM size otherwise ResourceDisk is used. Refer to the +// VM size documentation for Windows VM at https://docs.microsoft.com/azure/virtual-machines/windows/sizes and Linux VM at +// https://docs.microsoft.com/azure/virtual-machines/linux/sizes to check which VM +// sizes exposes a cache disk. Possible values include: 'CacheDisk', 'ResourceDisk' +type DiffDiskPlacement string + +const ( + // DiffDiskPlacementCacheDisk - Cache disk placement + DiffDiskPlacementCacheDisk DiffDiskPlacement = "CacheDisk" + // DiffDiskPlacementResourceDisk - Resource disk placement + DiffDiskPlacementResourceDisk DiffDiskPlacement = "ResourceDisk" +) + +// PossibleDiffDiskPlacementValues returns the possible values for the DiffDiskPlacement const type. +func PossibleDiffDiskPlacementValues() []DiffDiskPlacement { + return []DiffDiskPlacement{ + DiffDiskPlacementCacheDisk, + DiffDiskPlacementResourceDisk, + } +} + +// 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 @@ -154,6 +245,24 @@ func PossibleFailHealthCheckOnStagingFailureValues() []FailHealthCheckOnStagingF } } +// FailedSessionHostCleanupPolicySHC - The policy that should be applied when the Session Host provisioning operation fails. +type FailedSessionHostCleanupPolicySHC string + +const ( + FailedSessionHostCleanupPolicySHCKeepAll FailedSessionHostCleanupPolicySHC = "KeepAll" + FailedSessionHostCleanupPolicySHCKeepNone FailedSessionHostCleanupPolicySHC = "KeepNone" + FailedSessionHostCleanupPolicySHCKeepOne FailedSessionHostCleanupPolicySHC = "KeepOne" +) + +// PossibleFailedSessionHostCleanupPolicySHCValues returns the possible values for the FailedSessionHostCleanupPolicySHC const type. +func PossibleFailedSessionHostCleanupPolicySHCValues() []FailedSessionHostCleanupPolicySHC { + return []FailedSessionHostCleanupPolicySHC{ + FailedSessionHostCleanupPolicySHCKeepAll, + FailedSessionHostCleanupPolicySHCKeepNone, + FailedSessionHostCleanupPolicySHCKeepOne, + } +} + // HealthCheckName - Represents the name of the health check operation performed. type HealthCheckName string @@ -247,6 +356,21 @@ func PossibleHealthCheckResultValues() []HealthCheckResult { } } +// HostPoolProvisioningAction - Action types for controlling hostpool provisioning. +type HostPoolProvisioningAction string + +const ( + // HostPoolProvisioningActionCancel - Cancel the hostpool provisioning. + HostPoolProvisioningActionCancel HostPoolProvisioningAction = "Cancel" +) + +// PossibleHostPoolProvisioningActionValues returns the possible values for the HostPoolProvisioningAction const type. +func PossibleHostPoolProvisioningActionValues() []HostPoolProvisioningAction { + return []HostPoolProvisioningAction{ + HostPoolProvisioningActionCancel, + } +} + // HostPoolType - HostPool type for desktop. type HostPoolType string @@ -271,6 +395,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 @@ -296,9 +447,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. @@ -306,10 +458,68 @@ 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 @@ -346,8 +556,13 @@ func PossiblePersonalDesktopAssignmentTypeValues() []PersonalDesktopAssignmentTy type PreferredAppGroupType string const ( - PreferredAppGroupTypeDesktop PreferredAppGroupType = "Desktop" - PreferredAppGroupTypeNone PreferredAppGroupType = "None" + // PreferredAppGroupTypeDesktop - Users access the full Windows desktop from a session host. Available with pooled or personal + // host pools. + PreferredAppGroupTypeDesktop PreferredAppGroupType = "Desktop" + // PreferredAppGroupTypeNone - This value is read only, it is not accepted on input. + PreferredAppGroupTypeNone PreferredAppGroupType = "None" + // PreferredAppGroupTypeRailApplications - Users access individual applications you select and publish to the application + // group. Available with pooled host pools only. PreferredAppGroupTypeRailApplications PreferredAppGroupType = "RailApplications" ) @@ -418,6 +633,26 @@ func PossibleProvisioningStateValues() []ProvisioningState { } } +// 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 @@ -435,6 +670,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 @@ -453,6 +709,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 @@ -514,6 +791,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" ) @@ -521,32 +802,29 @@ const ( // PossibleScalingHostPoolTypeValues returns the possible values for the ScalingHostPoolType const type. func PossibleScalingHostPoolTypeValues() []ScalingHostPoolType { return []ScalingHostPoolType{ + ScalingHostPoolTypePersonal, ScalingHostPoolTypePooled, } } -type ScalingScheduleDaysOfWeekItem string +// ScalingMethod - The desired scaling method to be used to scale the hosts in the assigned host pool. +type ScalingMethod string const ( - ScalingScheduleDaysOfWeekItemFriday ScalingScheduleDaysOfWeekItem = "Friday" - ScalingScheduleDaysOfWeekItemMonday ScalingScheduleDaysOfWeekItem = "Monday" - ScalingScheduleDaysOfWeekItemSaturday ScalingScheduleDaysOfWeekItem = "Saturday" - ScalingScheduleDaysOfWeekItemSunday ScalingScheduleDaysOfWeekItem = "Sunday" - ScalingScheduleDaysOfWeekItemThursday ScalingScheduleDaysOfWeekItem = "Thursday" - ScalingScheduleDaysOfWeekItemTuesday ScalingScheduleDaysOfWeekItem = "Tuesday" - ScalingScheduleDaysOfWeekItemWednesday ScalingScheduleDaysOfWeekItem = "Wednesday" + // ScalingMethodCreateDeletePowerManage - Scaling will manage the hosts in the host pool by power managing the hosts, as well + // as creating and deleting hosts to modify the host pool size. This requires the create delete object to be set, and the + // assigned hostpool to have a session host config property. + ScalingMethodCreateDeletePowerManage ScalingMethod = "CreateDeletePowerManage" + // ScalingMethodPowerManage - Scaling will manage hosts in the host pool by power managing the hosts, but will not change + // the host pool size. + ScalingMethodPowerManage ScalingMethod = "PowerManage" ) -// PossibleScalingScheduleDaysOfWeekItemValues returns the possible values for the ScalingScheduleDaysOfWeekItem const type. -func PossibleScalingScheduleDaysOfWeekItemValues() []ScalingScheduleDaysOfWeekItem { - return []ScalingScheduleDaysOfWeekItem{ - ScalingScheduleDaysOfWeekItemFriday, - ScalingScheduleDaysOfWeekItemMonday, - ScalingScheduleDaysOfWeekItemSaturday, - ScalingScheduleDaysOfWeekItemSunday, - ScalingScheduleDaysOfWeekItemThursday, - ScalingScheduleDaysOfWeekItemTuesday, - ScalingScheduleDaysOfWeekItemWednesday, +// PossibleScalingMethodValues returns the possible values for the ScalingMethod const type. +func PossibleScalingMethodValues() []ScalingMethod { + return []ScalingMethod{ + ScalingMethodCreateDeletePowerManage, + ScalingMethodPowerManage, } } @@ -735,6 +1013,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 @@ -756,3 +1052,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/controlsessionhostprovisioning_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/controlsessionhostprovisioning_client.go new file mode 100644 index 000000000000..b24fd79440f1 --- /dev/null +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/controlsessionhostprovisioning_client.go @@ -0,0 +1,122 @@ +// 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" +) + +// ControlSessionHostProvisioningClient contains the methods for the ControlSessionHostProvisioning group. +// Don't use this type directly, use NewControlSessionHostProvisioningClient() instead. +type ControlSessionHostProvisioningClient struct { + internal *arm.Client + subscriptionID string +} + +// NewControlSessionHostProvisioningClient creates a new instance of ControlSessionHostProvisioningClient 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 NewControlSessionHostProvisioningClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ControlSessionHostProvisioningClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ControlSessionHostProvisioningClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginPost - Control provisioning of a hostpool. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-03-01-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 +// - hostPoolProvisioningControlParameter - Object containing control action for hostpool provisioning. +// - options - ControlSessionHostProvisioningClientBeginPostOptions contains the optional parameters for the ControlSessionHostProvisioningClient.BeginPost +// method. +func (client *ControlSessionHostProvisioningClient) BeginPost(ctx context.Context, resourceGroupName string, hostPoolName string, hostPoolProvisioningControlParameter HostPoolProvisioningControlParameter, options *ControlSessionHostProvisioningClientBeginPostOptions) (*runtime.Poller[ControlSessionHostProvisioningClientPostResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.post(ctx, resourceGroupName, hostPoolName, hostPoolProvisioningControlParameter, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ControlSessionHostProvisioningClientPostResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ControlSessionHostProvisioningClientPostResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Post - Control provisioning of a hostpool. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-03-01-preview +func (client *ControlSessionHostProvisioningClient) post(ctx context.Context, resourceGroupName string, hostPoolName string, hostPoolProvisioningControlParameter HostPoolProvisioningControlParameter, options *ControlSessionHostProvisioningClientBeginPostOptions) (*http.Response, error) { + var err error + const operationName = "ControlSessionHostProvisioningClient.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, hostPoolProvisioningControlParameter, 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 *ControlSessionHostProvisioningClient) postCreateRequest(ctx context.Context, resourceGroupName string, hostPoolName string, hostPoolProvisioningControlParameter HostPoolProvisioningControlParameter, _ *ControlSessionHostProvisioningClientBeginPostOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostManagements/default/controlSessionHostProvisioning" + 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", "2025-03-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, hostPoolProvisioningControlParameter); err != nil { + return nil, err + } + return req, nil +} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/controlsessionhostupdate_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/controlsessionhostupdate_client.go new file mode 100644 index 000000000000..c81d3b41fa0f --- /dev/null +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/controlsessionhostupdate_client.go @@ -0,0 +1,122 @@ +// 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 2025-03-01-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 2025-03-01-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, _ *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", "2025-03-01-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 fc7bebab8eea..6185403f4a63 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/desktops_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/desktops_client.go @@ -1,6 +1,3 @@ -//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. @@ -47,7 +44,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 2024-04-03 +// Generated from API version 2025-03-01-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 @@ -75,7 +72,7 @@ func (client *DesktopsClient) Get(ctx context.Context, resourceGroupName string, } // getCreateRequest creates the Get request. -func (client *DesktopsClient) getCreateRequest(ctx context.Context, resourceGroupName string, applicationGroupName string, desktopName string, options *DesktopsClientGetOptions) (*policy.Request, error) { +func (client *DesktopsClient) getCreateRequest(ctx context.Context, resourceGroupName string, applicationGroupName string, desktopName string, _ *DesktopsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/desktops/{desktopName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -98,7 +95,7 @@ func (client *DesktopsClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -115,7 +112,7 @@ func (client *DesktopsClient) getHandleResponse(resp *http.Response) (DesktopsCl // NewListPager - List desktops. // -// Generated from API version 2024-04-03 +// Generated from API version 2025-03-01-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,7 +159,7 @@ func (client *DesktopsClient) listCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-preview") if options != nil && options.InitialSkip != nil { reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) } @@ -189,7 +186,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 2024-04-03 +// Generated from API version 2025-03-01-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 +237,7 @@ func (client *DesktopsClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-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 ccad5fa43fcb..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/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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"), - // 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), - // }, - // 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"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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"), - // 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), - // }, - // 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"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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"), - // 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), - // }, - // 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"), - // }, - // }}, - // } - } -} 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..3588f4b924e5 --- /dev/null +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/activesessionhostconfigurations_server.go @@ -0,0 +1,174 @@ +// 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")} + } + + return a.dispatchToMethodFake(req, method) +} + +func (a *ActiveSessionHostConfigurationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if activeSessionHostConfigurationsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = activeSessionHostConfigurationsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ActiveSessionHostConfigurationsClient.Get": + res.resp, res.err = a.dispatchGet(req) + case "ActiveSessionHostConfigurationsClient.NewListByHostPoolPager": + res.resp, res.err = a.dispatchNewListByHostPoolPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } +} + +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 +} + +// set this to conditionally intercept incoming requests to ActiveSessionHostConfigurationsServerTransport +var activeSessionHostConfigurationsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/appattachpackage_server.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/appattachpackage_server.go index 43780abaf436..84bf44325196 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/appattachpackage_server.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/appattachpackage_server.go @@ -1,6 +1,3 @@ -//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. @@ -16,11 +13,12 @@ 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" "regexp" + "strconv" ) // AppAttachPackageServer is a fake server for instances of the armdesktopvirtualization.AppAttachPackageClient type. @@ -77,31 +75,50 @@ func (a *AppAttachPackageServerTransport) Do(req *http.Request) (*http.Response, return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return a.dispatchToMethodFake(req, method) +} - 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) - } +func (a *AppAttachPackageServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if appAttachPackageServerTransportInterceptor != nil { + res.resp, res.err, intercepted = appAttachPackageServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "AppAttachPackageClient.CreateOrUpdate": + res.resp, res.err = a.dispatchCreateOrUpdate(req) + case "AppAttachPackageClient.Delete": + res.resp, res.err = a.dispatchDelete(req) + case "AppAttachPackageClient.Get": + res.resp, res.err = a.dispatchGet(req) + case "AppAttachPackageClient.NewListByResourceGroupPager": + res.resp, res.err = a.dispatchNewListByResourceGroupPager(req) + case "AppAttachPackageClient.NewListBySubscriptionPager": + res.resp, res.err = a.dispatchNewListBySubscriptionPager(req) + case "AppAttachPackageClient.Update": + res.resp, res.err = a.dispatchUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (a *AppAttachPackageServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -151,6 +168,7 @@ func (a *AppAttachPackageServerTransport) dispatchDelete(req *http.Request) (*ht 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 @@ -159,7 +177,21 @@ func (a *AppAttachPackageServerTransport) dispatchDelete(req *http.Request) (*ht if err != nil { return nil, err } - respr, errRespr := a.srv.Delete(req.Context(), resourceGroupNameParam, appAttachPackageNameParam, nil) + 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 } @@ -343,3 +375,9 @@ func (a *AppAttachPackageServerTransport) dispatchUpdate(req *http.Request) (*ht } return resp, nil } + +// set this to conditionally intercept incoming requests to AppAttachPackageServerTransport +var appAttachPackageServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/appattachpackageinfo_server.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/appattachpackageinfo_server.go index cc893f57e632..80048830cb70 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/appattachpackageinfo_server.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/appattachpackageinfo_server.go @@ -1,6 +1,3 @@ -//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. @@ -15,7 +12,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" @@ -53,21 +50,40 @@ func (a *AppAttachPackageInfoServerTransport) Do(req *http.Request) (*http.Respo return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return a.dispatchToMethodFake(req, method) +} - switch method { - case "AppAttachPackageInfoClient.NewImportPager": - resp, err = a.dispatchNewImportPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (a *AppAttachPackageInfoServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if appAttachPackageInfoServerTransportInterceptor != nil { + res.resp, res.err, intercepted = appAttachPackageInfoServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "AppAttachPackageInfoClient.NewImportPager": + res.resp, res.err = a.dispatchNewImportPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (a *AppAttachPackageInfoServerTransport) dispatchNewImportPager(req *http.Request) (*http.Response, error) { @@ -114,3 +130,9 @@ func (a *AppAttachPackageInfoServerTransport) dispatchNewImportPager(req *http.R } return resp, nil } + +// set this to conditionally intercept incoming requests to AppAttachPackageInfoServerTransport +var appAttachPackageInfoServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/applicationgroups_server.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/applicationgroups_server.go index 646303fca197..1f86422c736c 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/applicationgroups_server.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/applicationgroups_server.go @@ -1,6 +1,3 @@ -//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. @@ -16,7 +13,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" @@ -78,31 +75,50 @@ func (a *ApplicationGroupsServerTransport) Do(req *http.Request) (*http.Response return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return a.dispatchToMethodFake(req, method) +} - switch method { - case "ApplicationGroupsClient.CreateOrUpdate": - resp, err = a.dispatchCreateOrUpdate(req) - case "ApplicationGroupsClient.Delete": - resp, err = a.dispatchDelete(req) - case "ApplicationGroupsClient.Get": - resp, err = a.dispatchGet(req) - case "ApplicationGroupsClient.NewListByResourceGroupPager": - resp, err = a.dispatchNewListByResourceGroupPager(req) - case "ApplicationGroupsClient.NewListBySubscriptionPager": - resp, err = a.dispatchNewListBySubscriptionPager(req) - case "ApplicationGroupsClient.Update": - resp, err = a.dispatchUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (a *ApplicationGroupsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if applicationGroupsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = applicationGroupsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ApplicationGroupsClient.CreateOrUpdate": + res.resp, res.err = a.dispatchCreateOrUpdate(req) + case "ApplicationGroupsClient.Delete": + res.resp, res.err = a.dispatchDelete(req) + case "ApplicationGroupsClient.Get": + res.resp, res.err = a.dispatchGet(req) + case "ApplicationGroupsClient.NewListByResourceGroupPager": + res.resp, res.err = a.dispatchNewListByResourceGroupPager(req) + case "ApplicationGroupsClient.NewListBySubscriptionPager": + res.resp, res.err = a.dispatchNewListBySubscriptionPager(req) + case "ApplicationGroupsClient.Update": + res.resp, res.err = a.dispatchUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (a *ApplicationGroupsServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -383,3 +399,9 @@ func (a *ApplicationGroupsServerTransport) dispatchUpdate(req *http.Request) (*h } return resp, nil } + +// set this to conditionally intercept incoming requests to ApplicationGroupsServerTransport +var applicationGroupsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/applications_server.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/applications_server.go index 26ce1f45f8c3..7561f182135b 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/applications_server.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/applications_server.go @@ -1,6 +1,3 @@ -//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. @@ -16,7 +13,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" @@ -72,29 +69,48 @@ func (a *ApplicationsServerTransport) Do(req *http.Request) (*http.Response, err return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return a.dispatchToMethodFake(req, method) +} - switch method { - case "ApplicationsClient.CreateOrUpdate": - resp, err = a.dispatchCreateOrUpdate(req) - case "ApplicationsClient.Delete": - resp, err = a.dispatchDelete(req) - case "ApplicationsClient.Get": - resp, err = a.dispatchGet(req) - case "ApplicationsClient.NewListPager": - resp, err = a.dispatchNewListPager(req) - case "ApplicationsClient.Update": - resp, err = a.dispatchUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (a *ApplicationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if applicationsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = applicationsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ApplicationsClient.CreateOrUpdate": + res.resp, res.err = a.dispatchCreateOrUpdate(req) + case "ApplicationsClient.Delete": + res.resp, res.err = a.dispatchDelete(req) + case "ApplicationsClient.Get": + res.resp, res.err = a.dispatchGet(req) + case "ApplicationsClient.NewListPager": + res.resp, res.err = a.dispatchNewListPager(req) + case "ApplicationsClient.Update": + res.resp, res.err = a.dispatchUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (a *ApplicationsServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -344,3 +360,9 @@ func (a *ApplicationsServerTransport) dispatchUpdate(req *http.Request) (*http.R } return resp, nil } + +// set this to conditionally intercept incoming requests to ApplicationsServerTransport +var applicationsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/controlsessionhostprovisioning_server.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/controlsessionhostprovisioning_server.go new file mode 100644 index 000000000000..ae3ffb850599 --- /dev/null +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/controlsessionhostprovisioning_server.go @@ -0,0 +1,141 @@ +// 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" +) + +// ControlSessionHostProvisioningServer is a fake server for instances of the armdesktopvirtualization.ControlSessionHostProvisioningClient type. +type ControlSessionHostProvisioningServer struct { + // BeginPost is the fake for method ControlSessionHostProvisioningClient.BeginPost + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginPost func(ctx context.Context, resourceGroupName string, hostPoolName string, hostPoolProvisioningControlParameter armdesktopvirtualization.HostPoolProvisioningControlParameter, options *armdesktopvirtualization.ControlSessionHostProvisioningClientBeginPostOptions) (resp azfake.PollerResponder[armdesktopvirtualization.ControlSessionHostProvisioningClientPostResponse], errResp azfake.ErrorResponder) +} + +// NewControlSessionHostProvisioningServerTransport creates a new instance of ControlSessionHostProvisioningServerTransport with the provided implementation. +// The returned ControlSessionHostProvisioningServerTransport instance is connected to an instance of armdesktopvirtualization.ControlSessionHostProvisioningClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewControlSessionHostProvisioningServerTransport(srv *ControlSessionHostProvisioningServer) *ControlSessionHostProvisioningServerTransport { + return &ControlSessionHostProvisioningServerTransport{ + srv: srv, + beginPost: newTracker[azfake.PollerResponder[armdesktopvirtualization.ControlSessionHostProvisioningClientPostResponse]](), + } +} + +// ControlSessionHostProvisioningServerTransport connects instances of armdesktopvirtualization.ControlSessionHostProvisioningClient to instances of ControlSessionHostProvisioningServer. +// Don't use this type directly, use NewControlSessionHostProvisioningServerTransport instead. +type ControlSessionHostProvisioningServerTransport struct { + srv *ControlSessionHostProvisioningServer + beginPost *tracker[azfake.PollerResponder[armdesktopvirtualization.ControlSessionHostProvisioningClientPostResponse]] +} + +// Do implements the policy.Transporter interface for ControlSessionHostProvisioningServerTransport. +func (c *ControlSessionHostProvisioningServerTransport) 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")} + } + + return c.dispatchToMethodFake(req, method) +} + +func (c *ControlSessionHostProvisioningServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if controlSessionHostProvisioningServerTransportInterceptor != nil { + res.resp, res.err, intercepted = controlSessionHostProvisioningServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ControlSessionHostProvisioningClient.BeginPost": + res.resp, res.err = c.dispatchBeginPost(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } +} + +func (c *ControlSessionHostProvisioningServerTransport) 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/controlSessionHostProvisioning` + 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.HostPoolProvisioningControlParameter](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.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + c.beginPost.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginPost) { + c.beginPost.remove(req) + } + + return resp, nil +} + +// set this to conditionally intercept incoming requests to ControlSessionHostProvisioningServerTransport +var controlSessionHostProvisioningServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} 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..992b0fb65a3f --- /dev/null +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/controlsessionhostupdate_server.go @@ -0,0 +1,141 @@ +// 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.StatusOK, http.StatusAccepted, http.StatusNoContent + 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")} + } + + return c.dispatchToMethodFake(req, method) +} + +func (c *ControlSessionHostUpdateServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if controlSessionHostUpdateServerTransportInterceptor != nil { + res.resp, res.err, intercepted = controlSessionHostUpdateServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ControlSessionHostUpdateClient.BeginPost": + res.resp, res.err = c.dispatchBeginPost(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } +} + +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.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + c.beginPost.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginPost) { + c.beginPost.remove(req) + } + + return resp, nil +} + +// set this to conditionally intercept incoming requests to ControlSessionHostUpdateServerTransport +var controlSessionHostUpdateServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/desktops_server.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/desktops_server.go index ed14e2507861..49eade5e5814 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/desktops_server.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/desktops_server.go @@ -1,6 +1,3 @@ -//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. @@ -16,7 +13,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" @@ -64,25 +61,44 @@ func (d *DesktopsServerTransport) Do(req *http.Request) (*http.Response, error) return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return d.dispatchToMethodFake(req, method) +} - switch method { - case "DesktopsClient.Get": - resp, err = d.dispatchGet(req) - case "DesktopsClient.NewListPager": - resp, err = d.dispatchNewListPager(req) - case "DesktopsClient.Update": - resp, err = d.dispatchUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (d *DesktopsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if desktopsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = desktopsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "DesktopsClient.Get": + res.resp, res.err = d.dispatchGet(req) + case "DesktopsClient.NewListPager": + res.resp, res.err = d.dispatchNewListPager(req) + case "DesktopsClient.Update": + res.resp, res.err = d.dispatchUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (d *DesktopsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -254,3 +270,9 @@ func (d *DesktopsServerTransport) dispatchUpdate(req *http.Request) (*http.Respo } return resp, nil } + +// set this to conditionally intercept incoming requests to DesktopsServerTransport +var desktopsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/hostpools_server.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/hostpools_server.go index 48efd6f36f4b..e070314dc806 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/hostpools_server.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/hostpools_server.go @@ -1,6 +1,3 @@ -//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. @@ -16,7 +13,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" @@ -86,35 +83,54 @@ func (h *HostPoolsServerTransport) Do(req *http.Request) (*http.Response, error) return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return h.dispatchToMethodFake(req, method) +} - switch method { - case "HostPoolsClient.CreateOrUpdate": - resp, err = h.dispatchCreateOrUpdate(req) - case "HostPoolsClient.Delete": - resp, err = h.dispatchDelete(req) - case "HostPoolsClient.Get": - resp, err = h.dispatchGet(req) - case "HostPoolsClient.NewListPager": - 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": - resp, err = h.dispatchUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (h *HostPoolsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if hostPoolsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = hostPoolsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "HostPoolsClient.CreateOrUpdate": + res.resp, res.err = h.dispatchCreateOrUpdate(req) + case "HostPoolsClient.Delete": + res.resp, res.err = h.dispatchDelete(req) + case "HostPoolsClient.Get": + res.resp, res.err = h.dispatchGet(req) + case "HostPoolsClient.NewListPager": + res.resp, res.err = h.dispatchNewListPager(req) + case "HostPoolsClient.NewListByResourceGroupPager": + res.resp, res.err = h.dispatchNewListByResourceGroupPager(req) + case "HostPoolsClient.ListRegistrationTokens": + res.resp, res.err = h.dispatchListRegistrationTokens(req) + case "HostPoolsClient.RetrieveRegistrationToken": + res.resp, res.err = h.dispatchRetrieveRegistrationToken(req) + case "HostPoolsClient.Update": + res.resp, res.err = h.dispatchUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (h *HostPoolsServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -503,3 +519,9 @@ func (h *HostPoolsServerTransport) dispatchUpdate(req *http.Request) (*http.Resp } return resp, nil } + +// set this to conditionally intercept incoming requests to HostPoolsServerTransport +var hostPoolsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} 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..859cec15a328 --- /dev/null +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/initiatesessionhostupdate_server.go @@ -0,0 +1,133 @@ +// 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.StatusNoContent + 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")} + } + + return i.dispatchToMethodFake(req, method) +} + +func (i *InitiateSessionHostUpdateServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if initiateSessionHostUpdateServerTransportInterceptor != nil { + res.resp, res.err, intercepted = initiateSessionHostUpdateServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "InitiateSessionHostUpdateClient.Post": + res.resp, res.err = i.dispatchPost(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } +} + +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.StatusNoContent}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusNoContent", respContent.HTTPStatus)} + } + resp, err := server.NewResponse(respContent, req, nil) + if err != nil { + return nil, err + } + return resp, nil +} + +// set this to conditionally intercept incoming requests to InitiateSessionHostUpdateServerTransport +var initiateSessionHostUpdateServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/internal.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/internal.go index 7d2f89ba4bb2..c614f8d5643a 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/internal.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/internal.go @@ -1,6 +1,3 @@ -//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. @@ -15,6 +12,11 @@ import ( "sync" ) +type result struct { + resp *http.Response + err error +} + type nonRetriableError struct { error } diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/msiximages_server.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/msiximages_server.go index 644c2ef89dd5..84e6f2f3a981 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/msiximages_server.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/msiximages_server.go @@ -1,6 +1,3 @@ -//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. @@ -15,7 +12,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" @@ -53,21 +50,40 @@ func (m *MsixImagesServerTransport) Do(req *http.Request) (*http.Response, error return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return m.dispatchToMethodFake(req, method) +} - switch method { - case "MsixImagesClient.NewExpandPager": - resp, err = m.dispatchNewExpandPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (m *MsixImagesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if msixImagesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = msixImagesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "MsixImagesClient.NewExpandPager": + res.resp, res.err = m.dispatchNewExpandPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (m *MsixImagesServerTransport) dispatchNewExpandPager(req *http.Request) (*http.Response, error) { @@ -114,3 +130,9 @@ func (m *MsixImagesServerTransport) dispatchNewExpandPager(req *http.Request) (* } return resp, nil } + +// set this to conditionally intercept incoming requests to MsixImagesServerTransport +var msixImagesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/msixpackages_server.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/msixpackages_server.go index da1f72bae6d0..4ad4bbf5990d 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/msixpackages_server.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/msixpackages_server.go @@ -1,6 +1,3 @@ -//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. @@ -16,7 +13,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" @@ -72,29 +69,48 @@ func (m *MSIXPackagesServerTransport) Do(req *http.Request) (*http.Response, err return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return m.dispatchToMethodFake(req, method) +} - switch method { - case "MSIXPackagesClient.CreateOrUpdate": - resp, err = m.dispatchCreateOrUpdate(req) - case "MSIXPackagesClient.Delete": - resp, err = m.dispatchDelete(req) - case "MSIXPackagesClient.Get": - resp, err = m.dispatchGet(req) - case "MSIXPackagesClient.NewListPager": - resp, err = m.dispatchNewListPager(req) - case "MSIXPackagesClient.Update": - resp, err = m.dispatchUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (m *MSIXPackagesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if msixPackagesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = msixPackagesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "MSIXPackagesClient.CreateOrUpdate": + res.resp, res.err = m.dispatchCreateOrUpdate(req) + case "MSIXPackagesClient.Delete": + res.resp, res.err = m.dispatchDelete(req) + case "MSIXPackagesClient.Get": + res.resp, res.err = m.dispatchGet(req) + case "MSIXPackagesClient.NewListPager": + res.resp, res.err = m.dispatchNewListPager(req) + case "MSIXPackagesClient.Update": + res.resp, res.err = m.dispatchUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (m *MSIXPackagesServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -344,3 +360,9 @@ func (m *MSIXPackagesServerTransport) dispatchUpdate(req *http.Request) (*http.R } return resp, nil } + +// set this to conditionally intercept incoming requests to MSIXPackagesServerTransport +var msixPackagesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/operations_server.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/operations_server.go index fb58e5f807f2..b05368564d76 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/operations_server.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/operations_server.go @@ -1,6 +1,3 @@ -//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. @@ -15,7 +12,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" ) @@ -51,21 +48,40 @@ func (o *OperationsServerTransport) Do(req *http.Request) (*http.Response, error return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return o.dispatchToMethodFake(req, method) +} - switch method { - case "OperationsClient.NewListPager": - resp, err = o.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (o *OperationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if operationsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = operationsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "OperationsClient.NewListPager": + res.resp, res.err = o.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (o *OperationsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { @@ -94,3 +110,9 @@ func (o *OperationsServerTransport) dispatchNewListPager(req *http.Request) (*ht } return resp, nil } + +// set this to conditionally intercept incoming requests to OperationsServerTransport +var operationsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/privateendpointconnections_server.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/privateendpointconnections_server.go index f377b83fee6d..6d4b5dec6b32 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/privateendpointconnections_server.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/privateendpointconnections_server.go @@ -1,6 +1,3 @@ -//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. @@ -16,7 +13,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" @@ -85,35 +82,54 @@ func (p *PrivateEndpointConnectionsServerTransport) Do(req *http.Request) (*http return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return p.dispatchToMethodFake(req, method) +} - switch method { - case "PrivateEndpointConnectionsClient.DeleteByHostPool": - resp, err = p.dispatchDeleteByHostPool(req) - case "PrivateEndpointConnectionsClient.DeleteByWorkspace": - resp, err = p.dispatchDeleteByWorkspace(req) - case "PrivateEndpointConnectionsClient.GetByHostPool": - resp, err = p.dispatchGetByHostPool(req) - case "PrivateEndpointConnectionsClient.GetByWorkspace": - resp, err = p.dispatchGetByWorkspace(req) - case "PrivateEndpointConnectionsClient.NewListByHostPoolPager": - resp, err = p.dispatchNewListByHostPoolPager(req) - case "PrivateEndpointConnectionsClient.NewListByWorkspacePager": - resp, err = p.dispatchNewListByWorkspacePager(req) - case "PrivateEndpointConnectionsClient.UpdateByHostPool": - resp, err = p.dispatchUpdateByHostPool(req) - case "PrivateEndpointConnectionsClient.UpdateByWorkspace": - resp, err = p.dispatchUpdateByWorkspace(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (p *PrivateEndpointConnectionsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if privateEndpointConnectionsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = privateEndpointConnectionsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "PrivateEndpointConnectionsClient.DeleteByHostPool": + res.resp, res.err = p.dispatchDeleteByHostPool(req) + case "PrivateEndpointConnectionsClient.DeleteByWorkspace": + res.resp, res.err = p.dispatchDeleteByWorkspace(req) + case "PrivateEndpointConnectionsClient.GetByHostPool": + res.resp, res.err = p.dispatchGetByHostPool(req) + case "PrivateEndpointConnectionsClient.GetByWorkspace": + res.resp, res.err = p.dispatchGetByWorkspace(req) + case "PrivateEndpointConnectionsClient.NewListByHostPoolPager": + res.resp, res.err = p.dispatchNewListByHostPoolPager(req) + case "PrivateEndpointConnectionsClient.NewListByWorkspacePager": + res.resp, res.err = p.dispatchNewListByWorkspacePager(req) + case "PrivateEndpointConnectionsClient.UpdateByHostPool": + res.resp, res.err = p.dispatchUpdateByHostPool(req) + case "PrivateEndpointConnectionsClient.UpdateByWorkspace": + res.resp, res.err = p.dispatchUpdateByWorkspace(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (p *PrivateEndpointConnectionsServerTransport) dispatchDeleteByHostPool(req *http.Request) (*http.Response, error) { @@ -472,3 +488,9 @@ func (p *PrivateEndpointConnectionsServerTransport) dispatchUpdateByWorkspace(re } return resp, nil } + +// set this to conditionally intercept incoming requests to PrivateEndpointConnectionsServerTransport +var privateEndpointConnectionsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/privatelinkresources_server.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/privatelinkresources_server.go index 65c1912ec461..f6da7e98c009 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/privatelinkresources_server.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/privatelinkresources_server.go @@ -1,6 +1,3 @@ -//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. @@ -15,7 +12,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" @@ -60,23 +57,42 @@ func (p *PrivateLinkResourcesServerTransport) Do(req *http.Request) (*http.Respo return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return p.dispatchToMethodFake(req, method) +} - switch method { - case "PrivateLinkResourcesClient.NewListByHostPoolPager": - resp, err = p.dispatchNewListByHostPoolPager(req) - case "PrivateLinkResourcesClient.NewListByWorkspacePager": - resp, err = p.dispatchNewListByWorkspacePager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (p *PrivateLinkResourcesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if privateLinkResourcesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = privateLinkResourcesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "PrivateLinkResourcesClient.NewListByHostPoolPager": + res.resp, res.err = p.dispatchNewListByHostPoolPager(req) + case "PrivateLinkResourcesClient.NewListByWorkspacePager": + res.resp, res.err = p.dispatchNewListByWorkspacePager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (p *PrivateLinkResourcesServerTransport) dispatchNewListByHostPoolPager(req *http.Request) (*http.Response, error) { @@ -250,3 +266,9 @@ func (p *PrivateLinkResourcesServerTransport) dispatchNewListByWorkspacePager(re } return resp, nil } + +// set this to conditionally intercept incoming requests to PrivateLinkResourcesServerTransport +var privateLinkResourcesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/scalingplanpersonalschedules_server.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/scalingplanpersonalschedules_server.go index 485b8ff5e21b..294ac2bb2d31 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/scalingplanpersonalschedules_server.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/scalingplanpersonalschedules_server.go @@ -1,6 +1,3 @@ -//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. @@ -16,7 +13,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" @@ -72,29 +69,48 @@ func (s *ScalingPlanPersonalSchedulesServerTransport) Do(req *http.Request) (*ht return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return s.dispatchToMethodFake(req, method) +} - switch method { - case "ScalingPlanPersonalSchedulesClient.Create": - resp, err = s.dispatchCreate(req) - case "ScalingPlanPersonalSchedulesClient.Delete": - resp, err = s.dispatchDelete(req) - case "ScalingPlanPersonalSchedulesClient.Get": - resp, err = s.dispatchGet(req) - case "ScalingPlanPersonalSchedulesClient.NewListPager": - resp, err = s.dispatchNewListPager(req) - case "ScalingPlanPersonalSchedulesClient.Update": - resp, err = s.dispatchUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (s *ScalingPlanPersonalSchedulesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if scalingPlanPersonalSchedulesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = scalingPlanPersonalSchedulesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ScalingPlanPersonalSchedulesClient.Create": + res.resp, res.err = s.dispatchCreate(req) + case "ScalingPlanPersonalSchedulesClient.Delete": + res.resp, res.err = s.dispatchDelete(req) + case "ScalingPlanPersonalSchedulesClient.Get": + res.resp, res.err = s.dispatchGet(req) + case "ScalingPlanPersonalSchedulesClient.NewListPager": + res.resp, res.err = s.dispatchNewListPager(req) + case "ScalingPlanPersonalSchedulesClient.Update": + res.resp, res.err = s.dispatchUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (s *ScalingPlanPersonalSchedulesServerTransport) dispatchCreate(req *http.Request) (*http.Response, error) { @@ -344,3 +360,9 @@ func (s *ScalingPlanPersonalSchedulesServerTransport) dispatchUpdate(req *http.R } return resp, nil } + +// set this to conditionally intercept incoming requests to ScalingPlanPersonalSchedulesServerTransport +var scalingPlanPersonalSchedulesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/scalingplanpooledschedules_server.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/scalingplanpooledschedules_server.go index 7604555e5557..3ce5fe359cc6 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/scalingplanpooledschedules_server.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/scalingplanpooledschedules_server.go @@ -1,6 +1,3 @@ -//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. @@ -16,7 +13,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" @@ -72,29 +69,48 @@ func (s *ScalingPlanPooledSchedulesServerTransport) Do(req *http.Request) (*http return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return s.dispatchToMethodFake(req, method) +} - switch method { - case "ScalingPlanPooledSchedulesClient.Create": - resp, err = s.dispatchCreate(req) - case "ScalingPlanPooledSchedulesClient.Delete": - resp, err = s.dispatchDelete(req) - case "ScalingPlanPooledSchedulesClient.Get": - resp, err = s.dispatchGet(req) - case "ScalingPlanPooledSchedulesClient.NewListPager": - resp, err = s.dispatchNewListPager(req) - case "ScalingPlanPooledSchedulesClient.Update": - resp, err = s.dispatchUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (s *ScalingPlanPooledSchedulesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if scalingPlanPooledSchedulesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = scalingPlanPooledSchedulesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ScalingPlanPooledSchedulesClient.Create": + res.resp, res.err = s.dispatchCreate(req) + case "ScalingPlanPooledSchedulesClient.Delete": + res.resp, res.err = s.dispatchDelete(req) + case "ScalingPlanPooledSchedulesClient.Get": + res.resp, res.err = s.dispatchGet(req) + case "ScalingPlanPooledSchedulesClient.NewListPager": + res.resp, res.err = s.dispatchNewListPager(req) + case "ScalingPlanPooledSchedulesClient.Update": + res.resp, res.err = s.dispatchUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (s *ScalingPlanPooledSchedulesServerTransport) dispatchCreate(req *http.Request) (*http.Response, error) { @@ -344,3 +360,9 @@ func (s *ScalingPlanPooledSchedulesServerTransport) dispatchUpdate(req *http.Req } return resp, nil } + +// set this to conditionally intercept incoming requests to ScalingPlanPooledSchedulesServerTransport +var scalingPlanPooledSchedulesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/scalingplans_server.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/scalingplans_server.go index 70d382457172..cc4250d19aa1 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/scalingplans_server.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/scalingplans_server.go @@ -1,6 +1,3 @@ -//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. @@ -16,7 +13,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" @@ -84,33 +81,52 @@ func (s *ScalingPlansServerTransport) Do(req *http.Request) (*http.Response, err return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return s.dispatchToMethodFake(req, method) +} - switch method { - case "ScalingPlansClient.Create": - resp, err = s.dispatchCreate(req) - case "ScalingPlansClient.Delete": - resp, err = s.dispatchDelete(req) - case "ScalingPlansClient.Get": - resp, err = s.dispatchGet(req) - case "ScalingPlansClient.NewListByHostPoolPager": - resp, err = s.dispatchNewListByHostPoolPager(req) - case "ScalingPlansClient.NewListByResourceGroupPager": - resp, err = s.dispatchNewListByResourceGroupPager(req) - case "ScalingPlansClient.NewListBySubscriptionPager": - resp, err = s.dispatchNewListBySubscriptionPager(req) - case "ScalingPlansClient.Update": - resp, err = s.dispatchUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (s *ScalingPlansServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if scalingPlansServerTransportInterceptor != nil { + res.resp, res.err, intercepted = scalingPlansServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ScalingPlansClient.Create": + res.resp, res.err = s.dispatchCreate(req) + case "ScalingPlansClient.Delete": + res.resp, res.err = s.dispatchDelete(req) + case "ScalingPlansClient.Get": + res.resp, res.err = s.dispatchGet(req) + case "ScalingPlansClient.NewListByHostPoolPager": + res.resp, res.err = s.dispatchNewListByHostPoolPager(req) + case "ScalingPlansClient.NewListByResourceGroupPager": + res.resp, res.err = s.dispatchNewListByResourceGroupPager(req) + case "ScalingPlansClient.NewListBySubscriptionPager": + res.resp, res.err = s.dispatchNewListBySubscriptionPager(req) + case "ScalingPlansClient.Update": + res.resp, res.err = s.dispatchUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (s *ScalingPlansServerTransport) dispatchCreate(req *http.Request) (*http.Response, error) { @@ -504,3 +520,9 @@ func (s *ScalingPlansServerTransport) dispatchUpdate(req *http.Request) (*http.R } return resp, nil } + +// set this to conditionally intercept incoming requests to ScalingPlansServerTransport +var scalingPlansServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/server_factory.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/server_factory.go index 9f04f1908688..98983fc8def9 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/server_factory.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/server_factory.go @@ -1,6 +1,3 @@ -//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. @@ -19,24 +16,86 @@ import ( // ServerFactory is a fake server for instances of the armdesktopvirtualization.ClientFactory type. type ServerFactory struct { - AppAttachPackageServer AppAttachPackageServer - AppAttachPackageInfoServer AppAttachPackageInfoServer - ApplicationGroupsServer ApplicationGroupsServer - ApplicationsServer ApplicationsServer - DesktopsServer DesktopsServer - HostPoolsServer HostPoolsServer - MSIXPackagesServer MSIXPackagesServer - MsixImagesServer MsixImagesServer - OperationsServer OperationsServer - PrivateEndpointConnectionsServer PrivateEndpointConnectionsServer - PrivateLinkResourcesServer PrivateLinkResourcesServer + // ActiveSessionHostConfigurationsServer contains the fakes for client ActiveSessionHostConfigurationsClient + ActiveSessionHostConfigurationsServer ActiveSessionHostConfigurationsServer + + // AppAttachPackageServer contains the fakes for client AppAttachPackageClient + AppAttachPackageServer AppAttachPackageServer + + // AppAttachPackageInfoServer contains the fakes for client AppAttachPackageInfoClient + AppAttachPackageInfoServer AppAttachPackageInfoServer + + // ApplicationGroupsServer contains the fakes for client ApplicationGroupsClient + ApplicationGroupsServer ApplicationGroupsServer + + // ApplicationsServer contains the fakes for client ApplicationsClient + ApplicationsServer ApplicationsServer + + // ControlSessionHostProvisioningServer contains the fakes for client ControlSessionHostProvisioningClient + ControlSessionHostProvisioningServer ControlSessionHostProvisioningServer + + // ControlSessionHostUpdateServer contains the fakes for client ControlSessionHostUpdateClient + ControlSessionHostUpdateServer ControlSessionHostUpdateServer + + // DesktopsServer contains the fakes for client DesktopsClient + DesktopsServer DesktopsServer + + // HostPoolsServer contains the fakes for client HostPoolsClient + HostPoolsServer HostPoolsServer + + // InitiateSessionHostUpdateServer contains the fakes for client InitiateSessionHostUpdateClient + InitiateSessionHostUpdateServer InitiateSessionHostUpdateServer + + // MSIXPackagesServer contains the fakes for client MSIXPackagesClient + MSIXPackagesServer MSIXPackagesServer + + // MsixImagesServer contains the fakes for client MsixImagesClient + MsixImagesServer MsixImagesServer + + // OperationsServer contains the fakes for client OperationsClient + OperationsServer OperationsServer + + // PrivateEndpointConnectionsServer contains the fakes for client PrivateEndpointConnectionsClient + PrivateEndpointConnectionsServer PrivateEndpointConnectionsServer + + // PrivateLinkResourcesServer contains the fakes for client PrivateLinkResourcesClient + PrivateLinkResourcesServer PrivateLinkResourcesServer + + // ScalingPlanPersonalSchedulesServer contains the fakes for client ScalingPlanPersonalSchedulesClient ScalingPlanPersonalSchedulesServer ScalingPlanPersonalSchedulesServer - ScalingPlanPooledSchedulesServer ScalingPlanPooledSchedulesServer - ScalingPlansServer ScalingPlansServer - SessionHostsServer SessionHostsServer - StartMenuItemsServer StartMenuItemsServer - UserSessionsServer UserSessionsServer - WorkspacesServer WorkspacesServer + + // ScalingPlanPooledSchedulesServer contains the fakes for client ScalingPlanPooledSchedulesClient + ScalingPlanPooledSchedulesServer ScalingPlanPooledSchedulesServer + + // ScalingPlansServer contains the fakes for client ScalingPlansClient + ScalingPlansServer ScalingPlansServer + + // SessionHostServer contains the fakes for client SessionHostClient + SessionHostServer SessionHostServer + + // SessionHostConfigurationsServer contains the fakes for client SessionHostConfigurationsClient + SessionHostConfigurationsServer SessionHostConfigurationsServer + + // SessionHostManagementsServer contains the fakes for client SessionHostManagementsClient + SessionHostManagementsServer SessionHostManagementsServer + + // SessionHostManagementsUpdateStatusServer contains the fakes for client SessionHostManagementsUpdateStatusClient + SessionHostManagementsUpdateStatusServer SessionHostManagementsUpdateStatusServer + + // SessionHostProvisioningStatusesServer contains the fakes for client SessionHostProvisioningStatusesClient + SessionHostProvisioningStatusesServer SessionHostProvisioningStatusesServer + + // SessionHostsServer contains the fakes for client SessionHostsClient + SessionHostsServer SessionHostsServer + + // StartMenuItemsServer contains the fakes for client StartMenuItemsClient + StartMenuItemsServer StartMenuItemsServer + + // UserSessionsServer contains the fakes for client UserSessionsClient + UserSessionsServer UserSessionsServer + + // WorkspacesServer contains the fakes for client WorkspacesClient + WorkspacesServer WorkspacesServer } // NewServerFactoryTransport creates a new instance of ServerFactoryTransport with the provided implementation. @@ -51,26 +110,35 @@ 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 - trAppAttachPackageServer *AppAttachPackageServerTransport - trAppAttachPackageInfoServer *AppAttachPackageInfoServerTransport - 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 + trControlSessionHostProvisioningServer *ControlSessionHostProvisioningServerTransport + 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 + trSessionHostProvisioningStatusesServer *SessionHostProvisioningStatusesServerTransport + trSessionHostsServer *SessionHostsServerTransport + trStartMenuItemsServer *StartMenuItemsServerTransport + trUserSessionsServer *UserSessionsServerTransport + trWorkspacesServer *WorkspacesServerTransport } // Do implements the policy.Transporter interface for ServerFactoryTransport. @@ -86,6 +154,11 @@ 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) @@ -104,12 +177,27 @@ 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 "ControlSessionHostProvisioningClient": + initServer(s, &s.trControlSessionHostProvisioningServer, func() *ControlSessionHostProvisioningServerTransport { + return NewControlSessionHostProvisioningServerTransport(&s.srv.ControlSessionHostProvisioningServer) + }) + resp, err = s.trControlSessionHostProvisioningServer.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) @@ -142,6 +230,29 @@ 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 "SessionHostProvisioningStatusesClient": + initServer(s, &s.trSessionHostProvisioningStatusesServer, func() *SessionHostProvisioningStatusesServerTransport { + return NewSessionHostProvisioningStatusesServerTransport(&s.srv.SessionHostProvisioningStatusesServer) + }) + resp, err = s.trSessionHostProvisioningStatusesServer.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..da2107bd561f --- /dev/null +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/sessionhost_server.go @@ -0,0 +1,126 @@ +// 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")} + } + + return s.dispatchToMethodFake(req, method) +} + +func (s *SessionHostServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if sessionHostServerTransportInterceptor != nil { + res.resp, res.err, intercepted = sessionHostServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "SessionHostClient.RetryProvisioning": + res.resp, res.err = s.dispatchRetryProvisioning(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } +} + +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 +} + +// set this to conditionally intercept incoming requests to SessionHostServerTransport +var sessionHostServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} 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..091c51381afa --- /dev/null +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/sessionhostconfigurations_server.go @@ -0,0 +1,293 @@ +// 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")} + } + + return s.dispatchToMethodFake(req, method) +} + +func (s *SessionHostConfigurationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if sessionHostConfigurationsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = sessionHostConfigurationsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "SessionHostConfigurationsClient.BeginCreateOrUpdate": + res.resp, res.err = s.dispatchBeginCreateOrUpdate(req) + case "SessionHostConfigurationsClient.Get": + res.resp, res.err = s.dispatchGet(req) + case "SessionHostConfigurationsClient.NewListByHostPoolPager": + res.resp, res.err = s.dispatchNewListByHostPoolPager(req) + case "SessionHostConfigurationsClient.BeginUpdate": + res.resp, res.err = s.dispatchBeginUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } +} + +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 +} + +// set this to conditionally intercept incoming requests to SessionHostConfigurationsServerTransport +var sessionHostConfigurationsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} 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..db1b94abf869 --- /dev/null +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/sessionhostmanagements_server.go @@ -0,0 +1,267 @@ +// 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")} + } + + return s.dispatchToMethodFake(req, method) +} + +func (s *SessionHostManagementsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if sessionHostManagementsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = sessionHostManagementsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "SessionHostManagementsClient.CreateOrUpdate": + res.resp, res.err = s.dispatchCreateOrUpdate(req) + case "SessionHostManagementsClient.Get": + res.resp, res.err = s.dispatchGet(req) + case "SessionHostManagementsClient.NewListByHostPoolPager": + res.resp, res.err = s.dispatchNewListByHostPoolPager(req) + case "SessionHostManagementsClient.Update": + res.resp, res.err = s.dispatchUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } +} + +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 +} + +// set this to conditionally intercept incoming requests to SessionHostManagementsServerTransport +var sessionHostManagementsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} 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..227acaa04f99 --- /dev/null +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/sessionhostmanagementsupdatestatus_server.go @@ -0,0 +1,122 @@ +// 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")} + } + + return s.dispatchToMethodFake(req, method) +} + +func (s *SessionHostManagementsUpdateStatusServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if sessionHostManagementsUpdateStatusServerTransportInterceptor != nil { + res.resp, res.err, intercepted = sessionHostManagementsUpdateStatusServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "SessionHostManagementsUpdateStatusClient.Get": + res.resp, res.err = s.dispatchGet(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } +} + +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 +} + +// set this to conditionally intercept incoming requests to SessionHostManagementsUpdateStatusServerTransport +var sessionHostManagementsUpdateStatusServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/sessionhostprovisioningstatuses_server.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/sessionhostprovisioningstatuses_server.go new file mode 100644 index 000000000000..32e3a3782eac --- /dev/null +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/sessionhostprovisioningstatuses_server.go @@ -0,0 +1,122 @@ +// 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" +) + +// SessionHostProvisioningStatusesServer is a fake server for instances of the armdesktopvirtualization.SessionHostProvisioningStatusesClient type. +type SessionHostProvisioningStatusesServer struct { + // Get is the fake for method SessionHostProvisioningStatusesClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, hostPoolName string, options *armdesktopvirtualization.SessionHostProvisioningStatusesClientGetOptions) (resp azfake.Responder[armdesktopvirtualization.SessionHostProvisioningStatusesClientGetResponse], errResp azfake.ErrorResponder) +} + +// NewSessionHostProvisioningStatusesServerTransport creates a new instance of SessionHostProvisioningStatusesServerTransport with the provided implementation. +// The returned SessionHostProvisioningStatusesServerTransport instance is connected to an instance of armdesktopvirtualization.SessionHostProvisioningStatusesClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewSessionHostProvisioningStatusesServerTransport(srv *SessionHostProvisioningStatusesServer) *SessionHostProvisioningStatusesServerTransport { + return &SessionHostProvisioningStatusesServerTransport{srv: srv} +} + +// SessionHostProvisioningStatusesServerTransport connects instances of armdesktopvirtualization.SessionHostProvisioningStatusesClient to instances of SessionHostProvisioningStatusesServer. +// Don't use this type directly, use NewSessionHostProvisioningStatusesServerTransport instead. +type SessionHostProvisioningStatusesServerTransport struct { + srv *SessionHostProvisioningStatusesServer +} + +// Do implements the policy.Transporter interface for SessionHostProvisioningStatusesServerTransport. +func (s *SessionHostProvisioningStatusesServerTransport) 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")} + } + + return s.dispatchToMethodFake(req, method) +} + +func (s *SessionHostProvisioningStatusesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if sessionHostProvisioningStatusesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = sessionHostProvisioningStatusesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "SessionHostProvisioningStatusesClient.Get": + res.resp, res.err = s.dispatchGet(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } +} + +func (s *SessionHostProvisioningStatusesServerTransport) 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/sessionHostProvisioningStatuses/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).SessionHostManagementProvisioningStatus, req) + if err != nil { + return nil, err + } + return resp, nil +} + +// set this to conditionally intercept incoming requests to SessionHostProvisioningStatusesServerTransport +var sessionHostProvisioningStatusesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/sessionhosts_server.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/sessionhosts_server.go index 205ed31003cc..e6bf78e8cd44 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/sessionhosts_server.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/sessionhosts_server.go @@ -1,6 +1,3 @@ -//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. @@ -16,7 +13,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" @@ -68,27 +65,46 @@ func (s *SessionHostsServerTransport) Do(req *http.Request) (*http.Response, err return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return s.dispatchToMethodFake(req, method) +} - switch method { - case "SessionHostsClient.Delete": - resp, err = s.dispatchDelete(req) - case "SessionHostsClient.Get": - resp, err = s.dispatchGet(req) - case "SessionHostsClient.NewListPager": - resp, err = s.dispatchNewListPager(req) - case "SessionHostsClient.Update": - resp, err = s.dispatchUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (s *SessionHostsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if sessionHostsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = sessionHostsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "SessionHostsClient.Delete": + res.resp, res.err = s.dispatchDelete(req) + case "SessionHostsClient.Get": + res.resp, res.err = s.dispatchGet(req) + case "SessionHostsClient.NewListPager": + res.resp, res.err = s.dispatchNewListPager(req) + case "SessionHostsClient.Update": + res.resp, res.err = s.dispatchUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (s *SessionHostsServerTransport) dispatchDelete(req *http.Request) (*http.Response, error) { @@ -237,12 +253,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) @@ -322,3 +344,9 @@ func (s *SessionHostsServerTransport) dispatchUpdate(req *http.Request) (*http.R } return resp, nil } + +// set this to conditionally intercept incoming requests to SessionHostsServerTransport +var sessionHostsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/startmenuitems_server.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/startmenuitems_server.go index 3f27aa6c7275..967a62bae4f9 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/startmenuitems_server.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/startmenuitems_server.go @@ -1,6 +1,3 @@ -//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. @@ -15,7 +12,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" @@ -54,21 +51,40 @@ func (s *StartMenuItemsServerTransport) Do(req *http.Request) (*http.Response, e return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return s.dispatchToMethodFake(req, method) +} - switch method { - case "StartMenuItemsClient.NewListPager": - resp, err = s.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (s *StartMenuItemsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if startMenuItemsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = startMenuItemsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "StartMenuItemsClient.NewListPager": + res.resp, res.err = s.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (s *StartMenuItemsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { @@ -156,3 +172,9 @@ func (s *StartMenuItemsServerTransport) dispatchNewListPager(req *http.Request) } return resp, nil } + +// set this to conditionally intercept incoming requests to StartMenuItemsServerTransport +var startMenuItemsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/time_rfc3339.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/time_rfc3339.go deleted file mode 100644 index 81f308b0d343..000000000000 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/time_rfc3339.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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" - "regexp" - "strings" - "time" -) - -// 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+)*"*$`) - -const ( - 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 - -func (t dateTimeRFC3339) MarshalJSON() ([]byte, error) { - tt := time.Time(t) - return tt.MarshalJSON() -} - -func (t dateTimeRFC3339) MarshalText() ([]byte, error) { - tt := time.Time(t) - return tt.MarshalText() -} - -func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { - 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 { - 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)) -} - -func (t *dateTimeRFC3339) Parse(layout, value string) error { - p, err := time.Parse(layout, strings.ToUpper(value)) - *t = dateTimeRFC3339(p) - 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 - } else if azcore.IsNullValue(t) { - m[k] = nil - return - } else if reflect.ValueOf(t).IsNil() { - return - } - m[k] = (*dateTimeRFC3339)(t) -} - -func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || string(data) == "null" { - return nil - } - var aux dateTimeRFC3339 - if err := json.Unmarshal(data, &aux); err != nil { - return fmt.Errorf("struct field %s: %v", fn, err) - } - *t = (*time.Time)(&aux) - return nil -} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/usersessions_server.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/usersessions_server.go index 1f83003d1294..f7c294370f51 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/usersessions_server.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/usersessions_server.go @@ -1,6 +1,3 @@ -//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. @@ -16,7 +13,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" @@ -78,31 +75,50 @@ func (u *UserSessionsServerTransport) Do(req *http.Request) (*http.Response, err return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return u.dispatchToMethodFake(req, method) +} - switch method { - case "UserSessionsClient.Delete": - resp, err = u.dispatchDelete(req) - case "UserSessionsClient.Disconnect": - resp, err = u.dispatchDisconnect(req) - case "UserSessionsClient.Get": - resp, err = u.dispatchGet(req) - case "UserSessionsClient.NewListPager": - resp, err = u.dispatchNewListPager(req) - case "UserSessionsClient.NewListByHostPoolPager": - resp, err = u.dispatchNewListByHostPoolPager(req) - case "UserSessionsClient.SendMessage": - resp, err = u.dispatchSendMessage(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (u *UserSessionsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if userSessionsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = userSessionsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "UserSessionsClient.Delete": + res.resp, res.err = u.dispatchDelete(req) + case "UserSessionsClient.Disconnect": + res.resp, res.err = u.dispatchDisconnect(req) + case "UserSessionsClient.Get": + res.resp, res.err = u.dispatchGet(req) + case "UserSessionsClient.NewListPager": + res.resp, res.err = u.dispatchNewListPager(req) + case "UserSessionsClient.NewListByHostPoolPager": + res.resp, res.err = u.dispatchNewListByHostPoolPager(req) + case "UserSessionsClient.SendMessage": + res.resp, res.err = u.dispatchSendMessage(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (u *UserSessionsServerTransport) dispatchDelete(req *http.Request) (*http.Response, error) { @@ -475,3 +491,9 @@ func (u *UserSessionsServerTransport) dispatchSendMessage(req *http.Request) (*h } return resp, nil } + +// set this to conditionally intercept incoming requests to UserSessionsServerTransport +var userSessionsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/workspaces_server.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/workspaces_server.go index aae61eb98697..777e39f933c5 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/workspaces_server.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/workspaces_server.go @@ -1,6 +1,3 @@ -//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. @@ -16,7 +13,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" @@ -78,31 +75,50 @@ func (w *WorkspacesServerTransport) Do(req *http.Request) (*http.Response, error return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return w.dispatchToMethodFake(req, method) +} - switch method { - case "WorkspacesClient.CreateOrUpdate": - resp, err = w.dispatchCreateOrUpdate(req) - case "WorkspacesClient.Delete": - resp, err = w.dispatchDelete(req) - case "WorkspacesClient.Get": - resp, err = w.dispatchGet(req) - case "WorkspacesClient.NewListByResourceGroupPager": - resp, err = w.dispatchNewListByResourceGroupPager(req) - case "WorkspacesClient.NewListBySubscriptionPager": - resp, err = w.dispatchNewListBySubscriptionPager(req) - case "WorkspacesClient.Update": - resp, err = w.dispatchUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (w *WorkspacesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if workspacesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = workspacesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "WorkspacesClient.CreateOrUpdate": + res.resp, res.err = w.dispatchCreateOrUpdate(req) + case "WorkspacesClient.Delete": + res.resp, res.err = w.dispatchDelete(req) + case "WorkspacesClient.Get": + res.resp, res.err = w.dispatchGet(req) + case "WorkspacesClient.NewListByResourceGroupPager": + res.resp, res.err = w.dispatchNewListByResourceGroupPager(req) + case "WorkspacesClient.NewListBySubscriptionPager": + res.resp, res.err = w.dispatchNewListBySubscriptionPager(req) + case "WorkspacesClient.Update": + res.resp, res.err = w.dispatchUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (w *WorkspacesServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -365,3 +381,9 @@ func (w *WorkspacesServerTransport) dispatchUpdate(req *http.Request) (*http.Res } return resp, nil } + +// set this to conditionally intercept incoming requests to WorkspacesServerTransport +var workspacesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/go.mod b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/go.mod index 5f8dc19ec25a..3139553202b8 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.23.0 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.1 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.2 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.1 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v1.4.2 // indirect - github.com/golang-jwt/jwt/v5 v5.2.2 // 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.36.0 // indirect golang.org/x/net v0.38.0 // indirect - golang.org/x/sys v0.31.0 // indirect golang.org/x/text v0.23.0 // indirect ) diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/go.sum b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/go.sum index 4bacf756f06c..4de695d9e23a 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/go.sum +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/go.sum @@ -1,44 +1,15 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.1 h1:DSDNVxqkoXJiko6x8a90zidoYqnYYa6c1MTzDKzKkTo= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.1/go.mod h1:zGqV2R4Cr/k8Uye5w+dgQ06WJtEcbQG/8J7BB6hnCr4= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.2 h1:F0gBpfdPLGsw+nsgk6aqqkZS1jiixa5WwFe3fk/T3Ys= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.2/go.mod h1:SqINnQ9lVVdRlyC8cd1lCI0SdX4n2paeABd2K8ggfnE= -github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.2 h1:yz1bePFlP5Vws5+8ez6T3HWXPmwOK7Yvq8QxDBD3SKY= -github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.2/go.mod h1:Pa9ZNPuoNu/GztvBSKk9J1cDJW6vk/n0zLtV4mgd8N8= 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-extensions-for-go/cache v0.1.1 h1:WJTmL004Abzc5wDB5VtZG2PJk5ndYDgVacGqfirKxjM= -github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1/go.mod h1:tCcJZ0uHAmvjsVYzEFivsRTN00oz5BEsRgQHu5JZ9WE= -github.com/AzureAD/microsoft-authentication-library-for-go v1.4.2 h1:oygO0locgZJe7PpYPXT5A29ZkwJaPqcva7BVeemZOZs= -github.com/AzureAD/microsoft-authentication-library-for-go v1.4.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= -github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= -github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= -github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= -github.com/golang-jwt/jwt/v5 v5.2.2 h1:Rl4B7itRWVtYIHFrSNd7vhTiz9UpLdi6gZhZ3wEeDy8= -github.com/golang-jwt/jwt/v5 v5.2.2/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/keybase/go-keychain v0.0.0-20231219164618-57a3676c3af6 h1:IsMZxCuZqKuao2vNdfD82fjjgPLfyHLpR41Z88viRWs= -github.com/keybase/go-keychain v0.0.0-20231219164618-57a3676c3af6/go.mod h1:3VeWNIJaW+O5xpRQbPp0Ybqu1vJd/pm7s2F473HRrkw= -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/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/redis/go-redis/v9 v9.7.0 h1:HhLSs+B6O021gwzl+locl0zEDnyNkxMtf/Z3NNBMa9E= -github.com/redis/go-redis/v9 v9.7.0/go.mod h1:f6zhXITC7JUJIlPEiBOTXxJgPLdZcA93GewI7inzyWw= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -golang.org/x/crypto v0.36.0 h1:AnAEvhDddvBdpY+uR+MyHmuZzzNqXSe/GvuDeob5L34= -golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc= golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8= golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik= -golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY= golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4= 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 ad6a0cf7724b..f224a80b8180 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/hostpools_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/hostpools_client.go @@ -1,6 +1,3 @@ -//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. @@ -47,7 +44,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 2024-04-03 +// Generated from API version 2025-03-01-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. @@ -76,7 +73,7 @@ func (client *HostPoolsClient) CreateOrUpdate(ctx context.Context, resourceGroup } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *HostPoolsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, hostPoolName string, hostPool HostPool, options *HostPoolsClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *HostPoolsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, hostPoolName string, hostPool HostPool, _ *HostPoolsClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -95,7 +92,7 @@ func (client *HostPoolsClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, hostPool); err != nil { @@ -116,7 +113,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 2024-04-03 +// Generated from API version 2025-03-01-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 +158,7 @@ func (client *HostPoolsClient) deleteCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-preview") if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } @@ -173,7 +170,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 2024-04-03 +// Generated from API version 2025-03-01-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. @@ -200,7 +197,7 @@ func (client *HostPoolsClient) Get(ctx context.Context, resourceGroupName string } // getCreateRequest creates the Get request. -func (client *HostPoolsClient) getCreateRequest(ctx context.Context, resourceGroupName string, hostPoolName string, options *HostPoolsClientGetOptions) (*policy.Request, error) { +func (client *HostPoolsClient) getCreateRequest(ctx context.Context, resourceGroupName string, hostPoolName string, _ *HostPoolsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -219,7 +216,7 @@ func (client *HostPoolsClient) getCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -236,7 +233,7 @@ func (client *HostPoolsClient) getHandleResponse(resp *http.Response) (HostPools // NewListPager - List hostPools in subscription. // -// Generated from API version 2024-04-03 +// Generated from API version 2025-03-01-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,7 +270,7 @@ func (client *HostPoolsClient) listCreateRequest(ctx context.Context, options *H return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-preview") if options != nil && options.InitialSkip != nil { reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) } @@ -299,7 +296,7 @@ func (client *HostPoolsClient) listHandleResponse(resp *http.Response) (HostPool // NewListByResourceGroupPager - List hostPools. // -// Generated from API version 2024-04-03 +// Generated from API version 2025-03-01-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,7 +339,7 @@ func (client *HostPoolsClient) listByResourceGroupCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-preview") if options != nil && options.InitialSkip != nil { reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) } @@ -366,10 +363,10 @@ func (client *HostPoolsClient) listByResourceGroupHandleResponse(resp *http.Resp return result, nil } -// ListRegistrationTokens - Operation to list the RegistrationTokens associated with the HostPool +// 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-03 +// Generated from API version 2025-03-01-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 @@ -397,7 +394,7 @@ func (client *HostPoolsClient) ListRegistrationTokens(ctx context.Context, resou } // listRegistrationTokensCreateRequest creates the ListRegistrationTokens request. -func (client *HostPoolsClient) listRegistrationTokensCreateRequest(ctx context.Context, resourceGroupName string, hostPoolName string, options *HostPoolsClientListRegistrationTokensOptions) (*policy.Request, error) { +func (client *HostPoolsClient) listRegistrationTokensCreateRequest(ctx context.Context, resourceGroupName string, hostPoolName string, _ *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") @@ -416,7 +413,7 @@ func (client *HostPoolsClient) listRegistrationTokensCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -434,7 +431,7 @@ func (client *HostPoolsClient) listRegistrationTokensHandleResponse(resp *http.R // RetrieveRegistrationToken - Registration token of the host pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-03 +// Generated from API version 2025-03-01-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 @@ -462,7 +459,7 @@ func (client *HostPoolsClient) RetrieveRegistrationToken(ctx context.Context, re } // retrieveRegistrationTokenCreateRequest creates the RetrieveRegistrationToken request. -func (client *HostPoolsClient) retrieveRegistrationTokenCreateRequest(ctx context.Context, resourceGroupName string, hostPoolName string, options *HostPoolsClientRetrieveRegistrationTokenOptions) (*policy.Request, error) { +func (client *HostPoolsClient) retrieveRegistrationTokenCreateRequest(ctx context.Context, resourceGroupName string, hostPoolName string, _ *HostPoolsClientRetrieveRegistrationTokenOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/retrieveRegistrationToken" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -481,7 +478,7 @@ func (client *HostPoolsClient) retrieveRegistrationTokenCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -499,7 +496,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 2024-04-03 +// Generated from API version 2025-03-01-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. @@ -545,7 +542,7 @@ func (client *HostPoolsClient) updateCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-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 92e22b6cd02a..000000000000 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/hostpools_client_example_test.go +++ /dev/null @@ -1,666 +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/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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"), - // 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), - // }, - // 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}"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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"), - // 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), - // }, - // 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}"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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"), - // 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), - // }, - // 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}"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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"), - // 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), - // }, - // 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}"), - // }, - // }, - // { - // 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"), - // 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), - // }, - // 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}"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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"), - // 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), - // }, - // 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}"), - // }, - // }, - // { - // 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"), - // 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), - // }, - // 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}"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/HostPools_ListRegistrationToken_Post.json -func ExampleHostPoolsClient_ListRegistrationTokens() { - 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().ListRegistrationTokens(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.RegistrationTokenList = armdesktopvirtualization.RegistrationTokenList{ - // Value: []*armdesktopvirtualization.RegistrationTokenMinimal{ - // { - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2008-09-22T14:01:54.957Z"); return t}()), - // 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..8982b2955491 --- /dev/null +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/initiatesessionhostupdate_client.go @@ -0,0 +1,102 @@ +// 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 2025-03-01-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.StatusNoContent) { + 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", "2025-03-01-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 00d8493270ad..d007c99a9616 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/models.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/models.go @@ -1,6 +1,3 @@ -//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. @@ -10,6 +7,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. @@ -77,7 +171,7 @@ type AppAttachPackageInfoProperties struct { // User friendly Name to be displayed in the portal. DisplayName *string - // VHD/CIM image path on Network Share. + // VHD/CIM/APP-V image path on Network Share. ImagePath *string // Make this version of the package the active one across the hostpool. @@ -89,7 +183,7 @@ type AppAttachPackageInfoProperties struct { // Specifies how to register Package in feed. IsRegularRegistration *bool - // Date Package was last updated, found in the appxmanifest.xml. + // 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 @@ -101,10 +195,10 @@ type AppAttachPackageInfoProperties struct { // List of package dependencies. PackageDependencies []*MsixPackageDependencies - // Package Family Name from appxmanifest.xml. Contains Package Name and Publisher name. + // Identifier not including the package version, for Msix packages it is the family name from the appxmanifest.xml. PackageFamilyName *string - // Package Full Name from appxmanifest.xml. + // Identifier including the package version, for Msix packages it is the full name from the appxmanifest.xml. PackageFullName *string // Package Name from appxmanifest.xml. @@ -113,7 +207,7 @@ type AppAttachPackageInfoProperties struct { // Relative Path to the package inside the image. PackageRelativePath *string - // Package version found in the appxmanifest.xml. + // Package Version found in the appxmanifest.xml. Version *string } @@ -126,11 +220,14 @@ type AppAttachPackageList struct { NextLink *string } -// AppAttachPackagePatch - Schema for updatable App Attach Package properties. +// 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 @@ -146,6 +243,9 @@ type AppAttachPackagePatch struct { // 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 @@ -155,12 +255,18 @@ type AppAttachPackagePatchProperties struct { // Detailed properties for App Attach Package Image *AppAttachPackageInfoProperties - // URL path to certificate name located in keyVault + // 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 @@ -170,9 +276,15 @@ type AppAttachPackageProperties struct { // Detailed properties for App Attach Package Image *AppAttachPackageInfoProperties - // URL path to certificate name located in keyVault + // 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 } @@ -202,7 +314,9 @@ type ApplicationGroup struct { // REQUIRED; Detailed properties for ApplicationGroup Properties *ApplicationGroupProperties - Identity *ResourceModelWithAllowedPropertySetIdentity + + // 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 @@ -213,8 +327,12 @@ type ApplicationGroup struct { // 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 @@ -408,6 +526,72 @@ 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 +} + +// CreateDeleteProperties - The properties that control how Scaling will manage the size of the hostpool by creating and deleting +// hosts. +type CreateDeleteProperties struct { + // Maximum number of session hosts that may be created by the Scaling Service. This requires the assigned hostpool to have + // a session host config property. + RampDownMaximumHostPoolSize *int32 + + // Minimum number of session hosts that will be be created by the Scaling Service. Scaling will not delete any hosts when + // this limit is met. This requires the assigned hostpool to have a session host + // config property. + RampDownMinimumHostPoolSize *int32 + + // Maximum number of session hosts that may be created by the Scaling Service. This requires the assigned hostpool to have + // a session host config property. + RampUpMaximumHostPoolSize *int32 + + // Minimum number of session hosts that will be be created by the Scaling Service. Scaling will not delete any hosts when + // this limit is met. This requires the assigned hostpool to have a session host + // config property. + RampUpMinimumHostPoolSize *int32 +} + +// 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 @@ -471,6 +655,73 @@ type DesktopProperties struct { ObjectID *string } +// DiffDiskProperties - Specifies the ephemeral Disk Settings for the operating system disk used by the virtual machine. +type DiffDiskProperties struct { + // Specifies the ephemeral disk settings for operating system disk. + Option *DiffDiskOption + + // Gets or sets specifies the ephemeral disk placement for operating system disk. The defaulting behavior is: CacheDisk if + // one is configured for the VM size otherwise ResourceDisk is used. Refer to the + // VM size documentation for Windows VM at https://docs.microsoft.com/azure/virtual-machines/windows/sizes and Linux VM at + // https://docs.microsoft.com/azure/virtual-machines/linux/sizes to check which VM + // sizes exposes a cache disk. Possible values include: 'CacheDisk', 'ResourceDisk' + Placement *DiffDiskPlacement +} + +// DiskInfoProperties - Disk information. +type DiskInfoProperties struct { + // Specifies the ephemeral Disk Settings for the operating system disk used by the virtual machine. + DiffDiskSettings *DiffDiskProperties + + // The managed disk parameters. + ManagedDisk *ManagedDiskProperties +} + +// 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 @@ -542,7 +793,7 @@ type ExpandMsixImageProperties struct { // Relative Path to the package inside the image. PackageRelativePath *string - // Package version found in the appxmanifest.xml. + // Package Version found in the appxmanifest.xml. Version *string } @@ -553,7 +804,9 @@ type HostPool struct { // REQUIRED; Detailed properties for HostPool Properties *HostPoolProperties - Identity *ResourceModelWithAllowedPropertySetIdentity + + // 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 @@ -564,8 +817,12 @@ type HostPool struct { // 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 @@ -630,12 +887,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 @@ -648,9 +917,22 @@ type HostPoolPatchProperties struct { // Enabled to allow this resource to be access from the public network PublicNetworkAccess *HostpoolPublicNetworkAccess - // The registration info of HostPool. + // 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. This is not returned on GET. In order to get the registration token use the retrieveRegistrationToken + // or listRegistrationTokens POST calls. 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 @@ -696,9 +978,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 @@ -709,9 +1006,22 @@ type HostPoolProperties struct { // be accessed via private endpoints PublicNetworkAccess *HostpoolPublicNetworkAccess - // The registration info of HostPool. + // 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. This is not returned on GET. In order to get the registration token use the retrieveRegistrationToken + // or listRegistrationTokens POST calls. 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 @@ -752,6 +1062,78 @@ type HostPoolProperties struct { PrivateEndpointConnections []*PrivateEndpointConnection } +// HostPoolProvisioningControlParameter - Represents properties for a hostpool provisioning control request. +type HostPoolProvisioningControlParameter struct { + // REQUIRED; Action types for controlling hostpool provisioning. + Action *HostPoolProvisioningAction + + // The cancel message sent to the user on the session host. + CancelMessage *string +} + +// 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 @@ -761,6 +1143,24 @@ type ImportPackageInfoRequest struct { 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 @@ -868,7 +1268,7 @@ type MSIXPackageProperties struct { // Relative Path to the package inside the image. PackageRelativePath *string - // Package version found in the appxmanifest.xml. + // Package Version found in the appxmanifest.xml. Version *string } @@ -890,6 +1290,62 @@ type MaintenanceWindowProperties struct { Hour *int32 } +// ManagedDiskProperties - Managed Disk information. +type ManagedDiskProperties struct { + // The disk type used by virtual machine in hostpool session host. + Type *VirtualMachineDiskType +} + +// 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. @@ -916,7 +1372,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. @@ -926,12 +1383,49 @@ 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 } +// 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. @@ -1051,7 +1545,8 @@ type PrivateLinkServiceConnectionState struct { Status *PrivateEndpointServiceConnectionStatus } -// RegistrationInfo - Represents a RegistrationInfo definition. +// RegistrationInfo - Represents a RegistrationInfo definition. This is not returned on HostPool GET. In order to get the +// registration token use the retrieveRegistrationToken or listRegistrationTokens POST calls. type RegistrationInfo struct { // Expiration time of registration token. ExpirationTime *time.Time @@ -1063,7 +1558,8 @@ type RegistrationInfo struct { Token *string } -// RegistrationInfoPatch - Represents a RegistrationInfo definition. +// RegistrationInfoPatch - Represents a RegistrationInfo definition. This is not returned on HostPool GET. In order to get +// the registration token use the retrieveRegistrationToken or listRegistrationTokens POST calls. type RegistrationInfoPatch struct { // Expiration time of registration token. ExpirationTime *time.Time @@ -1090,54 +1586,6 @@ type RegistrationTokenMinimal struct { Token *string } -type ResourceModelWithAllowedPropertySetIdentity struct { - // The identity type. - Type *string - - // READ-ONLY; The principal ID of resource identity. The value must be an UUID. - PrincipalID *string - - // READ-ONLY; The tenant ID of resource. The value must be an UUID. - 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 - - // 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 -} - -type ResourceModelWithAllowedPropertySetSKU 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 -} - // ResourceProviderOperation - Supported operation of this resource provider. type ResourceProviderOperation struct { // Display metadata associated with the operation. @@ -1177,6 +1625,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. @@ -1193,7 +1661,9 @@ type ScalingPlan struct { // REQUIRED; Detailed properties for scaling plan. Properties *ScalingPlanProperties - Identity *ResourceModelWithAllowedPropertySetIdentity + + // 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 @@ -1204,8 +1674,12 @@ type ScalingPlan struct { // 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 @@ -1261,7 +1735,7 @@ type ScalingPlanPatchProperties struct { // List of ScalingHostPoolReference definitions. HostPoolReferences []*ScalingHostPoolReference - // List of ScalingSchedule definitions. + // List Pooled ScalingSchedule definitions. Schedules []*ScalingSchedule // Timezone of the scaling plan. @@ -1298,11 +1772,11 @@ type ScalingPlanPersonalScheduleList struct { // ScalingPlanPersonalSchedulePatch - ScalingPlanPersonalSchedule properties that can be patched. type ScalingPlanPersonalSchedulePatch struct { // Detailed properties for ScalingPlanPersonalSchedule - Properties *ScalingPlanPersonalScheduleProperties + Properties *ScalingPlanPersonalSchedulePatchProperties } -// ScalingPlanPersonalScheduleProperties - A ScalingPlanPersonalSchedule. -type ScalingPlanPersonalScheduleProperties struct { +// ScalingPlanPersonalSchedulePatchProperties - A ScalingPlanPersonalSchedule. +type ScalingPlanPersonalSchedulePatchProperties struct { // Set of days of the week on which this schedule is active. DaysOfWeek []*DayOfWeek @@ -1392,8 +1866,99 @@ type ScalingPlanPersonalScheduleProperties struct { RampUpStartVMOnConnect *SetStartVMOnConnect } -// ScalingPlanPooledSchedule - Represents a ScalingPlanPooledSchedule definition. -type ScalingPlanPooledSchedule struct { +// ScalingPlanPersonalScheduleProperties - A ScalingPlanPersonalSchedule. +type ScalingPlanPersonalScheduleProperties struct { + // REQUIRED; Set of days of the week on which this schedule is active. + DaysOfWeek []*DayOfWeek + + // REQUIRED; Starting time for off-peak period. + OffPeakStartTime *Time + + // REQUIRED; Starting time for peak period. + PeakStartTime *Time + + // REQUIRED; Starting time for ramp down period. + RampDownStartTime *Time + + // REQUIRED; Starting time for ramp up period. + RampUpStartTime *Time + + // Action to be taken after a user disconnect during the off-peak period. + OffPeakActionOnDisconnect *SessionHandlingOperation + + // Action to be taken after a logoff during the off-peak period. + OffPeakActionOnLogoff *SessionHandlingOperation + + // The time in minutes to wait before performing the desired session handling action when a user disconnects during the off-peak + // period. + OffPeakMinutesToWaitOnDisconnect *int32 + + // The time in minutes to wait before performing the desired session handling action when a user logs off during the off-peak + // period. + OffPeakMinutesToWaitOnLogoff *int32 + + // The desired configuration of Start VM On Connect for the hostpool during the off-peak phase. + OffPeakStartVMOnConnect *SetStartVMOnConnect + + // Action to be taken after a user disconnect during the peak period. + PeakActionOnDisconnect *SessionHandlingOperation + + // Action to be taken after a logoff during the peak period. + PeakActionOnLogoff *SessionHandlingOperation + + // The time in minutes to wait before performing the desired session handling action when a user disconnects during the peak + // period. + PeakMinutesToWaitOnDisconnect *int32 + + // The time in minutes to wait before performing the desired session handling action when a user logs off during the peak + // period. + PeakMinutesToWaitOnLogoff *int32 + + // The desired configuration of Start VM On Connect for the hostpool during the peak phase. + PeakStartVMOnConnect *SetStartVMOnConnect + + // Action to be taken after a user disconnect during the ramp down period. + RampDownActionOnDisconnect *SessionHandlingOperation + + // Action to be taken after a logoff during the ramp down period. + RampDownActionOnLogoff *SessionHandlingOperation + + // The time in minutes to wait before performing the desired session handling action when a user disconnects during the ramp + // down period. + RampDownMinutesToWaitOnDisconnect *int32 + + // The time in minutes to wait before performing the desired session handling action when a user logs off during the ramp + // down period. + RampDownMinutesToWaitOnLogoff *int32 + + // The desired configuration of Start VM On Connect for the hostpool during the ramp down phase. + RampDownStartVMOnConnect *SetStartVMOnConnect + + // Action to be taken after a user disconnect during the ramp up period. + RampUpActionOnDisconnect *SessionHandlingOperation + + // Action to be taken after a logoff during the ramp up period. + RampUpActionOnLogoff *SessionHandlingOperation + + // The desired startup behavior during the ramp up period for personal vms in the hostpool. + RampUpAutoStartHosts *StartupBehavior + + // The time in minutes to wait before performing the desired session handling action when a user disconnects during the ramp + // up period. + RampUpMinutesToWaitOnDisconnect *int32 + + // The time in minutes to wait before performing the desired session handling action when a user logs off during the ramp + // up period. + RampUpMinutesToWaitOnLogoff *int32 + + // The desired configuration of Start VM On Connect for the hostpool during the ramp up phase. If this is disabled, session + // hosts must be turned on using rampUpAutoStartHosts or by turning them on + // manually. + RampUpStartVMOnConnect *SetStartVMOnConnect +} + +// ScalingPlanPooledSchedule - Represents a ScalingPlanPooledSchedule definition. +type ScalingPlanPooledSchedule struct { // REQUIRED; Detailed properties for ScalingPlanPooledSchedule Properties *ScalingPlanPooledScheduleProperties @@ -1422,7 +1987,7 @@ type ScalingPlanPooledScheduleList struct { // ScalingPlanPooledSchedulePatch - ScalingPlanPooledSchedule properties that can be patched. type ScalingPlanPooledSchedulePatch struct { // Detailed properties for ScalingPlanPooledSchedule - Properties *ScalingPlanPooledScheduleProperties + Properties *ScalingPlanPooledSchedulePatchProperties // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string @@ -1437,8 +2002,11 @@ type ScalingPlanPooledSchedulePatch struct { Type *string } -// ScalingPlanPooledScheduleProperties - A ScalingPlanPooledSchedule. -type ScalingPlanPooledScheduleProperties struct { +// ScalingPlanPooledSchedulePatchProperties - A ScalingPlanPooledSchedule. +type ScalingPlanPooledSchedulePatchProperties struct { + // The properties that control how Scaling will manage the size of the hostpool by creating and deleting hosts. + CreateDelete *CreateDeleteProperties + // Set of days of the week on which this schedule is active. DaysOfWeek []*DayOfWeek @@ -1489,6 +2057,75 @@ type ScalingPlanPooledScheduleProperties struct { // Starting time for ramp up period. RampUpStartTime *Time + + // The desired scaling method to be used to scale the hosts in the assigned host pool. + ScalingMethod *ScalingMethod + + // READ-ONLY; Name of the ScalingPlanPooledSchedule. + Name *string +} + +// ScalingPlanPooledScheduleProperties - A ScalingPlanPooledSchedule. +type ScalingPlanPooledScheduleProperties struct { + // REQUIRED; Set of days of the week on which this schedule is active. + DaysOfWeek []*DayOfWeek + + // REQUIRED; Starting time for off-peak period. + OffPeakStartTime *Time + + // REQUIRED; Starting time for peak period. + PeakStartTime *Time + + // REQUIRED; Capacity threshold for ramp down period. + RampDownCapacityThresholdPct *int32 + + // REQUIRED; Starting time for ramp down period. + RampDownStartTime *Time + + // REQUIRED; Capacity threshold for ramp up period. + RampUpCapacityThresholdPct *int32 + + // REQUIRED; Starting time for ramp up period. + RampUpStartTime *Time + + // The properties that control how Scaling will manage the size of the hostpool by creating and deleting hosts. + CreateDelete *CreateDeleteProperties + + // Load balancing algorithm for off-peak period. + OffPeakLoadBalancingAlgorithm *SessionHostLoadBalancingAlgorithm + + // Load balancing algorithm for peak period. + PeakLoadBalancingAlgorithm *SessionHostLoadBalancingAlgorithm + + // Should users be logged off forcefully from hosts. + RampDownForceLogoffUsers *bool + + // Load balancing algorithm for ramp down period. + RampDownLoadBalancingAlgorithm *SessionHostLoadBalancingAlgorithm + + // Minimum host percentage for ramp down period. + RampDownMinimumHostsPct *int32 + + // Notification message for users during ramp down period. + RampDownNotificationMessage *string + + // Specifies when to stop hosts during ramp down period. + RampDownStopHostsWhen *StopHostsWhen + + // Number of minutes to wait to stop hosts during ramp down period. + RampDownWaitTimeMinutes *int32 + + // Load balancing algorithm for ramp up period. + RampUpLoadBalancingAlgorithm *SessionHostLoadBalancingAlgorithm + + // Minimum host percentage for ramp up period. + RampUpMinimumHostsPct *int32 + + // The desired scaling method to be used to scale the hosts in the assigned host pool. + ScalingMethod *ScalingMethod + + // READ-ONLY; Name of the ScalingPlanPooledSchedule. + Name *string } // ScalingPlanProperties - Scaling plan properties. @@ -1511,7 +2148,7 @@ type ScalingPlanProperties struct { // HostPool type for desktop. HostPoolType *ScalingHostPoolType - // List of ScalingPlanPooledSchedule definitions. + // List of Pooled ScalingSchedule definitions. Schedules []*ScalingSchedule // READ-ONLY; ObjectId of scaling plan. (internal use) @@ -1520,8 +2157,11 @@ type ScalingPlanProperties struct { // ScalingSchedule - A ScalingPlanPooledSchedule. type ScalingSchedule struct { + // The properties that control how Scaling will manage the size of the hostpool by creating and deleting hosts. + CreateDelete *CreateDeleteProperties + // Set of days of the week on which this schedule is active. - DaysOfWeek []*ScalingScheduleDaysOfWeekItem + DaysOfWeek []*DayOfWeek // Name of the ScalingPlanPooledSchedule. Name *string @@ -1573,6 +2213,33 @@ type ScalingSchedule struct { // Starting time for ramp up period. RampUpStartTime *Time + + // The desired scaling method to be used to scale the hosts in the assigned host pool. + ScalingMethod *ScalingMethod +} + +// 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. @@ -1608,6 +2275,141 @@ type SessionHost struct { 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; 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 *DiskInfoProperties + + // 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. @@ -1641,6 +2443,195 @@ 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 { + // The policy that should be applied when the Session Host provisioning operation fails. + FailedSessionHostCleanupPolicy *FailedSessionHostCleanupPolicySHC + + // Parameters that apply when session hosts are provisioned. + Provisioning *SessionHostProvisioningConfigurationPatchProperties + + // 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 + + // The policy that should be applied when the Session Host provisioning operation fails. + FailedSessionHostCleanupPolicy *FailedSessionHostCleanupPolicySHC + + // Parameters that apply when session hosts are provisioned. + Provisioning *SessionHostProvisioningConfigurationProperties +} + +// SessionHostManagementProvisioningOperationProgress - SessionHostManagement Provisioning Operation Progress information. +type SessionHostManagementProvisioningOperationProgress struct { + // Time that the sessionHostManagement operation was created. + ExecutionStartTime *time.Time + + // The final instance count of the host pool for this provisioning operation. + FinalSessionHostsCount *int32 + + // The initial instance count of the host pool for this provisioning operation. + InitialSessionHostsCount *int32 + + // The number of sessionHosts completed in the sessionHostManagement provisioning operation. + SessionHostsCompleted *int32 + + // The number of sessionHosts in progress in the sessionHostManagement provisioning operation. + SessionHostsInProgress *int32 +} + +// SessionHostManagementProvisioningStatus - The current status of the session host provisioning async operation. +type SessionHostManagementProvisioningStatus struct { + // REQUIRED; Operation status. Current defined values are < Scheduled | ValidatingSessionHostProvisioning | Cancelling | ProvisioningSessionHosts + // > | 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 Provisioning Status. + Properties *SessionHostManagementProvisioningStatusProperties + + // The start time of the operation. + StartTime *time.Time +} + +// SessionHostManagementProvisioningStatusProperties - Properties bag to hold custom RP properties for sessionHostManagement +// Update Statuses. +type SessionHostManagementProvisioningStatusProperties struct { + // The correlation Id for Log Analytics. + CorrelationID *string + + // Progress information on the sessionHostManagement operation. + Progress *SessionHostManagementProvisioningOperationProgress + + // The timestamp that the update is scheduled for. + ScheduledDateTime *time.Time + + // SessionHostManagement properties used for the operation. + SessionHostManagement *SessionHostManagement +} + +// 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 correlation Id for 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 @@ -1673,6 +2664,9 @@ type SessionHostPatchProperties struct { // SessionHostProperties - Schema for SessionHost properties. type SessionHostProperties struct { + // Number of active sessions on SessionHost. + ActiveSessions *int32 + // Version of agent on SessionHost. AgentVersion *string @@ -1682,6 +2676,9 @@ type SessionHostProperties struct { // User assigned to SessionHost. AssignedUser *string + // Number of disconnected sessions on SessionHost. + DisconnectedSessions *int32 + // Friendly name of SessionHost FriendlyName *string @@ -1691,6 +2688,9 @@ type SessionHostProperties struct { // The version of the OS on the session host. OSVersion *string + // Number of pending sessions on SessionHost. + PendingSessions *int32 + // Number of sessions on SessionHost. Sessions *int32 @@ -1706,6 +2706,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 @@ -1715,6 +2718,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 @@ -1725,6 +2732,30 @@ type SessionHostProperties struct { VirtualMachineID *string } +// SessionHostProvisioningConfigurationPatchProperties - The configuration for session host provisioning operations. +type SessionHostProvisioningConfigurationPatchProperties struct { + // Policy on whether a Canary VM should be provisioned during a session host provisioning operation. + CanaryPolicy *CanaryPolicy + + // the number of session hosts to exist in the Host Pool. + InstanceCount *int32 + + // Whether the session host should be set in drain mode following provisioning. + SetDrainMode *bool +} + +// SessionHostProvisioningConfigurationProperties - The configuration for session host provisioning operations. +type SessionHostProvisioningConfigurationProperties struct { + // Policy on whether a Canary VM should be provisioned during a session host provisioning operation. + CanaryPolicy *CanaryPolicy + + // the number of session hosts to exist in the Host Pool. + InstanceCount *int32 + + // Whether the session host should be set in drain mode following provisioning. + SetDrainMode *bool +} + // StartMenuItem - Represents a StartMenuItem definition. type StartMenuItem struct { // Detailed properties for StartMenuItem @@ -1800,6 +2831,28 @@ 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 @@ -1852,7 +2905,9 @@ type UserSessionProperties struct { type Workspace struct { // REQUIRED; The geo-location where the resource lives Location *string - Identity *ResourceModelWithAllowedPropertySetIdentity + + // 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 @@ -1863,11 +2918,15 @@ type Workspace struct { // 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 diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/models_serde.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/models_serde.go index 7ca758c548cc..598f19817f7e 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/models_serde.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/models_serde.go @@ -1,6 +1,3 @@ -//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. @@ -16,6 +13,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) @@ -270,6 +490,7 @@ func (a AppAttachPackagePatch) MarshalJSON() ([]byte, error) { 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) } @@ -295,6 +516,9 @@ func (a *AppAttachPackagePatch) 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) @@ -309,10 +533,12 @@ func (a *AppAttachPackagePatch) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AppAttachPackagePatchProperties. func (a AppAttachPackagePatchProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + 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) } @@ -325,6 +551,9 @@ func (a *AppAttachPackagePatchProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "customData": + err = unpopulate(val, "CustomData", &a.CustomData) + delete(rawMsg, key) case "failHealthCheckOnStagingFailure": err = unpopulate(val, "FailHealthCheckOnStagingFailure", &a.FailHealthCheckOnStagingFailure) delete(rawMsg, key) @@ -337,6 +566,9 @@ func (a *AppAttachPackagePatchProperties) UnmarshalJSON(data []byte) error { 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 { return fmt.Errorf("unmarshalling type %T: %v", a, err) @@ -348,10 +580,13 @@ func (a *AppAttachPackagePatchProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AppAttachPackageProperties. func (a AppAttachPackageProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + 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) } @@ -365,6 +600,9 @@ func (a *AppAttachPackageProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "customData": + err = unpopulate(val, "CustomData", &a.CustomData) + delete(rawMsg, key) case "failHealthCheckOnStagingFailure": err = unpopulate(val, "FailHealthCheckOnStagingFailure", &a.FailHealthCheckOnStagingFailure) delete(rawMsg, key) @@ -377,6 +615,12 @@ func (a *AppAttachPackageProperties) UnmarshalJSON(data []byte) error { case "keyVaultURL": err = unpopulate(val, "KeyVaultURL", &a.KeyVaultURL) delete(rawMsg, key) + case "packageLookbackUrl": + err = unpopulate(val, "PackageLookbackURL", &a.PackageLookbackURL) + delete(rawMsg, key) + case "packageOwnerName": + err = unpopulate(val, "PackageOwnerName", &a.PackageOwnerName) + delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) delete(rawMsg, key) @@ -886,1069 +1130,1757 @@ 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 AzureActiveDirectoryInfoProperties. +func (a AzureActiveDirectoryInfoProperties) 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, "mdmProviderGuid", a.MdmProviderGUID) 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 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", 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) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &d.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &d.Type) + case "mdmProviderGuid": + err = unpopulate(val, "MdmProviderGUID", &a.MdmProviderGUID) 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 BootDiagnosticsInfoPatchProperties. +func (b BootDiagnosticsInfoPatchProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", d.NextLink) - populate(objectMap, "value", d.Value) + populate(objectMap, "enabled", b.Enabled) + populate(objectMap, "storageUri", b.StorageURI) 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 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", d, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &d.NextLink) + case "enabled": + err = unpopulate(val, "Enabled", &b.Enabled) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &d.Value) + case "storageUri": + err = unpopulate(val, "StorageURI", &b.StorageURI) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", b, 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 BootDiagnosticsInfoProperties. +func (b BootDiagnosticsInfoProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "tags", d.Tags) + populate(objectMap, "enabled", b.Enabled) + populate(objectMap, "storageUri", b.StorageURI) 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 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", d, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { - case "properties": - err = unpopulate(val, "Properties", &d.Properties) + case "enabled": + err = unpopulate(val, "Enabled", &b.Enabled) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &d.Tags) + case "storageUri": + err = unpopulate(val, "StorageURI", &b.StorageURI) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", b, 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 CreateDeleteProperties. +func (c CreateDeleteProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", d.Description) - populate(objectMap, "friendlyName", d.FriendlyName) + populate(objectMap, "rampDownMaximumHostPoolSize", c.RampDownMaximumHostPoolSize) + populate(objectMap, "rampDownMinimumHostPoolSize", c.RampDownMinimumHostPoolSize) + populate(objectMap, "rampUpMaximumHostPoolSize", c.RampUpMaximumHostPoolSize) + populate(objectMap, "rampUpMinimumHostPoolSize", c.RampUpMinimumHostPoolSize) 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 CreateDeleteProperties. +func (c *CreateDeleteProperties) 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", c, err) } for key, val := range rawMsg { var err error switch key { - case "description": - err = unpopulate(val, "Description", &d.Description) + case "rampDownMaximumHostPoolSize": + err = unpopulate(val, "RampDownMaximumHostPoolSize", &c.RampDownMaximumHostPoolSize) delete(rawMsg, key) - case "friendlyName": - err = unpopulate(val, "FriendlyName", &d.FriendlyName) + case "rampDownMinimumHostPoolSize": + err = unpopulate(val, "RampDownMinimumHostPoolSize", &c.RampDownMinimumHostPoolSize) + delete(rawMsg, key) + case "rampUpMaximumHostPoolSize": + err = unpopulate(val, "RampUpMaximumHostPoolSize", &c.RampUpMaximumHostPoolSize) + delete(rawMsg, key) + case "rampUpMinimumHostPoolSize": + err = unpopulate(val, "RampUpMinimumHostPoolSize", &c.RampUpMinimumHostPoolSize) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, 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 CustomInfoPatchProperties. +func (c CustomInfoPatchProperties) 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) + populate(objectMap, "resourceId", c.ResourceID) 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 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", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, 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) + case "resourceId": + err = unpopulate(val, "ResourceID", &c.ResourceID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, 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 CustomInfoProperties. +func (c CustomInfoProperties) 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) + populate(objectMap, "resourceId", c.ResourceID) 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 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", e, err) + return fmt.Errorf("unmarshalling type %T: %v", c, 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) + 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 ExpandMsixImageList. -func (e ExpandMsixImageList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Desktop. +func (d Desktop) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", e.NextLink) - populate(objectMap, "value", e.Value) + 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 ExpandMsixImageList. -func (e *ExpandMsixImageList) UnmarshalJSON(data []byte) error { +// 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", e, 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", &e.NextLink) + case "id": + err = unpopulate(val, "ID", &d.ID) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &e.Value) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &d.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, 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 DesktopList. +func (d DesktopList) 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) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) 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 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", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, 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) + case "nextLink": + err = unpopulate(val, "NextLink", &d.NextLink) delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &e.Version) + case "value": + err = unpopulate(val, "Value", &d.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, 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 DesktopPatch. +func (d DesktopPatch) 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, "properties", d.Properties) + populate(objectMap, "tags", d.Tags) 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 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 "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) + 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 HostPoolList. -func (h HostPoolList) 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, "nextLink", h.NextLink) - populate(objectMap, "value", h.Value) + populate(objectMap, "description", d.Description) + populate(objectMap, "friendlyName", d.FriendlyName) 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 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 "nextLink": - err = unpopulate(val, "NextLink", &h.NextLink) + case "description": + err = unpopulate(val, "Description", &d.Description) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &h.Value) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &d.FriendlyName) 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 DesktopProperties. +func (d DesktopProperties) 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) + 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 HostPoolPatch. -func (h *HostPoolPatch) UnmarshalJSON(data []byte) error { +// 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", 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) + case "description": + err = unpopulate(val, "Description", &d.Description) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &h.Properties) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &d.FriendlyName) delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &h.SystemData) + case "iconContent": + if val != nil && string(val) != "null" { + err = runtime.DecodeByteArray(string(val), &d.IconContent, runtime.Base64StdFormat) + } delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &h.Tags) + case "iconHash": + err = unpopulate(val, "IconHash", &d.IconHash) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &h.Type) + case "objectId": + err = unpopulate(val, "ObjectID", &d.ObjectID) 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 DiffDiskProperties. +func (d DiffDiskProperties) 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, "option", d.Option) + populate(objectMap, "placement", d.Placement) 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 DiffDiskProperties. +func (d *DiffDiskProperties) 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 "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) - 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 "registrationInfo": - err = unpopulate(val, "RegistrationInfo", &h.RegistrationInfo) - 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) + case "option": + err = unpopulate(val, "Option", &d.Option) delete(rawMsg, key) - case "validationEnvironment": - err = unpopulate(val, "ValidationEnvironment", &h.ValidationEnvironment) + case "placement": + err = unpopulate(val, "Placement", &d.Placement) 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 HostPoolProperties. -func (h HostPoolProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DiskInfoProperties. +func (d DiskInfoProperties) 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, "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, "diffDiskSettings", d.DiffDiskSettings) + populate(objectMap, "managedDisk", d.ManagedDisk) 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 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", h, err) + return fmt.Errorf("unmarshalling type %T: %v", d, 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 "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) - 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) + case "diffDiskSettings": + err = unpopulate(val, "DiffDiskSettings", &d.DiffDiskSettings) delete(rawMsg, key) - case "validationEnvironment": - err = unpopulate(val, "ValidationEnvironment", &h.ValidationEnvironment) + case "managedDisk": + err = unpopulate(val, "ManagedDisk", &d.ManagedDisk) 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 ImportPackageInfoRequest. -func (i ImportPackageInfoRequest) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DomainInfoPatchProperties. +func (d DomainInfoPatchProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "packageArchitecture", i.PackageArchitecture) - populate(objectMap, "path", i.Path) + populate(objectMap, "activeDirectoryInfo", d.ActiveDirectoryInfo) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ImportPackageInfoRequest. -func (i *ImportPackageInfoRequest) UnmarshalJSON(data []byte) error { +// 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", d, 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) + case "activeDirectoryInfo": + err = unpopulate(val, "ActiveDirectoryInfo", &d.ActiveDirectoryInfo) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", d, 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 DomainInfoProperties. +func (d DomainInfoProperties) 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, "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 LogSpecification. -func (l *LogSpecification) UnmarshalJSON(data []byte) error { +// 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", l, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "blobDuration": - err = unpopulate(val, "BlobDuration", &l.BlobDuration) + case "activeDirectoryInfo": + err = unpopulate(val, "ActiveDirectoryInfo", &d.ActiveDirectoryInfo) delete(rawMsg, key) - case "displayName": - err = unpopulate(val, "DisplayName", &l.DisplayName) + case "azureActiveDirectoryInfo": + err = unpopulate(val, "AzureActiveDirectoryInfo", &d.AzureActiveDirectoryInfo) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &l.Name) + case "joinType": + err = unpopulate(val, "JoinType", &d.JoinType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", d, 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 ErrorAdditionalInfo. +func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "uri", m.URI) + populateAny(objectMap, "info", e.Info) + populate(objectMap, "type", e.Type) 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 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", m, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "uri": - err = unpopulate(val, "URI", &m.URI) + 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", m, err) + return fmt.Errorf("unmarshalling type %T: %v", e, 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 ErrorDetail. +func (e ErrorDetail) 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, "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 MSIXPackage. -func (m *MSIXPackage) UnmarshalJSON(data []byte) error { +// 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", m, err) + 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", &m.ID) + case "additionalInfo": + err = unpopulate(val, "AdditionalInfo", &e.AdditionalInfo) 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) + case "code": + err = unpopulate(val, "Code", &e.Code) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &m.Type) + case "details": + err = unpopulate(val, "Details", &e.Details) 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) + case "message": + err = unpopulate(val, "Message", &e.Message) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &m.Value) + case "target": + err = unpopulate(val, "Target", &e.Target) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", e, 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 ExpandMsixImage. +func (e ExpandMsixImage) 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", 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 MSIXPackagePatch. -func (m *MSIXPackagePatch) UnmarshalJSON(data []byte) error { +// 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", m, err) + 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", &m.ID) + err = unpopulate(val, "ID", &e.ID) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &m.Name) + err = unpopulate(val, "Name", &e.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &m.Properties) + err = unpopulate(val, "Properties", &e.Properties) delete(rawMsg, key) case "systemData": - err = unpopulate(val, "SystemData", &m.SystemData) + err = unpopulate(val, "SystemData", &e.SystemData) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &m.Type) + err = unpopulate(val, "Type", &e.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", e, 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 ExpandMsixImageList. +func (e ExpandMsixImageList) 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, "nextLink", e.NextLink) + populate(objectMap, "value", e.Value) 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 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", m, err) + return fmt.Errorf("unmarshalling type %T: %v", e, 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) + case "nextLink": + err = unpopulate(val, "NextLink", &e.NextLink) delete(rawMsg, key) - case "isRegularRegistration": - err = unpopulate(val, "IsRegularRegistration", &m.IsRegularRegistration) + case "value": + err = unpopulate(val, "Value", &e.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", e, 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 ExpandMsixImageProperties. +func (e ExpandMsixImageProperties) 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) + 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 MSIXPackageProperties. -func (m *MSIXPackageProperties) UnmarshalJSON(data []byte) error { +// 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", m, err) + 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", &m.DisplayName) + err = unpopulate(val, "DisplayName", &e.DisplayName) delete(rawMsg, key) case "imagePath": - err = unpopulate(val, "ImagePath", &m.ImagePath) + err = unpopulate(val, "ImagePath", &e.ImagePath) delete(rawMsg, key) case "isActive": - err = unpopulate(val, "IsActive", &m.IsActive) + err = unpopulate(val, "IsActive", &e.IsActive) delete(rawMsg, key) case "isRegularRegistration": - err = unpopulate(val, "IsRegularRegistration", &m.IsRegularRegistration) + err = unpopulate(val, "IsRegularRegistration", &e.IsRegularRegistration) delete(rawMsg, key) case "lastUpdated": - err = unpopulateDateTimeRFC3339(val, "LastUpdated", &m.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", &m.PackageApplications) + err = unpopulate(val, "PackageApplications", &e.PackageApplications) delete(rawMsg, key) case "packageDependencies": - err = unpopulate(val, "PackageDependencies", &m.PackageDependencies) + err = unpopulate(val, "PackageDependencies", &e.PackageDependencies) delete(rawMsg, key) case "packageFamilyName": - err = unpopulate(val, "PackageFamilyName", &m.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", &m.PackageName) + err = unpopulate(val, "PackageName", &e.PackageName) delete(rawMsg, key) case "packageRelativePath": - err = unpopulate(val, "PackageRelativePath", &m.PackageRelativePath) + err = unpopulate(val, "PackageRelativePath", &e.PackageRelativePath) delete(rawMsg, key) case "version": - err = unpopulate(val, "Version", &m.Version) + err = unpopulate(val, "Version", &e.Version) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", e, 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 HostPool. +func (h HostPool) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "dayOfWeek", m.DayOfWeek) - populate(objectMap, "hour", m.Hour) + 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 MaintenanceWindowPatchProperties. -func (m *MaintenanceWindowPatchProperties) UnmarshalJSON(data []byte) error { +// 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", m, err) + return fmt.Errorf("unmarshalling type %T: %v", h, err) } for key, val := range rawMsg { var err error switch key { - case "dayOfWeek": - err = unpopulate(val, "DayOfWeek", &m.DayOfWeek) + case "etag": + err = unpopulate(val, "Etag", &h.Etag) delete(rawMsg, key) - case "hour": - err = unpopulate(val, "Hour", &m.Hour) + 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", m, err) + return fmt.Errorf("unmarshalling type %T: %v", h, 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 HostPoolList. +func (h HostPoolList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "dayOfWeek", m.DayOfWeek) - populate(objectMap, "hour", m.Hour) + populate(objectMap, "nextLink", h.NextLink) + populate(objectMap, "value", h.Value) 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 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", m, err) + 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 HostPoolProvisioningControlParameter. +func (h HostPoolProvisioningControlParameter) 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 HostPoolProvisioningControlParameter. +func (h *HostPoolProvisioningControlParameter) 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 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 @@ -1956,833 +2888,2056 @@ func (m *MaintenanceWindowProperties) UnmarshalJSON(data []byte) error { case "dayOfWeek": err = unpopulate(val, "DayOfWeek", &m.DayOfWeek) delete(rawMsg, key) - case "hour": - err = unpopulate(val, "Hour", &m.Hour) + 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 ManagedDiskProperties. +func (m ManagedDiskProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedDiskProperties. +func (m *ManagedDiskProperties) 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 "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 ManagedServiceIdentity. +func (m ManagedServiceIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "principalId", m.PrincipalID) + populate(objectMap, "tenantId", m.TenantID) + populate(objectMap, "type", m.Type) + populate(objectMap, "userAssignedIdentities", m.UserAssignedIdentities) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedServiceIdentity. +func (m *ManagedServiceIdentity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "principalId": + err = unpopulate(val, "PrincipalID", &m.PrincipalID) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &m.TenantID) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + case "userAssignedIdentities": + err = unpopulate(val, "UserAssignedIdentities", &m.UserAssignedIdentities) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type 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 "offer": + err = unpopulate(val, "Offer", &m.Offer) + delete(rawMsg, key) + case "publisher": + err = unpopulate(val, "Publisher", &m.Publisher) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &m.SKU) + 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 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 "offer": + err = unpopulate(val, "Offer", &m.Offer) + delete(rawMsg, key) + case "publisher": + err = unpopulate(val, "Publisher", &m.Publisher) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &m.SKU) + 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 MsixPackageApplications. +func (m MsixPackageApplications) 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, 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 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", m, 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) + 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": + if val != nil && string(val) != "null" { + err = runtime.DecodeByteArray(string(val), &m.RawIcon, runtime.Base64StdFormat) + } + delete(rawMsg, key) + case "rawPng": + if val != nil && string(val) != "null" { + err = runtime.DecodeByteArray(string(val), &m.RawPNG, runtime.Base64StdFormat) + } + 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 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 "minVersion": + err = unpopulate(val, "MinVersion", &m.MinVersion) + delete(rawMsg, key) + case "publisher": + err = unpopulate(val, "Publisher", &m.Publisher) + 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 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 "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 NetworkInfoProperties. +func (n NetworkInfoProperties) 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 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", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "securityGroupId": + err = unpopulate(val, "SecurityGroupID", &n.SecurityGroupID) + delete(rawMsg, key) + 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", &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", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpoint. +func (p PrivateEndpoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", p.ID) + return json.Marshal(objectMap) +} + +// 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", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnection. +func (p PrivateEndpointConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "systemData", p.SystemData) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type 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", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionListResultWithSystemData. +func (p PrivateEndpointConnectionListResultWithSystemData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type 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", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &p.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &p.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionProperties. +func (p PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 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", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "groupIds": + err = unpopulate(val, "GroupIDs", &p.GroupIDs) + delete(rawMsg, key) + case "privateEndpoint": + err = unpopulate(val, "PrivateEndpoint", &p.PrivateEndpoint) + delete(rawMsg, key) + case "privateLinkServiceConnectionState": + err = unpopulate(val, "PrivateLinkServiceConnectionState", &p.PrivateLinkServiceConnectionState) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionWithSystemData. +func (p PrivateEndpointConnectionWithSystemData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "systemData", p.SystemData) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type 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", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResource. +func (p PrivateLinkResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "systemData", p.SystemData) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type 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", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceListResult. +func (p PrivateLinkResourceListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type 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", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &p.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &p.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", 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 PrivateLinkResourceProperties. +func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 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", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "groupId": + err = unpopulate(val, "GroupID", &p.GroupID) + delete(rawMsg, key) + 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", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkServiceConnectionState. +func (p PrivateLinkServiceConnectionState) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 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", p, 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) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &p.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RegistrationInfo. +func (r RegistrationInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 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", 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) + delete(rawMsg, key) + case "token": + err = unpopulate(val, "Token", &r.Token) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RegistrationInfoPatch. +func (r RegistrationInfoPatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateDateTimeRFC3339(objectMap, "expirationTime", r.ExpirationTime) + populate(objectMap, "registrationTokenOperation", r.RegistrationTokenOperation) + return json.Marshal(objectMap) +} + +// 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", 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) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RegistrationTokenList. +func (r RegistrationTokenList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) + return json.Marshal(objectMap) +} + +// 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + 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", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RegistrationTokenMinimal. +func (r RegistrationTokenMinimal) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateDateTimeRFC3339(objectMap, "expirationTime", r.ExpirationTime) + populate(objectMap, "token", r.Token) + return json.Marshal(objectMap) +} + +// 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "expirationTime": + err = unpopulateDateTimeRFC3339(val, "ExpirationTime", &r.ExpirationTime) + delete(rawMsg, key) + case "token": + err = unpopulate(val, "Token", &r.Token) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceProviderOperation. +func (r ResourceProviderOperation) 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) + return json.Marshal(objectMap) +} + +// 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "display": + err = unpopulate(val, "Display", &r.Display) + delete(rawMsg, key) + 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", r, 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, "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) - }) + 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 MsixPackageApplications. -func (m *MsixPackageApplications) 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", m, err) + return fmt.Errorf("unmarshalling type %T: %v", r, 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) - delete(rawMsg, key) case "description": - err = unpopulate(val, "Description", &m.Description) - delete(rawMsg, key) - case "friendlyName": - err = unpopulate(val, "FriendlyName", &m.FriendlyName) + err = unpopulate(val, "Description", &r.Description) delete(rawMsg, key) - case "iconImageName": - err = unpopulate(val, "IconImageName", &m.IconImageName) + case "operation": + err = unpopulate(val, "Operation", &r.Operation) delete(rawMsg, key) - case "rawIcon": - if val != nil && string(val) != "null" { - err = runtime.DecodeByteArray(string(val), &m.RawIcon, runtime.Base64StdFormat) - } + case "provider": + err = unpopulate(val, "Provider", &r.Provider) delete(rawMsg, key) - case "rawPng": - if val != nil && string(val) != "null" { - err = runtime.DecodeByteArray(string(val), &m.RawPNG, runtime.Base64StdFormat) - } + case "resource": + err = unpopulate(val, "Resource", &r.Resource) 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 MsixPackageDependencies. -func (m MsixPackageDependencies) 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, "dependencyName", m.DependencyName) - populate(objectMap, "minVersion", m.MinVersion) - populate(objectMap, "publisher", m.Publisher) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) 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 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", 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) - delete(rawMsg, key) - case "minVersion": - err = unpopulate(val, "MinVersion", &m.MinVersion) + case "nextLink": + err = unpopulate(val, "NextLink", &r.NextLink) delete(rawMsg, key) - case "publisher": - err = unpopulate(val, "Publisher", &m.Publisher) + case "value": + err = unpopulate(val, "Value", &r.Value) 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 SKU. +func (s SKU) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "serviceSpecification", o.ServiceSpecification) + 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 OperationProperties. -func (o *OperationProperties) 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", o, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "serviceSpecification": - err = unpopulate(val, "ServiceSpecification", &o.ServiceSpecification) + 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", &s.Name) + delete(rawMsg, key) + case "size": + err = unpopulate(val, "Size", &s.Size) + delete(rawMsg, key) + case "tier": + err = unpopulate(val, "Tier", &s.Tier) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", s, 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 ScalingHostPoolReference. +func (s ScalingHostPoolReference) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", p.ID) + populate(objectMap, "hostPoolArmPath", s.HostPoolArmPath) + populate(objectMap, "scalingPlanEnabled", s.ScalingPlanEnabled) 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 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 "id": - err = unpopulate(val, "ID", &p.ID) + case "hostPoolArmPath": + err = unpopulate(val, "HostPoolArmPath", &s.HostPoolArmPath) + delete(rawMsg, key) + 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 PrivateEndpointConnection. -func (p PrivateEndpointConnection) 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, "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, "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 PrivateEndpointConnection. -func (p *PrivateEndpointConnection) 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 "etag": + err = unpopulate(val, "Etag", &s.Etag) + delete(rawMsg, key) case "id": - err = unpopulate(val, "ID", &p.ID) + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + 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", &p.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", &p.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", &p.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", &p.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 PrivateEndpointConnectionListResultWithSystemData. -func (p PrivateEndpointConnectionListResultWithSystemData) 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, "nextLink", p.NextLink) - populate(objectMap, "value", p.Value) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) 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 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 "nextLink": - err = unpopulate(val, "NextLink", &p.NextLink) + err = unpopulate(val, "NextLink", &s.NextLink) delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &p.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 PrivateEndpointConnectionProperties. -func (p PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ScalingPlanPatch. +func (s ScalingPlanPatch) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "groupIds", p.GroupIDs) - populate(objectMap, "privateEndpoint", p.PrivateEndpoint) - populate(objectMap, "privateLinkServiceConnectionState", p.PrivateLinkServiceConnectionState) - populate(objectMap, "provisioningState", p.ProvisioningState) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "tags", s.Tags) 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 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", p, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "groupIds": - err = unpopulate(val, "GroupIDs", &p.GroupIDs) - delete(rawMsg, key) - case "privateEndpoint": - err = unpopulate(val, "PrivateEndpoint", &p.PrivateEndpoint) - delete(rawMsg, key) - case "privateLinkServiceConnectionState": - err = unpopulate(val, "PrivateLinkServiceConnectionState", &p.PrivateLinkServiceConnectionState) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) + case "tags": + err = unpopulate(val, "Tags", &s.Tags) 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 PrivateEndpointConnectionWithSystemData. -func (p PrivateEndpointConnectionWithSystemData) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ScalingPlanPatchProperties. +func (s ScalingPlanPatchProperties) 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, "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 PrivateEndpointConnectionWithSystemData. -func (p *PrivateEndpointConnectionWithSystemData) 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", 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 "description": + err = unpopulate(val, "Description", &s.Description) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) + case "exclusionTag": + err = unpopulate(val, "ExclusionTag", &s.ExclusionTag) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &p.Properties) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &s.FriendlyName) delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &p.SystemData) + case "hostPoolReferences": + err = unpopulate(val, "HostPoolReferences", &s.HostPoolReferences) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) + 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", p, err) + return fmt.Errorf("unmarshalling type %T: %v", s, 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 ScalingPlanPersonalSchedule. +func (s ScalingPlanPersonalSchedule) 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, "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 PrivateLinkResource. -func (p *PrivateLinkResource) 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", 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) + err = unpopulate(val, "ID", &s.ID) 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) + err = unpopulate(val, "Properties", &s.Properties) delete(rawMsg, key) case "systemData": - err = unpopulate(val, "SystemData", &p.SystemData) + err = unpopulate(val, "SystemData", &s.SystemData) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &p.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 PrivateLinkResourceListResult. -func (p PrivateLinkResourceListResult) 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, "nextLink", p.NextLink) - populate(objectMap, "value", p.Value) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) 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 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", 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) + err = unpopulate(val, "NextLink", &s.NextLink) delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &p.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 PrivateLinkResourceProperties. -func (p PrivateLinkResourceProperties) 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, "groupId", p.GroupID) - populate(objectMap, "requiredMembers", p.RequiredMembers) - populate(objectMap, "requiredZoneNames", p.RequiredZoneNames) + populate(objectMap, "properties", s.Properties) 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 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", 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) - delete(rawMsg, key) - case "requiredMembers": - err = unpopulate(val, "RequiredMembers", &p.RequiredMembers) - delete(rawMsg, key) - case "requiredZoneNames": - err = unpopulate(val, "RequiredZoneNames", &p.RequiredZoneNames) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) 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 ScalingPlanPersonalSchedulePatchProperties. +func (s ScalingPlanPersonalSchedulePatchProperties) 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, "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 PrivateLinkServiceConnectionState. -func (p *PrivateLinkServiceConnectionState) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ScalingPlanPersonalSchedulePatchProperties. +func (s *ScalingPlanPersonalSchedulePatchProperties) 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) + case "daysOfWeek": + err = unpopulate(val, "DaysOfWeek", &s.DaysOfWeek) delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &p.Description) + case "offPeakActionOnDisconnect": + err = unpopulate(val, "OffPeakActionOnDisconnect", &s.OffPeakActionOnDisconnect) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &p.Status) + 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) + 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", 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 ScalingPlanPersonalScheduleProperties. +func (s ScalingPlanPersonalScheduleProperties) 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, "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 RegistrationInfo. -func (r *RegistrationInfo) 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 "expirationTime": - err = unpopulateDateTimeRFC3339(val, "ExpirationTime", &r.ExpirationTime) + case "daysOfWeek": + err = unpopulate(val, "DaysOfWeek", &s.DaysOfWeek) delete(rawMsg, key) - case "registrationTokenOperation": - err = unpopulate(val, "RegistrationTokenOperation", &r.RegistrationTokenOperation) + case "offPeakActionOnDisconnect": + err = unpopulate(val, "OffPeakActionOnDisconnect", &s.OffPeakActionOnDisconnect) delete(rawMsg, key) - case "token": - err = unpopulate(val, "Token", &r.Token) + 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) + 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 RegistrationInfoPatch. -func (r RegistrationInfoPatch) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ScalingPlanPooledSchedule. +func (s ScalingPlanPooledSchedule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateDateTimeRFC3339(objectMap, "expirationTime", r.ExpirationTime) - populate(objectMap, "registrationTokenOperation", r.RegistrationTokenOperation) + 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 RegistrationInfoPatch. -func (r *RegistrationInfoPatch) 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 "expirationTime": - err = unpopulateDateTimeRFC3339(val, "ExpirationTime", &r.ExpirationTime) + case "id": + err = unpopulate(val, "ID", &s.ID) delete(rawMsg, key) - case "registrationTokenOperation": - err = unpopulate(val, "RegistrationTokenOperation", &r.RegistrationTokenOperation) + 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 { - 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 RegistrationTokenList. -func (r RegistrationTokenList) 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 RegistrationTokenList. -func (r *RegistrationTokenList) 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 RegistrationTokenMinimal. -func (r RegistrationTokenMinimal) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ScalingPlanPooledSchedulePatch. +func (s ScalingPlanPooledSchedulePatch) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateDateTimeRFC3339(objectMap, "expirationTime", r.ExpirationTime) - populate(objectMap, "token", r.Token) + 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 RegistrationTokenMinimal. -func (r *RegistrationTokenMinimal) 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", 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 "id": + err = unpopulate(val, "ID", &s.ID) delete(rawMsg, key) - case "token": - err = unpopulate(val, "Token", &r.Token) + case "name": + err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ResourceModelWithAllowedPropertySetIdentity. -func (r ResourceModelWithAllowedPropertySetIdentity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "principalId", r.PrincipalID) - populate(objectMap, "tenantId", r.TenantID) - objectMap["type"] = "SystemAssigned" - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceModelWithAllowedPropertySetIdentity. -func (r *ResourceModelWithAllowedPropertySetIdentity) 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 "principalId": - err = unpopulate(val, "PrincipalID", &r.PrincipalID) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) delete(rawMsg, key) - case "tenantId": - err = unpopulate(val, "TenantID", &r.TenantID) + 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 ScalingPlanPooledSchedulePatchProperties. +func (s ScalingPlanPooledSchedulePatchProperties) 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, "createDelete", s.CreateDelete) + 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, "scalingMethod", s.ScalingMethod) 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 ScalingPlanPooledSchedulePatchProperties. +func (s *ScalingPlanPooledSchedulePatchProperties) 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 "createDelete": + err = unpopulate(val, "CreateDelete", &s.CreateDelete) + delete(rawMsg, key) + case "daysOfWeek": + err = unpopulate(val, "DaysOfWeek", &s.DaysOfWeek) + delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &r.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 "product": - err = unpopulate(val, "Product", &r.Product) + case "rampDownStopHostsWhen": + err = unpopulate(val, "RampDownStopHostsWhen", &s.RampDownStopHostsWhen) delete(rawMsg, key) - case "promotionCode": - err = unpopulate(val, "PromotionCode", &r.PromotionCode) + case "rampDownWaitTimeMinutes": + err = unpopulate(val, "RampDownWaitTimeMinutes", &s.RampDownWaitTimeMinutes) delete(rawMsg, key) - case "publisher": - err = unpopulate(val, "Publisher", &r.Publisher) + case "rampUpCapacityThresholdPct": + err = unpopulate(val, "RampUpCapacityThresholdPct", &s.RampUpCapacityThresholdPct) delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &r.Version) + 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) + case "scalingMethod": + err = unpopulate(val, "ScalingMethod", &s.ScalingMethod) 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 ScalingPlanPooledScheduleProperties. +func (s ScalingPlanPooledScheduleProperties) 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, "createDelete", s.CreateDelete) + 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, "scalingMethod", s.ScalingMethod) 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 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", 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) + case "createDelete": + err = unpopulate(val, "CreateDelete", &s.CreateDelete) delete(rawMsg, key) - case "family": - err = unpopulate(val, "Family", &r.Family) + case "daysOfWeek": + err = unpopulate(val, "DaysOfWeek", &s.DaysOfWeek) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &r.Name) + err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) - case "size": - err = unpopulate(val, "Size", &r.Size) + case "offPeakLoadBalancingAlgorithm": + err = unpopulate(val, "OffPeakLoadBalancingAlgorithm", &s.OffPeakLoadBalancingAlgorithm) delete(rawMsg, key) - case "tier": - err = unpopulate(val, "Tier", &r.Tier) + case "offPeakStartTime": + err = unpopulate(val, "OffPeakStartTime", &s.OffPeakStartTime) delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ResourceProviderOperation. -func (r ResourceProviderOperation) 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) - return json.Marshal(objectMap) -} - -// 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", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "display": - err = unpopulate(val, "Display", &r.Display) + case "peakLoadBalancingAlgorithm": + err = unpopulate(val, "PeakLoadBalancingAlgorithm", &s.PeakLoadBalancingAlgorithm) delete(rawMsg, key) - case "isDataAction": - err = unpopulate(val, "IsDataAction", &r.IsDataAction) + case "peakStartTime": + err = unpopulate(val, "PeakStartTime", &s.PeakStartTime) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) + case "rampDownCapacityThresholdPct": + err = unpopulate(val, "RampDownCapacityThresholdPct", &s.RampDownCapacityThresholdPct) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &r.Properties) + 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) + case "scalingMethod": + err = unpopulate(val, "ScalingMethod", &s.ScalingMethod) 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) { +// MarshalJSON implements the json.Marshaller interface for type ScalingPlanProperties. +func (s ScalingPlanProperties) 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) + 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 ResourceProviderOperationDisplay. -func (r *ResourceProviderOperationDisplay) 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", 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) + err = unpopulate(val, "Description", &s.Description) delete(rawMsg, key) - case "operation": - err = unpopulate(val, "Operation", &r.Operation) + case "exclusionTag": + err = unpopulate(val, "ExclusionTag", &s.ExclusionTag) delete(rawMsg, key) - case "provider": - err = unpopulate(val, "Provider", &r.Provider) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &s.FriendlyName) delete(rawMsg, key) - case "resource": - err = unpopulate(val, "Resource", &r.Resource) + 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 { - 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 ScalingSchedule. +func (s ScalingSchedule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", r.NextLink) - populate(objectMap, "value", r.Value) + populate(objectMap, "createDelete", s.CreateDelete) + 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, "scalingMethod", s.ScalingMethod) 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 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", 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) + case "createDelete": + err = unpopulate(val, "CreateDelete", &s.CreateDelete) + delete(rawMsg, 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 "value": - err = unpopulate(val, "Value", &r.Value) + 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) + case "scalingMethod": + err = unpopulate(val, "ScalingMethod", &s.ScalingMethod) 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 SecurityInfoPatchProperties. +func (s SecurityInfoPatchProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "hostPoolArmPath", s.HostPoolArmPath) - populate(objectMap, "scalingPlanEnabled", s.ScalingPlanEnabled) + 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 ScalingHostPoolReference. -func (s *ScalingHostPoolReference) 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) @@ -2790,11 +4945,14 @@ 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 "secureBootEnabled": + err = unpopulate(val, "SecureBootEnabled", &s.SecureBootEnabled) delete(rawMsg, key) - case "scalingPlanEnabled": - err = unpopulate(val, "ScalingPlanEnabled", &s.ScalingPlanEnabled) + 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 { @@ -2804,27 +4962,17 @@ 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 SecurityInfoProperties. +func (s SecurityInfoProperties) 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, "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 ScalingPlan. -func (s *ScalingPlan) 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) @@ -2832,45 +4980,15 @@ 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) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &s.ID) - delete(rawMsg, key) - 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) + 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) @@ -2879,16 +4997,16 @@ 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 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 ScalingPlanList. -func (s *ScalingPlanList) 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) @@ -2896,11 +5014,11 @@ 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 "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 { @@ -2910,16 +5028,15 @@ 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 ServiceSpecification. +func (s ServiceSpecification) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "tags", s.Tags) + populate(objectMap, "logSpecifications", s.LogSpecifications) 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 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) @@ -2927,11 +5044,8 @@ 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) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &s.Tags) + case "logSpecifications": + err = unpopulate(val, "LogSpecifications", &s.LogSpecifications) delete(rawMsg, key) } if err != nil { @@ -2941,20 +5055,19 @@ 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 SessionHost. +func (s SessionHost) 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, "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 ScalingPlanPatchProperties. -func (s *ScalingPlanPatchProperties) 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) @@ -2962,23 +5075,20 @@ 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) + case "id": + err = unpopulate(val, "ID", &s.ID) delete(rawMsg, key) - case "friendlyName": - err = unpopulate(val, "FriendlyName", &s.FriendlyName) + case "name": + err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) - case "hostPoolReferences": - err = unpopulate(val, "HostPoolReferences", &s.HostPoolReferences) + 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 { @@ -2988,8 +5098,8 @@ 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 SessionHostConfiguration. +func (s SessionHostConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", s.ID) populate(objectMap, "name", s.Name) @@ -2999,8 +5109,8 @@ func (s ScalingPlanPersonalSchedule) MarshalJSON() ([]byte, error) { 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 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) @@ -3031,16 +5141,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 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 ScalingPlanPersonalScheduleList. -func (s *ScalingPlanPersonalScheduleList) 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) @@ -3062,15 +5172,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 SessionHostConfigurationPatch. +func (s SessionHostConfigurationPatch) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "properties", s.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ScalingPlanPersonalSchedulePatch. -func (s *ScalingPlanPersonalSchedulePatch) 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) @@ -3089,40 +5199,29 @@ 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 SessionHostConfigurationPatchProperties. +func (s SessionHostConfigurationPatchProperties) 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, "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 ScalingPlanPersonalScheduleProperties. -func (s *ScalingPlanPersonalScheduleProperties) 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) @@ -3130,83 +5229,141 @@ 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) + case "availabilityZones": + err = unpopulate(val, "AvailabilityZones", &s.AvailabilityZones) delete(rawMsg, key) - case "offPeakActionOnDisconnect": - err = unpopulate(val, "OffPeakActionOnDisconnect", &s.OffPeakActionOnDisconnect) + case "bootDiagnosticsInfo": + err = unpopulate(val, "BootDiagnosticsInfo", &s.BootDiagnosticsInfo) delete(rawMsg, key) - case "offPeakActionOnLogoff": - err = unpopulate(val, "OffPeakActionOnLogoff", &s.OffPeakActionOnLogoff) + case "customConfigurationScriptUrl": + err = unpopulate(val, "CustomConfigurationScriptURL", &s.CustomConfigurationScriptURL) delete(rawMsg, key) - case "offPeakMinutesToWaitOnDisconnect": - err = unpopulate(val, "OffPeakMinutesToWaitOnDisconnect", &s.OffPeakMinutesToWaitOnDisconnect) + case "diskInfo": + err = unpopulate(val, "DiskInfo", &s.DiskInfo) delete(rawMsg, key) - case "offPeakMinutesToWaitOnLogoff": - err = unpopulate(val, "OffPeakMinutesToWaitOnLogoff", &s.OffPeakMinutesToWaitOnLogoff) + case "domainInfo": + err = unpopulate(val, "DomainInfo", &s.DomainInfo) delete(rawMsg, key) - case "offPeakStartTime": - err = unpopulate(val, "OffPeakStartTime", &s.OffPeakStartTime) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &s.FriendlyName) delete(rawMsg, key) - case "offPeakStartVMOnConnect": - err = unpopulate(val, "OffPeakStartVMOnConnect", &s.OffPeakStartVMOnConnect) + case "imageInfo": + err = unpopulate(val, "ImageInfo", &s.ImageInfo) delete(rawMsg, key) - case "peakActionOnDisconnect": - err = unpopulate(val, "PeakActionOnDisconnect", &s.PeakActionOnDisconnect) + case "networkInfo": + err = unpopulate(val, "NetworkInfo", &s.NetworkInfo) delete(rawMsg, key) - case "peakActionOnLogoff": - err = unpopulate(val, "PeakActionOnLogoff", &s.PeakActionOnLogoff) + case "securityInfo": + err = unpopulate(val, "SecurityInfo", &s.SecurityInfo) delete(rawMsg, key) - case "peakMinutesToWaitOnDisconnect": - err = unpopulate(val, "PeakMinutesToWaitOnDisconnect", &s.PeakMinutesToWaitOnDisconnect) + 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) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SessionHostConfigurationProperties. +func (s SessionHostConfigurationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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, "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 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "availabilityZones": + err = unpopulate(val, "AvailabilityZones", &s.AvailabilityZones) delete(rawMsg, key) - case "peakMinutesToWaitOnLogoff": - err = unpopulate(val, "PeakMinutesToWaitOnLogoff", &s.PeakMinutesToWaitOnLogoff) + 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 "peakStartVMOnConnect": - err = unpopulate(val, "PeakStartVMOnConnect", &s.PeakStartVMOnConnect) + case "diskInfo": + err = unpopulate(val, "DiskInfo", &s.DiskInfo) delete(rawMsg, key) - case "rampDownActionOnDisconnect": - err = unpopulate(val, "RampDownActionOnDisconnect", &s.RampDownActionOnDisconnect) + case "domainInfo": + err = unpopulate(val, "DomainInfo", &s.DomainInfo) delete(rawMsg, key) - case "rampDownActionOnLogoff": - err = unpopulate(val, "RampDownActionOnLogoff", &s.RampDownActionOnLogoff) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &s.FriendlyName) delete(rawMsg, key) - case "rampDownMinutesToWaitOnDisconnect": - err = unpopulate(val, "RampDownMinutesToWaitOnDisconnect", &s.RampDownMinutesToWaitOnDisconnect) + case "imageInfo": + err = unpopulate(val, "ImageInfo", &s.ImageInfo) delete(rawMsg, key) - case "rampDownMinutesToWaitOnLogoff": - err = unpopulate(val, "RampDownMinutesToWaitOnLogoff", &s.RampDownMinutesToWaitOnLogoff) + case "networkInfo": + err = unpopulate(val, "NetworkInfo", &s.NetworkInfo) delete(rawMsg, key) - case "rampDownStartTime": - err = unpopulate(val, "RampDownStartTime", &s.RampDownStartTime) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) delete(rawMsg, key) - case "rampDownStartVMOnConnect": - err = unpopulate(val, "RampDownStartVMOnConnect", &s.RampDownStartVMOnConnect) + case "securityInfo": + err = unpopulate(val, "SecurityInfo", &s.SecurityInfo) delete(rawMsg, key) - case "rampUpActionOnDisconnect": - err = unpopulate(val, "RampUpActionOnDisconnect", &s.RampUpActionOnDisconnect) + case "vmAdminCredentials": + err = unpopulate(val, "VMAdminCredentials", &s.VMAdminCredentials) delete(rawMsg, key) - case "rampUpActionOnLogoff": - err = unpopulate(val, "RampUpActionOnLogoff", &s.RampUpActionOnLogoff) + case "vmLocation": + err = unpopulate(val, "VMLocation", &s.VMLocation) delete(rawMsg, key) - case "rampUpAutoStartHosts": - err = unpopulate(val, "RampUpAutoStartHosts", &s.RampUpAutoStartHosts) + case "vmNamePrefix": + err = unpopulate(val, "VMNamePrefix", &s.VMNamePrefix) delete(rawMsg, key) - case "rampUpMinutesToWaitOnDisconnect": - err = unpopulate(val, "RampUpMinutesToWaitOnDisconnect", &s.RampUpMinutesToWaitOnDisconnect) + case "vmResourceGroup": + err = unpopulate(val, "VMResourceGroup", &s.VMResourceGroup) delete(rawMsg, key) - case "rampUpMinutesToWaitOnLogoff": - err = unpopulate(val, "RampUpMinutesToWaitOnLogoff", &s.RampUpMinutesToWaitOnLogoff) + 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) - case "rampUpStartVMOnConnect": - err = unpopulate(val, "RampUpStartVMOnConnect", &s.RampUpStartVMOnConnect) + case "version": + err = unpopulateDateTimeRFC3339(val, "Version", &s.Version) delete(rawMsg, key) } if err != nil { @@ -3216,19 +5373,17 @@ 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 SessionHostHealthCheckFailureDetails. +func (s SessionHostHealthCheckFailureDetails) 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, "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 ScalingPlanPooledSchedule. -func (s *ScalingPlanPooledSchedule) UnmarshalJSON(data []byte) error { +// 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) @@ -3236,20 +5391,49 @@ func (s *ScalingPlanPooledSchedule) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &s.ID) + case "errorCode": + err = unpopulate(val, "ErrorCode", &s.ErrorCode) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) + case "lastHealthCheckDateTime": + err = unpopulateDateTimeRFC3339(val, "LastHealthCheckDateTime", &s.LastHealthCheckDateTime) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &s.Properties) + case "message": + err = unpopulate(val, "Message", &s.Message) delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &s.SystemData) + } + 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 "type": - err = unpopulate(val, "Type", &s.Type) + 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 { @@ -3259,16 +5443,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 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 ScalingPlanPooledScheduleList. -func (s *ScalingPlanPooledScheduleList) UnmarshalJSON(data []byte) error { +// 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) @@ -3290,8 +5474,8 @@ 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 SessionHostManagement. +func (s SessionHostManagement) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", s.ID) populate(objectMap, "name", s.Name) @@ -3301,8 +5485,8 @@ func (s ScalingPlanPooledSchedulePatch) MarshalJSON() ([]byte, error) { 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 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) @@ -3333,31 +5517,16 @@ 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 SessionHostManagementList. +func (s SessionHostManagementList) 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, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) 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 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) @@ -3365,56 +5534,11 @@ 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) - 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 { @@ -3424,22 +5548,19 @@ 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 SessionHostManagementOperationProgress. +func (s SessionHostManagementOperationProgress) 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, "hostPoolType", s.HostPoolType) - populate(objectMap, "objectId", s.ObjectID) - populate(objectMap, "schedules", s.Schedules) - populate(objectMap, "timeZone", s.TimeZone) + 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 ScalingPlanProperties. -func (s *ScalingPlanProperties) 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) @@ -3447,29 +5568,20 @@ 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) - 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 "executionStartTime": + err = unpopulateDateTimeRFC3339(val, "ExecutionStartTime", &s.ExecutionStartTime) delete(rawMsg, key) - case "hostPoolType": - err = unpopulate(val, "HostPoolType", &s.HostPoolType) + case "sessionHostsCompleted": + err = unpopulate(val, "SessionHostsCompleted", &s.SessionHostsCompleted) delete(rawMsg, key) - case "objectId": - err = unpopulate(val, "ObjectID", &s.ObjectID) + case "sessionHostsInProgress": + err = unpopulate(val, "SessionHostsInProgress", &s.SessionHostsInProgress) delete(rawMsg, key) - case "schedules": - err = unpopulate(val, "Schedules", &s.Schedules) + case "sessionHostsRollbackFailed": + err = unpopulate(val, "SessionHostsRollbackFailed", &s.SessionHostsRollbackFailed) delete(rawMsg, key) - case "timeZone": - err = unpopulate(val, "TimeZone", &s.TimeZone) + case "totalSessionHosts": + err = unpopulate(val, "TotalSessionHosts", &s.TotalSessionHosts) delete(rawMsg, key) } if err != nil { @@ -3479,32 +5591,45 @@ 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 SessionHostManagementPatch. +func (s SessionHostManagementPatch) 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, "properties", s.Properties) + return json.Marshal(objectMap) +} + +// 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SessionHostManagementPatchProperties. +func (s SessionHostManagementPatchProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "failedSessionHostCleanupPolicy", s.FailedSessionHostCleanupPolicy) + populate(objectMap, "provisioning", s.Provisioning) + populate(objectMap, "scheduledDateTimeZone", s.ScheduledDateTimeZone) + populate(objectMap, "update", s.Update) 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 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) @@ -3512,59 +5637,17 @@ 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) + case "failedSessionHostCleanupPolicy": + err = unpopulate(val, "FailedSessionHostCleanupPolicy", &s.FailedSessionHostCleanupPolicy) 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) + case "provisioning": + err = unpopulate(val, "Provisioning", &s.Provisioning) delete(rawMsg, key) - case "rampUpLoadBalancingAlgorithm": - err = unpopulate(val, "RampUpLoadBalancingAlgorithm", &s.RampUpLoadBalancingAlgorithm) - delete(rawMsg, key) - case "rampUpMinimumHostsPct": - err = unpopulate(val, "RampUpMinimumHostsPct", &s.RampUpMinimumHostsPct) + case "scheduledDateTimeZone": + err = unpopulate(val, "ScheduledDateTimeZone", &s.ScheduledDateTimeZone) delete(rawMsg, key) - case "rampUpStartTime": - err = unpopulate(val, "RampUpStartTime", &s.RampUpStartTime) + case "update": + err = unpopulate(val, "Update", &s.Update) delete(rawMsg, key) } if err != nil { @@ -3574,16 +5657,18 @@ 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 SessionHostManagementProperties. +func (s SessionHostManagementProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "messageBody", s.MessageBody) - populate(objectMap, "messageTitle", s.MessageTitle) + populate(objectMap, "failedSessionHostCleanupPolicy", s.FailedSessionHostCleanupPolicy) + populate(objectMap, "provisioning", s.Provisioning) + populate(objectMap, "scheduledDateTimeZone", s.ScheduledDateTimeZone) + populate(objectMap, "update", s.Update) 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 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) @@ -3591,11 +5676,17 @@ 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 "failedSessionHostCleanupPolicy": + err = unpopulate(val, "FailedSessionHostCleanupPolicy", &s.FailedSessionHostCleanupPolicy) delete(rawMsg, key) - case "messageTitle": - err = unpopulate(val, "MessageTitle", &s.MessageTitle) + case "provisioning": + err = unpopulate(val, "Provisioning", &s.Provisioning) + delete(rawMsg, key) + case "scheduledDateTimeZone": + err = unpopulate(val, "ScheduledDateTimeZone", &s.ScheduledDateTimeZone) + delete(rawMsg, key) + case "update": + err = unpopulate(val, "Update", &s.Update) delete(rawMsg, key) } if err != nil { @@ -3605,15 +5696,19 @@ 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 SessionHostManagementProvisioningOperationProgress. +func (s SessionHostManagementProvisioningOperationProgress) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "logSpecifications", s.LogSpecifications) + populateDateTimeRFC3339(objectMap, "executionStartTime", s.ExecutionStartTime) + populate(objectMap, "finalSessionHostsCount", s.FinalSessionHostsCount) + populate(objectMap, "initialSessionHostsCount", s.InitialSessionHostsCount) + populate(objectMap, "sessionHostsCompleted", s.SessionHostsCompleted) + populate(objectMap, "sessionHostsInProgress", s.SessionHostsInProgress) 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 SessionHostManagementProvisioningOperationProgress. +func (s *SessionHostManagementProvisioningOperationProgress) 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) @@ -3621,8 +5716,20 @@ 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 "executionStartTime": + err = unpopulateDateTimeRFC3339(val, "ExecutionStartTime", &s.ExecutionStartTime) + delete(rawMsg, key) + case "finalSessionHostsCount": + err = unpopulate(val, "FinalSessionHostsCount", &s.FinalSessionHostsCount) + delete(rawMsg, key) + case "initialSessionHostsCount": + err = unpopulate(val, "InitialSessionHostsCount", &s.InitialSessionHostsCount) + delete(rawMsg, key) + case "sessionHostsCompleted": + err = unpopulate(val, "SessionHostsCompleted", &s.SessionHostsCompleted) + delete(rawMsg, key) + case "sessionHostsInProgress": + err = unpopulate(val, "SessionHostsInProgress", &s.SessionHostsInProgress) delete(rawMsg, key) } if err != nil { @@ -3632,19 +5739,22 @@ 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 SessionHostManagementProvisioningStatus. +func (s SessionHostManagementProvisioningStatus) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + 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) - populate(objectMap, "systemData", s.SystemData) - populate(objectMap, "type", s.Type) + populateDateTimeRFC3339(objectMap, "startTime", s.StartTime) + populate(objectMap, "status", s.Status) 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 SessionHostManagementProvisioningStatus. +func (s *SessionHostManagementProvisioningStatus) 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) @@ -3652,20 +5762,29 @@ func (s *SessionHost) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "endTime": + err = unpopulateDateTimeRFC3339(val, "EndTime", &s.EndTime) + delete(rawMsg, key) + case "error": + err = unpopulate(val, "Error", &s.Error) + delete(rawMsg, key) 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 "systemData": - err = unpopulate(val, "SystemData", &s.SystemData) + case "startTime": + err = unpopulateDateTimeRFC3339(val, "StartTime", &s.StartTime) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) + case "status": + err = unpopulate(val, "Status", &s.Status) delete(rawMsg, key) } if err != nil { @@ -3675,17 +5794,18 @@ 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 SessionHostManagementProvisioningStatusProperties. +func (s SessionHostManagementProvisioningStatusProperties) 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, "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 SessionHostHealthCheckFailureDetails. -func (s *SessionHostHealthCheckFailureDetails) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SessionHostManagementProvisioningStatusProperties. +func (s *SessionHostManagementProvisioningStatusProperties) 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) @@ -3693,14 +5813,17 @@ 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) + case "correlationId": + err = unpopulate(val, "CorrelationID", &s.CorrelationID) delete(rawMsg, key) - case "lastHealthCheckDateTime": - err = unpopulateDateTimeRFC3339(val, "LastHealthCheckDateTime", &s.LastHealthCheckDateTime) + case "progress": + err = unpopulate(val, "Progress", &s.Progress) delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &s.Message) + 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 { @@ -3710,17 +5833,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) @@ -3728,14 +5856,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 { @@ -3745,16 +5888,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) @@ -3762,11 +5907,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 { @@ -3857,15 +6008,20 @@ func (s *SessionHostPatchProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SessionHostProperties. func (s SessionHostProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "activeSessions", s.ActiveSessions) populate(objectMap, "agentVersion", s.AgentVersion) populate(objectMap, "allowNewSession", s.AllowNewSession) populate(objectMap, "assignedUser", s.AssignedUser) + populate(objectMap, "disconnectedSessions", s.DisconnectedSessions) 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, "pendingSessions", s.PendingSessions) 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) @@ -3886,6 +6042,9 @@ func (s *SessionHostProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "activeSessions": + err = unpopulate(val, "ActiveSessions", &s.ActiveSessions) + delete(rawMsg, key) case "agentVersion": err = unpopulate(val, "AgentVersion", &s.AgentVersion) delete(rawMsg, key) @@ -3895,12 +6054,18 @@ func (s *SessionHostProperties) UnmarshalJSON(data []byte) error { case "assignedUser": err = unpopulate(val, "AssignedUser", &s.AssignedUser) delete(rawMsg, key) + case "disconnectedSessions": + err = unpopulate(val, "DisconnectedSessions", &s.DisconnectedSessions) + delete(rawMsg, key) case "friendlyName": err = unpopulate(val, "FriendlyName", &s.FriendlyName) delete(rawMsg, key) 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) @@ -3910,9 +6075,15 @@ func (s *SessionHostProperties) UnmarshalJSON(data []byte) error { case "objectId": err = unpopulate(val, "ObjectID", &s.ObjectID) delete(rawMsg, key) + case "pendingSessions": + err = unpopulate(val, "PendingSessions", &s.PendingSessions) + delete(rawMsg, key) 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) @@ -3945,6 +6116,76 @@ func (s *SessionHostProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type SessionHostProvisioningConfigurationPatchProperties. +func (s SessionHostProvisioningConfigurationPatchProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "canaryPolicy", s.CanaryPolicy) + populate(objectMap, "instanceCount", s.InstanceCount) + populate(objectMap, "setDrainMode", s.SetDrainMode) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SessionHostProvisioningConfigurationPatchProperties. +func (s *SessionHostProvisioningConfigurationPatchProperties) 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 "canaryPolicy": + err = unpopulate(val, "CanaryPolicy", &s.CanaryPolicy) + delete(rawMsg, key) + case "instanceCount": + err = unpopulate(val, "InstanceCount", &s.InstanceCount) + delete(rawMsg, key) + case "setDrainMode": + err = unpopulate(val, "SetDrainMode", &s.SetDrainMode) + 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 SessionHostProvisioningConfigurationProperties. +func (s SessionHostProvisioningConfigurationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "canaryPolicy", s.CanaryPolicy) + populate(objectMap, "instanceCount", s.InstanceCount) + populate(objectMap, "setDrainMode", s.SetDrainMode) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SessionHostProvisioningConfigurationProperties. +func (s *SessionHostProvisioningConfigurationProperties) 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 "canaryPolicy": + err = unpopulate(val, "CanaryPolicy", &s.CanaryPolicy) + delete(rawMsg, key) + case "instanceCount": + err = unpopulate(val, "InstanceCount", &s.InstanceCount) + delete(rawMsg, key) + case "setDrainMode": + err = unpopulate(val, "SetDrainMode", &s.SetDrainMode) + 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 StartMenuItem. func (s StartMenuItem) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -4140,6 +6381,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) @@ -4498,6 +6805,16 @@ func populate(m map[string]any, k string, v any) { } } +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 diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/msiximages_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/msiximages_client.go index 4f2da2cdb18e..432a3bc06d6b 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/msiximages_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/msiximages_client.go @@ -1,6 +1,3 @@ -//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. @@ -45,7 +42,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 2024-04-03 +// Generated from API version 2025-03-01-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 @@ -74,7 +71,7 @@ func (client *MsixImagesClient) NewExpandPager(resourceGroupName string, hostPoo } // expandCreateRequest creates the Expand request. -func (client *MsixImagesClient) expandCreateRequest(ctx context.Context, resourceGroupName string, hostPoolName string, msixImageURI MSIXImageURI, options *MsixImagesClientExpandOptions) (*policy.Request, error) { +func (client *MsixImagesClient) expandCreateRequest(ctx context.Context, resourceGroupName string, hostPoolName string, msixImageURI MSIXImageURI, _ *MsixImagesClientExpandOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/expandMsixImage" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -93,7 +90,7 @@ func (client *MsixImagesClient) expandCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-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 c0d2b8398357..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/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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/msixImage"), - // 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/msixImageURI"), - // 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 42b618003f2c..fa233d90f9c2 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/msixpackages_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/msixpackages_client.go @@ -1,6 +1,3 @@ -//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. @@ -47,7 +44,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 2024-04-03 +// Generated from API version 2025-03-01-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 @@ -77,7 +74,7 @@ func (client *MSIXPackagesClient) CreateOrUpdate(ctx context.Context, resourceGr } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *MSIXPackagesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, hostPoolName string, msixPackageFullName string, msixPackage MSIXPackage, options *MSIXPackagesClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *MSIXPackagesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, hostPoolName string, msixPackageFullName string, msixPackage MSIXPackage, _ *MSIXPackagesClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/msixPackages/{msixPackageFullName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -100,7 +97,7 @@ func (client *MSIXPackagesClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, msixPackage); err != nil { @@ -121,7 +118,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 2024-04-03 +// Generated from API version 2025-03-01-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 @@ -148,7 +145,7 @@ func (client *MSIXPackagesClient) Delete(ctx context.Context, resourceGroupName } // deleteCreateRequest creates the Delete request. -func (client *MSIXPackagesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, hostPoolName string, msixPackageFullName string, options *MSIXPackagesClientDeleteOptions) (*policy.Request, error) { +func (client *MSIXPackagesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, hostPoolName string, msixPackageFullName string, _ *MSIXPackagesClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/msixPackages/{msixPackageFullName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -171,7 +168,7 @@ func (client *MSIXPackagesClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -180,7 +177,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 2024-04-03 +// Generated from API version 2025-03-01-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 @@ -208,7 +205,7 @@ func (client *MSIXPackagesClient) Get(ctx context.Context, resourceGroupName str } // getCreateRequest creates the Get request. -func (client *MSIXPackagesClient) getCreateRequest(ctx context.Context, resourceGroupName string, hostPoolName string, msixPackageFullName string, options *MSIXPackagesClientGetOptions) (*policy.Request, error) { +func (client *MSIXPackagesClient) getCreateRequest(ctx context.Context, resourceGroupName string, hostPoolName string, msixPackageFullName string, _ *MSIXPackagesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/msixPackages/{msixPackageFullName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -231,7 +228,7 @@ func (client *MSIXPackagesClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -248,7 +245,7 @@ func (client *MSIXPackagesClient) getHandleResponse(resp *http.Response) (MSIXPa // NewListPager - List MSIX packages in hostpool. // -// Generated from API version 2024-04-03 +// Generated from API version 2025-03-01-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,7 +292,7 @@ func (client *MSIXPackagesClient) listCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-preview") if options != nil && options.InitialSkip != nil { reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) } @@ -322,7 +319,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 2024-04-03 +// Generated from API version 2025-03-01-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 +370,7 @@ func (client *MSIXPackagesClient) updateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-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 1beedb4413f7..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/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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"), - // 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), - // }, - // 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"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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"), - // 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), - // }, - // 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"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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"), - // 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), - // }, - // 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"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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"), - // 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), - // }, - // 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"), - // }, - // }, - // { - // 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"), - // 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), - // }, - // 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"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/operations_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/operations_client.go index fb32651e4b4a..1e23546396fe 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/operations_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/operations_client.go @@ -1,6 +1,3 @@ -//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. @@ -39,7 +36,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 2024-04-03 +// Generated from API version 2025-03-01-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]{ @@ -65,14 +62,14 @@ func (client *OperationsClient) NewListPager(options *OperationsClientListOption } // listCreateRequest creates the List request. -func (client *OperationsClient) listCreateRequest(ctx context.Context, options *OperationsClientListOptions) (*policy.Request, error) { +func (client *OperationsClient) listCreateRequest(ctx context.Context, _ *OperationsClientListOptions) (*policy.Request, error) { urlPath := "/providers/Microsoft.DesktopVirtualization/operations" 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-03") + reqQP.Set("api-version", "2025-03-01-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 2f62a98686b0..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/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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 6286b8439eee..2bfff3440add 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/options.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/options.go @@ -1,6 +1,3 @@ -//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. @@ -8,6 +5,18 @@ 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 { @@ -16,7 +25,8 @@ type AppAttachPackageClientCreateOrUpdateOptions struct { // AppAttachPackageClientDeleteOptions contains the optional parameters for the AppAttachPackageClient.Delete method. type AppAttachPackageClientDeleteOptions struct { - // placeholder for future optional parameters + // Force flag to delete App Attach package. + Force *bool } // AppAttachPackageClientGetOptions contains the optional parameters for the AppAttachPackageClient.Get method. @@ -27,14 +37,15 @@ type AppAttachPackageClientGetOptions struct { // AppAttachPackageClientListByResourceGroupOptions contains the optional parameters for the AppAttachPackageClient.NewListByResourceGroupPager // method. type AppAttachPackageClientListByResourceGroupOptions struct { - // OData filter expression. Valid properties for filtering are package name and host pool. + // 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, host pool, and resource group. + // OData filter expression. Valid properties for filtering are package name, resource group, host pool, package owner name, + // and custom data. Filter *string } @@ -128,6 +139,20 @@ type ApplicationsClientUpdateOptions struct { Application *ApplicationPatch } +// ControlSessionHostProvisioningClientBeginPostOptions contains the optional parameters for the ControlSessionHostProvisioningClient.BeginPost +// method. +type ControlSessionHostProvisioningClientBeginPostOptions struct { + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// ControlSessionHostUpdateClientBeginPostOptions contains the optional parameters for the ControlSessionHostUpdateClient.BeginPost +// method. +type ControlSessionHostUpdateClientBeginPostOptions struct { + // Resumes the long-running operation from the provided token. + ResumeToken string +} + // DesktopsClientGetOptions contains the optional parameters for the DesktopsClient.Get method. type DesktopsClientGetOptions struct { // placeholder for future optional parameters @@ -210,6 +235,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 @@ -470,6 +502,77 @@ 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 long-running operation from the provided token. + ResumeToken string +} + +// SessionHostConfigurationsClientBeginUpdateOptions contains the optional parameters for the SessionHostConfigurationsClient.BeginUpdate +// method. +type SessionHostConfigurationsClientBeginUpdateOptions struct { + // Resumes the long-running operation 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 +} + +// SessionHostProvisioningStatusesClientGetOptions contains the optional parameters for the SessionHostProvisioningStatusesClient.Get +// method. +type SessionHostProvisioningStatusesClientGetOptions 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. @@ -491,6 +594,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 71e55c8e667c..3fa2e816220b 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/privateendpointconnections_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/privateendpointconnections_client.go @@ -1,6 +1,3 @@ -//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. @@ -47,7 +44,7 @@ func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcor // DeleteByHostPool - Remove a connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-03 +// Generated from API version 2025-03-01-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. @@ -75,7 +72,7 @@ func (client *PrivateEndpointConnectionsClient) DeleteByHostPool(ctx context.Con } // deleteByHostPoolCreateRequest creates the DeleteByHostPool request. -func (client *PrivateEndpointConnectionsClient) deleteByHostPoolCreateRequest(ctx context.Context, resourceGroupName string, hostPoolName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientDeleteByHostPoolOptions) (*policy.Request, error) { +func (client *PrivateEndpointConnectionsClient) deleteByHostPoolCreateRequest(ctx context.Context, resourceGroupName string, hostPoolName string, privateEndpointConnectionName string, _ *PrivateEndpointConnectionsClientDeleteByHostPoolOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/privateEndpointConnections/{privateEndpointConnectionName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -98,7 +95,7 @@ func (client *PrivateEndpointConnectionsClient) deleteByHostPoolCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -107,7 +104,7 @@ func (client *PrivateEndpointConnectionsClient) deleteByHostPoolCreateRequest(ct // DeleteByWorkspace - Remove a connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-03 +// Generated from API version 2025-03-01-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. @@ -135,7 +132,7 @@ func (client *PrivateEndpointConnectionsClient) DeleteByWorkspace(ctx context.Co } // deleteByWorkspaceCreateRequest creates the DeleteByWorkspace request. -func (client *PrivateEndpointConnectionsClient) deleteByWorkspaceCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientDeleteByWorkspaceOptions) (*policy.Request, error) { +func (client *PrivateEndpointConnectionsClient) deleteByWorkspaceCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string, _ *PrivateEndpointConnectionsClientDeleteByWorkspaceOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -158,7 +155,7 @@ func (client *PrivateEndpointConnectionsClient) deleteByWorkspaceCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -167,7 +164,7 @@ 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 2024-04-03 +// Generated from API version 2025-03-01-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. @@ -196,7 +193,7 @@ func (client *PrivateEndpointConnectionsClient) GetByHostPool(ctx context.Contex } // getByHostPoolCreateRequest creates the GetByHostPool request. -func (client *PrivateEndpointConnectionsClient) getByHostPoolCreateRequest(ctx context.Context, resourceGroupName string, hostPoolName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientGetByHostPoolOptions) (*policy.Request, error) { +func (client *PrivateEndpointConnectionsClient) getByHostPoolCreateRequest(ctx context.Context, resourceGroupName string, hostPoolName string, privateEndpointConnectionName string, _ *PrivateEndpointConnectionsClientGetByHostPoolOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/privateEndpointConnections/{privateEndpointConnectionName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -219,7 +216,7 @@ func (client *PrivateEndpointConnectionsClient) getByHostPoolCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -237,7 +234,7 @@ 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 2024-04-03 +// Generated from API version 2025-03-01-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. @@ -266,7 +263,7 @@ func (client *PrivateEndpointConnectionsClient) GetByWorkspace(ctx context.Conte } // getByWorkspaceCreateRequest creates the GetByWorkspace request. -func (client *PrivateEndpointConnectionsClient) getByWorkspaceCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientGetByWorkspaceOptions) (*policy.Request, error) { +func (client *PrivateEndpointConnectionsClient) getByWorkspaceCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string, _ *PrivateEndpointConnectionsClientGetByWorkspaceOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -289,7 +286,7 @@ func (client *PrivateEndpointConnectionsClient) getByWorkspaceCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -306,7 +303,7 @@ func (client *PrivateEndpointConnectionsClient) getByWorkspaceHandleResponse(res // NewListByHostPoolPager - List private endpoint connections associated with hostpool. // -// Generated from API version 2024-04-03 +// Generated from API version 2025-03-01-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,7 +351,7 @@ func (client *PrivateEndpointConnectionsClient) listByHostPoolCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-preview") if options != nil && options.InitialSkip != nil { reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) } @@ -380,7 +377,7 @@ func (client *PrivateEndpointConnectionsClient) listByHostPoolHandleResponse(res // NewListByWorkspacePager - List private endpoint connections. // -// Generated from API version 2024-04-03 +// Generated from API version 2025-03-01-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 @@ -409,7 +406,7 @@ func (client *PrivateEndpointConnectionsClient) NewListByWorkspacePager(resource } // listByWorkspaceCreateRequest creates the ListByWorkspace request. -func (client *PrivateEndpointConnectionsClient) listByWorkspaceCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, options *PrivateEndpointConnectionsClientListByWorkspaceOptions) (*policy.Request, error) { +func (client *PrivateEndpointConnectionsClient) listByWorkspaceCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, _ *PrivateEndpointConnectionsClientListByWorkspaceOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}/privateEndpointConnections" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -428,7 +425,7 @@ func (client *PrivateEndpointConnectionsClient) listByWorkspaceCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -446,7 +443,7 @@ 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 2024-04-03 +// Generated from API version 2025-03-01-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. @@ -476,7 +473,7 @@ func (client *PrivateEndpointConnectionsClient) UpdateByHostPool(ctx context.Con } // updateByHostPoolCreateRequest creates the UpdateByHostPool request. -func (client *PrivateEndpointConnectionsClient) updateByHostPoolCreateRequest(ctx context.Context, resourceGroupName string, hostPoolName string, privateEndpointConnectionName string, connection PrivateEndpointConnection, options *PrivateEndpointConnectionsClientUpdateByHostPoolOptions) (*policy.Request, error) { +func (client *PrivateEndpointConnectionsClient) updateByHostPoolCreateRequest(ctx context.Context, resourceGroupName string, hostPoolName string, privateEndpointConnectionName string, connection PrivateEndpointConnection, _ *PrivateEndpointConnectionsClientUpdateByHostPoolOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/privateEndpointConnections/{privateEndpointConnectionName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -499,7 +496,7 @@ func (client *PrivateEndpointConnectionsClient) updateByHostPoolCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, connection); err != nil { @@ -520,7 +517,7 @@ 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 2024-04-03 +// Generated from API version 2025-03-01-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. @@ -550,7 +547,7 @@ func (client *PrivateEndpointConnectionsClient) UpdateByWorkspace(ctx context.Co } // updateByWorkspaceCreateRequest creates the UpdateByWorkspace request. -func (client *PrivateEndpointConnectionsClient) updateByWorkspaceCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string, connection PrivateEndpointConnection, options *PrivateEndpointConnectionsClientUpdateByWorkspaceOptions) (*policy.Request, error) { +func (client *PrivateEndpointConnectionsClient) updateByWorkspaceCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string, connection PrivateEndpointConnection, _ *PrivateEndpointConnectionsClientUpdateByWorkspaceOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -573,7 +570,7 @@ func (client *PrivateEndpointConnectionsClient) updateByWorkspaceCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-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 1709c4e70566..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/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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"), - // 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), - // }, - // 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), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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"), - // 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), - // }, - // 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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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"), - // 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), - // }, - // 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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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"), - // 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), - // }, - // 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), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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"), - // 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), - // }, - // 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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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"), - // 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), - // }, - // 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), - // }, - // } -} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/privatelinkresources_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/privatelinkresources_client.go index b91d03f6b883..521e8374071f 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/privatelinkresources_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/privatelinkresources_client.go @@ -1,6 +1,3 @@ -//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. @@ -46,7 +43,7 @@ func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.Toke // NewListByHostPoolPager - List the private link resources available for this hostpool. // -// Generated from API version 2024-04-03 +// Generated from API version 2025-03-01-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,7 +91,7 @@ func (client *PrivateLinkResourcesClient) listByHostPoolCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-preview") if options != nil && options.InitialSkip != nil { reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) } @@ -120,7 +117,7 @@ func (client *PrivateLinkResourcesClient) listByHostPoolHandleResponse(resp *htt // NewListByWorkspacePager - List the private link resources available for this workspace. // -// Generated from API version 2024-04-03 +// Generated from API version 2025-03-01-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,7 +165,7 @@ func (client *PrivateLinkResourcesClient) listByWorkspaceCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-preview") if options != nil && options.InitialSkip != nil { reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) } 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 9550415f9e54..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/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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/responses.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/responses.go index 5fa018a66edf..737fda02fcd5 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/responses.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/responses.go @@ -1,6 +1,3 @@ -//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. @@ -8,6 +5,19 @@ 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. @@ -113,6 +123,16 @@ type ApplicationsClientUpdateResponse struct { Application } +// ControlSessionHostProvisioningClientPostResponse contains the response from method ControlSessionHostProvisioningClient.BeginPost. +type ControlSessionHostProvisioningClientPostResponse struct { + // placeholder for future response values +} + +// 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. @@ -168,7 +188,8 @@ type HostPoolsClientListResponse struct { // HostPoolsClientRetrieveRegistrationTokenResponse contains the response from method HostPoolsClient.RetrieveRegistrationToken. type HostPoolsClientRetrieveRegistrationTokenResponse struct { - // Represents a RegistrationInfo definition. + // Represents a RegistrationInfo definition. This is not returned on HostPool GET. In order to get the registration token + // use the retrieveRegistrationToken or listRegistrationTokens POST calls. RegistrationInfo } @@ -178,6 +199,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. @@ -376,6 +402,71 @@ 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 +} + +// SessionHostProvisioningStatusesClientGetResponse contains the response from method SessionHostProvisioningStatusesClient.Get. +type SessionHostProvisioningStatusesClientGetResponse struct { + // The current status of the session host provisioning async operation. + SessionHostManagementProvisioningStatus +} + // 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 e9dc0c107d05..eb9af9d01552 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/scalingplanpersonalschedules_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/scalingplanpersonalschedules_client.go @@ -1,6 +1,3 @@ -//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. @@ -47,7 +44,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 2024-04-03 +// Generated from API version 2025-03-01-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 @@ -77,7 +74,7 @@ func (client *ScalingPlanPersonalSchedulesClient) Create(ctx context.Context, re } // createCreateRequest creates the Create request. -func (client *ScalingPlanPersonalSchedulesClient) createCreateRequest(ctx context.Context, resourceGroupName string, scalingPlanName string, scalingPlanScheduleName string, scalingPlanSchedule ScalingPlanPersonalSchedule, options *ScalingPlanPersonalSchedulesClientCreateOptions) (*policy.Request, error) { +func (client *ScalingPlanPersonalSchedulesClient) createCreateRequest(ctx context.Context, resourceGroupName string, scalingPlanName string, scalingPlanScheduleName string, scalingPlanSchedule ScalingPlanPersonalSchedule, _ *ScalingPlanPersonalSchedulesClientCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/personalSchedules/{scalingPlanScheduleName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -100,7 +97,7 @@ func (client *ScalingPlanPersonalSchedulesClient) createCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, scalingPlanSchedule); err != nil { @@ -121,7 +118,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 2024-04-03 +// Generated from API version 2025-03-01-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 @@ -149,7 +146,7 @@ func (client *ScalingPlanPersonalSchedulesClient) Delete(ctx context.Context, re } // deleteCreateRequest creates the Delete request. -func (client *ScalingPlanPersonalSchedulesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, scalingPlanName string, scalingPlanScheduleName string, options *ScalingPlanPersonalSchedulesClientDeleteOptions) (*policy.Request, error) { +func (client *ScalingPlanPersonalSchedulesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, scalingPlanName string, scalingPlanScheduleName string, _ *ScalingPlanPersonalSchedulesClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/personalSchedules/{scalingPlanScheduleName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -172,7 +169,7 @@ func (client *ScalingPlanPersonalSchedulesClient) deleteCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -181,7 +178,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 2024-04-03 +// Generated from API version 2025-03-01-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 @@ -210,7 +207,7 @@ func (client *ScalingPlanPersonalSchedulesClient) Get(ctx context.Context, resou } // getCreateRequest creates the Get request. -func (client *ScalingPlanPersonalSchedulesClient) getCreateRequest(ctx context.Context, resourceGroupName string, scalingPlanName string, scalingPlanScheduleName string, options *ScalingPlanPersonalSchedulesClientGetOptions) (*policy.Request, error) { +func (client *ScalingPlanPersonalSchedulesClient) getCreateRequest(ctx context.Context, resourceGroupName string, scalingPlanName string, scalingPlanScheduleName string, _ *ScalingPlanPersonalSchedulesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/personalSchedules/{scalingPlanScheduleName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -233,7 +230,7 @@ func (client *ScalingPlanPersonalSchedulesClient) getCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -250,7 +247,7 @@ func (client *ScalingPlanPersonalSchedulesClient) getHandleResponse(resp *http.R // NewListPager - List ScalingPlanPersonalSchedules. // -// Generated from API version 2024-04-03 +// Generated from API version 2025-03-01-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,7 +295,7 @@ func (client *ScalingPlanPersonalSchedulesClient) listCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-preview") if options != nil && options.InitialSkip != nil { reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) } @@ -325,7 +322,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 2024-04-03 +// Generated from API version 2025-03-01-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 +374,7 @@ func (client *ScalingPlanPersonalSchedulesClient) updateCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-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 5dc012634f67..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/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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"), - // 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), - // }, - // 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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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"), - // 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), - // }, - // 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), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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"), - // 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), - // }, - // 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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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"), - // 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), - // }, - // 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), - // }, - // }, - // { - // 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"), - // 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), - // }, - // 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), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/scalingplanpooledschedules_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/scalingplanpooledschedules_client.go index e1cec540e936..f8e09e7acd5b 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/scalingplanpooledschedules_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/scalingplanpooledschedules_client.go @@ -1,6 +1,3 @@ -//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. @@ -47,7 +44,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 2024-04-03 +// Generated from API version 2025-03-01-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 @@ -77,7 +74,7 @@ func (client *ScalingPlanPooledSchedulesClient) Create(ctx context.Context, reso } // createCreateRequest creates the Create request. -func (client *ScalingPlanPooledSchedulesClient) createCreateRequest(ctx context.Context, resourceGroupName string, scalingPlanName string, scalingPlanScheduleName string, scalingPlanSchedule ScalingPlanPooledSchedule, options *ScalingPlanPooledSchedulesClientCreateOptions) (*policy.Request, error) { +func (client *ScalingPlanPooledSchedulesClient) createCreateRequest(ctx context.Context, resourceGroupName string, scalingPlanName string, scalingPlanScheduleName string, scalingPlanSchedule ScalingPlanPooledSchedule, _ *ScalingPlanPooledSchedulesClientCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/pooledSchedules/{scalingPlanScheduleName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -100,7 +97,7 @@ func (client *ScalingPlanPooledSchedulesClient) createCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, scalingPlanSchedule); err != nil { @@ -121,7 +118,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 2024-04-03 +// Generated from API version 2025-03-01-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 @@ -149,7 +146,7 @@ func (client *ScalingPlanPooledSchedulesClient) Delete(ctx context.Context, reso } // deleteCreateRequest creates the Delete request. -func (client *ScalingPlanPooledSchedulesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, scalingPlanName string, scalingPlanScheduleName string, options *ScalingPlanPooledSchedulesClientDeleteOptions) (*policy.Request, error) { +func (client *ScalingPlanPooledSchedulesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, scalingPlanName string, scalingPlanScheduleName string, _ *ScalingPlanPooledSchedulesClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/pooledSchedules/{scalingPlanScheduleName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -172,7 +169,7 @@ func (client *ScalingPlanPooledSchedulesClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -181,7 +178,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 2024-04-03 +// Generated from API version 2025-03-01-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 @@ -210,7 +207,7 @@ func (client *ScalingPlanPooledSchedulesClient) Get(ctx context.Context, resourc } // getCreateRequest creates the Get request. -func (client *ScalingPlanPooledSchedulesClient) getCreateRequest(ctx context.Context, resourceGroupName string, scalingPlanName string, scalingPlanScheduleName string, options *ScalingPlanPooledSchedulesClientGetOptions) (*policy.Request, error) { +func (client *ScalingPlanPooledSchedulesClient) getCreateRequest(ctx context.Context, resourceGroupName string, scalingPlanName string, scalingPlanScheduleName string, _ *ScalingPlanPooledSchedulesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/pooledSchedules/{scalingPlanScheduleName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -233,7 +230,7 @@ func (client *ScalingPlanPooledSchedulesClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -250,7 +247,7 @@ func (client *ScalingPlanPooledSchedulesClient) getHandleResponse(resp *http.Res // NewListPager - List ScalingPlanPooledSchedules. // -// Generated from API version 2024-04-03 +// Generated from API version 2025-03-01-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,7 +295,7 @@ func (client *ScalingPlanPooledSchedulesClient) listCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-preview") if options != nil && options.InitialSkip != nil { reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) } @@ -325,7 +322,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 2024-04-03 +// Generated from API version 2025-03-01-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 +374,7 @@ func (client *ScalingPlanPooledSchedulesClient) updateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-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 204cd6fe587f..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/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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"), - // 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), - // }, - // 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), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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"), - // 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), - // }, - // 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), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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"), - // 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), - // }, - // 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), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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"), - // 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), - // }, - // 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), - // }, - // }, - // }, - // { - // 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"), - // 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), - // }, - // 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), - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/scalingplans_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/scalingplans_client.go index 4d09094bf124..3d02aba89ba8 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/scalingplans_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/scalingplans_client.go @@ -1,6 +1,3 @@ -//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. @@ -47,7 +44,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 2024-04-03 +// Generated from API version 2025-03-01-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. @@ -75,7 +72,7 @@ func (client *ScalingPlansClient) Create(ctx context.Context, resourceGroupName } // createCreateRequest creates the Create request. -func (client *ScalingPlansClient) createCreateRequest(ctx context.Context, resourceGroupName string, scalingPlanName string, scalingPlan ScalingPlan, options *ScalingPlansClientCreateOptions) (*policy.Request, error) { +func (client *ScalingPlansClient) createCreateRequest(ctx context.Context, resourceGroupName string, scalingPlanName string, scalingPlan ScalingPlan, _ *ScalingPlansClientCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -94,7 +91,7 @@ func (client *ScalingPlansClient) createCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, scalingPlan); err != nil { @@ -115,7 +112,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 2024-04-03 +// Generated from API version 2025-03-01-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. @@ -141,7 +138,7 @@ func (client *ScalingPlansClient) Delete(ctx context.Context, resourceGroupName } // deleteCreateRequest creates the Delete request. -func (client *ScalingPlansClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, scalingPlanName string, options *ScalingPlansClientDeleteOptions) (*policy.Request, error) { +func (client *ScalingPlansClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, scalingPlanName string, _ *ScalingPlansClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -160,7 +157,7 @@ func (client *ScalingPlansClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -169,7 +166,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 2024-04-03 +// Generated from API version 2025-03-01-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. @@ -196,7 +193,7 @@ func (client *ScalingPlansClient) Get(ctx context.Context, resourceGroupName str } // getCreateRequest creates the Get request. -func (client *ScalingPlansClient) getCreateRequest(ctx context.Context, resourceGroupName string, scalingPlanName string, options *ScalingPlansClientGetOptions) (*policy.Request, error) { +func (client *ScalingPlansClient) getCreateRequest(ctx context.Context, resourceGroupName string, scalingPlanName string, _ *ScalingPlansClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -215,7 +212,7 @@ func (client *ScalingPlansClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -232,7 +229,7 @@ func (client *ScalingPlansClient) getHandleResponse(resp *http.Response) (Scalin // NewListByHostPoolPager - List scaling plan associated with hostpool. // -// Generated from API version 2024-04-03 +// Generated from API version 2025-03-01-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,7 +277,7 @@ func (client *ScalingPlansClient) listByHostPoolCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-preview") if options != nil && options.InitialSkip != nil { reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) } @@ -306,7 +303,7 @@ func (client *ScalingPlansClient) listByHostPoolHandleResponse(resp *http.Respon // NewListByResourceGroupPager - List scaling plans. // -// Generated from API version 2024-04-03 +// Generated from API version 2025-03-01-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,7 +346,7 @@ func (client *ScalingPlansClient) listByResourceGroupCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-preview") if options != nil && options.InitialSkip != nil { reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) } @@ -375,7 +372,7 @@ func (client *ScalingPlansClient) listByResourceGroupHandleResponse(resp *http.R // NewListBySubscriptionPager - List scaling plans in subscription. // -// Generated from API version 2024-04-03 +// Generated from API version 2025-03-01-preview // - options - ScalingPlansClientListBySubscriptionOptions contains the optional parameters for the ScalingPlansClient.NewListBySubscriptionPager // method. func (client *ScalingPlansClient) NewListBySubscriptionPager(options *ScalingPlansClientListBySubscriptionOptions) *runtime.Pager[ScalingPlansClientListBySubscriptionResponse] { @@ -413,7 +410,7 @@ func (client *ScalingPlansClient) listBySubscriptionCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-preview") if options != nil && options.InitialSkip != nil { reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) } @@ -440,7 +437,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 2024-04-03 +// Generated from API version 2025-03-01-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 +483,7 @@ func (client *ScalingPlansClient) updateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-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 ff96f0b0d9b9..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/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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"), - // 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), - // }, - // 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"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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"), - // 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), - // }, - // 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"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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"), - // 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), - // }, - // 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"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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"), - // 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), - // }, - // 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"), - // }, - // }, - // { - // 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"), - // 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), - // }, - // 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"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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"), - // 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), - // }, - // 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"), - // }, - // }, - // { - // 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"), - // 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), - // }, - // 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"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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"), - // 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), - // }, - // 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"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/sessionhost_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/sessionhost_client.go new file mode 100644 index 000000000000..1a1db4712815 --- /dev/null +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/sessionhost_client.go @@ -0,0 +1,101 @@ +// 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 2025-03-01-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, _ *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", "2025-03-01-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..0ce383995504 --- /dev/null +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/sessionhostconfigurations_client.go @@ -0,0 +1,335 @@ +// 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 2025-03-01-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 2025-03-01-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, _ *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", "2025-03-01-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 2025-03-01-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, _ *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", "2025-03-01-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 2025-03-01-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, _ *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", "2025-03-01-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 2025-03-01-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 2025-03-01-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", "2025-03-01-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..f6521206838c --- /dev/null +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/sessionhostmanagements_client.go @@ -0,0 +1,311 @@ +// 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 2025-03-01-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, _ *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", "2025-03-01-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 2025-03-01-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, _ *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", "2025-03-01-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 2025-03-01-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, _ *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", "2025-03-01-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 2025-03-01-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", "2025-03-01-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..42f98adc8374 --- /dev/null +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/sessionhostmanagementsupdatestatus_client.go @@ -0,0 +1,106 @@ +// 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 2025-03-01-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, _ *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", "2025-03-01-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/sessionhostprovisioningstatuses_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/sessionhostprovisioningstatuses_client.go new file mode 100644 index 000000000000..6b1210225111 --- /dev/null +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/sessionhostprovisioningstatuses_client.go @@ -0,0 +1,106 @@ +// 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" +) + +// SessionHostProvisioningStatusesClient contains the methods for the SessionHostProvisioningStatuses group. +// Don't use this type directly, use NewSessionHostProvisioningStatusesClient() instead. +type SessionHostProvisioningStatusesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewSessionHostProvisioningStatusesClient creates a new instance of SessionHostProvisioningStatusesClient 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 NewSessionHostProvisioningStatusesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SessionHostProvisioningStatusesClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &SessionHostProvisioningStatusesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Get - Get the session host provisioning status for a given hostpool. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-03-01-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 - SessionHostProvisioningStatusesClientGetOptions contains the optional parameters for the SessionHostProvisioningStatusesClient.Get +// method. +func (client *SessionHostProvisioningStatusesClient) Get(ctx context.Context, resourceGroupName string, hostPoolName string, options *SessionHostProvisioningStatusesClientGetOptions) (SessionHostProvisioningStatusesClientGetResponse, error) { + var err error + const operationName = "SessionHostProvisioningStatusesClient.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 SessionHostProvisioningStatusesClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return SessionHostProvisioningStatusesClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SessionHostProvisioningStatusesClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *SessionHostProvisioningStatusesClient) getCreateRequest(ctx context.Context, resourceGroupName string, hostPoolName string, _ *SessionHostProvisioningStatusesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostManagements/default/sessionHostProvisioningStatuses/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", "2025-03-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *SessionHostProvisioningStatusesClient) getHandleResponse(resp *http.Response) (SessionHostProvisioningStatusesClientGetResponse, error) { + result := SessionHostProvisioningStatusesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SessionHostManagementProvisioningStatus); err != nil { + return SessionHostProvisioningStatusesClientGetResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/sessionhosts_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/sessionhosts_client.go index 5d8dc813dbc9..73071a996e46 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/sessionhosts_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/sessionhosts_client.go @@ -1,6 +1,3 @@ -//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. @@ -47,7 +44,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 2024-04-03 +// Generated from API version 2025-03-01-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 +94,7 @@ func (client *SessionHostsClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-preview") if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } @@ -109,7 +106,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 2024-04-03 +// Generated from API version 2025-03-01-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 @@ -137,7 +134,7 @@ func (client *SessionHostsClient) Get(ctx context.Context, resourceGroupName str } // getCreateRequest creates the Get request. -func (client *SessionHostsClient) getCreateRequest(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string, options *SessionHostsClientGetOptions) (*policy.Request, error) { +func (client *SessionHostsClient) getCreateRequest(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string, _ *SessionHostsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -160,7 +157,7 @@ func (client *SessionHostsClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -177,7 +174,7 @@ func (client *SessionHostsClient) getHandleResponse(resp *http.Response) (Sessio // NewListPager - List sessionHosts. // -// Generated from API version 2024-04-03 +// Generated from API version 2025-03-01-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,7 +221,7 @@ func (client *SessionHostsClient) listCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-preview") if options != nil && options.InitialSkip != nil { reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) } @@ -234,6 +231,9 @@ func (client *SessionHostsClient) listCreateRequest(ctx context.Context, resourc 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"} return req, nil @@ -251,7 +251,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 2024-04-03 +// Generated from API version 2025-03-01-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 +302,7 @@ func (client *SessionHostsClient) updateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-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 3832638ab68c..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/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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"), - // 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), - // }, - // 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"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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"), - // 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), - // }, - // 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"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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"), - // 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), - // }, - // 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"), - // }, - // }, - // { - // 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"), - // 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), - // }, - // 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"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/startmenuitems_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/startmenuitems_client.go index 25dafcf22916..dc291eb8a174 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/startmenuitems_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/startmenuitems_client.go @@ -1,6 +1,3 @@ -//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. @@ -46,7 +43,7 @@ func NewStartMenuItemsClient(subscriptionID string, credential azcore.TokenCrede // NewListPager - List start menu items in the given application group. // -// Generated from API version 2024-04-03 +// Generated from API version 2025-03-01-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,7 +90,7 @@ func (client *StartMenuItemsClient) listCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-preview") if options != nil && options.InitialSkip != nil { reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) } 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 6e6d5e651bf3..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/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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 20977df2306f..ff35dae086f1 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/time_rfc3339.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/time_rfc3339.go @@ -1,6 +1,3 @@ -//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. @@ -60,6 +57,9 @@ func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { } func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { + if len(data) == 0 { + return nil + } tzOffset := tzOffsetRegex.Match(data) hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") var layout string diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/usersessions_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/usersessions_client.go index ea0966cf3c07..5da71162d1a8 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/usersessions_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/usersessions_client.go @@ -1,6 +1,3 @@ -//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. @@ -47,7 +44,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 2024-04-03 +// Generated from API version 2025-03-01-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 +99,7 @@ func (client *UserSessionsClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-preview") if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } @@ -114,7 +111,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 2024-04-03 +// Generated from API version 2025-03-01-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 @@ -142,7 +139,7 @@ func (client *UserSessionsClient) Disconnect(ctx context.Context, resourceGroupN } // disconnectCreateRequest creates the Disconnect request. -func (client *UserSessionsClient) disconnectCreateRequest(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string, userSessionID string, options *UserSessionsClientDisconnectOptions) (*policy.Request, error) { +func (client *UserSessionsClient) disconnectCreateRequest(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string, userSessionID string, _ *UserSessionsClientDisconnectOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/userSessions/{userSessionId}/disconnect" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -169,7 +166,7 @@ func (client *UserSessionsClient) disconnectCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -178,7 +175,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 2024-04-03 +// Generated from API version 2025-03-01-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 @@ -207,7 +204,7 @@ func (client *UserSessionsClient) Get(ctx context.Context, resourceGroupName str } // getCreateRequest creates the Get request. -func (client *UserSessionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string, userSessionID string, options *UserSessionsClientGetOptions) (*policy.Request, error) { +func (client *UserSessionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string, userSessionID string, _ *UserSessionsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/userSessions/{userSessionId}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -234,7 +231,7 @@ func (client *UserSessionsClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -251,7 +248,7 @@ func (client *UserSessionsClient) getHandleResponse(resp *http.Response) (UserSe // NewListPager - List userSessions. // -// Generated from API version 2024-04-03 +// Generated from API version 2025-03-01-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,7 +300,7 @@ func (client *UserSessionsClient) listCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-preview") if options != nil && options.InitialSkip != nil { reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) } @@ -329,7 +326,7 @@ func (client *UserSessionsClient) listHandleResponse(resp *http.Response) (UserS // NewListByHostPoolPager - List userSessions. // -// Generated from API version 2024-04-03 +// Generated from API version 2025-03-01-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 @@ -380,7 +377,7 @@ func (client *UserSessionsClient) listByHostPoolCreateRequest(ctx context.Contex if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-preview") if options != nil && options.InitialSkip != nil { reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) } @@ -407,7 +404,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 2024-04-03 +// Generated from API version 2025-03-01-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 +460,7 @@ func (client *UserSessionsClient) sendMessageCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-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 a6020fd3987f..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/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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"), - // 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), - // }, - // 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"), - // }, - // }, - // { - // 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"), - // 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), - // }, - // 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"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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"), - // 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), - // }, - // 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"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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"), - // 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), - // }, - // 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"), - // }, - // }, - // { - // 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"), - // 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), - // }, - // 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"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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 b42ebc4c4544..0c1e341583e9 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/workspaces_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/workspaces_client.go @@ -1,6 +1,3 @@ -//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. @@ -47,7 +44,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 2024-04-03 +// Generated from API version 2025-03-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - The name of the workspace // - workspace - Object containing Workspace definitions. @@ -76,7 +73,7 @@ func (client *WorkspacesClient) CreateOrUpdate(ctx context.Context, resourceGrou } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *WorkspacesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, workspace Workspace, options *WorkspacesClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *WorkspacesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, workspace Workspace, _ *WorkspacesClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -95,7 +92,7 @@ func (client *WorkspacesClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, workspace); err != nil { @@ -116,7 +113,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 2024-04-03 +// Generated from API version 2025-03-01-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. @@ -142,7 +139,7 @@ func (client *WorkspacesClient) Delete(ctx context.Context, resourceGroupName st } // deleteCreateRequest creates the Delete request. -func (client *WorkspacesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, options *WorkspacesClientDeleteOptions) (*policy.Request, error) { +func (client *WorkspacesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, _ *WorkspacesClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -161,7 +158,7 @@ func (client *WorkspacesClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -170,7 +167,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 2024-04-03 +// Generated from API version 2025-03-01-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. @@ -197,7 +194,7 @@ func (client *WorkspacesClient) Get(ctx context.Context, resourceGroupName strin } // getCreateRequest creates the Get request. -func (client *WorkspacesClient) getCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, options *WorkspacesClientGetOptions) (*policy.Request, error) { +func (client *WorkspacesClient) getCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, _ *WorkspacesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -216,7 +213,7 @@ func (client *WorkspacesClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -233,7 +230,7 @@ func (client *WorkspacesClient) getHandleResponse(resp *http.Response) (Workspac // NewListByResourceGroupPager - List workspaces. // -// Generated from API version 2024-04-03 +// Generated from API version 2025-03-01-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,7 +273,7 @@ func (client *WorkspacesClient) listByResourceGroupCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-preview") if options != nil && options.InitialSkip != nil { reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) } @@ -302,7 +299,7 @@ func (client *WorkspacesClient) listByResourceGroupHandleResponse(resp *http.Res // NewListBySubscriptionPager - List workspaces in subscription. // -// Generated from API version 2024-04-03 +// Generated from API version 2025-03-01-preview // - options - WorkspacesClientListBySubscriptionOptions contains the optional parameters for the WorkspacesClient.NewListBySubscriptionPager // method. func (client *WorkspacesClient) NewListBySubscriptionPager(options *WorkspacesClientListBySubscriptionOptions) *runtime.Pager[WorkspacesClientListBySubscriptionResponse] { @@ -329,7 +326,7 @@ func (client *WorkspacesClient) NewListBySubscriptionPager(options *WorkspacesCl } // listBySubscriptionCreateRequest creates the ListBySubscription request. -func (client *WorkspacesClient) listBySubscriptionCreateRequest(ctx context.Context, options *WorkspacesClientListBySubscriptionOptions) (*policy.Request, error) { +func (client *WorkspacesClient) listBySubscriptionCreateRequest(ctx context.Context, _ *WorkspacesClientListBySubscriptionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DesktopVirtualization/workspaces" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -340,7 +337,7 @@ func (client *WorkspacesClient) listBySubscriptionCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -358,7 +355,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 2024-04-03 +// Generated from API version 2025-03-01-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 +401,7 @@ func (client *WorkspacesClient) updateCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-03") + reqQP.Set("api-version", "2025-03-01-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 fcdf362632ae..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/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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"), - // 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), - // }, - // 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"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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"), - // 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), - // }, - // 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"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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"), - // 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), - // }, - // 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"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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"), - // 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), - // }, - // 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"), - // }, - // }, - // { - // 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"), - // 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), - // }, - // 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"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4883fa5dbf6f2c9093fac8ce334547e9dfac68fa/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/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"), - // 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), - // }, - // 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"), - // }, - // }, - // { - // 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"), - // 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), - // }, - // 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"), - // }, - // }}, - // } - } -}