From d98c5cc52fb6edbe969ab0e95ae9ebeb615fd2f8 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 4 Nov 2022 01:36:55 +0000 Subject: [PATCH] CodeGen from PR 20683 in Azure/azure-rest-api-specs Release desktopvirtualization microsoft.desktop virtualization 2022 09 09 (#20683) * Adds base for updating Microsoft.DesktopVirtualization from version preview/2022-04-01-preview to version 2022-09-09 * Updates readme * Updates API version in new specs and examples * remove privateLink references * add agentUpdate back to hostPool * remove migrationRequest property * add paginationHelper to workspace * update pagination helper to be in query * fix iconContent examples to be base64 * update byte strings to be actual encoded strings so they pass validation --- .../armdesktopvirtualization/CHANGELOG.md | 186 +- ..._client.go => applicationgroups_client.go} | 37 +- ...tions_client.go => applications_client.go} | 32 +- .../armdesktopvirtualization/autorest.md | 6 +- ...zz_generated_constants.go => constants.go} | 118 +- ..._desktops_client.go => desktops_client.go} | 24 +- .../armdesktopvirtualization/go.mod | 14 +- .../armdesktopvirtualization/go.sum | 24 +- ...ostpools_client.go => hostpools_client.go} | 49 +- .../{zz_generated_models.go => models.go} | 509 ++- .../armdesktopvirtualization/models_serde.go | 3744 +++++++++++++++++ ...ximages_client.go => msiximages_client.go} | 6 +- ...kages_client.go => msixpackages_client.go} | 32 +- ...rations_client.go => operations_client.go} | 6 +- ...ed_response_types.go => response_types.go} | 54 +- .../scalingplanpooledschedules_client.go | 378 ++ ...plans_client.go => scalingplans_client.go} | 60 +- ...hosts_client.go => sessionhosts_client.go} | 27 +- ...ems_client.go => startmenuitems_client.go} | 16 +- ...erated_time_rfc3339.go => time_rfc3339.go} | 1 + ...sions_client.go => usersessions_client.go} | 45 +- ...kspaces_client.go => workspaces_client.go} | 37 +- ...d_example_applicationgroups_client_test.go | 180 - ...erated_example_applications_client_test.go | 159 - ..._generated_example_desktops_client_test.go | 96 - ...generated_example_hostpools_client_test.go | 260 -- ...enerated_example_msiximages_client_test.go | 47 - ...erated_example_msixpackages_client_test.go | 172 - ...enerated_example_operations_client_test.go | 41 - ..._privateendpointconnections_client_test.go | 222 - ...xample_privatelinkresources_client_test.go | 69 - ...erated_example_scalingplans_client_test.go | 235 -- ...erated_example_sessionhosts_client_test.go | 119 - ...ated_example_startmenuitems_client_test.go | 43 - ...erated_example_usersessions_client_test.go | 165 - ...enerated_example_workspaces_client_test.go | 175 - .../zz_generated_models_serde.go | 947 ----- ...rated_privateendpointconnections_client.go | 551 --- ...z_generated_privatelinkresources_client.go | 195 - 39 files changed, 4751 insertions(+), 4330 deletions(-) rename sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/{zz_generated_applicationgroups_client.go => applicationgroups_client.go} (95%) rename sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/{zz_generated_applications_client.go => applications_client.go} (95%) rename sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/{zz_generated_constants.go => constants.go} (81%) rename sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/{zz_generated_desktops_client.go => desktops_client.go} (94%) rename sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/{zz_generated_hostpools_client.go => hostpools_client.go} (93%) rename sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/{zz_generated_models.go => models.go} (86%) create mode 100644 sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/models_serde.go rename sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/{zz_generated_msiximages_client.go => msiximages_client.go} (96%) rename sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/{zz_generated_msixpackages_client.go => msixpackages_client.go} (95%) rename sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/{zz_generated_operations_client.go => operations_client.go} (95%) rename sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/{zz_generated_response_types.go => response_types.go} (79%) create mode 100644 sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/scalingplanpooledschedules_client.go rename sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/{zz_generated_scalingplans_client.go => scalingplans_client.go} (92%) rename sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/{zz_generated_sessionhosts_client.go => sessionhosts_client.go} (95%) rename sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/{zz_generated_startmenuitems_client.go => startmenuitems_client.go} (91%) rename sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/{zz_generated_time_rfc3339.go => time_rfc3339.go} (99%) rename sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/{zz_generated_usersessions_client.go => usersessions_client.go} (94%) rename sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/{zz_generated_workspaces_client.go => workspaces_client.go} (95%) delete mode 100644 sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_applicationgroups_client_test.go delete mode 100644 sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_applications_client_test.go delete mode 100644 sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_desktops_client_test.go delete mode 100644 sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_hostpools_client_test.go delete mode 100644 sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_msiximages_client_test.go delete mode 100644 sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_msixpackages_client_test.go delete mode 100644 sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_operations_client_test.go delete mode 100644 sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_privateendpointconnections_client_test.go delete mode 100644 sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_privatelinkresources_client_test.go delete mode 100644 sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_scalingplans_client_test.go delete mode 100644 sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_sessionhosts_client_test.go delete mode 100644 sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_startmenuitems_client_test.go delete mode 100644 sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_usersessions_client_test.go delete mode 100644 sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_workspaces_client_test.go delete mode 100644 sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_models_serde.go delete mode 100644 sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_privateendpointconnections_client.go delete mode 100644 sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_privatelinkresources_client.go diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/CHANGELOG.md b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/CHANGELOG.md index 53959b69a7a0..c58288b0f93a 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/CHANGELOG.md +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/CHANGELOG.md @@ -1,118 +1,138 @@ # Release History -## 2.0.0-beta.1 (2022-05-24) +## 2.0.0 (2022-11-04) ### Breaking Changes -- Type of `ScalingSchedule.RampUpStartTime` has been changed from `*time.Time` to `*Time` -- Type of `ScalingSchedule.RampDownStartTime` has been changed from `*time.Time` to `*Time` +- Type of `ScalingPlanProperties.HostPoolType` has been changed from `*HostPoolType` to `*ScalingHostPoolType` - Type of `ScalingSchedule.OffPeakStartTime` has been changed from `*time.Time` to `*Time` +- Type of `ScalingSchedule.RampDownStartTime` has been changed from `*time.Time` to `*Time` - Type of `ScalingSchedule.PeakStartTime` has been changed from `*time.Time` to `*Time` -- Type of `ScalingPlanProperties.HostPoolType` has been changed from `*HostPoolType` to `*ScalingHostPoolType` -- Function `*DesktopsClient.List` has been removed -- Function `*ScalingSchedule.UnmarshalJSON` has been removed +- Type of `ScalingSchedule.RampUpStartTime` has been changed from `*time.Time` to `*Time` +- Const `OperationUnhide` has been removed +- Const `OperationHide` has been removed +- Const `OperationStart` has been removed +- Const `OperationRevoke` has been removed +- Const `OperationComplete` has been removed +- Type alias `Operation` has been removed +- Function `PossibleOperationValues` has been removed - Function `*OperationsClient.List` has been removed +- Function `*DesktopsClient.List` has been removed +- Struct `CloudError` has been removed +- Struct `MigrationRequestProperties` has been removed - Field `HostPoolType` of struct `ScalingPlanPatchProperties` has been removed +- Field `MigrationRequest` of struct `ApplicationGroupProperties` has been removed +- Field `MigrationRequest` of struct `HostPoolProperties` has been removed ### Features Added -- New const `PrivateEndpointServiceConnectionStatusRejected` -- New const `HostpoolPublicNetworkAccessEnabledForClientsOnly` -- New const `DayOfWeekMonday` +- New const `CreatedByTypeKey` - New const `CreatedByTypeApplication` -- New const `HostpoolPublicNetworkAccessEnabled` -- New const `PublicNetworkAccessDisabled` -- New const `DayOfWeekSunday` -- New const `DayOfWeekSaturday` - New const `DayOfWeekFriday` +- New const `DayOfWeekWednesday` +- New const `CreatedByTypeUser` +- New const `DayOfWeekMonday` - New const `ScalingHostPoolTypePooled` -- New const `PrivateEndpointConnectionProvisioningStateDeleting` - New const `SessionHostComponentUpdateTypeScheduled` -- New const `PrivateEndpointConnectionProvisioningStateSucceeded` -- New const `PrivateEndpointServiceConnectionStatusApproved` -- New const `PrivateEndpointConnectionProvisioningStateCreating` -- New const `PrivateEndpointConnectionProvisioningStateFailed` -- New const `HostpoolPublicNetworkAccessEnabledForSessionHostsOnly` - New const `DayOfWeekThursday` -- New const `CreatedByTypeKey` -- New const `PrivateEndpointServiceConnectionStatusPending` +- New const `DayOfWeekSaturday` +- New const `DayOfWeekSunday` - New const `SessionHostComponentUpdateTypeDefault` - New const `DayOfWeekTuesday` -- New const `HostpoolPublicNetworkAccessDisabled` -- New const `PublicNetworkAccessEnabled` - New const `CreatedByTypeManagedIdentity` -- New const `DayOfWeekWednesday` -- New const `CreatedByTypeUser` -- New function `PossibleDayOfWeekValues() []DayOfWeek` +- New type alias `CreatedByType` +- New type alias `SessionHostComponentUpdateType` +- New type alias `DayOfWeek` +- New type alias `ScalingHostPoolType` +- New function `*ScalingPlanPooledSchedulesClient.NewListPager(string, string, *ScalingPlanPooledSchedulesClientListOptions) *runtime.Pager[ScalingPlanPooledSchedulesClientListResponse]` +- New function `NewScalingPlanPooledSchedulesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ScalingPlanPooledSchedulesClient, error)` +- New function `*ScalingPlanPooledSchedulesClient.Create(context.Context, string, string, string, ScalingPlanPooledSchedule, *ScalingPlanPooledSchedulesClientCreateOptions) (ScalingPlanPooledSchedulesClientCreateResponse, error)` - New function `*DesktopsClient.NewListPager(string, string, *DesktopsClientListOptions) *runtime.Pager[DesktopsClientListResponse]` -- New function `PossibleCreatedByTypeValues() []CreatedByType` -- New function `AgentUpdatePatchProperties.MarshalJSON() ([]byte, error)` -- New function `PossiblePublicNetworkAccessValues() []PublicNetworkAccess` +- New function `PossibleSessionHostComponentUpdateTypeValues() []SessionHostComponentUpdateType` +- New function `*ScalingPlanPooledSchedulesClient.Update(context.Context, string, string, string, *ScalingPlanPooledSchedulesClientUpdateOptions) (ScalingPlanPooledSchedulesClientUpdateResponse, error)` +- New function `*ScalingPlanPooledSchedulesClient.Get(context.Context, string, string, string, *ScalingPlanPooledSchedulesClientGetOptions) (ScalingPlanPooledSchedulesClientGetResponse, error)` +- New function `PossibleDayOfWeekValues() []DayOfWeek` - New function `PossibleScalingHostPoolTypeValues() []ScalingHostPoolType` -- New function `PossiblePrivateEndpointServiceConnectionStatusValues() []PrivateEndpointServiceConnectionStatus` -- New function `AgentUpdateProperties.MarshalJSON() ([]byte, error)` -- New function `PossiblePrivateEndpointConnectionProvisioningStateValues() []PrivateEndpointConnectionProvisioningState` -- New function `SystemData.MarshalJSON() ([]byte, error)` -- New function `*SystemData.UnmarshalJSON([]byte) error` +- New function `*ScalingPlanPooledSchedulesClient.Delete(context.Context, string, string, string, *ScalingPlanPooledSchedulesClientDeleteOptions) (ScalingPlanPooledSchedulesClientDeleteResponse, error)` - New function `*OperationsClient.NewListPager(*OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse]` -- New function `PossibleSessionHostComponentUpdateTypeValues() []SessionHostComponentUpdateType` -- New function `PrivateLinkResourceProperties.MarshalJSON() ([]byte, error)` -- New function `PossibleHostpoolPublicNetworkAccessValues() []HostpoolPublicNetworkAccess` +- New function `PossibleCreatedByTypeValues() []CreatedByType` - New struct `AgentUpdatePatchProperties` - New struct `AgentUpdateProperties` - New struct `MaintenanceWindowPatchProperties` - New struct `MaintenanceWindowProperties` -- New struct `PrivateEndpoint` -- New struct `PrivateEndpointConnection` -- New struct `PrivateEndpointConnectionListResultWithSystemData` -- New struct `PrivateEndpointConnectionProperties` -- New struct `PrivateEndpointConnectionWithSystemData` -- New struct `PrivateEndpointConnectionsClientDeleteByHostPoolOptions` -- New struct `PrivateEndpointConnectionsClientDeleteByHostPoolResponse` -- New struct `PrivateEndpointConnectionsClientDeleteByWorkspaceOptions` -- New struct `PrivateEndpointConnectionsClientDeleteByWorkspaceResponse` -- New struct `PrivateEndpointConnectionsClientGetByHostPoolOptions` -- New struct `PrivateEndpointConnectionsClientGetByHostPoolResponse` -- New struct `PrivateEndpointConnectionsClientGetByWorkspaceOptions` -- New struct `PrivateEndpointConnectionsClientGetByWorkspaceResponse` -- New struct `PrivateEndpointConnectionsClientListByHostPoolOptions` -- New struct `PrivateEndpointConnectionsClientListByHostPoolResponse` -- New struct `PrivateEndpointConnectionsClientListByWorkspaceOptions` -- New struct `PrivateEndpointConnectionsClientListByWorkspaceResponse` -- New struct `PrivateEndpointConnectionsClientUpdateByHostPoolOptions` -- New struct `PrivateEndpointConnectionsClientUpdateByHostPoolResponse` -- New struct `PrivateEndpointConnectionsClientUpdateByWorkspaceOptions` -- New struct `PrivateEndpointConnectionsClientUpdateByWorkspaceResponse` -- New struct `PrivateLinkResource` -- New struct `PrivateLinkResourceListResult` -- New struct `PrivateLinkResourceProperties` -- New struct `PrivateLinkResourcesClientListByHostPoolOptions` -- New struct `PrivateLinkResourcesClientListByHostPoolResponse` -- New struct `PrivateLinkResourcesClientListByWorkspaceOptions` -- New struct `PrivateLinkResourcesClientListByWorkspaceResponse` -- New struct `PrivateLinkServiceConnectionState` +- New struct `ScalingPlanPooledSchedule` +- New struct `ScalingPlanPooledScheduleList` +- New struct `ScalingPlanPooledSchedulePatch` +- New struct `ScalingPlanPooledScheduleProperties` +- New struct `ScalingPlanPooledSchedulesClient` +- New struct `ScalingPlanPooledSchedulesClientCreateOptions` +- New struct `ScalingPlanPooledSchedulesClientCreateResponse` +- New struct `ScalingPlanPooledSchedulesClientDeleteOptions` +- New struct `ScalingPlanPooledSchedulesClientDeleteResponse` +- New struct `ScalingPlanPooledSchedulesClientGetOptions` +- New struct `ScalingPlanPooledSchedulesClientGetResponse` +- New struct `ScalingPlanPooledSchedulesClientListOptions` +- New struct `ScalingPlanPooledSchedulesClientListResponse` +- New struct `ScalingPlanPooledSchedulesClientUpdateOptions` +- New struct `ScalingPlanPooledSchedulesClientUpdateResponse` - New struct `SystemData` - New struct `Time` -- New field `FriendlyName` in struct `SessionHostProperties` -- New field `SystemData` in struct `UserSession` -- New field `PublicNetworkAccess` in struct `HostPoolPatchProperties` -- New field `AgentUpdate` in struct `HostPoolPatchProperties` +- New field `SystemData` in struct `ApplicationGroup` +- New field `PageSize` in struct `ScalingPlansClientListBySubscriptionOptions` +- New field `InitialSkip` in struct `ScalingPlansClientListBySubscriptionOptions` +- New field `IsDescending` in struct `ScalingPlansClientListBySubscriptionOptions` +- New field `SystemData` in struct `Desktop` +- New field `PageSize` in struct `HostPoolsClientListByResourceGroupOptions` +- New field `InitialSkip` in struct `HostPoolsClientListByResourceGroupOptions` +- New field `IsDescending` in struct `HostPoolsClientListByResourceGroupOptions` +- New field `InitialSkip` in struct `SessionHostsClientListOptions` +- New field `IsDescending` in struct `SessionHostsClientListOptions` +- New field `PageSize` in struct `SessionHostsClientListOptions` +- New field `PageSize` in struct `ScalingPlansClientListByHostPoolOptions` +- New field `InitialSkip` in struct `ScalingPlansClientListByHostPoolOptions` +- New field `IsDescending` in struct `ScalingPlansClientListByHostPoolOptions` +- New field `FriendlyName` in struct `SessionHostPatchProperties` +- New field `SystemData` in struct `ScalingPlan` +- New field `PageSize` in struct `ScalingPlansClientListByResourceGroupOptions` +- New field `InitialSkip` in struct `ScalingPlansClientListByResourceGroupOptions` +- New field `IsDescending` in struct `ScalingPlansClientListByResourceGroupOptions` +- New field `PageSize` in struct `HostPoolsClientListOptions` +- New field `InitialSkip` in struct `HostPoolsClientListOptions` +- New field `IsDescending` in struct `HostPoolsClientListOptions` +- New field `SystemData` in struct `Application` - New field `NextLink` in struct `ResourceProviderOperationList` +- New field `IsDescending` in struct `UserSessionsClientListByHostPoolOptions` +- New field `PageSize` in struct `UserSessionsClientListByHostPoolOptions` +- New field `InitialSkip` in struct `UserSessionsClientListByHostPoolOptions` +- New field `Force` in struct `SessionHostsClientUpdateOptions` +- New field `AgentUpdate` in struct `HostPoolProperties` +- New field `IsDescending` in struct `WorkspacesClientListByResourceGroupOptions` +- New field `PageSize` in struct `WorkspacesClientListByResourceGroupOptions` +- New field `InitialSkip` in struct `WorkspacesClientListByResourceGroupOptions` - New field `SystemData` in struct `SessionHost` +- New field `SystemData` in struct `UserSession` - New field `SystemData` in struct `MSIXPackage` -- New field `PrivateEndpointConnections` in struct `WorkspaceProperties` -- New field `PublicNetworkAccess` in struct `WorkspaceProperties` -- New field `SystemData` in struct `Workspace` -- New field `SystemData` in struct `Application` -- New field `SystemData` in struct `ScalingPlan` -- New field `PublicNetworkAccess` in struct `HostPoolProperties` -- New field `PrivateEndpointConnections` in struct `HostPoolProperties` -- New field `AgentUpdate` in struct `HostPoolProperties` -- New field `PublicNetworkAccess` in struct `WorkspacePatchProperties` -- New field `Force` in struct `SessionHostsClientUpdateOptions` -- New field `FriendlyName` in struct `SessionHostPatchProperties` -- New field `SystemData` in struct `ApplicationGroup` -- New field `SystemData` in struct `Desktop` +- New field `InitialSkip` in struct `DesktopsClientListOptions` +- New field `IsDescending` in struct `DesktopsClientListOptions` +- New field `PageSize` in struct `DesktopsClientListOptions` +- New field `IsDescending` in struct `UserSessionsClientListOptions` +- New field `PageSize` in struct `UserSessionsClientListOptions` +- New field `InitialSkip` in struct `UserSessionsClientListOptions` - New field `SystemData` in struct `HostPool` +- New field `SystemData` in struct `Workspace` +- New field `InitialSkip` in struct `MSIXPackagesClientListOptions` +- New field `IsDescending` in struct `MSIXPackagesClientListOptions` +- New field `PageSize` in struct `MSIXPackagesClientListOptions` +- New field `IsDescending` in struct `StartMenuItemsClientListOptions` +- New field `PageSize` in struct `StartMenuItemsClientListOptions` +- New field `InitialSkip` in struct `StartMenuItemsClientListOptions` +- New field `AgentUpdate` in struct `HostPoolPatchProperties` +- New field `InitialSkip` in struct `ApplicationsClientListOptions` +- New field `IsDescending` in struct `ApplicationsClientListOptions` +- New field `PageSize` in struct `ApplicationsClientListOptions` +- New field `FriendlyName` in struct `SessionHostProperties` +- New field `InitialSkip` in struct `ApplicationGroupsClientListByResourceGroupOptions` +- New field `IsDescending` in struct `ApplicationGroupsClientListByResourceGroupOptions` +- New field `PageSize` in struct `ApplicationGroupsClientListByResourceGroupOptions` ## 1.0.0 (2022-05-18) diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_applicationgroups_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/applicationgroups_client.go similarity index 95% rename from sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_applicationgroups_client.go rename to sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/applicationgroups_client.go index e5ad763dc9e0..297a8f2ad762 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_applicationgroups_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/applicationgroups_client.go @@ -5,6 +5,7 @@ // 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 @@ -19,6 +20,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" "net/url" + "strconv" "strings" ) @@ -56,7 +58,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 2022-02-10-preview +// Generated from API version 2022-09-09 // resourceGroupName - The name of the resource group. The name is case insensitive. // applicationGroupName - The name of the application group // applicationGroup - Object containing ApplicationGroup definitions. @@ -97,7 +99,7 @@ func (client *ApplicationGroupsClient) createOrUpdateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-10-preview") + reqQP.Set("api-version", "2022-09-09") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, applicationGroup) @@ -114,7 +116,7 @@ func (client *ApplicationGroupsClient) createOrUpdateHandleResponse(resp *http.R // Delete - Remove an applicationGroup. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-10-preview +// Generated from API version 2022-09-09 // 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 @@ -154,7 +156,7 @@ func (client *ApplicationGroupsClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-10-preview") + reqQP.Set("api-version", "2022-09-09") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -162,7 +164,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 2022-02-10-preview +// Generated from API version 2022-09-09 // 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. @@ -201,7 +203,7 @@ func (client *ApplicationGroupsClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-10-preview") + reqQP.Set("api-version", "2022-09-09") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -217,8 +219,7 @@ func (client *ApplicationGroupsClient) getHandleResponse(resp *http.Response) (A } // NewListByResourceGroupPager - List applicationGroups. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-10-preview +// Generated from API version 2022-09-09 // resourceGroupName - The name of the resource group. The name is case insensitive. // options - ApplicationGroupsClientListByResourceGroupOptions contains the optional parameters for the ApplicationGroupsClient.ListByResourceGroup // method. @@ -266,10 +267,19 @@ func (client *ApplicationGroupsClient) listByResourceGroupCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-10-preview") + reqQP.Set("api-version", "2022-09-09") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } + if options != nil && options.PageSize != nil { + reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) + } + if options != nil && options.IsDescending != nil { + reqQP.Set("isDescending", strconv.FormatBool(*options.IsDescending)) + } + if options != nil && options.InitialSkip != nil { + reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) + } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -285,8 +295,7 @@ func (client *ApplicationGroupsClient) listByResourceGroupHandleResponse(resp *h } // NewListBySubscriptionPager - List applicationGroups in subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-10-preview +// Generated from API version 2022-09-09 // options - ApplicationGroupsClientListBySubscriptionOptions contains the optional parameters for the ApplicationGroupsClient.ListBySubscription // method. func (client *ApplicationGroupsClient) NewListBySubscriptionPager(options *ApplicationGroupsClientListBySubscriptionOptions) *runtime.Pager[ApplicationGroupsClientListBySubscriptionResponse] { @@ -329,7 +338,7 @@ func (client *ApplicationGroupsClient) listBySubscriptionCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-10-preview") + reqQP.Set("api-version", "2022-09-09") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -349,7 +358,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 2022-02-10-preview +// Generated from API version 2022-09-09 // 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 @@ -389,7 +398,7 @@ func (client *ApplicationGroupsClient) updateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-10-preview") + reqQP.Set("api-version", "2022-09-09") 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/zz_generated_applications_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/applications_client.go similarity index 95% rename from sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_applications_client.go rename to sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/applications_client.go index 8f53b2ee9d46..5f23efc4c081 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_applications_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/applications_client.go @@ -5,6 +5,7 @@ // 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 @@ -19,6 +20,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" "net/url" + "strconv" "strings" ) @@ -56,7 +58,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 2022-02-10-preview +// Generated from API version 2022-09-09 // 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 @@ -102,7 +104,7 @@ func (client *ApplicationsClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-10-preview") + reqQP.Set("api-version", "2022-09-09") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, application) @@ -119,7 +121,7 @@ func (client *ApplicationsClient) createOrUpdateHandleResponse(resp *http.Respon // Delete - Remove an application. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-10-preview +// Generated from API version 2022-09-09 // 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 @@ -163,7 +165,7 @@ func (client *ApplicationsClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-10-preview") + reqQP.Set("api-version", "2022-09-09") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -171,7 +173,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 2022-02-10-preview +// Generated from API version 2022-09-09 // 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 @@ -215,7 +217,7 @@ func (client *ApplicationsClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-10-preview") + reqQP.Set("api-version", "2022-09-09") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -231,8 +233,7 @@ func (client *ApplicationsClient) getHandleResponse(resp *http.Response) (Applic } // NewListPager - List applications. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-10-preview +// Generated from API version 2022-09-09 // 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.List method. @@ -284,7 +285,16 @@ func (client *ApplicationsClient) listCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-10-preview") + reqQP.Set("api-version", "2022-09-09") + if options != nil && options.PageSize != nil { + reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) + } + if options != nil && options.IsDescending != nil { + reqQP.Set("isDescending", strconv.FormatBool(*options.IsDescending)) + } + if options != nil && options.InitialSkip != nil { + reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) + } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -301,7 +311,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 2022-02-10-preview +// Generated from API version 2022-09-09 // 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 @@ -345,7 +355,7 @@ func (client *ApplicationsClient) updateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-10-preview") + reqQP.Set("api-version", "2022-09-09") 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/autorest.md b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/autorest.md index b396b914d509..0dbdea4bb34c 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/autorest.md +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/autorest.md @@ -5,8 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/792db17291c758b2bfdbbc0d35d0e2f5b5a1bd05/specification/desktopvirtualization/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/792db17291c758b2bfdbbc0d35d0e2f5b5a1bd05/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.0.0-beta.1 +module-version: 2.0.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_constants.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/constants.go similarity index 81% rename from sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_constants.go rename to sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/constants.go index 27b2696b8bda..c5a5e85c6c98 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_constants.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/constants.go @@ -5,12 +5,13 @@ // 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 const ( moduleName = "armdesktopvirtualization" - moduleVersion = "v2.0.0-beta.1" + moduleVersion = "v2.0.0" ) // ApplicationGroupType - Resource Type of ApplicationGroup. @@ -84,7 +85,7 @@ func PossibleCreatedByTypeValues() []CreatedByType { } } -// DayOfWeek - The day of the week (Monday-Sunday). +// DayOfWeek - Day of the week. type DayOfWeek string const ( @@ -225,27 +226,6 @@ func PossibleHostPoolTypeValues() []HostPoolType { } } -// 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 - -const ( - HostpoolPublicNetworkAccessDisabled HostpoolPublicNetworkAccess = "Disabled" - HostpoolPublicNetworkAccessEnabled HostpoolPublicNetworkAccess = "Enabled" - HostpoolPublicNetworkAccessEnabledForClientsOnly HostpoolPublicNetworkAccess = "EnabledForClientsOnly" - HostpoolPublicNetworkAccessEnabledForSessionHostsOnly HostpoolPublicNetworkAccess = "EnabledForSessionHostsOnly" -) - -// PossibleHostpoolPublicNetworkAccessValues returns the possible values for the HostpoolPublicNetworkAccess const type. -func PossibleHostpoolPublicNetworkAccessValues() []HostpoolPublicNetworkAccess { - return []HostpoolPublicNetworkAccess{ - HostpoolPublicNetworkAccessDisabled, - HostpoolPublicNetworkAccessEnabled, - HostpoolPublicNetworkAccessEnabledForClientsOnly, - HostpoolPublicNetworkAccessEnabledForSessionHostsOnly, - } -} - // LoadBalancerType - The type of the load balancer. type LoadBalancerType string @@ -264,33 +244,6 @@ func PossibleLoadBalancerTypeValues() []LoadBalancerType { } } -// Operation - The type of operation for migration. -type Operation string - -const ( - // OperationComplete - Complete the migration. - OperationComplete Operation = "Complete" - // OperationHide - Hide the hostpool. - OperationHide Operation = "Hide" - // OperationRevoke - Revoke the migration. - OperationRevoke Operation = "Revoke" - // OperationStart - Start the migration. - OperationStart Operation = "Start" - // OperationUnhide - Unhide the hostpool. - OperationUnhide Operation = "Unhide" -) - -// PossibleOperationValues returns the possible values for the Operation const type. -func PossibleOperationValues() []Operation { - return []Operation{ - OperationComplete, - OperationHide, - OperationRevoke, - OperationStart, - OperationUnhide, - } -} - // PersonalDesktopAssignmentType - PersonalDesktopAssignment type for HostPool. type PersonalDesktopAssignmentType string @@ -325,61 +278,6 @@ func PossiblePreferredAppGroupTypeValues() []PreferredAppGroupType { } } -// PrivateEndpointConnectionProvisioningState - The current provisioning state. -type PrivateEndpointConnectionProvisioningState string - -const ( - PrivateEndpointConnectionProvisioningStateCreating PrivateEndpointConnectionProvisioningState = "Creating" - PrivateEndpointConnectionProvisioningStateDeleting PrivateEndpointConnectionProvisioningState = "Deleting" - PrivateEndpointConnectionProvisioningStateFailed PrivateEndpointConnectionProvisioningState = "Failed" - PrivateEndpointConnectionProvisioningStateSucceeded PrivateEndpointConnectionProvisioningState = "Succeeded" -) - -// PossiblePrivateEndpointConnectionProvisioningStateValues returns the possible values for the PrivateEndpointConnectionProvisioningState const type. -func PossiblePrivateEndpointConnectionProvisioningStateValues() []PrivateEndpointConnectionProvisioningState { - return []PrivateEndpointConnectionProvisioningState{ - PrivateEndpointConnectionProvisioningStateCreating, - PrivateEndpointConnectionProvisioningStateDeleting, - PrivateEndpointConnectionProvisioningStateFailed, - PrivateEndpointConnectionProvisioningStateSucceeded, - } -} - -// PrivateEndpointServiceConnectionStatus - The private endpoint connection status. -type PrivateEndpointServiceConnectionStatus string - -const ( - PrivateEndpointServiceConnectionStatusApproved PrivateEndpointServiceConnectionStatus = "Approved" - PrivateEndpointServiceConnectionStatusPending PrivateEndpointServiceConnectionStatus = "Pending" - PrivateEndpointServiceConnectionStatusRejected PrivateEndpointServiceConnectionStatus = "Rejected" -) - -// PossiblePrivateEndpointServiceConnectionStatusValues returns the possible values for the PrivateEndpointServiceConnectionStatus const type. -func PossiblePrivateEndpointServiceConnectionStatusValues() []PrivateEndpointServiceConnectionStatus { - return []PrivateEndpointServiceConnectionStatus{ - PrivateEndpointServiceConnectionStatusApproved, - PrivateEndpointServiceConnectionStatusPending, - PrivateEndpointServiceConnectionStatusRejected, - } -} - -// 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 - -const ( - PublicNetworkAccessDisabled PublicNetworkAccess = "Disabled" - PublicNetworkAccessEnabled PublicNetworkAccess = "Enabled" -) - -// PossiblePublicNetworkAccessValues returns the possible values for the PublicNetworkAccess const type. -func PossiblePublicNetworkAccessValues() []PublicNetworkAccess { - return []PublicNetworkAccess{ - PublicNetworkAccessDisabled, - PublicNetworkAccessEnabled, - } -} - // RegistrationTokenOperation - The type of resetting the token. type RegistrationTokenOperation string @@ -495,16 +393,14 @@ func PossibleScalingScheduleDaysOfWeekItemValues() []ScalingScheduleDaysOfWeekIt } } -// SessionHostComponentUpdateType - The preferred mechanism for updating the agent components. This is either Scheduled or -// Default. +// SessionHostComponentUpdateType - The type of maintenance for session host components. type SessionHostComponentUpdateType string const ( - // SessionHostComponentUpdateTypeDefault - The agent components are updated according to the AVD infrastructure flighting. - // For more information, see https://aka.ms/avdagent. + // SessionHostComponentUpdateTypeDefault - Agent and other agent side components are delivery schedule is controlled by WVD + // Infra. SessionHostComponentUpdateTypeDefault SessionHostComponentUpdateType = "Default" - // SessionHostComponentUpdateTypeScheduled - This enables the Scheduled Agent Updates feature which allows the agent components - // to get updated according to the schedule that the admin define. For more information, see https://aka.ms/avdsau. + // SessionHostComponentUpdateTypeScheduled - TenantAdmin have opted in for Scheduled Component Update feature. SessionHostComponentUpdateTypeScheduled SessionHostComponentUpdateType = "Scheduled" ) diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_desktops_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/desktops_client.go similarity index 94% rename from sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_desktops_client.go rename to sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/desktops_client.go index 10db4b463ee3..df015d32ad52 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_desktops_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/desktops_client.go @@ -5,6 +5,7 @@ // 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 @@ -19,6 +20,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" "net/url" + "strconv" "strings" ) @@ -56,7 +58,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 2022-02-10-preview +// Generated from API version 2022-09-09 // 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 @@ -100,7 +102,7 @@ func (client *DesktopsClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-10-preview") + reqQP.Set("api-version", "2022-09-09") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -116,8 +118,7 @@ func (client *DesktopsClient) getHandleResponse(resp *http.Response) (DesktopsCl } // NewListPager - List desktops. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-10-preview +// Generated from API version 2022-09-09 // 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.List method. @@ -169,7 +170,16 @@ func (client *DesktopsClient) listCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-10-preview") + reqQP.Set("api-version", "2022-09-09") + if options != nil && options.PageSize != nil { + reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) + } + if options != nil && options.IsDescending != nil { + reqQP.Set("isDescending", strconv.FormatBool(*options.IsDescending)) + } + if options != nil && options.InitialSkip != nil { + reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) + } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -186,7 +196,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 2022-02-10-preview +// Generated from API version 2022-09-09 // 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 @@ -230,7 +240,7 @@ func (client *DesktopsClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-10-preview") + reqQP.Set("api-version", "2022-09-09") 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/go.mod b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/go.mod index 5073cb9498a8..1e2ad2fd409e 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/go.mod +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/go.mod @@ -2,20 +2,12 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualizati go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 // indirect - github.com/golang-jwt/jwt v3.2.1+incompatible // indirect - github.com/google/uuid v1.1.1 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 // indirect - golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 // indirect - golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect golang.org/x/text v0.3.7 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/go.sum b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/go.sum index ed5b814680ee..3afb578030a5 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/go.sum +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/go.sum @@ -1,33 +1,15 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 h1:sVPhtT2qjO86rTUaWMr4WoES4TkjGnzcioXcnHV9s5k= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0 h1:Yoicul8bnVdQrhDMTHxdEckRGX01XvwXDHUT9zYZ3k0= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0/go.mod h1:+6sju8gk8FRmSajX3Oz4G5Gm7P+mbqE9FVaXXFYTkCM= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 h1:jp0dGvZ7ZK0mgqnTSClMxa5xuRL7NZgHameVYF6BurY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 h1:WVsrXCnHlDDX8ls+tootqRE87/hL9S/g4ewig9RsD/c= -github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= -github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= -github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= -github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 h1:Qj1ukM4GlMWXNdMBuXcXfz/Kw9s1qm0CLY32QxuSImI= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 h1:Tgea0cVUD0ivh5ADBX4WwuI12DUd2to3nCYe2eayMIw= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 h1:HVyaeDAYux4pnY+D/SiwmLOR36ewZ4iGQIIrtnuCjFA= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_hostpools_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/hostpools_client.go similarity index 93% rename from sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_hostpools_client.go rename to sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/hostpools_client.go index 10bd019fcfd2..54445d342a28 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_hostpools_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/hostpools_client.go @@ -5,6 +5,7 @@ // 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 @@ -57,7 +58,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 2022-02-10-preview +// Generated from API version 2022-09-09 // 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. @@ -98,7 +99,7 @@ func (client *HostPoolsClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-10-preview") + reqQP.Set("api-version", "2022-09-09") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, hostPool) @@ -115,7 +116,7 @@ func (client *HostPoolsClient) createOrUpdateHandleResponse(resp *http.Response) // Delete - Remove a host pool. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-10-preview +// Generated from API version 2022-09-09 // 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. @@ -154,7 +155,7 @@ func (client *HostPoolsClient) deleteCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-10-preview") + reqQP.Set("api-version", "2022-09-09") if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } @@ -165,7 +166,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 2022-02-10-preview +// Generated from API version 2022-09-09 // 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. @@ -204,7 +205,7 @@ func (client *HostPoolsClient) getCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-10-preview") + reqQP.Set("api-version", "2022-09-09") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -220,8 +221,7 @@ func (client *HostPoolsClient) getHandleResponse(resp *http.Response) (HostPools } // NewListPager - List hostPools in subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-10-preview +// Generated from API version 2022-09-09 // options - HostPoolsClientListOptions contains the optional parameters for the HostPoolsClient.List method. func (client *HostPoolsClient) NewListPager(options *HostPoolsClientListOptions) *runtime.Pager[HostPoolsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[HostPoolsClientListResponse]{ @@ -263,7 +263,16 @@ func (client *HostPoolsClient) listCreateRequest(ctx context.Context, options *H return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-10-preview") + reqQP.Set("api-version", "2022-09-09") + if options != nil && options.PageSize != nil { + reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) + } + if options != nil && options.IsDescending != nil { + reqQP.Set("isDescending", strconv.FormatBool(*options.IsDescending)) + } + if options != nil && options.InitialSkip != nil { + reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) + } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -279,8 +288,7 @@ func (client *HostPoolsClient) listHandleResponse(resp *http.Response) (HostPool } // NewListByResourceGroupPager - List hostPools. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-10-preview +// Generated from API version 2022-09-09 // resourceGroupName - The name of the resource group. The name is case insensitive. // options - HostPoolsClientListByResourceGroupOptions contains the optional parameters for the HostPoolsClient.ListByResourceGroup // method. @@ -328,7 +336,16 @@ func (client *HostPoolsClient) listByResourceGroupCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-10-preview") + reqQP.Set("api-version", "2022-09-09") + if options != nil && options.PageSize != nil { + reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) + } + if options != nil && options.IsDescending != nil { + reqQP.Set("isDescending", strconv.FormatBool(*options.IsDescending)) + } + if options != nil && options.InitialSkip != nil { + reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) + } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -345,7 +362,7 @@ func (client *HostPoolsClient) listByResourceGroupHandleResponse(resp *http.Resp // RetrieveRegistrationToken - Registration token of the host pool. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-10-preview +// Generated from API version 2022-09-09 // 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 @@ -385,7 +402,7 @@ func (client *HostPoolsClient) retrieveRegistrationTokenCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-10-preview") + reqQP.Set("api-version", "2022-09-09") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -402,7 +419,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 2022-02-10-preview +// Generated from API version 2022-09-09 // 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. @@ -441,7 +458,7 @@ func (client *HostPoolsClient) updateCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-10-preview") + reqQP.Set("api-version", "2022-09-09") 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/zz_generated_models.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/models.go similarity index 86% rename from sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_models.go rename to sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/models.go index 200598b0965e..8387e758b264 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_models.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/models.go @@ -5,48 +5,41 @@ // 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 import "time" -// AgentUpdatePatchProperties - The preferred settings for updating the agent components (RDAgent, Geneva Monitoring agent, -// and side-by-side stack) on session hosts. +// AgentUpdatePatchProperties - The session host configuration for updating agent, monitoring agent, and stack component. type AgentUpdatePatchProperties struct { - // The time zone for updating the agent components. Valid time zones can be found here: https://docs.microsoft.com/en-us/dotnet/api/system.timezoneinfo.findsystemtimezonebyid?view=net-5.0. - // A time zone - // must be specified if useSessionHostLocalTime is false. + // Time zone for maintenance as defined in https://docs.microsoft.com/en-us/dotnet/api/system.timezoneinfo.findsystemtimezonebyid?view=net-5.0. + // Must be set if useLocalTime is true. MaintenanceWindowTimeZone *string `json:"maintenanceWindowTimeZone,omitempty"` - // The maintenance windows (day and time) for updating the agent components. At least 1 window must be specified. Optionally, - // a 2nd window can be specified. + // List of maintenance windows. Maintenance windows are 2 hours long. MaintenanceWindows []*MaintenanceWindowPatchProperties `json:"maintenanceWindows,omitempty"` - // The preferred mechanism for updating the agent components. This is either Scheduled or Default. + // The type of maintenance for session host components. Type *SessionHostComponentUpdateType `json:"type,omitempty"` - // Boolean indicating whether to update the agent components in the local time zone of each session host in the host pool. - // By default, this is false. + // Whether to use localTime of the virtual machine. UseSessionHostLocalTime *bool `json:"useSessionHostLocalTime,omitempty"` } -// AgentUpdateProperties - The preferred settings for updating the agent components (RDAgent, Geneva Monitoring agent, and -// side-by-side stack) on session hosts. +// AgentUpdateProperties - The session host configuration for updating agent, monitoring agent, and stack component. type AgentUpdateProperties struct { - // The time zone for updating the agent components. Valid time zones can be found here: https://docs.microsoft.com/en-us/dotnet/api/system.timezoneinfo.findsystemtimezonebyid?view=net-5.0. - // A time zone - // must be specified if useSessionHostLocalTime is false. + // Time zone for maintenance as defined in https://docs.microsoft.com/en-us/dotnet/api/system.timezoneinfo.findsystemtimezonebyid?view=net-5.0. + // Must be set if useLocalTime is true. MaintenanceWindowTimeZone *string `json:"maintenanceWindowTimeZone,omitempty"` - // The maintenance windows (day and time) for updating the agent components. At least 1 window must be specified. Optionally, - // a 2nd window can be specified. + // List of maintenance windows. Maintenance windows are 2 hours long. MaintenanceWindows []*MaintenanceWindowProperties `json:"maintenanceWindows,omitempty"` - // The preferred mechanism for updating the agent components. This is either Scheduled or Default. + // The type of maintenance for session host components. Type *SessionHostComponentUpdateType `json:"type,omitempty"` - // Boolean indicating whether to update the agent components in the local time zone of each session host in the host pool. - // By default, this is false. + // Whether to use localTime of the virtual machine. UseSessionHostLocalTime *bool `json:"useSessionHostLocalTime,omitempty"` } @@ -161,9 +154,6 @@ type ApplicationGroupProperties struct { // Friendly name of ApplicationGroup. FriendlyName *string `json:"friendlyName,omitempty"` - // The registration info of HostPool. - MigrationRequest *MigrationRequestProperties `json:"migrationRequest,omitempty"` - // READ-ONLY; Is cloud pc resource. CloudPcResource *bool `json:"cloudPcResource,omitempty" azure:"ro"` @@ -195,6 +185,12 @@ type ApplicationGroupsClientGetOptions struct { type ApplicationGroupsClientListByResourceGroupOptions struct { // OData filter expression. Valid properties for filtering are applicationGroupType. Filter *string + // Initial number of items to skip. + InitialSkip *int32 + // Indicates whether the collection is descending. + IsDescending *bool + // Number of items per page. + PageSize *int32 } // ApplicationGroupsClientListBySubscriptionOptions contains the optional parameters for the ApplicationGroupsClient.ListBySubscription @@ -328,7 +324,12 @@ type ApplicationsClientGetOptions struct { // ApplicationsClientListOptions contains the optional parameters for the ApplicationsClient.List method. type ApplicationsClientListOptions struct { - // placeholder for future optional parameters + // Initial number of items to skip. + InitialSkip *int32 + // Indicates whether the collection is descending. + IsDescending *bool + // Number of items per page. + PageSize *int32 } // ApplicationsClientUpdateOptions contains the optional parameters for the ApplicationsClient.Update method. @@ -337,12 +338,6 @@ type ApplicationsClientUpdateOptions struct { Application *ApplicationPatch } -// CloudError - Cloud error object. -type CloudError struct { - // Cloud error object properties. - Error *CloudErrorProperties `json:"error,omitempty"` -} - // CloudErrorProperties - Cloud error object properties. type CloudErrorProperties struct { // Error code @@ -422,7 +417,12 @@ type DesktopsClientGetOptions struct { // DesktopsClientListOptions contains the optional parameters for the DesktopsClient.List method. type DesktopsClientListOptions struct { - // placeholder for future optional parameters + // Initial number of items to skip. + InitialSkip *int32 + // Indicates whether the collection is descending. + IsDescending *bool + // Number of items per page. + PageSize *int32 } // DesktopsClientUpdateOptions contains the optional parameters for the DesktopsClient.Update method. @@ -569,8 +569,7 @@ type HostPoolPatch struct { // HostPoolPatchProperties - Properties of HostPool. type HostPoolPatchProperties struct { - // The preferred settings for updating the agent components (RDAgent, Geneva Monitoring agent, and side-by-side stack) on - // session hosts. + // The session host configuration for updating agent, monitoring agent, and stack component. AgentUpdate *AgentUpdatePatchProperties `json:"agentUpdate,omitempty"` // Custom rdp property of HostPool. @@ -594,9 +593,6 @@ type HostPoolPatchProperties struct { // The type of preferred application group type, default to Desktop Application Group PreferredAppGroupType *PreferredAppGroupType `json:"preferredAppGroupType,omitempty"` - // Enabled to allow this resource to be access from the public network - PublicNetworkAccess *HostpoolPublicNetworkAccess `json:"publicNetworkAccess,omitempty"` - // The registration info of HostPool. RegistrationInfo *RegistrationInfoPatch `json:"registrationInfo,omitempty"` @@ -636,8 +632,7 @@ type HostPoolProperties struct { // REQUIRED; The type of preferred application group type, default to Desktop Application Group PreferredAppGroupType *PreferredAppGroupType `json:"preferredAppGroupType,omitempty"` - // The preferred settings for updating the agent components (RDAgent, Geneva Monitoring agent, and side-by-side stack) on - // session hosts. + // The session host configuration for updating agent, monitoring agent, and stack component. AgentUpdate *AgentUpdateProperties `json:"agentUpdate,omitempty"` // Custom rdp property of HostPool. @@ -652,16 +647,9 @@ type HostPoolProperties struct { // The max session limit of HostPool. MaxSessionLimit *int32 `json:"maxSessionLimit,omitempty"` - // The registration info of HostPool. - MigrationRequest *MigrationRequestProperties `json:"migrationRequest,omitempty"` - // PersonalDesktopAssignment type for HostPool. PersonalDesktopAssignmentType *PersonalDesktopAssignmentType `json:"personalDesktopAssignmentType,omitempty"` - // Enabled allows this resource to be accessed from both public and private networks, Disabled allows this resource to only - // be accessed via private endpoints - PublicNetworkAccess *HostpoolPublicNetworkAccess `json:"publicNetworkAccess,omitempty"` - // The registration info of HostPool. RegistrationInfo *RegistrationInfo `json:"registrationInfo,omitempty"` @@ -697,9 +685,6 @@ type HostPoolProperties struct { // READ-ONLY; ObjectId of HostPool. (internal use) ObjectID *string `json:"objectId,omitempty" azure:"ro"` - - // READ-ONLY; List of private endpoint connection associated with the specified resource - PrivateEndpointConnections []*PrivateEndpointConnection `json:"privateEndpointConnections,omitempty" azure:"ro"` } // HostPoolsClientCreateOrUpdateOptions contains the optional parameters for the HostPoolsClient.CreateOrUpdate method. @@ -721,12 +706,22 @@ type HostPoolsClientGetOptions struct { // HostPoolsClientListByResourceGroupOptions contains the optional parameters for the HostPoolsClient.ListByResourceGroup // method. type HostPoolsClientListByResourceGroupOptions struct { - // placeholder for future optional parameters + // Initial number of items to skip. + InitialSkip *int32 + // Indicates whether the collection is descending. + IsDescending *bool + // Number of items per page. + PageSize *int32 } // HostPoolsClientListOptions contains the optional parameters for the HostPoolsClient.List method. type HostPoolsClientListOptions struct { - // placeholder for future optional parameters + // Initial number of items to skip. + InitialSkip *int32 + // Indicates whether the collection is descending. + IsDescending *bool + // Number of items per page. + PageSize *int32 } // HostPoolsClientRetrieveRegistrationTokenOptions contains the optional parameters for the HostPoolsClient.RetrieveRegistrationToken @@ -878,7 +873,12 @@ type MSIXPackagesClientGetOptions struct { // MSIXPackagesClientListOptions contains the optional parameters for the MSIXPackagesClient.List method. type MSIXPackagesClientListOptions struct { - // placeholder for future optional parameters + // Initial number of items to skip. + InitialSkip *int32 + // Indicates whether the collection is descending. + IsDescending *bool + // Number of items per page. + PageSize *int32 } // MSIXPackagesClientUpdateOptions contains the optional parameters for the MSIXPackagesClient.Update method. @@ -889,33 +889,22 @@ type MSIXPackagesClientUpdateOptions struct { // MaintenanceWindowPatchProperties - Maintenance window starting hour and day of week. type MaintenanceWindowPatchProperties struct { - // The day of the week (Monday-Sunday). + // Day of the week. DayOfWeek *DayOfWeek `json:"dayOfWeek,omitempty"` - // The starting hour of the maintenance window (0-23). Note that maintenance windows are 2 hours long. This means that updates - // can be applied anytime from the specified start hour to 2 hours after. + // The update start hour of the day. (0 - 23) Hour *int32 `json:"hour,omitempty"` } // MaintenanceWindowProperties - Maintenance window starting hour and day of week. type MaintenanceWindowProperties struct { - // The day of the week (Monday-Sunday). + // Day of the week. DayOfWeek *DayOfWeek `json:"dayOfWeek,omitempty"` - // The starting hour of the maintenance window (0-23). Note that maintenance windows are 2 hours long. This means that updates - // can be applied anytime from the specified start hour to 2 hours after. + // The update start hour of the day. (0 - 23) Hour *int32 `json:"hour,omitempty"` } -// MigrationRequestProperties - Properties for arm migration. -type MigrationRequestProperties struct { - // The path to the legacy object to migrate. - MigrationPath *string `json:"migrationPath,omitempty"` - - // The type of operation for migration. - Operation *Operation `json:"operation,omitempty"` -} - // MsixImagesClientExpandOptions contains the optional parameters for the MsixImagesClient.Expand method. type MsixImagesClientExpandOptions struct { // placeholder for future optional parameters @@ -987,176 +976,6 @@ type Plan struct { Version *string `json:"version,omitempty"` } -// PrivateEndpoint - The Private Endpoint resource. -type PrivateEndpoint struct { - // READ-ONLY; The ARM identifier for Private Endpoint - ID *string `json:"id,omitempty" azure:"ro"` -} - -// PrivateEndpointConnection - The Private Endpoint Connection resource. -type PrivateEndpointConnection struct { - // Resource properties. - Properties *PrivateEndpointConnectionProperties `json:"properties,omitempty"` - - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; The name of the resource - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty" azure:"ro"` -} - -// PrivateEndpointConnectionListResultWithSystemData - List of private endpoint connection associated with the specified storage -// account -type PrivateEndpointConnectionListResultWithSystemData struct { - // Array of private endpoint connections - Value []*PrivateEndpointConnectionWithSystemData `json:"value,omitempty"` - - // READ-ONLY; Link to the next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` -} - -// PrivateEndpointConnectionProperties - Properties of the PrivateEndpointConnectProperties. -type PrivateEndpointConnectionProperties struct { - // REQUIRED; A collection of information about the state of the connection between service consumer and provider. - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - - // The resource of private end point. - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - - // The provisioning state of the private endpoint connection resource. - ProvisioningState *PrivateEndpointConnectionProvisioningState `json:"provisioningState,omitempty"` -} - -// PrivateEndpointConnectionWithSystemData - The Private Endpoint Connection resource. -type PrivateEndpointConnectionWithSystemData struct { - // Resource properties. - Properties *PrivateEndpointConnectionProperties `json:"properties,omitempty"` - - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; The name of the resource - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Metadata pertaining to creation and last modification of the resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` - - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty" azure:"ro"` -} - -// PrivateEndpointConnectionsClientDeleteByHostPoolOptions contains the optional parameters for the PrivateEndpointConnectionsClient.DeleteByHostPool -// method. -type PrivateEndpointConnectionsClientDeleteByHostPoolOptions struct { - // placeholder for future optional parameters -} - -// PrivateEndpointConnectionsClientDeleteByWorkspaceOptions contains the optional parameters for the PrivateEndpointConnectionsClient.DeleteByWorkspace -// method. -type PrivateEndpointConnectionsClientDeleteByWorkspaceOptions struct { - // placeholder for future optional parameters -} - -// PrivateEndpointConnectionsClientGetByHostPoolOptions contains the optional parameters for the PrivateEndpointConnectionsClient.GetByHostPool -// method. -type PrivateEndpointConnectionsClientGetByHostPoolOptions struct { - // placeholder for future optional parameters -} - -// PrivateEndpointConnectionsClientGetByWorkspaceOptions contains the optional parameters for the PrivateEndpointConnectionsClient.GetByWorkspace -// method. -type PrivateEndpointConnectionsClientGetByWorkspaceOptions struct { - // placeholder for future optional parameters -} - -// PrivateEndpointConnectionsClientListByHostPoolOptions contains the optional parameters for the PrivateEndpointConnectionsClient.ListByHostPool -// method. -type PrivateEndpointConnectionsClientListByHostPoolOptions struct { - // placeholder for future optional parameters -} - -// PrivateEndpointConnectionsClientListByWorkspaceOptions contains the optional parameters for the PrivateEndpointConnectionsClient.ListByWorkspace -// method. -type PrivateEndpointConnectionsClientListByWorkspaceOptions struct { - // placeholder for future optional parameters -} - -// PrivateEndpointConnectionsClientUpdateByHostPoolOptions contains the optional parameters for the PrivateEndpointConnectionsClient.UpdateByHostPool -// method. -type PrivateEndpointConnectionsClientUpdateByHostPoolOptions struct { - // placeholder for future optional parameters -} - -// PrivateEndpointConnectionsClientUpdateByWorkspaceOptions contains the optional parameters for the PrivateEndpointConnectionsClient.UpdateByWorkspace -// method. -type PrivateEndpointConnectionsClientUpdateByWorkspaceOptions struct { - // placeholder for future optional parameters -} - -// PrivateLinkResource - A private link resource -type PrivateLinkResource struct { - // Resource properties. - Properties *PrivateLinkResourceProperties `json:"properties,omitempty"` - - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; The name of the resource - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty" azure:"ro"` -} - -// PrivateLinkResourceListResult - A list of private link resources -type PrivateLinkResourceListResult struct { - // Array of private link resources - Value []*PrivateLinkResource `json:"value,omitempty"` - - // READ-ONLY; Link to the next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` -} - -// PrivateLinkResourceProperties - Properties of a private link resource. -type PrivateLinkResourceProperties struct { - // The private link resource Private link DNS zone name. - RequiredZoneNames []*string `json:"requiredZoneNames,omitempty"` - - // READ-ONLY; The private link resource group id. - GroupID *string `json:"groupId,omitempty" azure:"ro"` - - // READ-ONLY; The private link resource required member names. - RequiredMembers []*string `json:"requiredMembers,omitempty" azure:"ro"` -} - -// PrivateLinkResourcesClientListByHostPoolOptions contains the optional parameters for the PrivateLinkResourcesClient.ListByHostPool -// method. -type PrivateLinkResourcesClientListByHostPoolOptions struct { - // placeholder for future optional parameters -} - -// PrivateLinkResourcesClientListByWorkspaceOptions contains the optional parameters for the PrivateLinkResourcesClient.ListByWorkspace -// method. -type PrivateLinkResourcesClientListByWorkspaceOptions struct { - // placeholder for future optional parameters -} - -// PrivateLinkServiceConnectionState - A collection of information about the state of the connection between service consumer -// and provider. -type PrivateLinkServiceConnectionState struct { - // A message indicating if changes on the service provider require any updates on the consumer. - ActionsRequired *string `json:"actionsRequired,omitempty"` - - // The reason for approval/rejection of the connection. - Description *string `json:"description,omitempty"` - - // Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. - Status *PrivateEndpointServiceConnectionStatus `json:"status,omitempty"` -} - // RegistrationInfo - Represents a RegistrationInfo definition. type RegistrationInfo struct { // Expiration time of registration token. @@ -1347,7 +1166,9 @@ type ScalingHostPoolReference struct { // ScalingPlan - Represents a scaling plan definition. type ScalingPlan struct { - Identity *ResourceModelWithAllowedPropertySetIdentity `json:"identity,omitempty"` + // REQUIRED; Detailed properties for scaling plan. + Properties *ScalingPlanProperties `json:"properties,omitempty"` + Identity *ResourceModelWithAllowedPropertySetIdentity `json:"identity,omitempty"` // 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 @@ -1362,10 +1183,7 @@ type ScalingPlan struct { // delete the resource if it is removed from the template since it is managed by another resource. ManagedBy *string `json:"managedBy,omitempty"` Plan *ResourceModelWithAllowedPropertySetPlan `json:"plan,omitempty"` - - // Detailed properties for scaling plan. - Properties *ScalingPlanProperties `json:"properties,omitempty"` - SKU *ResourceModelWithAllowedPropertySetSKU `json:"sku,omitempty"` + SKU *ResourceModelWithAllowedPropertySetSKU `json:"sku,omitempty"` // Resource tags. Tags map[string]*string `json:"tags,omitempty"` @@ -1428,8 +1246,143 @@ type ScalingPlanPatchProperties struct { TimeZone *string `json:"timeZone,omitempty"` } +// ScalingPlanPooledSchedule - Represents a ScalingPlanPooledSchedule definition. +type ScalingPlanPooledSchedule struct { + // REQUIRED; Detailed properties for ScalingPlanPooledSchedule + Properties *ScalingPlanPooledScheduleProperties `json:"properties,omitempty"` + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` +} + +// ScalingPlanPooledScheduleList - List of ScalingPlanPooledSchedule definitions. +type ScalingPlanPooledScheduleList struct { + // List of ScalingPlanPooledSchedule definitions. + Value []*ScalingPlanPooledSchedule `json:"value,omitempty"` + + // READ-ONLY; Link to the next page of results. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// ScalingPlanPooledSchedulePatch - ScalingPlanPooledSchedule properties that can be patched. +type ScalingPlanPooledSchedulePatch struct { + // Detailed properties for ScalingPlanPooledSchedule + Properties *ScalingPlanPooledScheduleProperties `json:"properties,omitempty"` + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` +} + +// ScalingPlanPooledScheduleProperties - A ScalingPlanPooledSchedule. +type ScalingPlanPooledScheduleProperties struct { + // Set of days of the week on which this schedule is active. + DaysOfWeek []*DayOfWeek `json:"daysOfWeek,omitempty"` + + // Load balancing algorithm for off-peak period. + OffPeakLoadBalancingAlgorithm *SessionHostLoadBalancingAlgorithm `json:"offPeakLoadBalancingAlgorithm,omitempty"` + + // Starting time for off-peak period. + OffPeakStartTime *Time `json:"offPeakStartTime,omitempty"` + + // Load balancing algorithm for peak period. + PeakLoadBalancingAlgorithm *SessionHostLoadBalancingAlgorithm `json:"peakLoadBalancingAlgorithm,omitempty"` + + // Starting time for peak period. + PeakStartTime *Time `json:"peakStartTime,omitempty"` + + // Capacity threshold for ramp down period. + RampDownCapacityThresholdPct *int32 `json:"rampDownCapacityThresholdPct,omitempty"` + + // Should users be logged off forcefully from hosts. + RampDownForceLogoffUsers *bool `json:"rampDownForceLogoffUsers,omitempty"` + + // Load balancing algorithm for ramp down period. + RampDownLoadBalancingAlgorithm *SessionHostLoadBalancingAlgorithm `json:"rampDownLoadBalancingAlgorithm,omitempty"` + + // Minimum host percentage for ramp down period. + RampDownMinimumHostsPct *int32 `json:"rampDownMinimumHostsPct,omitempty"` + + // Notification message for users during ramp down period. + RampDownNotificationMessage *string `json:"rampDownNotificationMessage,omitempty"` + + // Starting time for ramp down period. + RampDownStartTime *Time `json:"rampDownStartTime,omitempty"` + + // Specifies when to stop hosts during ramp down period. + RampDownStopHostsWhen *StopHostsWhen `json:"rampDownStopHostsWhen,omitempty"` + + // Number of minutes to wait to stop hosts during ramp down period. + RampDownWaitTimeMinutes *int32 `json:"rampDownWaitTimeMinutes,omitempty"` + + // Capacity threshold for ramp up period. + RampUpCapacityThresholdPct *int32 `json:"rampUpCapacityThresholdPct,omitempty"` + + // Load balancing algorithm for ramp up period. + RampUpLoadBalancingAlgorithm *SessionHostLoadBalancingAlgorithm `json:"rampUpLoadBalancingAlgorithm,omitempty"` + + // Minimum host percentage for ramp up period. + RampUpMinimumHostsPct *int32 `json:"rampUpMinimumHostsPct,omitempty"` + + // Starting time for ramp up period. + RampUpStartTime *Time `json:"rampUpStartTime,omitempty"` +} + +// ScalingPlanPooledSchedulesClientCreateOptions contains the optional parameters for the ScalingPlanPooledSchedulesClient.Create +// method. +type ScalingPlanPooledSchedulesClientCreateOptions struct { + // placeholder for future optional parameters +} + +// ScalingPlanPooledSchedulesClientDeleteOptions contains the optional parameters for the ScalingPlanPooledSchedulesClient.Delete +// method. +type ScalingPlanPooledSchedulesClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// ScalingPlanPooledSchedulesClientGetOptions contains the optional parameters for the ScalingPlanPooledSchedulesClient.Get +// method. +type ScalingPlanPooledSchedulesClientGetOptions struct { + // placeholder for future optional parameters +} + +// ScalingPlanPooledSchedulesClientListOptions contains the optional parameters for the ScalingPlanPooledSchedulesClient.List +// method. +type ScalingPlanPooledSchedulesClientListOptions struct { + // Initial number of items to skip. + InitialSkip *int32 + // Indicates whether the collection is descending. + IsDescending *bool + // Number of items per page. + PageSize *int32 +} + +// ScalingPlanPooledSchedulesClientUpdateOptions contains the optional parameters for the ScalingPlanPooledSchedulesClient.Update +// method. +type ScalingPlanPooledSchedulesClientUpdateOptions struct { + // Object containing ScalingPlanPooledSchedule definitions. + ScalingPlanSchedule *ScalingPlanPooledSchedulePatch +} + // ScalingPlanProperties - Scaling plan properties. type ScalingPlanProperties struct { + // REQUIRED; Timezone of the scaling plan. + TimeZone *string `json:"timeZone,omitempty"` + // Description of scaling plan. Description *string `json:"description,omitempty"` @@ -1445,12 +1398,9 @@ type ScalingPlanProperties struct { // HostPool type for desktop. HostPoolType *ScalingHostPoolType `json:"hostPoolType,omitempty"` - // List of ScalingSchedule definitions. + // List of ScalingPlanPooledSchedule definitions. Schedules []*ScalingSchedule `json:"schedules,omitempty"` - // Timezone of the scaling plan. - TimeZone *string `json:"timeZone,omitempty"` - // READ-ONLY; ObjectId of scaling plan. (internal use) ObjectID *string `json:"objectId,omitempty" azure:"ro"` } @@ -1472,19 +1422,34 @@ type ScalingPlansClientGetOptions struct { // ScalingPlansClientListByHostPoolOptions contains the optional parameters for the ScalingPlansClient.ListByHostPool method. type ScalingPlansClientListByHostPoolOptions struct { - // placeholder for future optional parameters + // Initial number of items to skip. + InitialSkip *int32 + // Indicates whether the collection is descending. + IsDescending *bool + // Number of items per page. + PageSize *int32 } // ScalingPlansClientListByResourceGroupOptions contains the optional parameters for the ScalingPlansClient.ListByResourceGroup // method. type ScalingPlansClientListByResourceGroupOptions struct { - // placeholder for future optional parameters + // Initial number of items to skip. + InitialSkip *int32 + // Indicates whether the collection is descending. + IsDescending *bool + // Number of items per page. + PageSize *int32 } // ScalingPlansClientListBySubscriptionOptions contains the optional parameters for the ScalingPlansClient.ListBySubscription // method. type ScalingPlansClientListBySubscriptionOptions struct { - // placeholder for future optional parameters + // Initial number of items to skip. + InitialSkip *int32 + // Indicates whether the collection is descending. + IsDescending *bool + // Number of items per page. + PageSize *int32 } // ScalingPlansClientUpdateOptions contains the optional parameters for the ScalingPlansClient.Update method. @@ -1493,12 +1458,12 @@ type ScalingPlansClientUpdateOptions struct { ScalingPlan *ScalingPlanPatch } -// ScalingSchedule - Scaling plan schedule. +// ScalingSchedule - A ScalingPlanPooledSchedule. type ScalingSchedule struct { // Set of days of the week on which this schedule is active. DaysOfWeek []*ScalingScheduleDaysOfWeekItem `json:"daysOfWeek,omitempty"` - // Name of the scaling schedule. + // Name of the ScalingPlanPooledSchedule. Name *string `json:"name,omitempty"` // Load balancing algorithm for off-peak period. @@ -1710,7 +1675,12 @@ type SessionHostsClientGetOptions struct { // SessionHostsClientListOptions contains the optional parameters for the SessionHostsClient.List method. type SessionHostsClientListOptions struct { - // placeholder for future optional parameters + // Initial number of items to skip. + InitialSkip *int32 + // Indicates whether the collection is descending. + IsDescending *bool + // Number of items per page. + PageSize *int32 } // SessionHostsClientUpdateOptions contains the optional parameters for the SessionHostsClient.Update method. @@ -1765,7 +1735,12 @@ type StartMenuItemProperties struct { // StartMenuItemsClientListOptions contains the optional parameters for the StartMenuItemsClient.List method. type StartMenuItemsClientListOptions struct { - // placeholder for future optional parameters + // Initial number of items to skip. + InitialSkip *int32 + // Indicates whether the collection is descending. + IsDescending *bool + // Number of items per page. + PageSize *int32 } // SystemData - Metadata pertaining to creation and last modification of the resource. @@ -1866,11 +1841,22 @@ type UserSessionsClientGetOptions struct { type UserSessionsClientListByHostPoolOptions struct { // OData filter expression. Valid properties for filtering are userprincipalname and sessionstate. Filter *string + // Initial number of items to skip. + InitialSkip *int32 + // Indicates whether the collection is descending. + IsDescending *bool + // Number of items per page. + PageSize *int32 } // UserSessionsClientListOptions contains the optional parameters for the UserSessionsClient.List method. type UserSessionsClientListOptions struct { - // placeholder for future optional parameters + // Initial number of items to skip. + InitialSkip *int32 + // Indicates whether the collection is descending. + IsDescending *bool + // Number of items per page. + PageSize *int32 } // UserSessionsClientSendMessageOptions contains the optional parameters for the UserSessionsClient.SendMessage method. @@ -1951,9 +1937,6 @@ type WorkspacePatchProperties struct { // Friendly name of Workspace. FriendlyName *string `json:"friendlyName,omitempty"` - - // Enabled to allow this resource to be access from the public network - PublicNetworkAccess *PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` } // WorkspaceProperties - Schema for Workspace properties. @@ -1967,18 +1950,11 @@ type WorkspaceProperties struct { // Friendly name of Workspace. FriendlyName *string `json:"friendlyName,omitempty"` - // Enabled allows this resource to be accessed from both public and private networks, Disabled allows this resource to only - // be accessed via private endpoints - PublicNetworkAccess *PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` - // READ-ONLY; Is cloud pc resource. CloudPcResource *bool `json:"cloudPcResource,omitempty" azure:"ro"` // READ-ONLY; ObjectId of Workspace. (internal use) ObjectID *string `json:"objectId,omitempty" azure:"ro"` - - // READ-ONLY; List of private endpoint connection associated with the specified resource - PrivateEndpointConnections []*PrivateEndpointConnection `json:"privateEndpointConnections,omitempty" azure:"ro"` } // WorkspacesClientCreateOrUpdateOptions contains the optional parameters for the WorkspacesClient.CreateOrUpdate method. @@ -1999,7 +1975,12 @@ type WorkspacesClientGetOptions struct { // WorkspacesClientListByResourceGroupOptions contains the optional parameters for the WorkspacesClient.ListByResourceGroup // method. type WorkspacesClientListByResourceGroupOptions struct { - // placeholder for future optional parameters + // Initial number of items to skip. + InitialSkip *int32 + // Indicates whether the collection is descending. + IsDescending *bool + // Number of items per page. + PageSize *int32 } // WorkspacesClientListBySubscriptionOptions contains the optional parameters for the WorkspacesClient.ListBySubscription diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/models_serde.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/models_serde.go new file mode 100644 index 000000000000..424946d1ac12 --- /dev/null +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/models_serde.go @@ -0,0 +1,3744 @@ +//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 + +import ( + "encoding/json" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "reflect" +) + +// MarshalJSON implements the json.Marshaller interface for type AgentUpdatePatchProperties. +func (a AgentUpdatePatchProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "maintenanceWindowTimeZone", a.MaintenanceWindowTimeZone) + populate(objectMap, "maintenanceWindows", a.MaintenanceWindows) + populate(objectMap, "type", a.Type) + populate(objectMap, "useSessionHostLocalTime", a.UseSessionHostLocalTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AgentUpdatePatchProperties. +func (a *AgentUpdatePatchProperties) UnmarshalJSON(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 "maintenanceWindowTimeZone": + err = unpopulate(val, "MaintenanceWindowTimeZone", &a.MaintenanceWindowTimeZone) + delete(rawMsg, key) + case "maintenanceWindows": + err = unpopulate(val, "MaintenanceWindows", &a.MaintenanceWindows) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) + delete(rawMsg, key) + case "useSessionHostLocalTime": + err = unpopulate(val, "UseSessionHostLocalTime", &a.UseSessionHostLocalTime) + 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 AgentUpdateProperties. +func (a AgentUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "maintenanceWindowTimeZone", a.MaintenanceWindowTimeZone) + populate(objectMap, "maintenanceWindows", a.MaintenanceWindows) + populate(objectMap, "type", a.Type) + populate(objectMap, "useSessionHostLocalTime", a.UseSessionHostLocalTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AgentUpdateProperties. +func (a *AgentUpdateProperties) UnmarshalJSON(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 "maintenanceWindowTimeZone": + err = unpopulate(val, "MaintenanceWindowTimeZone", &a.MaintenanceWindowTimeZone) + delete(rawMsg, key) + case "maintenanceWindows": + err = unpopulate(val, "MaintenanceWindows", &a.MaintenanceWindows) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) + delete(rawMsg, key) + case "useSessionHostLocalTime": + err = unpopulate(val, "UseSessionHostLocalTime", &a.UseSessionHostLocalTime) + 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 Application. +func (a Application) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + 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 Application. +func (a *Application) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + 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 ApplicationGroup. +func (a ApplicationGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", a.Etag) + populate(objectMap, "id", a.ID) + populate(objectMap, "identity", a.Identity) + populate(objectMap, "kind", a.Kind) + populate(objectMap, "location", a.Location) + populate(objectMap, "managedBy", a.ManagedBy) + populate(objectMap, "name", a.Name) + populate(objectMap, "plan", a.Plan) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "sku", a.SKU) + populate(objectMap, "systemData", a.SystemData) + populate(objectMap, "tags", a.Tags) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGroup. +func (a *ApplicationGroup) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &a.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "identity": + err = unpopulate(val, "Identity", &a.Identity) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &a.Kind) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &a.Location) + delete(rawMsg, key) + case "managedBy": + err = unpopulate(val, "ManagedBy", &a.ManagedBy) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "plan": + err = unpopulate(val, "Plan", &a.Plan) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &a.SKU) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &a.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &a.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ApplicationGroupList. +func (a ApplicationGroupList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGroupList. +func (a *ApplicationGroupList) UnmarshalJSON(data []byte) error { + 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 ApplicationGroupPatch. +func (a ApplicationGroupPatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", a.ID) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "tags", a.Tags) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGroupPatch. +func (a *ApplicationGroupPatch) UnmarshalJSON(data []byte) error { + 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 "tags": + err = unpopulate(val, "Tags", &a.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ApplicationGroupPatchProperties. +func (a ApplicationGroupPatchProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", a.Description) + populate(objectMap, "friendlyName", a.FriendlyName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGroupPatchProperties. +func (a *ApplicationGroupPatchProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &a.Description) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &a.FriendlyName) + 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 ApplicationGroupProperties. +func (a ApplicationGroupProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "applicationGroupType", a.ApplicationGroupType) + populate(objectMap, "cloudPcResource", a.CloudPcResource) + populate(objectMap, "description", a.Description) + populate(objectMap, "friendlyName", a.FriendlyName) + populate(objectMap, "hostPoolArmPath", a.HostPoolArmPath) + populate(objectMap, "objectId", a.ObjectID) + populate(objectMap, "workspaceArmPath", a.WorkspaceArmPath) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGroupProperties. +func (a *ApplicationGroupProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "applicationGroupType": + err = unpopulate(val, "ApplicationGroupType", &a.ApplicationGroupType) + delete(rawMsg, key) + case "cloudPcResource": + err = unpopulate(val, "CloudPcResource", &a.CloudPcResource) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &a.Description) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &a.FriendlyName) + delete(rawMsg, key) + case "hostPoolArmPath": + err = unpopulate(val, "HostPoolArmPath", &a.HostPoolArmPath) + delete(rawMsg, key) + case "objectId": + err = unpopulate(val, "ObjectID", &a.ObjectID) + delete(rawMsg, key) + case "workspaceArmPath": + err = unpopulate(val, "WorkspaceArmPath", &a.WorkspaceArmPath) + 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 ApplicationList. +func (a ApplicationList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationList. +func (a *ApplicationList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", 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 ApplicationPatch. +func (a ApplicationPatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "tags", a.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationPatch. +func (a *ApplicationPatch) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &a.Tags) + 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 ApplicationPatchProperties. +func (a ApplicationPatchProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "applicationType", a.ApplicationType) + populate(objectMap, "commandLineArguments", a.CommandLineArguments) + populate(objectMap, "commandLineSetting", a.CommandLineSetting) + populate(objectMap, "description", a.Description) + populate(objectMap, "filePath", a.FilePath) + populate(objectMap, "friendlyName", a.FriendlyName) + populate(objectMap, "iconIndex", a.IconIndex) + populate(objectMap, "iconPath", a.IconPath) + populate(objectMap, "msixPackageApplicationId", a.MsixPackageApplicationID) + populate(objectMap, "msixPackageFamilyName", a.MsixPackageFamilyName) + populate(objectMap, "showInPortal", a.ShowInPortal) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationPatchProperties. +func (a *ApplicationPatchProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "applicationType": + err = unpopulate(val, "ApplicationType", &a.ApplicationType) + delete(rawMsg, key) + case "commandLineArguments": + err = unpopulate(val, "CommandLineArguments", &a.CommandLineArguments) + delete(rawMsg, key) + case "commandLineSetting": + err = unpopulate(val, "CommandLineSetting", &a.CommandLineSetting) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &a.Description) + delete(rawMsg, key) + case "filePath": + err = unpopulate(val, "FilePath", &a.FilePath) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &a.FriendlyName) + delete(rawMsg, key) + case "iconIndex": + err = unpopulate(val, "IconIndex", &a.IconIndex) + delete(rawMsg, key) + case "iconPath": + err = unpopulate(val, "IconPath", &a.IconPath) + delete(rawMsg, key) + case "msixPackageApplicationId": + err = unpopulate(val, "MsixPackageApplicationID", &a.MsixPackageApplicationID) + delete(rawMsg, key) + case "msixPackageFamilyName": + err = unpopulate(val, "MsixPackageFamilyName", &a.MsixPackageFamilyName) + delete(rawMsg, key) + case "showInPortal": + err = unpopulate(val, "ShowInPortal", &a.ShowInPortal) + 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 ApplicationProperties. +func (a ApplicationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "applicationType", a.ApplicationType) + populate(objectMap, "commandLineArguments", a.CommandLineArguments) + populate(objectMap, "commandLineSetting", a.CommandLineSetting) + populate(objectMap, "description", a.Description) + populate(objectMap, "filePath", a.FilePath) + populate(objectMap, "friendlyName", a.FriendlyName) + populateByteArray(objectMap, "iconContent", a.IconContent, runtime.Base64StdFormat) + populate(objectMap, "iconHash", a.IconHash) + populate(objectMap, "iconIndex", a.IconIndex) + populate(objectMap, "iconPath", a.IconPath) + populate(objectMap, "msixPackageApplicationId", a.MsixPackageApplicationID) + populate(objectMap, "msixPackageFamilyName", a.MsixPackageFamilyName) + populate(objectMap, "objectId", a.ObjectID) + populate(objectMap, "showInPortal", a.ShowInPortal) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationProperties. +func (a *ApplicationProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "applicationType": + err = unpopulate(val, "ApplicationType", &a.ApplicationType) + delete(rawMsg, key) + case "commandLineArguments": + err = unpopulate(val, "CommandLineArguments", &a.CommandLineArguments) + delete(rawMsg, key) + case "commandLineSetting": + err = unpopulate(val, "CommandLineSetting", &a.CommandLineSetting) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &a.Description) + delete(rawMsg, key) + case "filePath": + err = unpopulate(val, "FilePath", &a.FilePath) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &a.FriendlyName) + delete(rawMsg, key) + case "iconContent": + err = runtime.DecodeByteArray(string(val), &a.IconContent, runtime.Base64StdFormat) + delete(rawMsg, key) + case "iconHash": + err = unpopulate(val, "IconHash", &a.IconHash) + delete(rawMsg, key) + case "iconIndex": + err = unpopulate(val, "IconIndex", &a.IconIndex) + delete(rawMsg, key) + case "iconPath": + err = unpopulate(val, "IconPath", &a.IconPath) + delete(rawMsg, key) + case "msixPackageApplicationId": + err = unpopulate(val, "MsixPackageApplicationID", &a.MsixPackageApplicationID) + delete(rawMsg, key) + case "msixPackageFamilyName": + err = unpopulate(val, "MsixPackageFamilyName", &a.MsixPackageFamilyName) + delete(rawMsg, key) + case "objectId": + err = unpopulate(val, "ObjectID", &a.ObjectID) + delete(rawMsg, key) + case "showInPortal": + err = unpopulate(val, "ShowInPortal", &a.ShowInPortal) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CloudErrorProperties. +func (c CloudErrorProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "code", c.Code) + populate(objectMap, "message", c.Message) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CloudErrorProperties. +func (c *CloudErrorProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "code": + err = unpopulate(val, "Code", &c.Code) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &c.Message) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Desktop. +func (d Desktop) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "systemData", d.SystemData) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Desktop. +func (d *Desktop) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &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) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DesktopList. +func (d DesktopList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &d.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &d.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DesktopPatch. +func (d DesktopPatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "tags", d.Tags) + return json.Marshal(objectMap) +} + +// 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &d.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DesktopPatchProperties. +func (d DesktopPatchProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", d.Description) + populate(objectMap, "friendlyName", d.FriendlyName) + return json.Marshal(objectMap) +} + +// 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &d.Description) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &d.FriendlyName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DesktopProperties. +func (d DesktopProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", d.Description) + populate(objectMap, "friendlyName", d.FriendlyName) + populateByteArray(objectMap, "iconContent", d.IconContent, runtime.Base64StdFormat) + populate(objectMap, "iconHash", d.IconHash) + populate(objectMap, "objectId", d.ObjectID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DesktopProperties. +func (d *DesktopProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &d.Description) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &d.FriendlyName) + delete(rawMsg, key) + case "iconContent": + err = runtime.DecodeByteArray(string(val), &d.IconContent, runtime.Base64StdFormat) + delete(rawMsg, key) + case "iconHash": + err = unpopulate(val, "IconHash", &d.IconHash) + delete(rawMsg, key) + case "objectId": + err = unpopulate(val, "ObjectID", &d.ObjectID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ExpandMsixImage. +func (e ExpandMsixImage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", e.ID) + populate(objectMap, "name", e.Name) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpandMsixImage. +func (e *ExpandMsixImage) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &e.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &e.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ExpandMsixImageList. +func (e ExpandMsixImageList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", e.NextLink) + populate(objectMap, "value", e.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpandMsixImageList. +func (e *ExpandMsixImageList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &e.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &e.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ExpandMsixImageProperties. +func (e ExpandMsixImageProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "displayName", e.DisplayName) + populate(objectMap, "imagePath", e.ImagePath) + populate(objectMap, "isActive", e.IsActive) + populate(objectMap, "isRegularRegistration", e.IsRegularRegistration) + populateTimeRFC3339(objectMap, "lastUpdated", e.LastUpdated) + populate(objectMap, "packageAlias", e.PackageAlias) + populate(objectMap, "packageApplications", e.PackageApplications) + populate(objectMap, "packageDependencies", e.PackageDependencies) + populate(objectMap, "packageFamilyName", e.PackageFamilyName) + populate(objectMap, "packageFullName", e.PackageFullName) + populate(objectMap, "packageName", e.PackageName) + populate(objectMap, "packageRelativePath", e.PackageRelativePath) + populate(objectMap, "version", e.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpandMsixImageProperties. +func (e *ExpandMsixImageProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "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 = unpopulateTimeRFC3339(val, "LastUpdated", &e.LastUpdated) + delete(rawMsg, key) + case "packageAlias": + err = unpopulate(val, "PackageAlias", &e.PackageAlias) + delete(rawMsg, key) + case "packageApplications": + err = unpopulate(val, "PackageApplications", &e.PackageApplications) + delete(rawMsg, key) + case "packageDependencies": + err = unpopulate(val, "PackageDependencies", &e.PackageDependencies) + delete(rawMsg, key) + case "packageFamilyName": + err = unpopulate(val, "PackageFamilyName", &e.PackageFamilyName) + delete(rawMsg, key) + case "packageFullName": + err = unpopulate(val, "PackageFullName", &e.PackageFullName) + delete(rawMsg, key) + case "packageName": + err = unpopulate(val, "PackageName", &e.PackageName) + delete(rawMsg, key) + case "packageRelativePath": + err = unpopulate(val, "PackageRelativePath", &e.PackageRelativePath) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &e.Version) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type HostPool. +func (h HostPool) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", h.Etag) + populate(objectMap, "id", h.ID) + populate(objectMap, "identity", h.Identity) + populate(objectMap, "kind", h.Kind) + populate(objectMap, "location", h.Location) + populate(objectMap, "managedBy", h.ManagedBy) + populate(objectMap, "name", h.Name) + populate(objectMap, "plan", h.Plan) + populate(objectMap, "properties", h.Properties) + populate(objectMap, "sku", h.SKU) + populate(objectMap, "systemData", h.SystemData) + populate(objectMap, "tags", h.Tags) + populate(objectMap, "type", h.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HostPool. +func (h *HostPool) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &h.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &h.ID) + delete(rawMsg, key) + case "identity": + err = unpopulate(val, "Identity", &h.Identity) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &h.Kind) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &h.Location) + delete(rawMsg, key) + case "managedBy": + err = unpopulate(val, "ManagedBy", &h.ManagedBy) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &h.Name) + delete(rawMsg, key) + case "plan": + err = unpopulate(val, "Plan", &h.Plan) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &h.Properties) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &h.SKU) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &h.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &h.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &h.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type HostPoolList. +func (h HostPoolList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", h.NextLink) + populate(objectMap, "value", h.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HostPoolList. +func (h *HostPoolList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &h.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &h.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type HostPoolPatch. +func (h HostPoolPatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", h.ID) + populate(objectMap, "name", h.Name) + populate(objectMap, "properties", h.Properties) + populate(objectMap, "tags", h.Tags) + populate(objectMap, "type", h.Type) + 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 "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]interface{}) + 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, "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) + 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 "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 "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) + 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]interface{}) + populate(objectMap, "agentUpdate", h.AgentUpdate) + populate(objectMap, "applicationGroupReferences", h.ApplicationGroupReferences) + populate(objectMap, "cloudPcResource", h.CloudPcResource) + populate(objectMap, "customRdpProperty", h.CustomRdpProperty) + populate(objectMap, "description", h.Description) + populate(objectMap, "friendlyName", h.FriendlyName) + populate(objectMap, "hostPoolType", h.HostPoolType) + populate(objectMap, "loadBalancerType", h.LoadBalancerType) + populate(objectMap, "maxSessionLimit", h.MaxSessionLimit) + populate(objectMap, "objectId", h.ObjectID) + populate(objectMap, "personalDesktopAssignmentType", h.PersonalDesktopAssignmentType) + populate(objectMap, "preferredAppGroupType", h.PreferredAppGroupType) + populate(objectMap, "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) + 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 "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 "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) + 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 Identity. +func (i Identity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "principalId", i.PrincipalID) + populate(objectMap, "tenantId", i.TenantID) + objectMap["type"] = "SystemAssigned" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Identity. +func (i *Identity) UnmarshalJSON(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 "principalId": + err = unpopulate(val, "PrincipalID", &i.PrincipalID) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &i.TenantID) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &i.Type) + 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 LogSpecification. +func (l LogSpecification) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + 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]interface{}) + 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]interface{}) + 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]interface{}) + 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]interface{}) + populate(objectMap, "id", m.ID) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + 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 "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]interface{}) + 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]interface{}) + populate(objectMap, "displayName", m.DisplayName) + populate(objectMap, "imagePath", m.ImagePath) + populate(objectMap, "isActive", m.IsActive) + populate(objectMap, "isRegularRegistration", m.IsRegularRegistration) + populateTimeRFC3339(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 = unpopulateTimeRFC3339(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]interface{}) + 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]interface{}) + populate(objectMap, "dayOfWeek", m.DayOfWeek) + populate(objectMap, "hour", m.Hour) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MaintenanceWindowProperties. +func (m *MaintenanceWindowProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "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 MsixPackageApplications. +func (m MsixPackageApplications) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "appId", m.AppID) + populate(objectMap, "appUserModelID", m.AppUserModelID) + populate(objectMap, "description", m.Description) + populate(objectMap, "friendlyName", m.FriendlyName) + populate(objectMap, "iconImageName", m.IconImageName) + populateByteArray(objectMap, "rawIcon", m.RawIcon, runtime.Base64StdFormat) + populateByteArray(objectMap, "rawPng", m.RawPNG, runtime.Base64StdFormat) + 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": + err = runtime.DecodeByteArray(string(val), &m.RawIcon, runtime.Base64StdFormat) + delete(rawMsg, key) + case "rawPng": + 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]interface{}) + 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 OperationProperties. +func (o OperationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + 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]interface{}) + 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 RegistrationInfo. +func (r RegistrationInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(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 = unpopulateTimeRFC3339(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]interface{}) + populateTimeRFC3339(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 = unpopulateTimeRFC3339(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 Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Resource. +func (r *Resource) UnmarshalJSON(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 "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) + 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 ResourceModelWithAllowedPropertySet. +func (r ResourceModelWithAllowedPropertySet) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", r.Etag) + populate(objectMap, "id", r.ID) + populate(objectMap, "identity", r.Identity) + populate(objectMap, "kind", r.Kind) + populate(objectMap, "location", r.Location) + populate(objectMap, "managedBy", r.ManagedBy) + populate(objectMap, "name", r.Name) + populate(objectMap, "plan", r.Plan) + populate(objectMap, "sku", r.SKU) + populate(objectMap, "tags", r.Tags) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceModelWithAllowedPropertySet. +func (r *ResourceModelWithAllowedPropertySet) UnmarshalJSON(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 "etag": + err = unpopulate(val, "Etag", &r.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "identity": + err = unpopulate(val, "Identity", &r.Identity) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &r.Kind) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &r.Location) + delete(rawMsg, key) + case "managedBy": + err = unpopulate(val, "ManagedBy", &r.ManagedBy) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "plan": + err = unpopulate(val, "Plan", &r.Plan) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &r.SKU) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &r.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) + 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]interface{}) + 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) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &r.TenantID) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) + 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 ResourceModelWithAllowedPropertySetPlan. +func (r ResourceModelWithAllowedPropertySetPlan) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + 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) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceModelWithAllowedPropertySetPlan. +func (r *ResourceModelWithAllowedPropertySetPlan) UnmarshalJSON(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 "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "product": + err = unpopulate(val, "Product", &r.Product) + delete(rawMsg, key) + case "promotionCode": + err = unpopulate(val, "PromotionCode", &r.PromotionCode) + delete(rawMsg, key) + case "publisher": + err = unpopulate(val, "Publisher", &r.Publisher) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &r.Version) + 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 ResourceModelWithAllowedPropertySetSKU. +func (r ResourceModelWithAllowedPropertySetSKU) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + 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) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceModelWithAllowedPropertySetSKU. +func (r *ResourceModelWithAllowedPropertySetSKU) UnmarshalJSON(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 "capacity": + err = unpopulate(val, "Capacity", &r.Capacity) + delete(rawMsg, key) + case "family": + err = unpopulate(val, "Family", &r.Family) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "size": + err = unpopulate(val, "Size", &r.Size) + delete(rawMsg, key) + case "tier": + err = unpopulate(val, "Tier", &r.Tier) + 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]interface{}) + 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]interface{}) + 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 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &r.Description) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &r.Operation) + delete(rawMsg, key) + case "provider": + err = unpopulate(val, "Provider", &r.Provider) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &r.Resource) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceProviderOperationList. +func (r ResourceProviderOperationList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) + return json.Marshal(objectMap) +} + +// 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", 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 SKU. +func (s SKU) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + 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 SKU. +func (s *SKU) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + 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", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ScalingHostPoolReference. +func (s ScalingHostPoolReference) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "hostPoolArmPath", s.HostPoolArmPath) + populate(objectMap, "scalingPlanEnabled", s.ScalingPlanEnabled) + return json.Marshal(objectMap) +} + +// 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + 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", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ScalingPlan. +func (s ScalingPlan) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + 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 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", 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", &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) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ScalingPlanList. +func (s ScalingPlanList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ScalingPlanPatch. +func (s ScalingPlanPatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "tags", s.Tags) + return json.Marshal(objectMap) +} + +// 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", s, err) + } + 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) + 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 ScalingPlanPatchProperties. +func (s ScalingPlanPatchProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + 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 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", s, err) + } + 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) + 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", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ScalingPlanPooledSchedule. +func (s ScalingPlanPooledSchedule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + 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 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "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", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ScalingPlanPooledScheduleList. +func (s ScalingPlanPooledScheduleList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + 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 { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ScalingPlanPooledSchedulePatch. +func (s ScalingPlanPooledSchedulePatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ScalingPlanPooledSchedulePatch. +func (s *ScalingPlanPooledSchedulePatch) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ScalingPlanPooledScheduleProperties. +func (s ScalingPlanPooledScheduleProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "daysOfWeek", s.DaysOfWeek) + populate(objectMap, "offPeakLoadBalancingAlgorithm", s.OffPeakLoadBalancingAlgorithm) + populate(objectMap, "offPeakStartTime", s.OffPeakStartTime) + populate(objectMap, "peakLoadBalancingAlgorithm", s.PeakLoadBalancingAlgorithm) + populate(objectMap, "peakStartTime", s.PeakStartTime) + populate(objectMap, "rampDownCapacityThresholdPct", s.RampDownCapacityThresholdPct) + populate(objectMap, "rampDownForceLogoffUsers", s.RampDownForceLogoffUsers) + populate(objectMap, "rampDownLoadBalancingAlgorithm", s.RampDownLoadBalancingAlgorithm) + populate(objectMap, "rampDownMinimumHostsPct", s.RampDownMinimumHostsPct) + populate(objectMap, "rampDownNotificationMessage", s.RampDownNotificationMessage) + populate(objectMap, "rampDownStartTime", s.RampDownStartTime) + populate(objectMap, "rampDownStopHostsWhen", s.RampDownStopHostsWhen) + populate(objectMap, "rampDownWaitTimeMinutes", s.RampDownWaitTimeMinutes) + populate(objectMap, "rampUpCapacityThresholdPct", s.RampUpCapacityThresholdPct) + populate(objectMap, "rampUpLoadBalancingAlgorithm", s.RampUpLoadBalancingAlgorithm) + populate(objectMap, "rampUpMinimumHostsPct", s.RampUpMinimumHostsPct) + populate(objectMap, "rampUpStartTime", s.RampUpStartTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ScalingPlanPooledScheduleProperties. +func (s *ScalingPlanPooledScheduleProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + 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) + delete(rawMsg, key) + case "rampUpStartTime": + err = unpopulate(val, "RampUpStartTime", &s.RampUpStartTime) + 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 ScalingPlanProperties. +func (s ScalingPlanProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + 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 ScalingPlanProperties. +func (s *ScalingPlanProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + 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) + 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", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ScalingSchedule. +func (s ScalingSchedule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "daysOfWeek", s.DaysOfWeek) + populate(objectMap, "name", s.Name) + populate(objectMap, "offPeakLoadBalancingAlgorithm", s.OffPeakLoadBalancingAlgorithm) + populate(objectMap, "offPeakStartTime", s.OffPeakStartTime) + populate(objectMap, "peakLoadBalancingAlgorithm", s.PeakLoadBalancingAlgorithm) + populate(objectMap, "peakStartTime", s.PeakStartTime) + populate(objectMap, "rampDownCapacityThresholdPct", s.RampDownCapacityThresholdPct) + populate(objectMap, "rampDownForceLogoffUsers", s.RampDownForceLogoffUsers) + populate(objectMap, "rampDownLoadBalancingAlgorithm", s.RampDownLoadBalancingAlgorithm) + populate(objectMap, "rampDownMinimumHostsPct", s.RampDownMinimumHostsPct) + populate(objectMap, "rampDownNotificationMessage", s.RampDownNotificationMessage) + populate(objectMap, "rampDownStartTime", s.RampDownStartTime) + populate(objectMap, "rampDownStopHostsWhen", s.RampDownStopHostsWhen) + populate(objectMap, "rampDownWaitTimeMinutes", s.RampDownWaitTimeMinutes) + populate(objectMap, "rampUpCapacityThresholdPct", s.RampUpCapacityThresholdPct) + populate(objectMap, "rampUpLoadBalancingAlgorithm", s.RampUpLoadBalancingAlgorithm) + populate(objectMap, "rampUpMinimumHostsPct", s.RampUpMinimumHostsPct) + populate(objectMap, "rampUpStartTime", s.RampUpStartTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ScalingSchedule. +func (s *ScalingSchedule) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "daysOfWeek": + err = unpopulate(val, "DaysOfWeek", &s.DaysOfWeek) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "offPeakLoadBalancingAlgorithm": + err = unpopulate(val, "OffPeakLoadBalancingAlgorithm", &s.OffPeakLoadBalancingAlgorithm) + delete(rawMsg, key) + case "offPeakStartTime": + err = unpopulate(val, "OffPeakStartTime", &s.OffPeakStartTime) + delete(rawMsg, key) + case "peakLoadBalancingAlgorithm": + err = unpopulate(val, "PeakLoadBalancingAlgorithm", &s.PeakLoadBalancingAlgorithm) + delete(rawMsg, key) + case "peakStartTime": + err = unpopulate(val, "PeakStartTime", &s.PeakStartTime) + delete(rawMsg, key) + case "rampDownCapacityThresholdPct": + err = unpopulate(val, "RampDownCapacityThresholdPct", &s.RampDownCapacityThresholdPct) + delete(rawMsg, key) + case "rampDownForceLogoffUsers": + err = unpopulate(val, "RampDownForceLogoffUsers", &s.RampDownForceLogoffUsers) + delete(rawMsg, key) + case "rampDownLoadBalancingAlgorithm": + err = unpopulate(val, "RampDownLoadBalancingAlgorithm", &s.RampDownLoadBalancingAlgorithm) + delete(rawMsg, key) + case "rampDownMinimumHostsPct": + err = unpopulate(val, "RampDownMinimumHostsPct", &s.RampDownMinimumHostsPct) + delete(rawMsg, key) + case "rampDownNotificationMessage": + err = unpopulate(val, "RampDownNotificationMessage", &s.RampDownNotificationMessage) + delete(rawMsg, key) + case "rampDownStartTime": + err = unpopulate(val, "RampDownStartTime", &s.RampDownStartTime) + delete(rawMsg, key) + case "rampDownStopHostsWhen": + err = unpopulate(val, "RampDownStopHostsWhen", &s.RampDownStopHostsWhen) + delete(rawMsg, key) + case "rampDownWaitTimeMinutes": + err = unpopulate(val, "RampDownWaitTimeMinutes", &s.RampDownWaitTimeMinutes) + delete(rawMsg, key) + case "rampUpCapacityThresholdPct": + err = unpopulate(val, "RampUpCapacityThresholdPct", &s.RampUpCapacityThresholdPct) + delete(rawMsg, key) + case "rampUpLoadBalancingAlgorithm": + err = unpopulate(val, "RampUpLoadBalancingAlgorithm", &s.RampUpLoadBalancingAlgorithm) + delete(rawMsg, key) + case "rampUpMinimumHostsPct": + err = unpopulate(val, "RampUpMinimumHostsPct", &s.RampUpMinimumHostsPct) + delete(rawMsg, key) + case "rampUpStartTime": + err = unpopulate(val, "RampUpStartTime", &s.RampUpStartTime) + 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 SendMessage. +func (s SendMessage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "messageBody", s.MessageBody) + populate(objectMap, "messageTitle", s.MessageTitle) + return json.Marshal(objectMap) +} + +// 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "messageBody": + err = unpopulate(val, "MessageBody", &s.MessageBody) + delete(rawMsg, key) + case "messageTitle": + err = unpopulate(val, "MessageTitle", &s.MessageTitle) + 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 ServiceSpecification. +func (s ServiceSpecification) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "logSpecifications", s.LogSpecifications) + return json.Marshal(objectMap) +} + +// 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "logSpecifications": + err = unpopulate(val, "LogSpecifications", &s.LogSpecifications) + 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 SessionHost. +func (s SessionHost) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + 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 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SessionHostHealthCheckFailureDetails. +func (s SessionHostHealthCheckFailureDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "errorCode", s.ErrorCode) + populateTimeRFC3339(objectMap, "lastHealthCheckDateTime", s.LastHealthCheckDateTime) + populate(objectMap, "message", s.Message) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SessionHostHealthCheckFailureDetails. +func (s *SessionHostHealthCheckFailureDetails) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "errorCode": + err = unpopulate(val, "ErrorCode", &s.ErrorCode) + delete(rawMsg, key) + case "lastHealthCheckDateTime": + err = unpopulateTimeRFC3339(val, "LastHealthCheckDateTime", &s.LastHealthCheckDateTime) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &s.Message) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SessionHostHealthCheckReport. +func (s SessionHostHealthCheckReport) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "additionalFailureDetails", s.AdditionalFailureDetails) + populate(objectMap, "healthCheckName", s.HealthCheckName) + populate(objectMap, "healthCheckResult", s.HealthCheckResult) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SessionHostHealthCheckReport. +func (s *SessionHostHealthCheckReport) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "additionalFailureDetails": + err = unpopulate(val, "AdditionalFailureDetails", &s.AdditionalFailureDetails) + delete(rawMsg, key) + case "healthCheckName": + err = unpopulate(val, "HealthCheckName", &s.HealthCheckName) + delete(rawMsg, key) + case "healthCheckResult": + err = unpopulate(val, "HealthCheckResult", &s.HealthCheckResult) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SessionHostList. +func (s SessionHostList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SessionHostList. +func (s *SessionHostList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SessionHostPatch. +func (s SessionHostPatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SessionHostPatch. +func (s *SessionHostPatch) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SessionHostPatchProperties. +func (s SessionHostPatchProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "allowNewSession", s.AllowNewSession) + populate(objectMap, "assignedUser", s.AssignedUser) + populate(objectMap, "friendlyName", s.FriendlyName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SessionHostPatchProperties. +func (s *SessionHostPatchProperties) UnmarshalJSON(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 "allowNewSession": + err = unpopulate(val, "AllowNewSession", &s.AllowNewSession) + delete(rawMsg, key) + case "assignedUser": + err = unpopulate(val, "AssignedUser", &s.AssignedUser) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &s.FriendlyName) + 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 SessionHostProperties. +func (s SessionHostProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "agentVersion", s.AgentVersion) + populate(objectMap, "allowNewSession", s.AllowNewSession) + populate(objectMap, "assignedUser", s.AssignedUser) + populate(objectMap, "friendlyName", s.FriendlyName) + populateTimeRFC3339(objectMap, "lastHeartBeat", s.LastHeartBeat) + populateTimeRFC3339(objectMap, "lastUpdateTime", s.LastUpdateTime) + populate(objectMap, "osVersion", s.OSVersion) + populate(objectMap, "objectId", s.ObjectID) + populate(objectMap, "resourceId", s.ResourceID) + populate(objectMap, "sessionHostHealthCheckResults", s.SessionHostHealthCheckResults) + populate(objectMap, "sessions", s.Sessions) + populate(objectMap, "status", s.Status) + populateTimeRFC3339(objectMap, "statusTimestamp", s.StatusTimestamp) + populate(objectMap, "sxSStackVersion", s.SxSStackVersion) + populate(objectMap, "updateErrorMessage", s.UpdateErrorMessage) + populate(objectMap, "updateState", s.UpdateState) + populate(objectMap, "virtualMachineId", s.VirtualMachineID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SessionHostProperties. +func (s *SessionHostProperties) UnmarshalJSON(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 "agentVersion": + err = unpopulate(val, "AgentVersion", &s.AgentVersion) + delete(rawMsg, key) + case "allowNewSession": + err = unpopulate(val, "AllowNewSession", &s.AllowNewSession) + delete(rawMsg, key) + case "assignedUser": + err = unpopulate(val, "AssignedUser", &s.AssignedUser) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &s.FriendlyName) + delete(rawMsg, key) + case "lastHeartBeat": + err = unpopulateTimeRFC3339(val, "LastHeartBeat", &s.LastHeartBeat) + delete(rawMsg, key) + case "lastUpdateTime": + err = unpopulateTimeRFC3339(val, "LastUpdateTime", &s.LastUpdateTime) + delete(rawMsg, key) + case "osVersion": + err = unpopulate(val, "OSVersion", &s.OSVersion) + delete(rawMsg, key) + case "objectId": + err = unpopulate(val, "ObjectID", &s.ObjectID) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &s.ResourceID) + delete(rawMsg, key) + case "sessionHostHealthCheckResults": + err = unpopulate(val, "SessionHostHealthCheckResults", &s.SessionHostHealthCheckResults) + delete(rawMsg, key) + case "sessions": + err = unpopulate(val, "Sessions", &s.Sessions) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &s.Status) + delete(rawMsg, key) + case "statusTimestamp": + err = unpopulateTimeRFC3339(val, "StatusTimestamp", &s.StatusTimestamp) + delete(rawMsg, key) + case "sxSStackVersion": + err = unpopulate(val, "SxSStackVersion", &s.SxSStackVersion) + delete(rawMsg, key) + case "updateErrorMessage": + err = unpopulate(val, "UpdateErrorMessage", &s.UpdateErrorMessage) + delete(rawMsg, key) + case "updateState": + err = unpopulate(val, "UpdateState", &s.UpdateState) + delete(rawMsg, key) + case "virtualMachineId": + err = unpopulate(val, "VirtualMachineID", &s.VirtualMachineID) + 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]interface{}) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type StartMenuItem. +func (s *StartMenuItem) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type StartMenuItemList. +func (s StartMenuItemList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type StartMenuItemList. +func (s *StartMenuItemList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type StartMenuItemProperties. +func (s StartMenuItemProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "appAlias", s.AppAlias) + populate(objectMap, "commandLineArguments", s.CommandLineArguments) + populate(objectMap, "filePath", s.FilePath) + populate(objectMap, "iconIndex", s.IconIndex) + populate(objectMap, "iconPath", s.IconPath) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type StartMenuItemProperties. +func (s *StartMenuItemProperties) UnmarshalJSON(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 "appAlias": + err = unpopulate(val, "AppAlias", &s.AppAlias) + delete(rawMsg, key) + case "commandLineArguments": + err = unpopulate(val, "CommandLineArguments", &s.CommandLineArguments) + delete(rawMsg, key) + case "filePath": + err = unpopulate(val, "FilePath", &s.FilePath) + delete(rawMsg, key) + case "iconIndex": + err = unpopulate(val, "IconIndex", &s.IconIndex) + delete(rawMsg, key) + case "iconPath": + err = unpopulate(val, "IconPath", &s.IconPath) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SystemData. +func (s SystemData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) + populate(objectMap, "createdBy", s.CreatedBy) + populate(objectMap, "createdByType", s.CreatedByType) + populateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) + populate(objectMap, "lastModifiedBy", s.LastModifiedBy) + populate(objectMap, "lastModifiedByType", s.LastModifiedByType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. +func (s *SystemData) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "createdAt": + err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) + delete(rawMsg, key) + case "createdBy": + err = unpopulate(val, "CreatedBy", &s.CreatedBy) + delete(rawMsg, key) + case "createdByType": + err = unpopulate(val, "CreatedByType", &s.CreatedByType) + delete(rawMsg, key) + case "lastModifiedAt": + err = unpopulateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) + delete(rawMsg, key) + case "lastModifiedBy": + err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) + delete(rawMsg, key) + case "lastModifiedByType": + err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Time. +func (t Time) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "hour", t.Hour) + populate(objectMap, "minute", t.Minute) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Time. +func (t *Time) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "hour": + err = unpopulate(val, "Hour", &t.Hour) + delete(rawMsg, key) + case "minute": + err = unpopulate(val, "Minute", &t.Minute) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UserSession. +func (u UserSession) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", u.ID) + populate(objectMap, "name", u.Name) + populate(objectMap, "properties", u.Properties) + populate(objectMap, "systemData", u.SystemData) + populate(objectMap, "type", u.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UserSession. +func (u *UserSession) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &u.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &u.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &u.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &u.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &u.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UserSessionList. +func (u UserSessionList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", u.NextLink) + populate(objectMap, "value", u.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UserSessionList. +func (u *UserSessionList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &u.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &u.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UserSessionProperties. +func (u UserSessionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "activeDirectoryUserName", u.ActiveDirectoryUserName) + populate(objectMap, "applicationType", u.ApplicationType) + populateTimeRFC3339(objectMap, "createTime", u.CreateTime) + populate(objectMap, "objectId", u.ObjectID) + populate(objectMap, "sessionState", u.SessionState) + populate(objectMap, "userPrincipalName", u.UserPrincipalName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UserSessionProperties. +func (u *UserSessionProperties) UnmarshalJSON(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 "activeDirectoryUserName": + err = unpopulate(val, "ActiveDirectoryUserName", &u.ActiveDirectoryUserName) + delete(rawMsg, key) + case "applicationType": + err = unpopulate(val, "ApplicationType", &u.ApplicationType) + delete(rawMsg, key) + case "createTime": + err = unpopulateTimeRFC3339(val, "CreateTime", &u.CreateTime) + delete(rawMsg, key) + case "objectId": + err = unpopulate(val, "ObjectID", &u.ObjectID) + delete(rawMsg, key) + case "sessionState": + err = unpopulate(val, "SessionState", &u.SessionState) + delete(rawMsg, key) + case "userPrincipalName": + err = unpopulate(val, "UserPrincipalName", &u.UserPrincipalName) + 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 Workspace. +func (w Workspace) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", w.Etag) + populate(objectMap, "id", w.ID) + populate(objectMap, "identity", w.Identity) + populate(objectMap, "kind", w.Kind) + populate(objectMap, "location", w.Location) + populate(objectMap, "managedBy", w.ManagedBy) + populate(objectMap, "name", w.Name) + populate(objectMap, "plan", w.Plan) + populate(objectMap, "properties", w.Properties) + populate(objectMap, "sku", w.SKU) + populate(objectMap, "systemData", w.SystemData) + populate(objectMap, "tags", w.Tags) + populate(objectMap, "type", w.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Workspace. +func (w *Workspace) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &w.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &w.ID) + delete(rawMsg, key) + case "identity": + err = unpopulate(val, "Identity", &w.Identity) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &w.Kind) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &w.Location) + delete(rawMsg, key) + case "managedBy": + err = unpopulate(val, "ManagedBy", &w.ManagedBy) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &w.Name) + delete(rawMsg, key) + case "plan": + err = unpopulate(val, "Plan", &w.Plan) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &w.Properties) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &w.SKU) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &w.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &w.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &w.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WorkspaceList. +func (w WorkspaceList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", w.NextLink) + populate(objectMap, "value", w.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkspaceList. +func (w *WorkspaceList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &w.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &w.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WorkspacePatch. +func (w WorkspacePatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", w.Properties) + populate(objectMap, "tags", w.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkspacePatch. +func (w *WorkspacePatch) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &w.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &w.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WorkspacePatchProperties. +func (w WorkspacePatchProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "applicationGroupReferences", w.ApplicationGroupReferences) + populate(objectMap, "description", w.Description) + populate(objectMap, "friendlyName", w.FriendlyName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkspacePatchProperties. +func (w *WorkspacePatchProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "applicationGroupReferences": + err = unpopulate(val, "ApplicationGroupReferences", &w.ApplicationGroupReferences) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &w.Description) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &w.FriendlyName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WorkspaceProperties. +func (w WorkspaceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "applicationGroupReferences", w.ApplicationGroupReferences) + populate(objectMap, "cloudPcResource", w.CloudPcResource) + populate(objectMap, "description", w.Description) + populate(objectMap, "friendlyName", w.FriendlyName) + populate(objectMap, "objectId", w.ObjectID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkspaceProperties. +func (w *WorkspaceProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "applicationGroupReferences": + err = unpopulate(val, "ApplicationGroupReferences", &w.ApplicationGroupReferences) + delete(rawMsg, key) + case "cloudPcResource": + err = unpopulate(val, "CloudPcResource", &w.CloudPcResource) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &w.Description) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &w.FriendlyName) + delete(rawMsg, key) + case "objectId": + err = unpopulate(val, "ObjectID", &w.ObjectID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +func populate(m map[string]interface{}, k string, v interface{}) { + if v == nil { + return + } else if azcore.IsNullValue(v) { + m[k] = nil + } else if !reflect.ValueOf(v).IsNil() { + m[k] = v + } +} + +func populateByteArray(m map[string]interface{}, k string, b []byte, f runtime.Base64Encoding) { + if azcore.IsNullValue(b) { + m[k] = nil + } else if len(b) == 0 { + return + } else { + m[k] = runtime.EncodeByteArray(b, f) + } +} + +func unpopulate(data json.RawMessage, fn string, v interface{}) error { + if data == nil { + return nil + } + if err := json.Unmarshal(data, v); err != nil { + return fmt.Errorf("struct field %s: %v", fn, err) + } + return nil +} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_msiximages_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/msiximages_client.go similarity index 96% rename from sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_msiximages_client.go rename to sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/msiximages_client.go index ac5e9c620d77..6843ee5d50d8 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_msiximages_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/msiximages_client.go @@ -5,6 +5,7 @@ // 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 @@ -55,8 +56,7 @@ func NewMsixImagesClient(subscriptionID string, credential azcore.TokenCredentia } // NewExpandPager - Expands and Lists MSIX packages in an Image, given the Image Path. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-10-preview +// Generated from API version 2022-09-09 // 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 @@ -109,7 +109,7 @@ func (client *MsixImagesClient) expandCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-10-preview") + reqQP.Set("api-version", "2022-09-09") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, msixImageURI) diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_msixpackages_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/msixpackages_client.go similarity index 95% rename from sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_msixpackages_client.go rename to sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/msixpackages_client.go index 4ee85546daca..c95e066c1563 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_msixpackages_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/msixpackages_client.go @@ -5,6 +5,7 @@ // 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 @@ -19,6 +20,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" "net/url" + "strconv" "strings" ) @@ -56,7 +58,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 2022-02-10-preview +// Generated from API version 2022-09-09 // 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 @@ -102,7 +104,7 @@ func (client *MSIXPackagesClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-10-preview") + reqQP.Set("api-version", "2022-09-09") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, msixPackage) @@ -119,7 +121,7 @@ func (client *MSIXPackagesClient) createOrUpdateHandleResponse(resp *http.Respon // Delete - Remove an MSIX Package. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-10-preview +// Generated from API version 2022-09-09 // 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 @@ -163,7 +165,7 @@ func (client *MSIXPackagesClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-10-preview") + reqQP.Set("api-version", "2022-09-09") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -171,7 +173,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 2022-02-10-preview +// Generated from API version 2022-09-09 // 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 @@ -215,7 +217,7 @@ func (client *MSIXPackagesClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-10-preview") + reqQP.Set("api-version", "2022-09-09") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -231,8 +233,7 @@ func (client *MSIXPackagesClient) getHandleResponse(resp *http.Response) (MSIXPa } // NewListPager - List MSIX packages in hostpool. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-10-preview +// Generated from API version 2022-09-09 // 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.List method. @@ -284,7 +285,16 @@ func (client *MSIXPackagesClient) listCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-10-preview") + reqQP.Set("api-version", "2022-09-09") + if options != nil && options.PageSize != nil { + reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) + } + if options != nil && options.IsDescending != nil { + reqQP.Set("isDescending", strconv.FormatBool(*options.IsDescending)) + } + if options != nil && options.InitialSkip != nil { + reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) + } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -301,7 +311,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 2022-02-10-preview +// Generated from API version 2022-09-09 // 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 @@ -345,7 +355,7 @@ func (client *MSIXPackagesClient) updateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-10-preview") + reqQP.Set("api-version", "2022-09-09") 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/zz_generated_operations_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/operations_client.go similarity index 95% rename from sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_operations_client.go rename to sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/operations_client.go index 08fa3bddf0de..4826b25478fe 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_operations_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/operations_client.go @@ -5,6 +5,7 @@ // 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 @@ -49,8 +50,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO } // NewListPager - List all of the available operations the Desktop Virtualization resource provider supports. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-10-preview +// Generated from API version 2022-09-09 // options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -88,7 +88,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-10-preview") + reqQP.Set("api-version", "2022-09-09") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_response_types.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/response_types.go similarity index 79% rename from sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_response_types.go rename to sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/response_types.go index c24e32c275bf..bfd54771330d 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_response_types.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/response_types.go @@ -5,6 +5,7 @@ // 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 @@ -148,54 +149,29 @@ type OperationsClientListResponse struct { ResourceProviderOperationList } -// PrivateEndpointConnectionsClientDeleteByHostPoolResponse contains the response from method PrivateEndpointConnectionsClient.DeleteByHostPool. -type PrivateEndpointConnectionsClientDeleteByHostPoolResponse struct { - // placeholder for future response values +// ScalingPlanPooledSchedulesClientCreateResponse contains the response from method ScalingPlanPooledSchedulesClient.Create. +type ScalingPlanPooledSchedulesClientCreateResponse struct { + ScalingPlanPooledSchedule } -// PrivateEndpointConnectionsClientDeleteByWorkspaceResponse contains the response from method PrivateEndpointConnectionsClient.DeleteByWorkspace. -type PrivateEndpointConnectionsClientDeleteByWorkspaceResponse struct { +// ScalingPlanPooledSchedulesClientDeleteResponse contains the response from method ScalingPlanPooledSchedulesClient.Delete. +type ScalingPlanPooledSchedulesClientDeleteResponse struct { // placeholder for future response values } -// PrivateEndpointConnectionsClientGetByHostPoolResponse contains the response from method PrivateEndpointConnectionsClient.GetByHostPool. -type PrivateEndpointConnectionsClientGetByHostPoolResponse struct { - PrivateEndpointConnectionWithSystemData -} - -// PrivateEndpointConnectionsClientGetByWorkspaceResponse contains the response from method PrivateEndpointConnectionsClient.GetByWorkspace. -type PrivateEndpointConnectionsClientGetByWorkspaceResponse struct { - PrivateEndpointConnectionWithSystemData -} - -// PrivateEndpointConnectionsClientListByHostPoolResponse contains the response from method PrivateEndpointConnectionsClient.ListByHostPool. -type PrivateEndpointConnectionsClientListByHostPoolResponse struct { - PrivateEndpointConnectionListResultWithSystemData -} - -// PrivateEndpointConnectionsClientListByWorkspaceResponse contains the response from method PrivateEndpointConnectionsClient.ListByWorkspace. -type PrivateEndpointConnectionsClientListByWorkspaceResponse struct { - PrivateEndpointConnectionListResultWithSystemData -} - -// PrivateEndpointConnectionsClientUpdateByHostPoolResponse contains the response from method PrivateEndpointConnectionsClient.UpdateByHostPool. -type PrivateEndpointConnectionsClientUpdateByHostPoolResponse struct { - PrivateEndpointConnectionWithSystemData -} - -// PrivateEndpointConnectionsClientUpdateByWorkspaceResponse contains the response from method PrivateEndpointConnectionsClient.UpdateByWorkspace. -type PrivateEndpointConnectionsClientUpdateByWorkspaceResponse struct { - PrivateEndpointConnectionWithSystemData +// ScalingPlanPooledSchedulesClientGetResponse contains the response from method ScalingPlanPooledSchedulesClient.Get. +type ScalingPlanPooledSchedulesClientGetResponse struct { + ScalingPlanPooledSchedule } -// PrivateLinkResourcesClientListByHostPoolResponse contains the response from method PrivateLinkResourcesClient.ListByHostPool. -type PrivateLinkResourcesClientListByHostPoolResponse struct { - PrivateLinkResourceListResult +// ScalingPlanPooledSchedulesClientListResponse contains the response from method ScalingPlanPooledSchedulesClient.List. +type ScalingPlanPooledSchedulesClientListResponse struct { + ScalingPlanPooledScheduleList } -// PrivateLinkResourcesClientListByWorkspaceResponse contains the response from method PrivateLinkResourcesClient.ListByWorkspace. -type PrivateLinkResourcesClientListByWorkspaceResponse struct { - PrivateLinkResourceListResult +// ScalingPlanPooledSchedulesClientUpdateResponse contains the response from method ScalingPlanPooledSchedulesClient.Update. +type ScalingPlanPooledSchedulesClientUpdateResponse struct { + ScalingPlanPooledSchedule } // ScalingPlansClientCreateResponse contains the response from method ScalingPlansClient.Create. diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/scalingplanpooledschedules_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/scalingplanpooledschedules_client.go new file mode 100644 index 000000000000..25db1324225c --- /dev/null +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/scalingplanpooledschedules_client.go @@ -0,0 +1,378 @@ +//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 + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strconv" + "strings" +) + +// ScalingPlanPooledSchedulesClient contains the methods for the ScalingPlanPooledSchedules group. +// Don't use this type directly, use NewScalingPlanPooledSchedulesClient() instead. +type ScalingPlanPooledSchedulesClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewScalingPlanPooledSchedulesClient creates a new instance of ScalingPlanPooledSchedulesClient with the specified values. +// subscriptionID - The ID of the target subscription. +// credential - used to authorize requests. Usually a credential from azidentity. +// options - pass nil to accept the default values. +func NewScalingPlanPooledSchedulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ScalingPlanPooledSchedulesClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &ScalingPlanPooledSchedulesClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// Create - Create or update a ScalingPlanPooledSchedule. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-09-09 +// 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 +// scalingPlanSchedule - Object containing ScalingPlanPooledSchedule definitions. +// options - ScalingPlanPooledSchedulesClientCreateOptions contains the optional parameters for the ScalingPlanPooledSchedulesClient.Create +// method. +func (client *ScalingPlanPooledSchedulesClient) Create(ctx context.Context, resourceGroupName string, scalingPlanName string, scalingPlanScheduleName string, scalingPlanSchedule ScalingPlanPooledSchedule, options *ScalingPlanPooledSchedulesClientCreateOptions) (ScalingPlanPooledSchedulesClientCreateResponse, error) { + req, err := client.createCreateRequest(ctx, resourceGroupName, scalingPlanName, scalingPlanScheduleName, scalingPlanSchedule, options) + if err != nil { + return ScalingPlanPooledSchedulesClientCreateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ScalingPlanPooledSchedulesClientCreateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return ScalingPlanPooledSchedulesClientCreateResponse{}, runtime.NewResponseError(resp) + } + return client.createHandleResponse(resp) +} + +// 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) { + 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") + } + 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 scalingPlanName == "" { + return nil, errors.New("parameter scalingPlanName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{scalingPlanName}", url.PathEscape(scalingPlanName)) + if scalingPlanScheduleName == "" { + return nil, errors.New("parameter scalingPlanScheduleName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{scalingPlanScheduleName}", url.PathEscape(scalingPlanScheduleName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-09-09") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, scalingPlanSchedule) +} + +// createHandleResponse handles the Create response. +func (client *ScalingPlanPooledSchedulesClient) createHandleResponse(resp *http.Response) (ScalingPlanPooledSchedulesClientCreateResponse, error) { + result := ScalingPlanPooledSchedulesClientCreateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ScalingPlanPooledSchedule); err != nil { + return ScalingPlanPooledSchedulesClientCreateResponse{}, err + } + return result, nil +} + +// Delete - Remove a ScalingPlanPooledSchedule. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-09-09 +// 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 +// options - ScalingPlanPooledSchedulesClientDeleteOptions contains the optional parameters for the ScalingPlanPooledSchedulesClient.Delete +// method. +func (client *ScalingPlanPooledSchedulesClient) Delete(ctx context.Context, resourceGroupName string, scalingPlanName string, scalingPlanScheduleName string, options *ScalingPlanPooledSchedulesClientDeleteOptions) (ScalingPlanPooledSchedulesClientDeleteResponse, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, scalingPlanName, scalingPlanScheduleName, options) + if err != nil { + return ScalingPlanPooledSchedulesClientDeleteResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ScalingPlanPooledSchedulesClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return ScalingPlanPooledSchedulesClientDeleteResponse{}, runtime.NewResponseError(resp) + } + return ScalingPlanPooledSchedulesClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *ScalingPlanPooledSchedulesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, scalingPlanName string, scalingPlanScheduleName string, options *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") + } + 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 scalingPlanName == "" { + return nil, errors.New("parameter scalingPlanName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{scalingPlanName}", url.PathEscape(scalingPlanName)) + if scalingPlanScheduleName == "" { + return nil, errors.New("parameter scalingPlanScheduleName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{scalingPlanScheduleName}", url.PathEscape(scalingPlanScheduleName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-09-09") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get a ScalingPlanPooledSchedule. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-09-09 +// 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 +// options - ScalingPlanPooledSchedulesClientGetOptions contains the optional parameters for the ScalingPlanPooledSchedulesClient.Get +// method. +func (client *ScalingPlanPooledSchedulesClient) Get(ctx context.Context, resourceGroupName string, scalingPlanName string, scalingPlanScheduleName string, options *ScalingPlanPooledSchedulesClientGetOptions) (ScalingPlanPooledSchedulesClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, scalingPlanName, scalingPlanScheduleName, options) + if err != nil { + return ScalingPlanPooledSchedulesClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ScalingPlanPooledSchedulesClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ScalingPlanPooledSchedulesClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *ScalingPlanPooledSchedulesClient) getCreateRequest(ctx context.Context, resourceGroupName string, scalingPlanName string, scalingPlanScheduleName string, options *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") + } + 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 scalingPlanName == "" { + return nil, errors.New("parameter scalingPlanName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{scalingPlanName}", url.PathEscape(scalingPlanName)) + if scalingPlanScheduleName == "" { + return nil, errors.New("parameter scalingPlanScheduleName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{scalingPlanScheduleName}", url.PathEscape(scalingPlanScheduleName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-09-09") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ScalingPlanPooledSchedulesClient) getHandleResponse(resp *http.Response) (ScalingPlanPooledSchedulesClientGetResponse, error) { + result := ScalingPlanPooledSchedulesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ScalingPlanPooledSchedule); err != nil { + return ScalingPlanPooledSchedulesClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - List ScalingPlanPooledSchedules. +// Generated from API version 2022-09-09 +// 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.List +// method. +func (client *ScalingPlanPooledSchedulesClient) NewListPager(resourceGroupName string, scalingPlanName string, options *ScalingPlanPooledSchedulesClientListOptions) *runtime.Pager[ScalingPlanPooledSchedulesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[ScalingPlanPooledSchedulesClientListResponse]{ + More: func(page ScalingPlanPooledSchedulesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ScalingPlanPooledSchedulesClientListResponse) (ScalingPlanPooledSchedulesClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, scalingPlanName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ScalingPlanPooledSchedulesClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ScalingPlanPooledSchedulesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ScalingPlanPooledSchedulesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *ScalingPlanPooledSchedulesClient) listCreateRequest(ctx context.Context, resourceGroupName string, scalingPlanName string, options *ScalingPlanPooledSchedulesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/pooledSchedules" + 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 scalingPlanName == "" { + return nil, errors.New("parameter scalingPlanName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{scalingPlanName}", url.PathEscape(scalingPlanName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-09-09") + if options != nil && options.PageSize != nil { + reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) + } + if options != nil && options.IsDescending != nil { + reqQP.Set("isDescending", strconv.FormatBool(*options.IsDescending)) + } + if options != nil && options.InitialSkip != nil { + reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *ScalingPlanPooledSchedulesClient) listHandleResponse(resp *http.Response) (ScalingPlanPooledSchedulesClientListResponse, error) { + result := ScalingPlanPooledSchedulesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ScalingPlanPooledScheduleList); err != nil { + return ScalingPlanPooledSchedulesClientListResponse{}, err + } + return result, nil +} + +// Update - Update a ScalingPlanPooledSchedule. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-09-09 +// 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 +// options - ScalingPlanPooledSchedulesClientUpdateOptions contains the optional parameters for the ScalingPlanPooledSchedulesClient.Update +// method. +func (client *ScalingPlanPooledSchedulesClient) Update(ctx context.Context, resourceGroupName string, scalingPlanName string, scalingPlanScheduleName string, options *ScalingPlanPooledSchedulesClientUpdateOptions) (ScalingPlanPooledSchedulesClientUpdateResponse, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, scalingPlanName, scalingPlanScheduleName, options) + if err != nil { + return ScalingPlanPooledSchedulesClientUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ScalingPlanPooledSchedulesClientUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ScalingPlanPooledSchedulesClientUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.updateHandleResponse(resp) +} + +// updateCreateRequest creates the Update request. +func (client *ScalingPlanPooledSchedulesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, scalingPlanName string, scalingPlanScheduleName string, options *ScalingPlanPooledSchedulesClientUpdateOptions) (*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") + } + 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 scalingPlanName == "" { + return nil, errors.New("parameter scalingPlanName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{scalingPlanName}", url.PathEscape(scalingPlanName)) + if scalingPlanScheduleName == "" { + return nil, errors.New("parameter scalingPlanScheduleName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{scalingPlanScheduleName}", url.PathEscape(scalingPlanScheduleName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-09-09") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if options != nil && options.ScalingPlanSchedule != nil { + return req, runtime.MarshalAsJSON(req, *options.ScalingPlanSchedule) + } + return req, nil +} + +// updateHandleResponse handles the Update response. +func (client *ScalingPlanPooledSchedulesClient) updateHandleResponse(resp *http.Response) (ScalingPlanPooledSchedulesClientUpdateResponse, error) { + result := ScalingPlanPooledSchedulesClientUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ScalingPlanPooledSchedule); err != nil { + return ScalingPlanPooledSchedulesClientUpdateResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_scalingplans_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/scalingplans_client.go similarity index 92% rename from sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_scalingplans_client.go rename to sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/scalingplans_client.go index a9c4a800ec52..f801f770c75e 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_scalingplans_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/scalingplans_client.go @@ -5,6 +5,7 @@ // 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 @@ -19,6 +20,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" "net/url" + "strconv" "strings" ) @@ -56,7 +58,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 2022-02-10-preview +// Generated from API version 2022-09-09 // 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. @@ -96,7 +98,7 @@ func (client *ScalingPlansClient) createCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-10-preview") + reqQP.Set("api-version", "2022-09-09") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, scalingPlan) @@ -113,7 +115,7 @@ func (client *ScalingPlansClient) createHandleResponse(resp *http.Response) (Sca // Delete - Remove a scaling plan. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-10-preview +// Generated from API version 2022-09-09 // 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. @@ -152,7 +154,7 @@ func (client *ScalingPlansClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-10-preview") + reqQP.Set("api-version", "2022-09-09") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -160,7 +162,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 2022-02-10-preview +// Generated from API version 2022-09-09 // 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. @@ -199,7 +201,7 @@ func (client *ScalingPlansClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-10-preview") + reqQP.Set("api-version", "2022-09-09") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -215,8 +217,7 @@ func (client *ScalingPlansClient) getHandleResponse(resp *http.Response) (Scalin } // NewListByHostPoolPager - List scaling plan associated with hostpool. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-10-preview +// Generated from API version 2022-09-09 // 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.ListByHostPool @@ -269,7 +270,16 @@ func (client *ScalingPlansClient) listByHostPoolCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-10-preview") + reqQP.Set("api-version", "2022-09-09") + if options != nil && options.PageSize != nil { + reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) + } + if options != nil && options.IsDescending != nil { + reqQP.Set("isDescending", strconv.FormatBool(*options.IsDescending)) + } + if options != nil && options.InitialSkip != nil { + reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) + } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -285,8 +295,7 @@ func (client *ScalingPlansClient) listByHostPoolHandleResponse(resp *http.Respon } // NewListByResourceGroupPager - List scaling plans. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-10-preview +// Generated from API version 2022-09-09 // resourceGroupName - The name of the resource group. The name is case insensitive. // options - ScalingPlansClientListByResourceGroupOptions contains the optional parameters for the ScalingPlansClient.ListByResourceGroup // method. @@ -334,7 +343,16 @@ func (client *ScalingPlansClient) listByResourceGroupCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-10-preview") + reqQP.Set("api-version", "2022-09-09") + if options != nil && options.PageSize != nil { + reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) + } + if options != nil && options.IsDescending != nil { + reqQP.Set("isDescending", strconv.FormatBool(*options.IsDescending)) + } + if options != nil && options.InitialSkip != nil { + reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) + } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -350,8 +368,7 @@ func (client *ScalingPlansClient) listByResourceGroupHandleResponse(resp *http.R } // NewListBySubscriptionPager - List scaling plans in subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-10-preview +// Generated from API version 2022-09-09 // options - ScalingPlansClientListBySubscriptionOptions contains the optional parameters for the ScalingPlansClient.ListBySubscription // method. func (client *ScalingPlansClient) NewListBySubscriptionPager(options *ScalingPlansClientListBySubscriptionOptions) *runtime.Pager[ScalingPlansClientListBySubscriptionResponse] { @@ -394,7 +411,16 @@ func (client *ScalingPlansClient) listBySubscriptionCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-10-preview") + reqQP.Set("api-version", "2022-09-09") + if options != nil && options.PageSize != nil { + reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) + } + if options != nil && options.IsDescending != nil { + reqQP.Set("isDescending", strconv.FormatBool(*options.IsDescending)) + } + if options != nil && options.InitialSkip != nil { + reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) + } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -411,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 2022-02-10-preview +// Generated from API version 2022-09-09 // 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. @@ -450,7 +476,7 @@ func (client *ScalingPlansClient) updateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-10-preview") + reqQP.Set("api-version", "2022-09-09") 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/zz_generated_sessionhosts_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/sessionhosts_client.go similarity index 95% rename from sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_sessionhosts_client.go rename to sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/sessionhosts_client.go index fb4b37e97358..957da7b45dac 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_sessionhosts_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/sessionhosts_client.go @@ -5,6 +5,7 @@ // 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 @@ -57,7 +58,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 2022-02-10-preview +// Generated from API version 2022-09-09 // 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 @@ -101,7 +102,7 @@ func (client *SessionHostsClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-10-preview") + reqQP.Set("api-version", "2022-09-09") if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } @@ -112,7 +113,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 2022-02-10-preview +// Generated from API version 2022-09-09 // 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 @@ -156,7 +157,7 @@ func (client *SessionHostsClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-10-preview") + reqQP.Set("api-version", "2022-09-09") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -172,8 +173,7 @@ func (client *SessionHostsClient) getHandleResponse(resp *http.Response) (Sessio } // NewListPager - List sessionHosts. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-10-preview +// Generated from API version 2022-09-09 // 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.List method. @@ -225,7 +225,16 @@ func (client *SessionHostsClient) listCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-10-preview") + reqQP.Set("api-version", "2022-09-09") + if options != nil && options.PageSize != nil { + reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) + } + if options != nil && options.IsDescending != nil { + reqQP.Set("isDescending", strconv.FormatBool(*options.IsDescending)) + } + if options != nil && options.InitialSkip != nil { + reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) + } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -242,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 2022-02-10-preview +// Generated from API version 2022-09-09 // 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 @@ -286,7 +295,7 @@ func (client *SessionHostsClient) updateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-10-preview") + reqQP.Set("api-version", "2022-09-09") if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_startmenuitems_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/startmenuitems_client.go similarity index 91% rename from sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_startmenuitems_client.go rename to sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/startmenuitems_client.go index 21be7eebc156..a5e10d4e726c 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_startmenuitems_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/startmenuitems_client.go @@ -5,6 +5,7 @@ // 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 @@ -19,6 +20,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" "net/url" + "strconv" "strings" ) @@ -55,8 +57,7 @@ func NewStartMenuItemsClient(subscriptionID string, credential azcore.TokenCrede } // NewListPager - List start menu items in the given application group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-10-preview +// Generated from API version 2022-09-09 // 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.List method. @@ -108,7 +109,16 @@ func (client *StartMenuItemsClient) listCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-10-preview") + reqQP.Set("api-version", "2022-09-09") + if options != nil && options.PageSize != nil { + reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) + } + if options != nil && options.IsDescending != nil { + reqQP.Set("isDescending", strconv.FormatBool(*options.IsDescending)) + } + if options != nil && options.InitialSkip != nil { + reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) + } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_time_rfc3339.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/time_rfc3339.go similarity index 99% rename from sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_time_rfc3339.go rename to sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/time_rfc3339.go index e90345791088..6b10287d07d2 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_time_rfc3339.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/time_rfc3339.go @@ -5,6 +5,7 @@ // 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 diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_usersessions_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/usersessions_client.go similarity index 94% rename from sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_usersessions_client.go rename to sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/usersessions_client.go index a5e96a7e47b6..8e4de97db96b 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_usersessions_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/usersessions_client.go @@ -5,6 +5,7 @@ // 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 @@ -57,7 +58,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 2022-02-10-preview +// Generated from API version 2022-09-09 // 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 @@ -106,7 +107,7 @@ func (client *UserSessionsClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-10-preview") + reqQP.Set("api-version", "2022-09-09") if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } @@ -117,7 +118,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 2022-02-10-preview +// Generated from API version 2022-09-09 // 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 @@ -166,7 +167,7 @@ func (client *UserSessionsClient) disconnectCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-10-preview") + reqQP.Set("api-version", "2022-09-09") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -174,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 2022-02-10-preview +// Generated from API version 2022-09-09 // 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 @@ -223,7 +224,7 @@ func (client *UserSessionsClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-10-preview") + reqQP.Set("api-version", "2022-09-09") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -239,8 +240,7 @@ func (client *UserSessionsClient) getHandleResponse(resp *http.Response) (UserSe } // NewListPager - List userSessions. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-10-preview +// Generated from API version 2022-09-09 // 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 @@ -297,7 +297,16 @@ func (client *UserSessionsClient) listCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-10-preview") + reqQP.Set("api-version", "2022-09-09") + if options != nil && options.PageSize != nil { + reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) + } + if options != nil && options.IsDescending != nil { + reqQP.Set("isDescending", strconv.FormatBool(*options.IsDescending)) + } + if options != nil && options.InitialSkip != nil { + reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) + } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -313,8 +322,7 @@ func (client *UserSessionsClient) listHandleResponse(resp *http.Response) (UserS } // NewListByHostPoolPager - List userSessions. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-10-preview +// Generated from API version 2022-09-09 // 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.ListByHostPool @@ -367,10 +375,19 @@ func (client *UserSessionsClient) listByHostPoolCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-10-preview") + reqQP.Set("api-version", "2022-09-09") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } + if options != nil && options.PageSize != nil { + reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) + } + if options != nil && options.IsDescending != nil { + reqQP.Set("isDescending", strconv.FormatBool(*options.IsDescending)) + } + if options != nil && options.InitialSkip != nil { + reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) + } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -387,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 2022-02-10-preview +// Generated from API version 2022-09-09 // 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 @@ -437,7 +454,7 @@ func (client *UserSessionsClient) sendMessageCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-10-preview") + reqQP.Set("api-version", "2022-09-09") 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/zz_generated_workspaces_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/workspaces_client.go similarity index 95% rename from sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_workspaces_client.go rename to sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/workspaces_client.go index 43a612fb511a..9266c153e267 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_workspaces_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/workspaces_client.go @@ -5,6 +5,7 @@ // 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 @@ -19,6 +20,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" "net/url" + "strconv" "strings" ) @@ -56,7 +58,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 2022-02-10-preview +// Generated from API version 2022-09-09 // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace // workspace - Object containing Workspace definitions. @@ -97,7 +99,7 @@ func (client *WorkspacesClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-10-preview") + reqQP.Set("api-version", "2022-09-09") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, workspace) @@ -114,7 +116,7 @@ func (client *WorkspacesClient) createOrUpdateHandleResponse(resp *http.Response // Delete - Remove a workspace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-10-preview +// Generated from API version 2022-09-09 // 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. @@ -153,7 +155,7 @@ func (client *WorkspacesClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-10-preview") + reqQP.Set("api-version", "2022-09-09") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -161,7 +163,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 2022-02-10-preview +// Generated from API version 2022-09-09 // 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. @@ -200,7 +202,7 @@ func (client *WorkspacesClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-10-preview") + reqQP.Set("api-version", "2022-09-09") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -216,8 +218,7 @@ func (client *WorkspacesClient) getHandleResponse(resp *http.Response) (Workspac } // NewListByResourceGroupPager - List workspaces. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-10-preview +// Generated from API version 2022-09-09 // resourceGroupName - The name of the resource group. The name is case insensitive. // options - WorkspacesClientListByResourceGroupOptions contains the optional parameters for the WorkspacesClient.ListByResourceGroup // method. @@ -265,7 +266,16 @@ func (client *WorkspacesClient) listByResourceGroupCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-10-preview") + reqQP.Set("api-version", "2022-09-09") + if options != nil && options.PageSize != nil { + reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) + } + if options != nil && options.IsDescending != nil { + reqQP.Set("isDescending", strconv.FormatBool(*options.IsDescending)) + } + if options != nil && options.InitialSkip != nil { + reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) + } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -281,8 +291,7 @@ func (client *WorkspacesClient) listByResourceGroupHandleResponse(resp *http.Res } // NewListBySubscriptionPager - List workspaces in subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-10-preview +// Generated from API version 2022-09-09 // options - WorkspacesClientListBySubscriptionOptions contains the optional parameters for the WorkspacesClient.ListBySubscription // method. func (client *WorkspacesClient) NewListBySubscriptionPager(options *WorkspacesClientListBySubscriptionOptions) *runtime.Pager[WorkspacesClientListBySubscriptionResponse] { @@ -325,7 +334,7 @@ func (client *WorkspacesClient) listBySubscriptionCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-10-preview") + reqQP.Set("api-version", "2022-09-09") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -342,7 +351,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 2022-02-10-preview +// Generated from API version 2022-09-09 // 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. @@ -381,7 +390,7 @@ func (client *WorkspacesClient) updateCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-10-preview") + reqQP.Set("api-version", "2022-09-09") 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/ze_generated_example_applicationgroups_client_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_applicationgroups_client_test.go deleted file mode 100644 index 69cdfde1f592..000000000000 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_applicationgroups_client_test.go +++ /dev/null @@ -1,180 +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. - -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/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/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() - client, err := armdesktopvirtualization.NewApplicationGroupsClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "resourceGroup1", - "applicationGroup1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/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() - client, err := armdesktopvirtualization.NewApplicationGroupsClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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"), - MigrationRequest: &armdesktopvirtualization.MigrationRequestProperties{ - MigrationPath: to.Ptr("TenantGroups/{defaultV1TenantGroup.Name}/Tenants/{defaultV1Tenant.Name}/HostPools/{sessionHostPool.Name}"), - Operation: to.Ptr(armdesktopvirtualization.OperationStart), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/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() - client, err := armdesktopvirtualization.NewApplicationGroupsClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.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/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/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() - client, err := armdesktopvirtualization.NewApplicationGroupsClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "resourceGroup1", - "applicationGroup1", - &armdesktopvirtualization.ApplicationGroupsClientUpdateOptions{ApplicationGroup: &armdesktopvirtualization.ApplicationGroupPatch{ - Properties: &armdesktopvirtualization.ApplicationGroupPatchProperties{ - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/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() - client, err := armdesktopvirtualization.NewApplicationGroupsClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("resourceGroup1", - &armdesktopvirtualization.ApplicationGroupsClientListByResourceGroupOptions{Filter: to.Ptr("applicationGroupType eq 'RailApplication'")}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/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() - client, err := armdesktopvirtualization.NewApplicationGroupsClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySubscriptionPager(&armdesktopvirtualization.ApplicationGroupsClientListBySubscriptionOptions{Filter: to.Ptr("applicationGroupType eq 'RailApplication'")}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_applications_client_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_applications_client_test.go deleted file mode 100644 index 59cd65dadb51..000000000000 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_applications_client_test.go +++ /dev/null @@ -1,159 +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. - -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/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/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() - client, err := armdesktopvirtualization.NewApplicationsClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "resourceGroup1", - "applicationGroup1", - "application1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/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() - client, err := armdesktopvirtualization.NewApplicationsClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/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() - client, err := armdesktopvirtualization.NewApplicationsClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.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/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/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() - client, err := armdesktopvirtualization.NewApplicationsClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/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() - client, err := armdesktopvirtualization.NewApplicationsClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("resourceGroup1", - "applicationGroup1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_desktops_client_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_desktops_client_test.go deleted file mode 100644 index 272030b98747..000000000000 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_desktops_client_test.go +++ /dev/null @@ -1,96 +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. - -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/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/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() - client, err := armdesktopvirtualization.NewDesktopsClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "resourceGroup1", - "applicationGroup1", - "SessionDesktop", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/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() - client, err := armdesktopvirtualization.NewDesktopsClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/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() - client, err := armdesktopvirtualization.NewDesktopsClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("resourceGroup1", - "applicationGroup1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_hostpools_client_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_hostpools_client_test.go deleted file mode 100644 index 3cdf36e40893..000000000000 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_hostpools_client_test.go +++ /dev/null @@ -1,260 +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. - -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/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/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() - client, err := armdesktopvirtualization.NewHostPoolsClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "resourceGroup1", - "hostPool1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/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() - client, err := armdesktopvirtualization.NewHostPoolsClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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), - MigrationRequest: &armdesktopvirtualization.MigrationRequestProperties{ - MigrationPath: to.Ptr("TenantGroups/{defaultV1TenantGroup.Name}/Tenants/{defaultV1Tenant.Name}/HostPools/{sessionHostPool.Name}"), - Operation: to.Ptr(armdesktopvirtualization.OperationStart), - }, - PersonalDesktopAssignmentType: to.Ptr(armdesktopvirtualization.PersonalDesktopAssignmentTypeAutomatic), - PreferredAppGroupType: to.Ptr(armdesktopvirtualization.PreferredAppGroupTypeDesktop), - PublicNetworkAccess: to.Ptr(armdesktopvirtualization.HostpoolPublicNetworkAccessEnabled), - RegistrationInfo: &armdesktopvirtualization.RegistrationInfo{ - ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-01T14:01:54.9571247Z"); 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/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() - client, err := armdesktopvirtualization.NewHostPoolsClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.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/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/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() - client, err := armdesktopvirtualization.NewHostPoolsClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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), - PublicNetworkAccess: to.Ptr(armdesktopvirtualization.HostpoolPublicNetworkAccessEnabled), - RegistrationInfo: &armdesktopvirtualization.RegistrationInfoPatch{ - ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-01T15:01:54.9571247Z"); 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/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() - client, err := armdesktopvirtualization.NewHostPoolsClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("resourceGroup1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/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() - client, err := armdesktopvirtualization.NewHostPoolsClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/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() - client, err := armdesktopvirtualization.NewHostPoolsClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.RetrieveRegistrationToken(ctx, - "resourceGroup1", - "hostPool1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_msiximages_client_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_msiximages_client_test.go deleted file mode 100644 index 9510cd781196..000000000000 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_msiximages_client_test.go +++ /dev/null @@ -1,47 +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. - -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/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/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() - client, err := armdesktopvirtualization.NewMsixImagesClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewExpandPager("resourceGroup1", - "hostpool1", - armdesktopvirtualization.MSIXImageURI{ - URI: to.Ptr("imagepath"), - }, - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_msixpackages_client_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_msixpackages_client_test.go deleted file mode 100644 index 26bc95dbaab5..000000000000 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_msixpackages_client_test.go +++ /dev/null @@ -1,172 +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. - -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/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/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() - client, err := armdesktopvirtualization.NewMSIXPackagesClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "resourceGroup1", - "hostpool1", - "packagefullname", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/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() - client, err := armdesktopvirtualization.NewMSIXPackagesClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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.9571247Z"); 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/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() - client, err := armdesktopvirtualization.NewMSIXPackagesClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.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/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/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() - client, err := armdesktopvirtualization.NewMSIXPackagesClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/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() - client, err := armdesktopvirtualization.NewMSIXPackagesClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("resourceGroup1", - "hostpool1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_operations_client_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_operations_client_test.go deleted file mode 100644 index f75e9023c1e7..000000000000 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_operations_client_test.go +++ /dev/null @@ -1,41 +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. - -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/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/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() - client, err := armdesktopvirtualization.NewOperationsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_privateendpointconnections_client_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_privateendpointconnections_client_test.go deleted file mode 100644 index 0ca954b79edb..000000000000 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_privateendpointconnections_client_test.go +++ /dev/null @@ -1,222 +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. - -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/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/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() - client, err := armdesktopvirtualization.NewPrivateEndpointConnectionsClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByHostPoolPager("resourceGroup1", - "hostPool1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/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() - client, err := armdesktopvirtualization.NewPrivateEndpointConnectionsClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetByHostPool(ctx, - "resourceGroup1", - "hostPool1", - "hostPool1.377103f1-5179-4bdf-8556-4cdd3207cc5b", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/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() - client, err := armdesktopvirtualization.NewPrivateEndpointConnectionsClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.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/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/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() - client, err := armdesktopvirtualization.NewPrivateEndpointConnectionsClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/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() - client, err := armdesktopvirtualization.NewPrivateEndpointConnectionsClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByWorkspacePager("resourceGroup1", - "workspace1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/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() - client, err := armdesktopvirtualization.NewPrivateEndpointConnectionsClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetByWorkspace(ctx, - "resourceGroup1", - "workspace1", - "workspace1.377103f1-5179-4bdf-8556-4cdd3207cc5b", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/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() - client, err := armdesktopvirtualization.NewPrivateEndpointConnectionsClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.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/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/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() - client, err := armdesktopvirtualization.NewPrivateEndpointConnectionsClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_privatelinkresources_client_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_privatelinkresources_client_test.go deleted file mode 100644 index 4983eb72d8dc..000000000000 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_privatelinkresources_client_test.go +++ /dev/null @@ -1,69 +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. - -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/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/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() - client, err := armdesktopvirtualization.NewPrivateLinkResourcesClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByHostPoolPager("resourceGroup1", - "hostPool1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/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() - client, err := armdesktopvirtualization.NewPrivateLinkResourcesClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByWorkspacePager("resourceGroup1", - "workspace1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_scalingplans_client_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_scalingplans_client_test.go deleted file mode 100644 index 6262fe679248..000000000000 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_scalingplans_client_test.go +++ /dev/null @@ -1,235 +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. - -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/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/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() - client, err := armdesktopvirtualization.NewScalingPlansClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "resourceGroup1", - "scalingPlan1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/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() - client, err := armdesktopvirtualization.NewScalingPlansClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/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() - client, err := armdesktopvirtualization.NewScalingPlansClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.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/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/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() - client, err := armdesktopvirtualization.NewScalingPlansClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "resourceGroup1", - "scalingPlan1", - &armdesktopvirtualization.ScalingPlansClientUpdateOptions{ScalingPlan: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/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() - client, err := armdesktopvirtualization.NewScalingPlansClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("resourceGroup1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/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() - client, err := armdesktopvirtualization.NewScalingPlansClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySubscriptionPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/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() - client, err := armdesktopvirtualization.NewScalingPlansClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByHostPoolPager("resourceGroup1", - "hostPool1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_sessionhosts_client_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_sessionhosts_client_test.go deleted file mode 100644 index 03e0ede8137e..000000000000 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_sessionhosts_client_test.go +++ /dev/null @@ -1,119 +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. - -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/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/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() - client, err := armdesktopvirtualization.NewSessionHostsClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "resourceGroup1", - "hostPool1", - "sessionHost1.microsoft.com", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/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() - client, err := armdesktopvirtualization.NewSessionHostsClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.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/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/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() - client, err := armdesktopvirtualization.NewSessionHostsClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/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() - client, err := armdesktopvirtualization.NewSessionHostsClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("resourceGroup1", - "hostPool1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_startmenuitems_client_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_startmenuitems_client_test.go deleted file mode 100644 index cd7b8a074ebb..000000000000 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_startmenuitems_client_test.go +++ /dev/null @@ -1,43 +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. - -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/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/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() - client, err := armdesktopvirtualization.NewStartMenuItemsClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("resourceGroup1", - "applicationGroup1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_usersessions_client_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_usersessions_client_test.go deleted file mode 100644 index a00321e6497a..000000000000 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_usersessions_client_test.go +++ /dev/null @@ -1,165 +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. - -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/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/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() - client, err := armdesktopvirtualization.NewUserSessionsClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByHostPoolPager("resourceGroup1", - "hostPool1", - &armdesktopvirtualization.UserSessionsClientListByHostPoolOptions{Filter: to.Ptr("userPrincipalName eq 'user1@microsoft.com' and state eq 'active'")}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/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() - client, err := armdesktopvirtualization.NewUserSessionsClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "resourceGroup1", - "hostPool1", - "sessionHost1.microsoft.com", - "1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/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() - client, err := armdesktopvirtualization.NewUserSessionsClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.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/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/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() - client, err := armdesktopvirtualization.NewUserSessionsClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("resourceGroup1", - "hostPool1", - "sessionHost1.microsoft.com", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/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() - client, err := armdesktopvirtualization.NewUserSessionsClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.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/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/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() - client, err := armdesktopvirtualization.NewUserSessionsClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.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/ze_generated_example_workspaces_client_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_workspaces_client_test.go deleted file mode 100644 index ba6f517d1147..000000000000 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_workspaces_client_test.go +++ /dev/null @@ -1,175 +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. - -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/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/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() - client, err := armdesktopvirtualization.NewWorkspacesClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "resourceGroup1", - "workspace1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/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() - client, err := armdesktopvirtualization.NewWorkspacesClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/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() - client, err := armdesktopvirtualization.NewWorkspacesClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.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/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/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() - client, err := armdesktopvirtualization.NewWorkspacesClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "resourceGroup1", - "workspace1", - &armdesktopvirtualization.WorkspacesClientUpdateOptions{Workspace: &armdesktopvirtualization.WorkspacePatch{ - Properties: &armdesktopvirtualization.WorkspacePatchProperties{ - Description: to.Ptr("des1"), - FriendlyName: to.Ptr("friendly"), - PublicNetworkAccess: to.Ptr(armdesktopvirtualization.PublicNetworkAccessEnabled), - }, - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/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() - client, err := armdesktopvirtualization.NewWorkspacesClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("resourceGroup1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/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() - client, err := armdesktopvirtualization.NewWorkspacesClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySubscriptionPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_models_serde.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_models_serde.go deleted file mode 100644 index 05fd0b990818..000000000000 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_models_serde.go +++ /dev/null @@ -1,947 +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. - -package armdesktopvirtualization - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "reflect" -) - -// MarshalJSON implements the json.Marshaller interface for type AgentUpdatePatchProperties. -func (a AgentUpdatePatchProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "maintenanceWindowTimeZone", a.MaintenanceWindowTimeZone) - populate(objectMap, "maintenanceWindows", a.MaintenanceWindows) - populate(objectMap, "type", a.Type) - populate(objectMap, "useSessionHostLocalTime", a.UseSessionHostLocalTime) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type AgentUpdateProperties. -func (a AgentUpdateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "maintenanceWindowTimeZone", a.MaintenanceWindowTimeZone) - populate(objectMap, "maintenanceWindows", a.MaintenanceWindows) - populate(objectMap, "type", a.Type) - populate(objectMap, "useSessionHostLocalTime", a.UseSessionHostLocalTime) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGroup. -func (a ApplicationGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", a.Etag) - populate(objectMap, "id", a.ID) - populate(objectMap, "identity", a.Identity) - populate(objectMap, "kind", a.Kind) - populate(objectMap, "location", a.Location) - populate(objectMap, "managedBy", a.ManagedBy) - populate(objectMap, "name", a.Name) - populate(objectMap, "plan", a.Plan) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "sku", a.SKU) - populate(objectMap, "systemData", a.SystemData) - populate(objectMap, "tags", a.Tags) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGroupPatch. -func (a ApplicationGroupPatch) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", a.ID) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "tags", a.Tags) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationPatch. -func (a ApplicationPatch) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "tags", a.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationProperties. -func (a ApplicationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "applicationType", a.ApplicationType) - populate(objectMap, "commandLineArguments", a.CommandLineArguments) - populate(objectMap, "commandLineSetting", a.CommandLineSetting) - populate(objectMap, "description", a.Description) - populate(objectMap, "filePath", a.FilePath) - populate(objectMap, "friendlyName", a.FriendlyName) - populateByteArray(objectMap, "iconContent", a.IconContent, runtime.Base64StdFormat) - populate(objectMap, "iconHash", a.IconHash) - populate(objectMap, "iconIndex", a.IconIndex) - populate(objectMap, "iconPath", a.IconPath) - populate(objectMap, "msixPackageApplicationId", a.MsixPackageApplicationID) - populate(objectMap, "msixPackageFamilyName", a.MsixPackageFamilyName) - populate(objectMap, "objectId", a.ObjectID) - populate(objectMap, "showInPortal", a.ShowInPortal) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationProperties. -func (a *ApplicationProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "applicationType": - err = unpopulate(val, "ApplicationType", &a.ApplicationType) - delete(rawMsg, key) - case "commandLineArguments": - err = unpopulate(val, "CommandLineArguments", &a.CommandLineArguments) - delete(rawMsg, key) - case "commandLineSetting": - err = unpopulate(val, "CommandLineSetting", &a.CommandLineSetting) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &a.Description) - delete(rawMsg, key) - case "filePath": - err = unpopulate(val, "FilePath", &a.FilePath) - delete(rawMsg, key) - case "friendlyName": - err = unpopulate(val, "FriendlyName", &a.FriendlyName) - delete(rawMsg, key) - case "iconContent": - err = runtime.DecodeByteArray(string(val), &a.IconContent, runtime.Base64StdFormat) - delete(rawMsg, key) - case "iconHash": - err = unpopulate(val, "IconHash", &a.IconHash) - delete(rawMsg, key) - case "iconIndex": - err = unpopulate(val, "IconIndex", &a.IconIndex) - delete(rawMsg, key) - case "iconPath": - err = unpopulate(val, "IconPath", &a.IconPath) - delete(rawMsg, key) - case "msixPackageApplicationId": - err = unpopulate(val, "MsixPackageApplicationID", &a.MsixPackageApplicationID) - delete(rawMsg, key) - case "msixPackageFamilyName": - err = unpopulate(val, "MsixPackageFamilyName", &a.MsixPackageFamilyName) - delete(rawMsg, key) - case "objectId": - err = unpopulate(val, "ObjectID", &a.ObjectID) - delete(rawMsg, key) - case "showInPortal": - err = unpopulate(val, "ShowInPortal", &a.ShowInPortal) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DesktopPatch. -func (d DesktopPatch) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "tags", d.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type DesktopProperties. -func (d DesktopProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "description", d.Description) - populate(objectMap, "friendlyName", d.FriendlyName) - populateByteArray(objectMap, "iconContent", d.IconContent, runtime.Base64StdFormat) - populate(objectMap, "iconHash", d.IconHash) - populate(objectMap, "objectId", d.ObjectID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DesktopProperties. -func (d *DesktopProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "description": - err = unpopulate(val, "Description", &d.Description) - delete(rawMsg, key) - case "friendlyName": - err = unpopulate(val, "FriendlyName", &d.FriendlyName) - delete(rawMsg, key) - case "iconContent": - err = runtime.DecodeByteArray(string(val), &d.IconContent, runtime.Base64StdFormat) - delete(rawMsg, key) - case "iconHash": - err = unpopulate(val, "IconHash", &d.IconHash) - delete(rawMsg, key) - case "objectId": - err = unpopulate(val, "ObjectID", &d.ObjectID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExpandMsixImageProperties. -func (e ExpandMsixImageProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "displayName", e.DisplayName) - populate(objectMap, "imagePath", e.ImagePath) - populate(objectMap, "isActive", e.IsActive) - populate(objectMap, "isRegularRegistration", e.IsRegularRegistration) - populateTimeRFC3339(objectMap, "lastUpdated", e.LastUpdated) - populate(objectMap, "packageAlias", e.PackageAlias) - populate(objectMap, "packageApplications", e.PackageApplications) - populate(objectMap, "packageDependencies", e.PackageDependencies) - populate(objectMap, "packageFamilyName", e.PackageFamilyName) - populate(objectMap, "packageFullName", e.PackageFullName) - populate(objectMap, "packageName", e.PackageName) - populate(objectMap, "packageRelativePath", e.PackageRelativePath) - populate(objectMap, "version", e.Version) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpandMsixImageProperties. -func (e *ExpandMsixImageProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "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 = unpopulateTimeRFC3339(val, "LastUpdated", &e.LastUpdated) - delete(rawMsg, key) - case "packageAlias": - err = unpopulate(val, "PackageAlias", &e.PackageAlias) - delete(rawMsg, key) - case "packageApplications": - err = unpopulate(val, "PackageApplications", &e.PackageApplications) - delete(rawMsg, key) - case "packageDependencies": - err = unpopulate(val, "PackageDependencies", &e.PackageDependencies) - delete(rawMsg, key) - case "packageFamilyName": - err = unpopulate(val, "PackageFamilyName", &e.PackageFamilyName) - delete(rawMsg, key) - case "packageFullName": - err = unpopulate(val, "PackageFullName", &e.PackageFullName) - delete(rawMsg, key) - case "packageName": - err = unpopulate(val, "PackageName", &e.PackageName) - delete(rawMsg, key) - case "packageRelativePath": - err = unpopulate(val, "PackageRelativePath", &e.PackageRelativePath) - delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &e.Version) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type HostPool. -func (h HostPool) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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) -} - -// MarshalJSON implements the json.Marshaller interface for type HostPoolPatch. -func (h HostPoolPatch) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", h.ID) - populate(objectMap, "name", h.Name) - populate(objectMap, "properties", h.Properties) - populate(objectMap, "tags", h.Tags) - populate(objectMap, "type", h.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type HostPoolProperties. -func (h HostPoolProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "agentUpdate", h.AgentUpdate) - populate(objectMap, "applicationGroupReferences", h.ApplicationGroupReferences) - populate(objectMap, "cloudPcResource", h.CloudPcResource) - populate(objectMap, "customRdpProperty", h.CustomRdpProperty) - populate(objectMap, "description", h.Description) - populate(objectMap, "friendlyName", h.FriendlyName) - populate(objectMap, "hostPoolType", h.HostPoolType) - populate(objectMap, "loadBalancerType", h.LoadBalancerType) - populate(objectMap, "maxSessionLimit", h.MaxSessionLimit) - populate(objectMap, "migrationRequest", h.MigrationRequest) - 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) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type MSIXPackagePatch. -func (m MSIXPackagePatch) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", m.ID) - populate(objectMap, "name", m.Name) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "type", m.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type MSIXPackageProperties. -func (m MSIXPackageProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "displayName", m.DisplayName) - populate(objectMap, "imagePath", m.ImagePath) - populate(objectMap, "isActive", m.IsActive) - populate(objectMap, "isRegularRegistration", m.IsRegularRegistration) - populateTimeRFC3339(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 = unpopulateTimeRFC3339(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 MsixPackageApplications. -func (m MsixPackageApplications) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "appId", m.AppID) - populate(objectMap, "appUserModelID", m.AppUserModelID) - populate(objectMap, "description", m.Description) - populate(objectMap, "friendlyName", m.FriendlyName) - populate(objectMap, "iconImageName", m.IconImageName) - populateByteArray(objectMap, "rawIcon", m.RawIcon, runtime.Base64StdFormat) - populateByteArray(objectMap, "rawPng", m.RawPNG, runtime.Base64StdFormat) - 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": - err = runtime.DecodeByteArray(string(val), &m.RawIcon, runtime.Base64StdFormat) - delete(rawMsg, key) - case "rawPng": - 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 PrivateLinkResourceProperties. -func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "groupId", p.GroupID) - populate(objectMap, "requiredMembers", p.RequiredMembers) - populate(objectMap, "requiredZoneNames", p.RequiredZoneNames) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type RegistrationInfo. -func (r RegistrationInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(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 = unpopulateTimeRFC3339(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]interface{}) - populateTimeRFC3339(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 = unpopulateTimeRFC3339(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 ResourceModelWithAllowedPropertySet. -func (r ResourceModelWithAllowedPropertySet) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", r.Etag) - populate(objectMap, "id", r.ID) - populate(objectMap, "identity", r.Identity) - populate(objectMap, "kind", r.Kind) - populate(objectMap, "location", r.Location) - populate(objectMap, "managedBy", r.ManagedBy) - populate(objectMap, "name", r.Name) - populate(objectMap, "plan", r.Plan) - populate(objectMap, "sku", r.SKU) - populate(objectMap, "tags", r.Tags) - populate(objectMap, "type", r.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ScalingPlan. -func (s ScalingPlan) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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) -} - -// MarshalJSON implements the json.Marshaller interface for type ScalingPlanPatch. -func (s ScalingPlanPatch) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "tags", s.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ScalingPlanPatchProperties. -func (s ScalingPlanPatchProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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) -} - -// MarshalJSON implements the json.Marshaller interface for type ScalingPlanProperties. -func (s ScalingPlanProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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) -} - -// MarshalJSON implements the json.Marshaller interface for type ScalingSchedule. -func (s ScalingSchedule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "daysOfWeek", s.DaysOfWeek) - populate(objectMap, "name", s.Name) - populate(objectMap, "offPeakLoadBalancingAlgorithm", s.OffPeakLoadBalancingAlgorithm) - populate(objectMap, "offPeakStartTime", s.OffPeakStartTime) - populate(objectMap, "peakLoadBalancingAlgorithm", s.PeakLoadBalancingAlgorithm) - populate(objectMap, "peakStartTime", s.PeakStartTime) - populate(objectMap, "rampDownCapacityThresholdPct", s.RampDownCapacityThresholdPct) - populate(objectMap, "rampDownForceLogoffUsers", s.RampDownForceLogoffUsers) - populate(objectMap, "rampDownLoadBalancingAlgorithm", s.RampDownLoadBalancingAlgorithm) - populate(objectMap, "rampDownMinimumHostsPct", s.RampDownMinimumHostsPct) - populate(objectMap, "rampDownNotificationMessage", s.RampDownNotificationMessage) - populate(objectMap, "rampDownStartTime", s.RampDownStartTime) - populate(objectMap, "rampDownStopHostsWhen", s.RampDownStopHostsWhen) - populate(objectMap, "rampDownWaitTimeMinutes", s.RampDownWaitTimeMinutes) - populate(objectMap, "rampUpCapacityThresholdPct", s.RampUpCapacityThresholdPct) - populate(objectMap, "rampUpLoadBalancingAlgorithm", s.RampUpLoadBalancingAlgorithm) - populate(objectMap, "rampUpMinimumHostsPct", s.RampUpMinimumHostsPct) - populate(objectMap, "rampUpStartTime", s.RampUpStartTime) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type SessionHostHealthCheckFailureDetails. -func (s SessionHostHealthCheckFailureDetails) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "errorCode", s.ErrorCode) - populateTimeRFC3339(objectMap, "lastHealthCheckDateTime", s.LastHealthCheckDateTime) - populate(objectMap, "message", s.Message) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SessionHostHealthCheckFailureDetails. -func (s *SessionHostHealthCheckFailureDetails) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "errorCode": - err = unpopulate(val, "ErrorCode", &s.ErrorCode) - delete(rawMsg, key) - case "lastHealthCheckDateTime": - err = unpopulateTimeRFC3339(val, "LastHealthCheckDateTime", &s.LastHealthCheckDateTime) - delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &s.Message) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SessionHostPatch. -func (s SessionHostPatch) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", s.ID) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "type", s.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type SessionHostProperties. -func (s SessionHostProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "agentVersion", s.AgentVersion) - populate(objectMap, "allowNewSession", s.AllowNewSession) - populate(objectMap, "assignedUser", s.AssignedUser) - populate(objectMap, "friendlyName", s.FriendlyName) - populateTimeRFC3339(objectMap, "lastHeartBeat", s.LastHeartBeat) - populateTimeRFC3339(objectMap, "lastUpdateTime", s.LastUpdateTime) - populate(objectMap, "osVersion", s.OSVersion) - populate(objectMap, "objectId", s.ObjectID) - populate(objectMap, "resourceId", s.ResourceID) - populate(objectMap, "sessionHostHealthCheckResults", s.SessionHostHealthCheckResults) - populate(objectMap, "sessions", s.Sessions) - populate(objectMap, "status", s.Status) - populateTimeRFC3339(objectMap, "statusTimestamp", s.StatusTimestamp) - populate(objectMap, "sxSStackVersion", s.SxSStackVersion) - populate(objectMap, "updateErrorMessage", s.UpdateErrorMessage) - populate(objectMap, "updateState", s.UpdateState) - populate(objectMap, "virtualMachineId", s.VirtualMachineID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SessionHostProperties. -func (s *SessionHostProperties) UnmarshalJSON(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 "agentVersion": - err = unpopulate(val, "AgentVersion", &s.AgentVersion) - delete(rawMsg, key) - case "allowNewSession": - err = unpopulate(val, "AllowNewSession", &s.AllowNewSession) - delete(rawMsg, key) - case "assignedUser": - err = unpopulate(val, "AssignedUser", &s.AssignedUser) - delete(rawMsg, key) - case "friendlyName": - err = unpopulate(val, "FriendlyName", &s.FriendlyName) - delete(rawMsg, key) - case "lastHeartBeat": - err = unpopulateTimeRFC3339(val, "LastHeartBeat", &s.LastHeartBeat) - delete(rawMsg, key) - case "lastUpdateTime": - err = unpopulateTimeRFC3339(val, "LastUpdateTime", &s.LastUpdateTime) - delete(rawMsg, key) - case "osVersion": - err = unpopulate(val, "OSVersion", &s.OSVersion) - delete(rawMsg, key) - case "objectId": - err = unpopulate(val, "ObjectID", &s.ObjectID) - delete(rawMsg, key) - case "resourceId": - err = unpopulate(val, "ResourceID", &s.ResourceID) - delete(rawMsg, key) - case "sessionHostHealthCheckResults": - err = unpopulate(val, "SessionHostHealthCheckResults", &s.SessionHostHealthCheckResults) - delete(rawMsg, key) - case "sessions": - err = unpopulate(val, "Sessions", &s.Sessions) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &s.Status) - delete(rawMsg, key) - case "statusTimestamp": - err = unpopulateTimeRFC3339(val, "StatusTimestamp", &s.StatusTimestamp) - delete(rawMsg, key) - case "sxSStackVersion": - err = unpopulate(val, "SxSStackVersion", &s.SxSStackVersion) - delete(rawMsg, key) - case "updateErrorMessage": - err = unpopulate(val, "UpdateErrorMessage", &s.UpdateErrorMessage) - delete(rawMsg, key) - case "updateState": - err = unpopulate(val, "UpdateState", &s.UpdateState) - delete(rawMsg, key) - case "virtualMachineId": - err = unpopulate(val, "VirtualMachineID", &s.VirtualMachineID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SystemData. -func (s SystemData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) - populate(objectMap, "createdBy", s.CreatedBy) - populate(objectMap, "createdByType", s.CreatedByType) - populateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) - populate(objectMap, "lastModifiedBy", s.LastModifiedBy) - populate(objectMap, "lastModifiedByType", s.LastModifiedByType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. -func (s *SystemData) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "createdAt": - err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) - delete(rawMsg, key) - case "createdBy": - err = unpopulate(val, "CreatedBy", &s.CreatedBy) - delete(rawMsg, key) - case "createdByType": - err = unpopulate(val, "CreatedByType", &s.CreatedByType) - delete(rawMsg, key) - case "lastModifiedAt": - err = unpopulateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) - delete(rawMsg, key) - case "lastModifiedBy": - err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) - delete(rawMsg, key) - case "lastModifiedByType": - err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type UserSessionProperties. -func (u UserSessionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "activeDirectoryUserName", u.ActiveDirectoryUserName) - populate(objectMap, "applicationType", u.ApplicationType) - populateTimeRFC3339(objectMap, "createTime", u.CreateTime) - populate(objectMap, "objectId", u.ObjectID) - populate(objectMap, "sessionState", u.SessionState) - populate(objectMap, "userPrincipalName", u.UserPrincipalName) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type UserSessionProperties. -func (u *UserSessionProperties) UnmarshalJSON(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 "activeDirectoryUserName": - err = unpopulate(val, "ActiveDirectoryUserName", &u.ActiveDirectoryUserName) - delete(rawMsg, key) - case "applicationType": - err = unpopulate(val, "ApplicationType", &u.ApplicationType) - delete(rawMsg, key) - case "createTime": - err = unpopulateTimeRFC3339(val, "CreateTime", &u.CreateTime) - delete(rawMsg, key) - case "objectId": - err = unpopulate(val, "ObjectID", &u.ObjectID) - delete(rawMsg, key) - case "sessionState": - err = unpopulate(val, "SessionState", &u.SessionState) - delete(rawMsg, key) - case "userPrincipalName": - err = unpopulate(val, "UserPrincipalName", &u.UserPrincipalName) - 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 Workspace. -func (w Workspace) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", w.Etag) - populate(objectMap, "id", w.ID) - populate(objectMap, "identity", w.Identity) - populate(objectMap, "kind", w.Kind) - populate(objectMap, "location", w.Location) - populate(objectMap, "managedBy", w.ManagedBy) - populate(objectMap, "name", w.Name) - populate(objectMap, "plan", w.Plan) - populate(objectMap, "properties", w.Properties) - populate(objectMap, "sku", w.SKU) - populate(objectMap, "systemData", w.SystemData) - populate(objectMap, "tags", w.Tags) - populate(objectMap, "type", w.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type WorkspacePatch. -func (w WorkspacePatch) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", w.Properties) - populate(objectMap, "tags", w.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type WorkspacePatchProperties. -func (w WorkspacePatchProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "applicationGroupReferences", w.ApplicationGroupReferences) - populate(objectMap, "description", w.Description) - populate(objectMap, "friendlyName", w.FriendlyName) - populate(objectMap, "publicNetworkAccess", w.PublicNetworkAccess) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type WorkspaceProperties. -func (w WorkspaceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "applicationGroupReferences", w.ApplicationGroupReferences) - populate(objectMap, "cloudPcResource", w.CloudPcResource) - populate(objectMap, "description", w.Description) - populate(objectMap, "friendlyName", w.FriendlyName) - populate(objectMap, "objectId", w.ObjectID) - populate(objectMap, "privateEndpointConnections", w.PrivateEndpointConnections) - populate(objectMap, "publicNetworkAccess", w.PublicNetworkAccess) - return json.Marshal(objectMap) -} - -func populate(m map[string]interface{}, k string, v interface{}) { - if v == nil { - return - } else if azcore.IsNullValue(v) { - m[k] = nil - } else if !reflect.ValueOf(v).IsNil() { - m[k] = v - } -} - -func populateByteArray(m map[string]interface{}, k string, b []byte, f runtime.Base64Encoding) { - if azcore.IsNullValue(b) { - m[k] = nil - } else if len(b) == 0 { - return - } else { - m[k] = runtime.EncodeByteArray(b, f) - } -} - -func unpopulate(data json.RawMessage, fn string, v interface{}) error { - if data == nil { - return nil - } - if err := json.Unmarshal(data, v); err != nil { - return fmt.Errorf("struct field %s: %v", fn, err) - } - return nil -} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_privateendpointconnections_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_privateendpointconnections_client.go deleted file mode 100644 index 7dca43baf40c..000000000000 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_privateendpointconnections_client.go +++ /dev/null @@ -1,551 +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. - -package armdesktopvirtualization - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "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" -) - -// PrivateEndpointConnectionsClient contains the methods for the PrivateEndpointConnections group. -// Don't use this type directly, use NewPrivateEndpointConnectionsClient() instead. -type PrivateEndpointConnectionsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewPrivateEndpointConnectionsClient creates a new instance of PrivateEndpointConnectionsClient with the specified values. -// subscriptionID - The ID of the target subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateEndpointConnectionsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &PrivateEndpointConnectionsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// DeleteByHostPool - Remove a connection. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-10-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 -// options - PrivateEndpointConnectionsClientDeleteByHostPoolOptions contains the optional parameters for the PrivateEndpointConnectionsClient.DeleteByHostPool -// method. -func (client *PrivateEndpointConnectionsClient) DeleteByHostPool(ctx context.Context, resourceGroupName string, hostPoolName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientDeleteByHostPoolOptions) (PrivateEndpointConnectionsClientDeleteByHostPoolResponse, error) { - req, err := client.deleteByHostPoolCreateRequest(ctx, resourceGroupName, hostPoolName, privateEndpointConnectionName, options) - if err != nil { - return PrivateEndpointConnectionsClientDeleteByHostPoolResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return PrivateEndpointConnectionsClientDeleteByHostPoolResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return PrivateEndpointConnectionsClientDeleteByHostPoolResponse{}, runtime.NewResponseError(resp) - } - return PrivateEndpointConnectionsClientDeleteByHostPoolResponse{}, nil -} - -// deleteByHostPoolCreateRequest creates the DeleteByHostPool request. -func (client *PrivateEndpointConnectionsClient) deleteByHostPoolCreateRequest(ctx context.Context, resourceGroupName string, hostPoolName string, privateEndpointConnectionName string, options *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") - } - 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 privateEndpointConnectionName == "" { - return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-10-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// DeleteByWorkspace - Remove a connection. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-10-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 -// options - PrivateEndpointConnectionsClientDeleteByWorkspaceOptions contains the optional parameters for the PrivateEndpointConnectionsClient.DeleteByWorkspace -// method. -func (client *PrivateEndpointConnectionsClient) DeleteByWorkspace(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientDeleteByWorkspaceOptions) (PrivateEndpointConnectionsClientDeleteByWorkspaceResponse, error) { - req, err := client.deleteByWorkspaceCreateRequest(ctx, resourceGroupName, workspaceName, privateEndpointConnectionName, options) - if err != nil { - return PrivateEndpointConnectionsClientDeleteByWorkspaceResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return PrivateEndpointConnectionsClientDeleteByWorkspaceResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return PrivateEndpointConnectionsClientDeleteByWorkspaceResponse{}, runtime.NewResponseError(resp) - } - return PrivateEndpointConnectionsClientDeleteByWorkspaceResponse{}, nil -} - -// deleteByWorkspaceCreateRequest creates the DeleteByWorkspace request. -func (client *PrivateEndpointConnectionsClient) deleteByWorkspaceCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string, options *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") - } - 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 workspaceName == "" { - return nil, errors.New("parameter workspaceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) - if privateEndpointConnectionName == "" { - return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-10-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// GetByHostPool - Get a private endpoint connection. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-10-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 -// options - PrivateEndpointConnectionsClientGetByHostPoolOptions contains the optional parameters for the PrivateEndpointConnectionsClient.GetByHostPool -// method. -func (client *PrivateEndpointConnectionsClient) GetByHostPool(ctx context.Context, resourceGroupName string, hostPoolName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientGetByHostPoolOptions) (PrivateEndpointConnectionsClientGetByHostPoolResponse, error) { - req, err := client.getByHostPoolCreateRequest(ctx, resourceGroupName, hostPoolName, privateEndpointConnectionName, options) - if err != nil { - return PrivateEndpointConnectionsClientGetByHostPoolResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return PrivateEndpointConnectionsClientGetByHostPoolResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PrivateEndpointConnectionsClientGetByHostPoolResponse{}, runtime.NewResponseError(resp) - } - return client.getByHostPoolHandleResponse(resp) -} - -// getByHostPoolCreateRequest creates the GetByHostPool request. -func (client *PrivateEndpointConnectionsClient) getByHostPoolCreateRequest(ctx context.Context, resourceGroupName string, hostPoolName string, privateEndpointConnectionName string, options *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") - } - 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 privateEndpointConnectionName == "" { - return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-10-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getByHostPoolHandleResponse handles the GetByHostPool response. -func (client *PrivateEndpointConnectionsClient) getByHostPoolHandleResponse(resp *http.Response) (PrivateEndpointConnectionsClientGetByHostPoolResponse, error) { - result := PrivateEndpointConnectionsClientGetByHostPoolResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnectionWithSystemData); err != nil { - return PrivateEndpointConnectionsClientGetByHostPoolResponse{}, err - } - return result, nil -} - -// GetByWorkspace - Get a private endpoint connection. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-10-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 -// options - PrivateEndpointConnectionsClientGetByWorkspaceOptions contains the optional parameters for the PrivateEndpointConnectionsClient.GetByWorkspace -// method. -func (client *PrivateEndpointConnectionsClient) GetByWorkspace(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientGetByWorkspaceOptions) (PrivateEndpointConnectionsClientGetByWorkspaceResponse, error) { - req, err := client.getByWorkspaceCreateRequest(ctx, resourceGroupName, workspaceName, privateEndpointConnectionName, options) - if err != nil { - return PrivateEndpointConnectionsClientGetByWorkspaceResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return PrivateEndpointConnectionsClientGetByWorkspaceResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PrivateEndpointConnectionsClientGetByWorkspaceResponse{}, runtime.NewResponseError(resp) - } - return client.getByWorkspaceHandleResponse(resp) -} - -// getByWorkspaceCreateRequest creates the GetByWorkspace request. -func (client *PrivateEndpointConnectionsClient) getByWorkspaceCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string, options *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") - } - 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 workspaceName == "" { - return nil, errors.New("parameter workspaceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) - if privateEndpointConnectionName == "" { - return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-10-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getByWorkspaceHandleResponse handles the GetByWorkspace response. -func (client *PrivateEndpointConnectionsClient) getByWorkspaceHandleResponse(resp *http.Response) (PrivateEndpointConnectionsClientGetByWorkspaceResponse, error) { - result := PrivateEndpointConnectionsClientGetByWorkspaceResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnectionWithSystemData); err != nil { - return PrivateEndpointConnectionsClientGetByWorkspaceResponse{}, err - } - return result, nil -} - -// NewListByHostPoolPager - List private endpoint connections associated with hostpool. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-10-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.ListByHostPool -// method. -func (client *PrivateEndpointConnectionsClient) NewListByHostPoolPager(resourceGroupName string, hostPoolName string, options *PrivateEndpointConnectionsClientListByHostPoolOptions) *runtime.Pager[PrivateEndpointConnectionsClientListByHostPoolResponse] { - return runtime.NewPager(runtime.PagingHandler[PrivateEndpointConnectionsClientListByHostPoolResponse]{ - More: func(page PrivateEndpointConnectionsClientListByHostPoolResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *PrivateEndpointConnectionsClientListByHostPoolResponse) (PrivateEndpointConnectionsClientListByHostPoolResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByHostPoolCreateRequest(ctx, resourceGroupName, hostPoolName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return PrivateEndpointConnectionsClientListByHostPoolResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return PrivateEndpointConnectionsClientListByHostPoolResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PrivateEndpointConnectionsClientListByHostPoolResponse{}, runtime.NewResponseError(resp) - } - return client.listByHostPoolHandleResponse(resp) - }, - }) -} - -// listByHostPoolCreateRequest creates the ListByHostPool request. -func (client *PrivateEndpointConnectionsClient) listByHostPoolCreateRequest(ctx context.Context, resourceGroupName string, hostPoolName string, options *PrivateEndpointConnectionsClientListByHostPoolOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/privateEndpointConnections" - 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.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-10-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByHostPoolHandleResponse handles the ListByHostPool response. -func (client *PrivateEndpointConnectionsClient) listByHostPoolHandleResponse(resp *http.Response) (PrivateEndpointConnectionsClientListByHostPoolResponse, error) { - result := PrivateEndpointConnectionsClientListByHostPoolResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnectionListResultWithSystemData); err != nil { - return PrivateEndpointConnectionsClientListByHostPoolResponse{}, err - } - return result, nil -} - -// NewListByWorkspacePager - List private endpoint connections. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-10-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.ListByWorkspace -// method. -func (client *PrivateEndpointConnectionsClient) NewListByWorkspacePager(resourceGroupName string, workspaceName string, options *PrivateEndpointConnectionsClientListByWorkspaceOptions) *runtime.Pager[PrivateEndpointConnectionsClientListByWorkspaceResponse] { - return runtime.NewPager(runtime.PagingHandler[PrivateEndpointConnectionsClientListByWorkspaceResponse]{ - More: func(page PrivateEndpointConnectionsClientListByWorkspaceResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *PrivateEndpointConnectionsClientListByWorkspaceResponse) (PrivateEndpointConnectionsClientListByWorkspaceResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByWorkspaceCreateRequest(ctx, resourceGroupName, workspaceName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return PrivateEndpointConnectionsClientListByWorkspaceResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return PrivateEndpointConnectionsClientListByWorkspaceResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PrivateEndpointConnectionsClientListByWorkspaceResponse{}, runtime.NewResponseError(resp) - } - return client.listByWorkspaceHandleResponse(resp) - }, - }) -} - -// listByWorkspaceCreateRequest creates the ListByWorkspace request. -func (client *PrivateEndpointConnectionsClient) listByWorkspaceCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, options *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") - } - 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 workspaceName == "" { - return nil, errors.New("parameter workspaceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-10-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByWorkspaceHandleResponse handles the ListByWorkspace response. -func (client *PrivateEndpointConnectionsClient) listByWorkspaceHandleResponse(resp *http.Response) (PrivateEndpointConnectionsClientListByWorkspaceResponse, error) { - result := PrivateEndpointConnectionsClientListByWorkspaceResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnectionListResultWithSystemData); err != nil { - return PrivateEndpointConnectionsClientListByWorkspaceResponse{}, err - } - return result, nil -} - -// UpdateByHostPool - Approve or reject a private endpoint connection. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-10-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 -// connection - Object containing the updated connection. -// options - PrivateEndpointConnectionsClientUpdateByHostPoolOptions contains the optional parameters for the PrivateEndpointConnectionsClient.UpdateByHostPool -// method. -func (client *PrivateEndpointConnectionsClient) UpdateByHostPool(ctx context.Context, resourceGroupName string, hostPoolName string, privateEndpointConnectionName string, connection PrivateEndpointConnection, options *PrivateEndpointConnectionsClientUpdateByHostPoolOptions) (PrivateEndpointConnectionsClientUpdateByHostPoolResponse, error) { - req, err := client.updateByHostPoolCreateRequest(ctx, resourceGroupName, hostPoolName, privateEndpointConnectionName, connection, options) - if err != nil { - return PrivateEndpointConnectionsClientUpdateByHostPoolResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return PrivateEndpointConnectionsClientUpdateByHostPoolResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PrivateEndpointConnectionsClientUpdateByHostPoolResponse{}, runtime.NewResponseError(resp) - } - return client.updateByHostPoolHandleResponse(resp) -} - -// 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) { - 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") - } - 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 privateEndpointConnectionName == "" { - return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-10-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, connection) -} - -// updateByHostPoolHandleResponse handles the UpdateByHostPool response. -func (client *PrivateEndpointConnectionsClient) updateByHostPoolHandleResponse(resp *http.Response) (PrivateEndpointConnectionsClientUpdateByHostPoolResponse, error) { - result := PrivateEndpointConnectionsClientUpdateByHostPoolResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnectionWithSystemData); err != nil { - return PrivateEndpointConnectionsClientUpdateByHostPoolResponse{}, err - } - return result, nil -} - -// UpdateByWorkspace - Approve or reject a private endpoint connection. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-10-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 -// connection - Object containing the updated connection. -// options - PrivateEndpointConnectionsClientUpdateByWorkspaceOptions contains the optional parameters for the PrivateEndpointConnectionsClient.UpdateByWorkspace -// method. -func (client *PrivateEndpointConnectionsClient) UpdateByWorkspace(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string, connection PrivateEndpointConnection, options *PrivateEndpointConnectionsClientUpdateByWorkspaceOptions) (PrivateEndpointConnectionsClientUpdateByWorkspaceResponse, error) { - req, err := client.updateByWorkspaceCreateRequest(ctx, resourceGroupName, workspaceName, privateEndpointConnectionName, connection, options) - if err != nil { - return PrivateEndpointConnectionsClientUpdateByWorkspaceResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return PrivateEndpointConnectionsClientUpdateByWorkspaceResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PrivateEndpointConnectionsClientUpdateByWorkspaceResponse{}, runtime.NewResponseError(resp) - } - return client.updateByWorkspaceHandleResponse(resp) -} - -// 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) { - 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") - } - 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 workspaceName == "" { - return nil, errors.New("parameter workspaceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) - if privateEndpointConnectionName == "" { - return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-10-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, connection) -} - -// updateByWorkspaceHandleResponse handles the UpdateByWorkspace response. -func (client *PrivateEndpointConnectionsClient) updateByWorkspaceHandleResponse(resp *http.Response) (PrivateEndpointConnectionsClientUpdateByWorkspaceResponse, error) { - result := PrivateEndpointConnectionsClientUpdateByWorkspaceResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnectionWithSystemData); err != nil { - return PrivateEndpointConnectionsClientUpdateByWorkspaceResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_privatelinkresources_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_privatelinkresources_client.go deleted file mode 100644 index f86c0fac2333..000000000000 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_privatelinkresources_client.go +++ /dev/null @@ -1,195 +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. - -package armdesktopvirtualization - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "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" -) - -// PrivateLinkResourcesClient contains the methods for the PrivateLinkResources group. -// Don't use this type directly, use NewPrivateLinkResourcesClient() instead. -type PrivateLinkResourcesClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewPrivateLinkResourcesClient creates a new instance of PrivateLinkResourcesClient with the specified values. -// subscriptionID - The ID of the target subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateLinkResourcesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &PrivateLinkResourcesClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// NewListByHostPoolPager - List the private link resources available for this hostpool. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-10-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.ListByHostPool -// method. -func (client *PrivateLinkResourcesClient) NewListByHostPoolPager(resourceGroupName string, hostPoolName string, options *PrivateLinkResourcesClientListByHostPoolOptions) *runtime.Pager[PrivateLinkResourcesClientListByHostPoolResponse] { - return runtime.NewPager(runtime.PagingHandler[PrivateLinkResourcesClientListByHostPoolResponse]{ - More: func(page PrivateLinkResourcesClientListByHostPoolResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *PrivateLinkResourcesClientListByHostPoolResponse) (PrivateLinkResourcesClientListByHostPoolResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByHostPoolCreateRequest(ctx, resourceGroupName, hostPoolName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return PrivateLinkResourcesClientListByHostPoolResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return PrivateLinkResourcesClientListByHostPoolResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PrivateLinkResourcesClientListByHostPoolResponse{}, runtime.NewResponseError(resp) - } - return client.listByHostPoolHandleResponse(resp) - }, - }) -} - -// listByHostPoolCreateRequest creates the ListByHostPool request. -func (client *PrivateLinkResourcesClient) listByHostPoolCreateRequest(ctx context.Context, resourceGroupName string, hostPoolName string, options *PrivateLinkResourcesClientListByHostPoolOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/privateLinkResources" - 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.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-10-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByHostPoolHandleResponse handles the ListByHostPool response. -func (client *PrivateLinkResourcesClient) listByHostPoolHandleResponse(resp *http.Response) (PrivateLinkResourcesClientListByHostPoolResponse, error) { - result := PrivateLinkResourcesClientListByHostPoolResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.PrivateLinkResourceListResult); err != nil { - return PrivateLinkResourcesClientListByHostPoolResponse{}, err - } - return result, nil -} - -// NewListByWorkspacePager - List the private link resources available for this workspace. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-10-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.ListByWorkspace -// method. -func (client *PrivateLinkResourcesClient) NewListByWorkspacePager(resourceGroupName string, workspaceName string, options *PrivateLinkResourcesClientListByWorkspaceOptions) *runtime.Pager[PrivateLinkResourcesClientListByWorkspaceResponse] { - return runtime.NewPager(runtime.PagingHandler[PrivateLinkResourcesClientListByWorkspaceResponse]{ - More: func(page PrivateLinkResourcesClientListByWorkspaceResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *PrivateLinkResourcesClientListByWorkspaceResponse) (PrivateLinkResourcesClientListByWorkspaceResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByWorkspaceCreateRequest(ctx, resourceGroupName, workspaceName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return PrivateLinkResourcesClientListByWorkspaceResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return PrivateLinkResourcesClientListByWorkspaceResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PrivateLinkResourcesClientListByWorkspaceResponse{}, runtime.NewResponseError(resp) - } - return client.listByWorkspaceHandleResponse(resp) - }, - }) -} - -// listByWorkspaceCreateRequest creates the ListByWorkspace request. -func (client *PrivateLinkResourcesClient) listByWorkspaceCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, options *PrivateLinkResourcesClientListByWorkspaceOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}/privateLinkResources" - 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 workspaceName == "" { - return nil, errors.New("parameter workspaceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-10-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByWorkspaceHandleResponse handles the ListByWorkspace response. -func (client *PrivateLinkResourcesClient) listByWorkspaceHandleResponse(resp *http.Response) (PrivateLinkResourcesClientListByWorkspaceResponse, error) { - result := PrivateLinkResourcesClientListByWorkspaceResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.PrivateLinkResourceListResult); err != nil { - return PrivateLinkResourcesClientListByWorkspaceResponse{}, err - } - return result, nil -}