diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/CHANGELOG.md b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/CHANGELOG.md index e486be525b76..36ed2e515b34 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/CHANGELOG.md +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/CHANGELOG.md @@ -1,5 +1,44 @@ # Release History +## 2.3.0 (2024-05-18) +### Features Added + +- New enum type `AppAttachPackageArchitectures` with values `AppAttachPackageArchitecturesALL`, `AppAttachPackageArchitecturesARM`, `AppAttachPackageArchitecturesARM64`, `AppAttachPackageArchitecturesNeutral`, `AppAttachPackageArchitecturesX64`, `AppAttachPackageArchitecturesX86`, `AppAttachPackageArchitecturesX86A64` +- New enum type `FailHealthCheckOnStagingFailure` with values `FailHealthCheckOnStagingFailureDoNotFail`, `FailHealthCheckOnStagingFailureNeedsAssistance`, `FailHealthCheckOnStagingFailureUnhealthy` +- New enum type `PackageTimestamped` with values `PackageTimestampedNotTimestamped`, `PackageTimestampedTimestamped` +- New enum type `ProvisioningState` with values `ProvisioningStateCanceled`, `ProvisioningStateFailed`, `ProvisioningStateProvisioning`, `ProvisioningStateSucceeded` +- New function `NewAppAttachPackageClient(string, azcore.TokenCredential, *arm.ClientOptions) (*AppAttachPackageClient, error)` +- New function `*AppAttachPackageClient.CreateOrUpdate(context.Context, string, string, AppAttachPackage, *AppAttachPackageClientCreateOrUpdateOptions) (AppAttachPackageClientCreateOrUpdateResponse, error)` +- New function `*AppAttachPackageClient.Delete(context.Context, string, string, *AppAttachPackageClientDeleteOptions) (AppAttachPackageClientDeleteResponse, error)` +- New function `*AppAttachPackageClient.Get(context.Context, string, string, *AppAttachPackageClientGetOptions) (AppAttachPackageClientGetResponse, error)` +- New function `*AppAttachPackageClient.NewListByResourceGroupPager(string, *AppAttachPackageClientListByResourceGroupOptions) *runtime.Pager[AppAttachPackageClientListByResourceGroupResponse]` +- New function `*AppAttachPackageClient.NewListBySubscriptionPager(*AppAttachPackageClientListBySubscriptionOptions) *runtime.Pager[AppAttachPackageClientListBySubscriptionResponse]` +- New function `*AppAttachPackageClient.Update(context.Context, string, string, *AppAttachPackageClientUpdateOptions) (AppAttachPackageClientUpdateResponse, error)` +- New function `NewAppAttachPackageInfoClient(string, azcore.TokenCredential, *arm.ClientOptions) (*AppAttachPackageInfoClient, error)` +- New function `*AppAttachPackageInfoClient.NewImportPager(string, string, ImportPackageInfoRequest, *AppAttachPackageInfoClientImportOptions) *runtime.Pager[AppAttachPackageInfoClientImportResponse]` +- New function `*ClientFactory.NewAppAttachPackageClient() *AppAttachPackageClient` +- New function `*ClientFactory.NewAppAttachPackageInfoClient() *AppAttachPackageInfoClient` +- New struct `AppAttachPackage` +- New struct `AppAttachPackageInfoProperties` +- New struct `AppAttachPackageList` +- New struct `AppAttachPackagePatch` +- New struct `AppAttachPackagePatchProperties` +- New struct `AppAttachPackageProperties` +- New struct `ImportPackageInfoRequest` +- New field `SystemData` in struct `ApplicationGroupPatch` +- New field `SystemData` in struct `ExpandMsixImage` +- New field `CertificateExpiry`, `CertificateName` in struct `ExpandMsixImageProperties` +- New field `SystemData` in struct `HostPoolPatch` +- New field `AppAttachPackageReferences` in struct `HostPoolProperties` +- New field `SystemData` in struct `MSIXPackagePatch` +- New field `SystemData` in struct `PrivateEndpointConnection` +- New field `GroupIDs` in struct `PrivateEndpointConnectionProperties` +- New field `SystemData` in struct `PrivateLinkResource` +- New field `SystemData` in struct `ScalingPlanPooledSchedulePatch` +- New field `SystemData` in struct `SessionHostPatch` +- New field `SystemData` in struct `StartMenuItem` + + ## 2.2.0 (2023-11-24) ### Features Added diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/README.md b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/README.md index bb5ca459adc1..9dad2e6b9fcd 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/README.md +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/README.md @@ -57,7 +57,7 @@ clientFactory, err := armdesktopvirtualization.NewClientFactory( 0 + }, + Fetcher: func(ctx context.Context, page *AppAttachPackageClientListByResourceGroupResponse) (AppAttachPackageClientListByResourceGroupResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "AppAttachPackageClient.NewListByResourceGroupPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + }, nil) + if err != nil { + return AppAttachPackageClientListByResourceGroupResponse{}, err + } + return client.listByResourceGroupHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *AppAttachPackageClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *AppAttachPackageClientListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/appAttachPackages" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + reqQP.Set("api-version", "2024-04-03") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *AppAttachPackageClient) listByResourceGroupHandleResponse(resp *http.Response) (AppAttachPackageClientListByResourceGroupResponse, error) { + result := AppAttachPackageClientListByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AppAttachPackageList); err != nil { + return AppAttachPackageClientListByResourceGroupResponse{}, err + } + return result, nil +} + +// NewListBySubscriptionPager - List App Attach packages in subscription. +// +// Generated from API version 2024-04-03 +// - options - AppAttachPackageClientListBySubscriptionOptions contains the optional parameters for the AppAttachPackageClient.NewListBySubscriptionPager +// method. +func (client *AppAttachPackageClient) NewListBySubscriptionPager(options *AppAttachPackageClientListBySubscriptionOptions) *runtime.Pager[AppAttachPackageClientListBySubscriptionResponse] { + return runtime.NewPager(runtime.PagingHandler[AppAttachPackageClientListBySubscriptionResponse]{ + More: func(page AppAttachPackageClientListBySubscriptionResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *AppAttachPackageClientListBySubscriptionResponse) (AppAttachPackageClientListBySubscriptionResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "AppAttachPackageClient.NewListBySubscriptionPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listBySubscriptionCreateRequest(ctx, options) + }, nil) + if err != nil { + return AppAttachPackageClientListBySubscriptionResponse{}, err + } + return client.listBySubscriptionHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listBySubscriptionCreateRequest creates the ListBySubscription request. +func (client *AppAttachPackageClient) listBySubscriptionCreateRequest(ctx context.Context, options *AppAttachPackageClientListBySubscriptionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DesktopVirtualization/appAttachPackages" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + reqQP.Set("api-version", "2024-04-03") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listBySubscriptionHandleResponse handles the ListBySubscription response. +func (client *AppAttachPackageClient) listBySubscriptionHandleResponse(resp *http.Response) (AppAttachPackageClientListBySubscriptionResponse, error) { + result := AppAttachPackageClientListBySubscriptionResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AppAttachPackageList); err != nil { + return AppAttachPackageClientListBySubscriptionResponse{}, err + } + return result, nil +} + +// Update - Update an App Attach Package +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-04-03 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - appAttachPackageName - The name of the App Attach package +// - options - AppAttachPackageClientUpdateOptions contains the optional parameters for the AppAttachPackageClient.Update method. +func (client *AppAttachPackageClient) Update(ctx context.Context, resourceGroupName string, appAttachPackageName string, options *AppAttachPackageClientUpdateOptions) (AppAttachPackageClientUpdateResponse, error) { + var err error + const operationName = "AppAttachPackageClient.Update" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.updateCreateRequest(ctx, resourceGroupName, appAttachPackageName, options) + if err != nil { + return AppAttachPackageClientUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AppAttachPackageClientUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AppAttachPackageClientUpdateResponse{}, err + } + resp, err := client.updateHandleResponse(httpResp) + return resp, err +} + +// updateCreateRequest creates the Update request. +func (client *AppAttachPackageClient) updateCreateRequest(ctx context.Context, resourceGroupName string, appAttachPackageName string, options *AppAttachPackageClientUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/appAttachPackages/{appAttachPackageName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if appAttachPackageName == "" { + return nil, errors.New("parameter appAttachPackageName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{appAttachPackageName}", url.PathEscape(appAttachPackageName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-04-03") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if options != nil && options.AppAttachPackagePatch != nil { + if err := runtime.MarshalAsJSON(req, *options.AppAttachPackagePatch); err != nil { + return nil, err + } + return req, nil + } + return req, nil +} + +// updateHandleResponse handles the Update response. +func (client *AppAttachPackageClient) updateHandleResponse(resp *http.Response) (AppAttachPackageClientUpdateResponse, error) { + result := AppAttachPackageClientUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AppAttachPackage); err != nil { + return AppAttachPackageClientUpdateResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/appattachpackageinfo_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/appattachpackageinfo_client.go new file mode 100644 index 000000000000..b85f717710d1 --- /dev/null +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/appattachpackageinfo_client.go @@ -0,0 +1,113 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armdesktopvirtualization + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// AppAttachPackageInfoClient contains the methods for the AppAttachPackageInfo group. +// Don't use this type directly, use NewAppAttachPackageInfoClient() instead. +type AppAttachPackageInfoClient struct { + internal *arm.Client + subscriptionID string +} + +// NewAppAttachPackageInfoClient creates a new instance of AppAttachPackageInfoClient with the specified values. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewAppAttachPackageInfoClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AppAttachPackageInfoClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &AppAttachPackageInfoClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// NewImportPager - Gets information from a package given the path to the package. +// +// Generated from API version 2024-04-03 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - hostPoolName - The name of the host pool within the specified resource group +// - importPackageInfoRequest - Object containing URI to package image and other optional properties +// - options - AppAttachPackageInfoClientImportOptions contains the optional parameters for the AppAttachPackageInfoClient.NewImportPager +// method. +func (client *AppAttachPackageInfoClient) NewImportPager(resourceGroupName string, hostPoolName string, importPackageInfoRequest ImportPackageInfoRequest, options *AppAttachPackageInfoClientImportOptions) *runtime.Pager[AppAttachPackageInfoClientImportResponse] { + return runtime.NewPager(runtime.PagingHandler[AppAttachPackageInfoClientImportResponse]{ + More: func(page AppAttachPackageInfoClientImportResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *AppAttachPackageInfoClientImportResponse) (AppAttachPackageInfoClientImportResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "AppAttachPackageInfoClient.NewImportPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.importCreateRequest(ctx, resourceGroupName, hostPoolName, importPackageInfoRequest, options) + }, nil) + if err != nil { + return AppAttachPackageInfoClientImportResponse{}, err + } + return client.importHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// importCreateRequest creates the Import request. +func (client *AppAttachPackageInfoClient) importCreateRequest(ctx context.Context, resourceGroupName string, hostPoolName string, importPackageInfoRequest ImportPackageInfoRequest, options *AppAttachPackageInfoClientImportOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/importAppAttachPackageInfo" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if hostPoolName == "" { + return nil, errors.New("parameter hostPoolName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{hostPoolName}", url.PathEscape(hostPoolName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-04-03") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, importPackageInfoRequest); err != nil { + return nil, err + } + return req, nil +} + +// importHandleResponse handles the Import response. +func (client *AppAttachPackageInfoClient) importHandleResponse(resp *http.Response) (AppAttachPackageInfoClientImportResponse, error) { + result := AppAttachPackageInfoClientImportResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AppAttachPackageList); err != nil { + return AppAttachPackageInfoClientImportResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/applicationgroups_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/applicationgroups_client.go index 5e9855c22d80..2fd802ca610f 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/applicationgroups_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/applicationgroups_client.go @@ -29,7 +29,7 @@ type ApplicationGroupsClient struct { } // NewApplicationGroupsClient creates a new instance of ApplicationGroupsClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewApplicationGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ApplicationGroupsClient, error) { @@ -47,7 +47,7 @@ func NewApplicationGroupsClient(subscriptionID string, credential azcore.TokenCr // CreateOrUpdate - Create or update an applicationGroup. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - applicationGroupName - The name of the application group // - applicationGroup - Object containing ApplicationGroup definitions. @@ -95,7 +95,7 @@ func (client *ApplicationGroupsClient) createOrUpdateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, applicationGroup); err != nil { @@ -116,7 +116,7 @@ func (client *ApplicationGroupsClient) createOrUpdateHandleResponse(resp *http.R // Delete - Remove an applicationGroup. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - applicationGroupName - The name of the application group // - options - ApplicationGroupsClientDeleteOptions contains the optional parameters for the ApplicationGroupsClient.Delete @@ -162,7 +162,7 @@ func (client *ApplicationGroupsClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -171,7 +171,7 @@ func (client *ApplicationGroupsClient) deleteCreateRequest(ctx context.Context, // Get - Get an application group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - applicationGroupName - The name of the application group // - options - ApplicationGroupsClientGetOptions contains the optional parameters for the ApplicationGroupsClient.Get method. @@ -217,7 +217,7 @@ func (client *ApplicationGroupsClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -234,7 +234,7 @@ func (client *ApplicationGroupsClient) getHandleResponse(resp *http.Response) (A // NewListByResourceGroupPager - List applicationGroups. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - ApplicationGroupsClientListByResourceGroupOptions contains the optional parameters for the ApplicationGroupsClient.NewListByResourceGroupPager // method. @@ -277,18 +277,18 @@ func (client *ApplicationGroupsClient) listByResourceGroupCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - if options != nil && options.PageSize != nil { - reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) + reqQP.Set("api-version", "2024-04-03") + if options != nil && options.InitialSkip != nil { + reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) } if options != nil && options.IsDescending != nil { reqQP.Set("isDescending", strconv.FormatBool(*options.IsDescending)) } - if options != nil && options.InitialSkip != nil { - reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) + if options != nil && options.PageSize != nil { + reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} @@ -306,7 +306,7 @@ func (client *ApplicationGroupsClient) listByResourceGroupHandleResponse(resp *h // NewListBySubscriptionPager - List applicationGroups in subscription. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - options - ApplicationGroupsClientListBySubscriptionOptions contains the optional parameters for the ApplicationGroupsClient.NewListBySubscriptionPager // method. func (client *ApplicationGroupsClient) NewListBySubscriptionPager(options *ApplicationGroupsClientListBySubscriptionOptions) *runtime.Pager[ApplicationGroupsClientListBySubscriptionResponse] { @@ -344,10 +344,10 @@ func (client *ApplicationGroupsClient) listBySubscriptionCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } + reqQP.Set("api-version", "2024-04-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -365,7 +365,7 @@ func (client *ApplicationGroupsClient) listBySubscriptionHandleResponse(resp *ht // Update - Update an applicationGroup. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - applicationGroupName - The name of the application group // - options - ApplicationGroupsClientUpdateOptions contains the optional parameters for the ApplicationGroupsClient.Update @@ -412,7 +412,7 @@ func (client *ApplicationGroupsClient) updateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.ApplicationGroup != nil { diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/applicationgroups_client_example_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/applicationgroups_client_example_test.go deleted file mode 100644 index 62d3faf09a3f..000000000000 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/applicationgroups_client_example_test.go +++ /dev/null @@ -1,376 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armdesktopvirtualization_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ApplicationGroup_Get.json -func ExampleApplicationGroupsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApplicationGroupsClient().Get(ctx, "resourceGroup1", "applicationGroup1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ApplicationGroup = armdesktopvirtualization.ApplicationGroup{ - // Name: to.Ptr("applicationGroup1"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/applicationGroups"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/applicationGroups/applicationGroup1"), - // Location: to.Ptr("centralus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armdesktopvirtualization.ApplicationGroupProperties{ - // Description: to.Ptr("des1"), - // ApplicationGroupType: to.Ptr(armdesktopvirtualization.ApplicationGroupTypeRemoteApp), - // CloudPcResource: to.Ptr(false), - // FriendlyName: to.Ptr("friendly"), - // HostPoolArmPath: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1"), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // ShowInFeed: to.Ptr(true), - // WorkspaceArmPath: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/workspaces/workspace1"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ApplicationGroup_Create.json -func ExampleApplicationGroupsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApplicationGroupsClient().CreateOrUpdate(ctx, "resourceGroup1", "applicationGroup1", armdesktopvirtualization.ApplicationGroup{ - Location: to.Ptr("centralus"), - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - Properties: &armdesktopvirtualization.ApplicationGroupProperties{ - Description: to.Ptr("des1"), - ApplicationGroupType: to.Ptr(armdesktopvirtualization.ApplicationGroupTypeRemoteApp), - FriendlyName: to.Ptr("friendly"), - HostPoolArmPath: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1"), - ShowInFeed: to.Ptr(true), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ApplicationGroup = armdesktopvirtualization.ApplicationGroup{ - // Name: to.Ptr("applicationGroup1"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/applicationGroups"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/applicationGroups/applicationGroup1"), - // Location: to.Ptr("centralus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armdesktopvirtualization.ApplicationGroupProperties{ - // Description: to.Ptr("des1"), - // ApplicationGroupType: to.Ptr(armdesktopvirtualization.ApplicationGroupTypeRemoteApp), - // CloudPcResource: to.Ptr(false), - // FriendlyName: to.Ptr("friendly"), - // HostPoolArmPath: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1"), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // ShowInFeed: to.Ptr(true), - // WorkspaceArmPath: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/workspaces/workspace1"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ApplicationGroup_Delete.json -func ExampleApplicationGroupsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewApplicationGroupsClient().Delete(ctx, "resourceGroup1", "applicationGroup1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ApplicationGroup_Update.json -func ExampleApplicationGroupsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApplicationGroupsClient().Update(ctx, "resourceGroup1", "applicationGroup1", &armdesktopvirtualization.ApplicationGroupsClientUpdateOptions{ApplicationGroup: &armdesktopvirtualization.ApplicationGroupPatch{ - Properties: &armdesktopvirtualization.ApplicationGroupPatchProperties{ - Description: to.Ptr("des1"), - FriendlyName: to.Ptr("friendly"), - ShowInFeed: to.Ptr(true), - }, - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ApplicationGroup = armdesktopvirtualization.ApplicationGroup{ - // Name: to.Ptr("applicationGroup1"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/applicationGroups"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/applicationGroups/applicationGroup1"), - // Location: to.Ptr("centralus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armdesktopvirtualization.ApplicationGroupProperties{ - // Description: to.Ptr("des1"), - // ApplicationGroupType: to.Ptr(armdesktopvirtualization.ApplicationGroupTypeRemoteApp), - // CloudPcResource: to.Ptr(false), - // FriendlyName: to.Ptr("friendly"), - // HostPoolArmPath: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1"), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // ShowInFeed: to.Ptr(true), - // WorkspaceArmPath: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/workspaces/workspace1"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ApplicationGroup_ListByResourceGroup.json -func ExampleApplicationGroupsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewApplicationGroupsClient().NewListByResourceGroupPager("resourceGroup1", &armdesktopvirtualization.ApplicationGroupsClientListByResourceGroupOptions{Filter: to.Ptr("applicationGroupType eq 'RailApplication'"), - PageSize: to.Ptr[int32](10), - IsDescending: to.Ptr(true), - InitialSkip: to.Ptr[int32](0), - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ApplicationGroupList = armdesktopvirtualization.ApplicationGroupList{ - // Value: []*armdesktopvirtualization.ApplicationGroup{ - // { - // Name: to.Ptr("applicationGroup1"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/applicationGroups"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/applicationGroups/applicationGroup1"), - // Location: to.Ptr("centralus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armdesktopvirtualization.ApplicationGroupProperties{ - // Description: to.Ptr("des1"), - // ApplicationGroupType: to.Ptr(armdesktopvirtualization.ApplicationGroupTypeRemoteApp), - // CloudPcResource: to.Ptr(false), - // FriendlyName: to.Ptr("friendly"), - // HostPoolArmPath: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1"), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // ShowInFeed: to.Ptr(true), - // WorkspaceArmPath: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/workspaces/workspace1"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }, - // { - // Name: to.Ptr("applicationGroup2"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/applicationGroups"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/applicationGroups/applicationGroup2"), - // Location: to.Ptr("centralus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armdesktopvirtualization.ApplicationGroupProperties{ - // Description: to.Ptr("des1"), - // ApplicationGroupType: to.Ptr(armdesktopvirtualization.ApplicationGroupTypeRemoteApp), - // CloudPcResource: to.Ptr(false), - // FriendlyName: to.Ptr("friendly"), - // HostPoolArmPath: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1"), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // ShowInFeed: to.Ptr(true), - // WorkspaceArmPath: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/workspaces/workspace1"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ApplicationGroup_ListBySubscription.json -func ExampleApplicationGroupsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewApplicationGroupsClient().NewListBySubscriptionPager(&armdesktopvirtualization.ApplicationGroupsClientListBySubscriptionOptions{Filter: to.Ptr("applicationGroupType eq 'RailApplication'")}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ApplicationGroupList = armdesktopvirtualization.ApplicationGroupList{ - // Value: []*armdesktopvirtualization.ApplicationGroup{ - // { - // Name: to.Ptr("applicationGroup1"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/applicationGroups"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/applicationGroups/applicationGroup1"), - // Location: to.Ptr("centralus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armdesktopvirtualization.ApplicationGroupProperties{ - // Description: to.Ptr("des1"), - // ApplicationGroupType: to.Ptr(armdesktopvirtualization.ApplicationGroupTypeRemoteApp), - // CloudPcResource: to.Ptr(false), - // FriendlyName: to.Ptr("friendly"), - // HostPoolArmPath: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1"), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // ShowInFeed: to.Ptr(true), - // WorkspaceArmPath: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/workspaces/workspace1"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }, - // { - // Name: to.Ptr("applicationGroup2"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/applicationGroups"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/applicationGroups/applicationGroup2"), - // Location: to.Ptr("centralus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armdesktopvirtualization.ApplicationGroupProperties{ - // Description: to.Ptr("des1"), - // ApplicationGroupType: to.Ptr(armdesktopvirtualization.ApplicationGroupTypeRemoteApp), - // CloudPcResource: to.Ptr(false), - // FriendlyName: to.Ptr("friendly"), - // HostPoolArmPath: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1"), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // ShowInFeed: to.Ptr(true), - // WorkspaceArmPath: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/workspaces/workspace1"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/applications_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/applications_client.go index bf67edaa5e4c..d6742799f755 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/applications_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/applications_client.go @@ -29,7 +29,7 @@ type ApplicationsClient struct { } // NewApplicationsClient creates a new instance of ApplicationsClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewApplicationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ApplicationsClient, error) { @@ -47,7 +47,7 @@ func NewApplicationsClient(subscriptionID string, credential azcore.TokenCredent // CreateOrUpdate - Create or update an application. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - applicationGroupName - The name of the application group // - applicationName - The name of the application within the specified application group @@ -100,7 +100,7 @@ func (client *ApplicationsClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, application); err != nil { @@ -121,7 +121,7 @@ func (client *ApplicationsClient) createOrUpdateHandleResponse(resp *http.Respon // Delete - Remove an application. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - applicationGroupName - The name of the application group // - applicationName - The name of the application within the specified application group @@ -171,7 +171,7 @@ func (client *ApplicationsClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -180,7 +180,7 @@ func (client *ApplicationsClient) deleteCreateRequest(ctx context.Context, resou // Get - Get an application. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - applicationGroupName - The name of the application group // - applicationName - The name of the application within the specified application group @@ -231,7 +231,7 @@ func (client *ApplicationsClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -248,7 +248,7 @@ func (client *ApplicationsClient) getHandleResponse(resp *http.Response) (Applic // NewListPager - List applications. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - applicationGroupName - The name of the application group // - options - ApplicationsClientListOptions contains the optional parameters for the ApplicationsClient.NewListPager method. @@ -295,15 +295,15 @@ func (client *ApplicationsClient) listCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") - if options != nil && options.PageSize != nil { - reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) + reqQP.Set("api-version", "2024-04-03") + if options != nil && options.InitialSkip != nil { + reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) } if options != nil && options.IsDescending != nil { reqQP.Set("isDescending", strconv.FormatBool(*options.IsDescending)) } - if options != nil && options.InitialSkip != nil { - reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) + if options != nil && options.PageSize != nil { + reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} @@ -322,7 +322,7 @@ func (client *ApplicationsClient) listHandleResponse(resp *http.Response) (Appli // Update - Update an application. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - applicationGroupName - The name of the application group // - applicationName - The name of the application within the specified application group @@ -373,7 +373,7 @@ func (client *ApplicationsClient) updateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Application != nil { diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/applications_client_example_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/applications_client_example_test.go deleted file mode 100644 index 52a7e3ba4f49..000000000000 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/applications_client_example_test.go +++ /dev/null @@ -1,286 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armdesktopvirtualization_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Application_Get.json -func ExampleApplicationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApplicationsClient().Get(ctx, "resourceGroup1", "applicationGroup1", "application1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Application = armdesktopvirtualization.Application{ - // Name: to.Ptr("applicationGroup1/application1"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/applicationGroups/applications"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/applicationGroups/applicationGroup1/applications/application1"), - // Properties: &armdesktopvirtualization.ApplicationProperties{ - // Description: to.Ptr("des1"), - // ApplicationType: to.Ptr(armdesktopvirtualization.RemoteApplicationTypeInBuilt), - // CommandLineArguments: to.Ptr("arguments"), - // CommandLineSetting: to.Ptr(armdesktopvirtualization.CommandLineSettingAllow), - // FilePath: to.Ptr("path"), - // FriendlyName: to.Ptr("friendly"), - // IconContent: []byte("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo"), - // IconHash: to.Ptr("bEQ1n2HysrGxCDvgt4bfOtkET8ydzh5SXGM0KGTBPVc"), - // IconIndex: to.Ptr[int32](1), - // IconPath: to.Ptr("icon"), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // ShowInPortal: to.Ptr(true), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Application_Create.json -func ExampleApplicationsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApplicationsClient().CreateOrUpdate(ctx, "resourceGroup1", "applicationGroup1", "application1", armdesktopvirtualization.Application{ - Properties: &armdesktopvirtualization.ApplicationProperties{ - Description: to.Ptr("des1"), - CommandLineArguments: to.Ptr("arguments"), - CommandLineSetting: to.Ptr(armdesktopvirtualization.CommandLineSettingAllow), - FilePath: to.Ptr("path"), - FriendlyName: to.Ptr("friendly"), - IconIndex: to.Ptr[int32](1), - IconPath: to.Ptr("icon"), - ShowInPortal: to.Ptr(true), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Application = armdesktopvirtualization.Application{ - // Name: to.Ptr("applicationGroup1/application1"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/applicationGroups/applications"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/applicationGroups/applicationGroup1/applications/application1"), - // Properties: &armdesktopvirtualization.ApplicationProperties{ - // Description: to.Ptr("des1"), - // ApplicationType: to.Ptr(armdesktopvirtualization.RemoteApplicationTypeInBuilt), - // CommandLineArguments: to.Ptr("arguments"), - // CommandLineSetting: to.Ptr(armdesktopvirtualization.CommandLineSettingAllow), - // FilePath: to.Ptr("path"), - // FriendlyName: to.Ptr("friendly"), - // IconContent: []byte("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo"), - // IconHash: to.Ptr("bEQ1n2HysrGxCDvgt4bfOtkET8ydzh5SXGM0KGTBPVc"), - // IconIndex: to.Ptr[int32](1), - // IconPath: to.Ptr("icon"), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // ShowInPortal: to.Ptr(true), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Application_Delete.json -func ExampleApplicationsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewApplicationsClient().Delete(ctx, "resourceGroup1", "applicationGroup1", "application1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Application_Update.json -func ExampleApplicationsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApplicationsClient().Update(ctx, "resourceGroup1", "applicationGroup1", "application1", &armdesktopvirtualization.ApplicationsClientUpdateOptions{Application: &armdesktopvirtualization.ApplicationPatch{ - Properties: &armdesktopvirtualization.ApplicationPatchProperties{ - Description: to.Ptr("des1"), - ApplicationType: to.Ptr(armdesktopvirtualization.RemoteApplicationTypeInBuilt), - CommandLineArguments: to.Ptr("arguments"), - CommandLineSetting: to.Ptr(armdesktopvirtualization.CommandLineSettingAllow), - FilePath: to.Ptr("path"), - FriendlyName: to.Ptr("friendly"), - IconIndex: to.Ptr[int32](1), - IconPath: to.Ptr("icon"), - ShowInPortal: to.Ptr(true), - }, - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Application = armdesktopvirtualization.Application{ - // Name: to.Ptr("applicationGroup1/application1"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/applicationGroups/applications"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/applicationGroups/applicationGroup1/applications/application1"), - // Properties: &armdesktopvirtualization.ApplicationProperties{ - // Description: to.Ptr("des1"), - // ApplicationType: to.Ptr(armdesktopvirtualization.RemoteApplicationTypeInBuilt), - // CommandLineArguments: to.Ptr("arguments"), - // CommandLineSetting: to.Ptr(armdesktopvirtualization.CommandLineSettingAllow), - // FilePath: to.Ptr("path"), - // FriendlyName: to.Ptr("friendly"), - // IconContent: []byte("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo"), - // IconHash: to.Ptr("bEQ1n2HysrGxCDvgt4bfOtkET8ydzh5SXGM0KGTBPVc"), - // IconIndex: to.Ptr[int32](1), - // IconPath: to.Ptr("icon"), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // ShowInPortal: to.Ptr(true), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Application_List.json -func ExampleApplicationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewApplicationsClient().NewListPager("resourceGroup1", "applicationGroup1", &armdesktopvirtualization.ApplicationsClientListOptions{PageSize: to.Ptr[int32](10), - IsDescending: to.Ptr(true), - InitialSkip: to.Ptr[int32](0), - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ApplicationList = armdesktopvirtualization.ApplicationList{ - // Value: []*armdesktopvirtualization.Application{ - // { - // Name: to.Ptr("applicationGroup1/application1"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/applicationGroups/applications"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/applicationGroups/applicationGroup1/applications/application1"), - // Properties: &armdesktopvirtualization.ApplicationProperties{ - // Description: to.Ptr("des1"), - // ApplicationType: to.Ptr(armdesktopvirtualization.RemoteApplicationTypeInBuilt), - // CommandLineArguments: to.Ptr("arguments"), - // CommandLineSetting: to.Ptr(armdesktopvirtualization.CommandLineSettingAllow), - // FilePath: to.Ptr("path"), - // FriendlyName: to.Ptr("friendly"), - // IconContent: []byte("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo"), - // IconHash: to.Ptr("bEQ1n2HysrGxCDvgt4bfOtkET8ydzh5SXGM0KGTBPVc"), - // IconIndex: to.Ptr[int32](1), - // IconPath: to.Ptr("icon"), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // ShowInPortal: to.Ptr(true), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }, - // { - // Name: to.Ptr("applicationGroup1/application2"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/applicationGroups/applications"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/applicationGroups/applicationGroup1/applications/application2"), - // Properties: &armdesktopvirtualization.ApplicationProperties{ - // Description: to.Ptr("des2"), - // ApplicationType: to.Ptr(armdesktopvirtualization.RemoteApplicationTypeInBuilt), - // CommandLineArguments: to.Ptr("arguments"), - // CommandLineSetting: to.Ptr(armdesktopvirtualization.CommandLineSettingAllow), - // FilePath: to.Ptr("path"), - // FriendlyName: to.Ptr("friendly"), - // IconContent: []byte("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo"), - // IconHash: to.Ptr("bEQ1n2HysrGxCDvgt4bfOtkET8ydzh5SXGM0KGTBPVc"), - // IconIndex: to.Ptr[int32](1), - // IconPath: to.Ptr("icon"), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // ShowInPortal: to.Ptr(true), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/autorest.md b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/autorest.md index e7eb60411eb1..fc1b74bd1fbf 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/autorest.md +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/autorest.md @@ -5,9 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/desktopvirtualization/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/desktopvirtualization/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 2.2.0 -tag: package-2023-09 +module-version: 2.3.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/client_factory.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/client_factory.go index cf8d3ef1a230..93da21c36237 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/client_factory.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/client_factory.go @@ -17,118 +17,164 @@ import ( // Don't use this type directly, use NewClientFactory instead. type ClientFactory struct { subscriptionID string - credential azcore.TokenCredential - options *arm.ClientOptions + internal *arm.Client } // NewClientFactory creates a new instance of ClientFactory with the specified values. // The parameter values will be propagated to any client created from this factory. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error) { - _, err := arm.NewClient(moduleName, moduleVersion, credential, options) + internal, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } return &ClientFactory{ - subscriptionID: subscriptionID, credential: credential, - options: options.Clone(), + subscriptionID: subscriptionID, + internal: internal, }, nil } +// NewAppAttachPackageClient creates a new instance of AppAttachPackageClient. +func (c *ClientFactory) NewAppAttachPackageClient() *AppAttachPackageClient { + return &AppAttachPackageClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewAppAttachPackageInfoClient creates a new instance of AppAttachPackageInfoClient. +func (c *ClientFactory) NewAppAttachPackageInfoClient() *AppAttachPackageInfoClient { + return &AppAttachPackageInfoClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + // NewApplicationGroupsClient creates a new instance of ApplicationGroupsClient. func (c *ClientFactory) NewApplicationGroupsClient() *ApplicationGroupsClient { - subClient, _ := NewApplicationGroupsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &ApplicationGroupsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewApplicationsClient creates a new instance of ApplicationsClient. func (c *ClientFactory) NewApplicationsClient() *ApplicationsClient { - subClient, _ := NewApplicationsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &ApplicationsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewDesktopsClient creates a new instance of DesktopsClient. func (c *ClientFactory) NewDesktopsClient() *DesktopsClient { - subClient, _ := NewDesktopsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &DesktopsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewHostPoolsClient creates a new instance of HostPoolsClient. func (c *ClientFactory) NewHostPoolsClient() *HostPoolsClient { - subClient, _ := NewHostPoolsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &HostPoolsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewMSIXPackagesClient creates a new instance of MSIXPackagesClient. func (c *ClientFactory) NewMSIXPackagesClient() *MSIXPackagesClient { - subClient, _ := NewMSIXPackagesClient(c.subscriptionID, c.credential, c.options) - return subClient + return &MSIXPackagesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewMsixImagesClient creates a new instance of MsixImagesClient. func (c *ClientFactory) NewMsixImagesClient() *MsixImagesClient { - subClient, _ := NewMsixImagesClient(c.subscriptionID, c.credential, c.options) - return subClient + return &MsixImagesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewOperationsClient creates a new instance of OperationsClient. func (c *ClientFactory) NewOperationsClient() *OperationsClient { - subClient, _ := NewOperationsClient(c.credential, c.options) - return subClient + return &OperationsClient{ + internal: c.internal, + } } // NewPrivateEndpointConnectionsClient creates a new instance of PrivateEndpointConnectionsClient. func (c *ClientFactory) NewPrivateEndpointConnectionsClient() *PrivateEndpointConnectionsClient { - subClient, _ := NewPrivateEndpointConnectionsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &PrivateEndpointConnectionsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewPrivateLinkResourcesClient creates a new instance of PrivateLinkResourcesClient. func (c *ClientFactory) NewPrivateLinkResourcesClient() *PrivateLinkResourcesClient { - subClient, _ := NewPrivateLinkResourcesClient(c.subscriptionID, c.credential, c.options) - return subClient + return &PrivateLinkResourcesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewScalingPlanPersonalSchedulesClient creates a new instance of ScalingPlanPersonalSchedulesClient. func (c *ClientFactory) NewScalingPlanPersonalSchedulesClient() *ScalingPlanPersonalSchedulesClient { - subClient, _ := NewScalingPlanPersonalSchedulesClient(c.subscriptionID, c.credential, c.options) - return subClient + return &ScalingPlanPersonalSchedulesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewScalingPlanPooledSchedulesClient creates a new instance of ScalingPlanPooledSchedulesClient. func (c *ClientFactory) NewScalingPlanPooledSchedulesClient() *ScalingPlanPooledSchedulesClient { - subClient, _ := NewScalingPlanPooledSchedulesClient(c.subscriptionID, c.credential, c.options) - return subClient + return &ScalingPlanPooledSchedulesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewScalingPlansClient creates a new instance of ScalingPlansClient. func (c *ClientFactory) NewScalingPlansClient() *ScalingPlansClient { - subClient, _ := NewScalingPlansClient(c.subscriptionID, c.credential, c.options) - return subClient + return &ScalingPlansClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewSessionHostsClient creates a new instance of SessionHostsClient. func (c *ClientFactory) NewSessionHostsClient() *SessionHostsClient { - subClient, _ := NewSessionHostsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &SessionHostsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewStartMenuItemsClient creates a new instance of StartMenuItemsClient. func (c *ClientFactory) NewStartMenuItemsClient() *StartMenuItemsClient { - subClient, _ := NewStartMenuItemsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &StartMenuItemsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewUserSessionsClient creates a new instance of UserSessionsClient. func (c *ClientFactory) NewUserSessionsClient() *UserSessionsClient { - subClient, _ := NewUserSessionsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &UserSessionsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewWorkspacesClient creates a new instance of WorkspacesClient. func (c *ClientFactory) NewWorkspacesClient() *WorkspacesClient { - subClient, _ := NewWorkspacesClient(c.subscriptionID, c.credential, c.options) - return subClient + return &WorkspacesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/constants.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/constants.go index 4ceb1d89e104..c1f2b3f0a7af 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/constants.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/constants.go @@ -10,9 +10,35 @@ package armdesktopvirtualization const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization" - moduleVersion = "v2.2.0" + moduleVersion = "v2.3.0" ) +// AppAttachPackageArchitectures - Possible device architectures that an app attach package can be configured for +type AppAttachPackageArchitectures string + +const ( + AppAttachPackageArchitecturesALL AppAttachPackageArchitectures = "ALL" + AppAttachPackageArchitecturesARM AppAttachPackageArchitectures = "ARM" + AppAttachPackageArchitecturesARM64 AppAttachPackageArchitectures = "ARM64" + AppAttachPackageArchitecturesNeutral AppAttachPackageArchitectures = "Neutral" + AppAttachPackageArchitecturesX64 AppAttachPackageArchitectures = "x64" + AppAttachPackageArchitecturesX86 AppAttachPackageArchitectures = "x86" + AppAttachPackageArchitecturesX86A64 AppAttachPackageArchitectures = "x86a64" +) + +// PossibleAppAttachPackageArchitecturesValues returns the possible values for the AppAttachPackageArchitectures const type. +func PossibleAppAttachPackageArchitecturesValues() []AppAttachPackageArchitectures { + return []AppAttachPackageArchitectures{ + AppAttachPackageArchitecturesALL, + AppAttachPackageArchitecturesARM, + AppAttachPackageArchitecturesARM64, + AppAttachPackageArchitecturesNeutral, + AppAttachPackageArchitecturesX64, + AppAttachPackageArchitecturesX86, + AppAttachPackageArchitecturesX86A64, + } +} + // ApplicationGroupType - Resource Type of ApplicationGroup. type ApplicationGroupType string @@ -110,6 +136,24 @@ func PossibleDayOfWeekValues() []DayOfWeek { } } +// FailHealthCheckOnStagingFailure - Parameter indicating how the health check should behave if this package fails staging +type FailHealthCheckOnStagingFailure string + +const ( + FailHealthCheckOnStagingFailureDoNotFail FailHealthCheckOnStagingFailure = "DoNotFail" + FailHealthCheckOnStagingFailureNeedsAssistance FailHealthCheckOnStagingFailure = "NeedsAssistance" + FailHealthCheckOnStagingFailureUnhealthy FailHealthCheckOnStagingFailure = "Unhealthy" +) + +// PossibleFailHealthCheckOnStagingFailureValues returns the possible values for the FailHealthCheckOnStagingFailure const type. +func PossibleFailHealthCheckOnStagingFailureValues() []FailHealthCheckOnStagingFailure { + return []FailHealthCheckOnStagingFailure{ + FailHealthCheckOnStagingFailureDoNotFail, + FailHealthCheckOnStagingFailureNeedsAssistance, + FailHealthCheckOnStagingFailureUnhealthy, + } +} + // HealthCheckName - Represents the name of the health check operation performed. type HealthCheckName string @@ -266,6 +310,22 @@ func PossibleLoadBalancerTypeValues() []LoadBalancerType { } } +// PackageTimestamped - Is package timestamped so it can ignore the certificate expiry date +type PackageTimestamped string + +const ( + PackageTimestampedNotTimestamped PackageTimestamped = "NotTimestamped" + PackageTimestampedTimestamped PackageTimestamped = "Timestamped" +) + +// PossiblePackageTimestampedValues returns the possible values for the PackageTimestamped const type. +func PossiblePackageTimestampedValues() []PackageTimestamped { + return []PackageTimestamped{ + PackageTimestampedNotTimestamped, + PackageTimestampedTimestamped, + } +} + // PersonalDesktopAssignmentType - PersonalDesktopAssignment type for HostPool. type PersonalDesktopAssignmentType string @@ -338,6 +398,26 @@ func PossiblePrivateEndpointServiceConnectionStatusValues() []PrivateEndpointSer } } +// ProvisioningState - The current provisioning state. +type ProvisioningState string + +const ( + ProvisioningStateCanceled ProvisioningState = "Canceled" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateProvisioning ProvisioningState = "Provisioning" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" +) + +// PossibleProvisioningStateValues returns the possible values for the ProvisioningState const type. +func PossibleProvisioningStateValues() []ProvisioningState { + return []ProvisioningState{ + ProvisioningStateCanceled, + ProvisioningStateFailed, + ProvisioningStateProvisioning, + ProvisioningStateSucceeded, + } +} + // 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 diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/desktops_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/desktops_client.go index 1ffaaa3ff65a..fc7bebab8eea 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/desktops_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/desktops_client.go @@ -29,7 +29,7 @@ type DesktopsClient struct { } // NewDesktopsClient creates a new instance of DesktopsClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewDesktopsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DesktopsClient, error) { @@ -47,7 +47,7 @@ func NewDesktopsClient(subscriptionID string, credential azcore.TokenCredential, // Get - Get a desktop. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - applicationGroupName - The name of the application group // - desktopName - The name of the desktop within the specified desktop group @@ -98,7 +98,7 @@ func (client *DesktopsClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -115,7 +115,7 @@ func (client *DesktopsClient) getHandleResponse(resp *http.Response) (DesktopsCl // NewListPager - List desktops. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - applicationGroupName - The name of the application group // - options - DesktopsClientListOptions contains the optional parameters for the DesktopsClient.NewListPager method. @@ -162,15 +162,15 @@ func (client *DesktopsClient) listCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") - if options != nil && options.PageSize != nil { - reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) + reqQP.Set("api-version", "2024-04-03") + if options != nil && options.InitialSkip != nil { + reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) } if options != nil && options.IsDescending != nil { reqQP.Set("isDescending", strconv.FormatBool(*options.IsDescending)) } - if options != nil && options.InitialSkip != nil { - reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) + if options != nil && options.PageSize != nil { + reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} @@ -189,7 +189,7 @@ func (client *DesktopsClient) listHandleResponse(resp *http.Response) (DesktopsC // Update - Update a desktop. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - applicationGroupName - The name of the application group // - desktopName - The name of the desktop within the specified desktop group @@ -240,7 +240,7 @@ func (client *DesktopsClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Desktop != nil { diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/desktops_client_example_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/desktops_client_example_test.go deleted file mode 100644 index dbe02bfe89bf..000000000000 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/desktops_client_example_test.go +++ /dev/null @@ -1,156 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armdesktopvirtualization_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Desktop_Get.json -func ExampleDesktopsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDesktopsClient().Get(ctx, "resourceGroup1", "applicationGroup1", "SessionDesktop", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Desktop = armdesktopvirtualization.Desktop{ - // Name: to.Ptr("applicationGroup1/SessionDesktop"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/applicationGroups/desktops"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/applicationGroups/applicationGroup1/applications/SessionDesktop"), - // Properties: &armdesktopvirtualization.DesktopProperties{ - // Description: to.Ptr("des1"), - // FriendlyName: to.Ptr("friendly"), - // IconContent: []byte("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo"), - // IconHash: to.Ptr("bEQ1n2HysrGxCDvgt4bfOtkET8ydzh5SXGM0KGTBPVc"), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Desktop_Update.json -func ExampleDesktopsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDesktopsClient().Update(ctx, "resourceGroup1", "applicationGroup1", "SessionDesktop", &armdesktopvirtualization.DesktopsClientUpdateOptions{Desktop: &armdesktopvirtualization.DesktopPatch{ - Properties: &armdesktopvirtualization.DesktopPatchProperties{ - Description: to.Ptr("des1"), - FriendlyName: to.Ptr("friendly"), - }, - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Desktop = armdesktopvirtualization.Desktop{ - // Name: to.Ptr("applicationGroup1/SessionDesktop"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/applicationGroups/desktops"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/applicationGroups/applicationGroup1/desktops/SessionDesktop"), - // Properties: &armdesktopvirtualization.DesktopProperties{ - // Description: to.Ptr("des1"), - // FriendlyName: to.Ptr("friendly"), - // IconContent: []byte("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo"), - // IconHash: to.Ptr("bEQ1n2HysrGxCDvgt4bfOtkET8ydzh5SXGM0KGTBPVc"), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Desktop_List.json -func ExampleDesktopsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDesktopsClient().NewListPager("resourceGroup1", "applicationGroup1", &armdesktopvirtualization.DesktopsClientListOptions{PageSize: to.Ptr[int32](10), - IsDescending: to.Ptr(true), - InitialSkip: to.Ptr[int32](0), - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DesktopList = armdesktopvirtualization.DesktopList{ - // Value: []*armdesktopvirtualization.Desktop{ - // { - // Name: to.Ptr("applicationGroup1/SessionDesktop"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/applicationGroups/desktops"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/applicationGroups/applicationGroup1/applications/SessionDesktop"), - // Properties: &armdesktopvirtualization.DesktopProperties{ - // Description: to.Ptr("des1"), - // FriendlyName: to.Ptr("friendly"), - // IconContent: []byte("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo"), - // IconHash: to.Ptr("bEQ1n2HysrGxCDvgt4bfOtkET8ydzh5SXGM0KGTBPVc"), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/appattachpackage_server.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/appattachpackage_server.go new file mode 100644 index 000000000000..43780abaf436 --- /dev/null +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/appattachpackage_server.go @@ -0,0 +1,345 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v2" + "net/http" + "net/url" + "reflect" + "regexp" +) + +// AppAttachPackageServer is a fake server for instances of the armdesktopvirtualization.AppAttachPackageClient type. +type AppAttachPackageServer struct { + // CreateOrUpdate is the fake for method AppAttachPackageClient.CreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + CreateOrUpdate func(ctx context.Context, resourceGroupName string, appAttachPackageName string, appAttachPackage armdesktopvirtualization.AppAttachPackage, options *armdesktopvirtualization.AppAttachPackageClientCreateOrUpdateOptions) (resp azfake.Responder[armdesktopvirtualization.AppAttachPackageClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // Delete is the fake for method AppAttachPackageClient.Delete + // HTTP status codes to indicate success: http.StatusOK, http.StatusNoContent + Delete func(ctx context.Context, resourceGroupName string, appAttachPackageName string, options *armdesktopvirtualization.AppAttachPackageClientDeleteOptions) (resp azfake.Responder[armdesktopvirtualization.AppAttachPackageClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method AppAttachPackageClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, appAttachPackageName string, options *armdesktopvirtualization.AppAttachPackageClientGetOptions) (resp azfake.Responder[armdesktopvirtualization.AppAttachPackageClientGetResponse], errResp azfake.ErrorResponder) + + // NewListByResourceGroupPager is the fake for method AppAttachPackageClient.NewListByResourceGroupPager + // HTTP status codes to indicate success: http.StatusOK + NewListByResourceGroupPager func(resourceGroupName string, options *armdesktopvirtualization.AppAttachPackageClientListByResourceGroupOptions) (resp azfake.PagerResponder[armdesktopvirtualization.AppAttachPackageClientListByResourceGroupResponse]) + + // NewListBySubscriptionPager is the fake for method AppAttachPackageClient.NewListBySubscriptionPager + // HTTP status codes to indicate success: http.StatusOK + NewListBySubscriptionPager func(options *armdesktopvirtualization.AppAttachPackageClientListBySubscriptionOptions) (resp azfake.PagerResponder[armdesktopvirtualization.AppAttachPackageClientListBySubscriptionResponse]) + + // Update is the fake for method AppAttachPackageClient.Update + // HTTP status codes to indicate success: http.StatusOK + Update func(ctx context.Context, resourceGroupName string, appAttachPackageName string, options *armdesktopvirtualization.AppAttachPackageClientUpdateOptions) (resp azfake.Responder[armdesktopvirtualization.AppAttachPackageClientUpdateResponse], errResp azfake.ErrorResponder) +} + +// NewAppAttachPackageServerTransport creates a new instance of AppAttachPackageServerTransport with the provided implementation. +// The returned AppAttachPackageServerTransport instance is connected to an instance of armdesktopvirtualization.AppAttachPackageClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewAppAttachPackageServerTransport(srv *AppAttachPackageServer) *AppAttachPackageServerTransport { + return &AppAttachPackageServerTransport{ + srv: srv, + newListByResourceGroupPager: newTracker[azfake.PagerResponder[armdesktopvirtualization.AppAttachPackageClientListByResourceGroupResponse]](), + newListBySubscriptionPager: newTracker[azfake.PagerResponder[armdesktopvirtualization.AppAttachPackageClientListBySubscriptionResponse]](), + } +} + +// AppAttachPackageServerTransport connects instances of armdesktopvirtualization.AppAttachPackageClient to instances of AppAttachPackageServer. +// Don't use this type directly, use NewAppAttachPackageServerTransport instead. +type AppAttachPackageServerTransport struct { + srv *AppAttachPackageServer + newListByResourceGroupPager *tracker[azfake.PagerResponder[armdesktopvirtualization.AppAttachPackageClientListByResourceGroupResponse]] + newListBySubscriptionPager *tracker[azfake.PagerResponder[armdesktopvirtualization.AppAttachPackageClientListBySubscriptionResponse]] +} + +// Do implements the policy.Transporter interface for AppAttachPackageServerTransport. +func (a *AppAttachPackageServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "AppAttachPackageClient.CreateOrUpdate": + resp, err = a.dispatchCreateOrUpdate(req) + case "AppAttachPackageClient.Delete": + resp, err = a.dispatchDelete(req) + case "AppAttachPackageClient.Get": + resp, err = a.dispatchGet(req) + case "AppAttachPackageClient.NewListByResourceGroupPager": + resp, err = a.dispatchNewListByResourceGroupPager(req) + case "AppAttachPackageClient.NewListBySubscriptionPager": + resp, err = a.dispatchNewListBySubscriptionPager(req) + case "AppAttachPackageClient.Update": + resp, err = a.dispatchUpdate(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (a *AppAttachPackageServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { + if a.srv.CreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method CreateOrUpdate not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DesktopVirtualization/appAttachPackages/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armdesktopvirtualization.AppAttachPackage](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + appAttachPackageNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("appAttachPackageName")]) + if err != nil { + return nil, err + } + respr, errRespr := a.srv.CreateOrUpdate(req.Context(), resourceGroupNameParam, appAttachPackageNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).AppAttachPackage, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (a *AppAttachPackageServerTransport) dispatchDelete(req *http.Request) (*http.Response, error) { + if a.srv.Delete == nil { + return nil, &nonRetriableError{errors.New("fake for method Delete not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DesktopVirtualization/appAttachPackages/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + appAttachPackageNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("appAttachPackageName")]) + if err != nil { + return nil, err + } + respr, errRespr := a.srv.Delete(req.Context(), resourceGroupNameParam, appAttachPackageNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusNoContent", respContent.HTTPStatus)} + } + resp, err := server.NewResponse(respContent, req, nil) + if err != nil { + return nil, err + } + return resp, nil +} + +func (a *AppAttachPackageServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if a.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DesktopVirtualization/appAttachPackages/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + appAttachPackageNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("appAttachPackageName")]) + if err != nil { + return nil, err + } + respr, errRespr := a.srv.Get(req.Context(), resourceGroupNameParam, appAttachPackageNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).AppAttachPackage, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (a *AppAttachPackageServerTransport) dispatchNewListByResourceGroupPager(req *http.Request) (*http.Response, error) { + if a.srv.NewListByResourceGroupPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListByResourceGroupPager not implemented")} + } + newListByResourceGroupPager := a.newListByResourceGroupPager.get(req) + if newListByResourceGroupPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DesktopVirtualization/appAttachPackages` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 2 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + filterUnescaped, err := url.QueryUnescape(qp.Get("$filter")) + if err != nil { + return nil, err + } + filterParam := getOptional(filterUnescaped) + var options *armdesktopvirtualization.AppAttachPackageClientListByResourceGroupOptions + if filterParam != nil { + options = &armdesktopvirtualization.AppAttachPackageClientListByResourceGroupOptions{ + Filter: filterParam, + } + } + resp := a.srv.NewListByResourceGroupPager(resourceGroupNameParam, options) + newListByResourceGroupPager = &resp + a.newListByResourceGroupPager.add(req, newListByResourceGroupPager) + server.PagerResponderInjectNextLinks(newListByResourceGroupPager, req, func(page *armdesktopvirtualization.AppAttachPackageClientListByResourceGroupResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListByResourceGroupPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + a.newListByResourceGroupPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListByResourceGroupPager) { + a.newListByResourceGroupPager.remove(req) + } + return resp, nil +} + +func (a *AppAttachPackageServerTransport) dispatchNewListBySubscriptionPager(req *http.Request) (*http.Response, error) { + if a.srv.NewListBySubscriptionPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListBySubscriptionPager not implemented")} + } + newListBySubscriptionPager := a.newListBySubscriptionPager.get(req) + if newListBySubscriptionPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DesktopVirtualization/appAttachPackages` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 1 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + filterUnescaped, err := url.QueryUnescape(qp.Get("$filter")) + if err != nil { + return nil, err + } + filterParam := getOptional(filterUnescaped) + var options *armdesktopvirtualization.AppAttachPackageClientListBySubscriptionOptions + if filterParam != nil { + options = &armdesktopvirtualization.AppAttachPackageClientListBySubscriptionOptions{ + Filter: filterParam, + } + } + resp := a.srv.NewListBySubscriptionPager(options) + newListBySubscriptionPager = &resp + a.newListBySubscriptionPager.add(req, newListBySubscriptionPager) + server.PagerResponderInjectNextLinks(newListBySubscriptionPager, req, func(page *armdesktopvirtualization.AppAttachPackageClientListBySubscriptionResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListBySubscriptionPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + a.newListBySubscriptionPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListBySubscriptionPager) { + a.newListBySubscriptionPager.remove(req) + } + return resp, nil +} + +func (a *AppAttachPackageServerTransport) dispatchUpdate(req *http.Request) (*http.Response, error) { + if a.srv.Update == nil { + return nil, &nonRetriableError{errors.New("fake for method Update not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DesktopVirtualization/appAttachPackages/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armdesktopvirtualization.AppAttachPackagePatch](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + appAttachPackageNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("appAttachPackageName")]) + if err != nil { + return nil, err + } + var options *armdesktopvirtualization.AppAttachPackageClientUpdateOptions + if !reflect.ValueOf(body).IsZero() { + options = &armdesktopvirtualization.AppAttachPackageClientUpdateOptions{ + AppAttachPackagePatch: &body, + } + } + respr, errRespr := a.srv.Update(req.Context(), resourceGroupNameParam, appAttachPackageNameParam, options) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).AppAttachPackage, req) + if err != nil { + return nil, err + } + return resp, nil +} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/appattachpackageinfo_server.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/appattachpackageinfo_server.go new file mode 100644 index 000000000000..cc893f57e632 --- /dev/null +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/appattachpackageinfo_server.go @@ -0,0 +1,116 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v2" + "net/http" + "net/url" + "regexp" +) + +// AppAttachPackageInfoServer is a fake server for instances of the armdesktopvirtualization.AppAttachPackageInfoClient type. +type AppAttachPackageInfoServer struct { + // NewImportPager is the fake for method AppAttachPackageInfoClient.NewImportPager + // HTTP status codes to indicate success: http.StatusOK + NewImportPager func(resourceGroupName string, hostPoolName string, importPackageInfoRequest armdesktopvirtualization.ImportPackageInfoRequest, options *armdesktopvirtualization.AppAttachPackageInfoClientImportOptions) (resp azfake.PagerResponder[armdesktopvirtualization.AppAttachPackageInfoClientImportResponse]) +} + +// NewAppAttachPackageInfoServerTransport creates a new instance of AppAttachPackageInfoServerTransport with the provided implementation. +// The returned AppAttachPackageInfoServerTransport instance is connected to an instance of armdesktopvirtualization.AppAttachPackageInfoClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewAppAttachPackageInfoServerTransport(srv *AppAttachPackageInfoServer) *AppAttachPackageInfoServerTransport { + return &AppAttachPackageInfoServerTransport{ + srv: srv, + newImportPager: newTracker[azfake.PagerResponder[armdesktopvirtualization.AppAttachPackageInfoClientImportResponse]](), + } +} + +// AppAttachPackageInfoServerTransport connects instances of armdesktopvirtualization.AppAttachPackageInfoClient to instances of AppAttachPackageInfoServer. +// Don't use this type directly, use NewAppAttachPackageInfoServerTransport instead. +type AppAttachPackageInfoServerTransport struct { + srv *AppAttachPackageInfoServer + newImportPager *tracker[azfake.PagerResponder[armdesktopvirtualization.AppAttachPackageInfoClientImportResponse]] +} + +// Do implements the policy.Transporter interface for AppAttachPackageInfoServerTransport. +func (a *AppAttachPackageInfoServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "AppAttachPackageInfoClient.NewImportPager": + resp, err = a.dispatchNewImportPager(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (a *AppAttachPackageInfoServerTransport) dispatchNewImportPager(req *http.Request) (*http.Response, error) { + if a.srv.NewImportPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewImportPager not implemented")} + } + newImportPager := a.newImportPager.get(req) + if newImportPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DesktopVirtualization/hostPools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/importAppAttachPackageInfo` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armdesktopvirtualization.ImportPackageInfoRequest](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + hostPoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("hostPoolName")]) + if err != nil { + return nil, err + } + resp := a.srv.NewImportPager(resourceGroupNameParam, hostPoolNameParam, body, nil) + newImportPager = &resp + a.newImportPager.add(req, newImportPager) + server.PagerResponderInjectNextLinks(newImportPager, req, func(page *armdesktopvirtualization.AppAttachPackageInfoClientImportResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newImportPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + a.newImportPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newImportPager) { + a.newImportPager.remove(req) + } + return resp, nil +} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/server_factory.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/server_factory.go index b8912a0f565c..9f04f1908688 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/server_factory.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/server_factory.go @@ -19,6 +19,8 @@ import ( // ServerFactory is a fake server for instances of the armdesktopvirtualization.ClientFactory type. type ServerFactory struct { + AppAttachPackageServer AppAttachPackageServer + AppAttachPackageInfoServer AppAttachPackageInfoServer ApplicationGroupsServer ApplicationGroupsServer ApplicationsServer ApplicationsServer DesktopsServer DesktopsServer @@ -51,6 +53,8 @@ func NewServerFactoryTransport(srv *ServerFactory) *ServerFactoryTransport { type ServerFactoryTransport struct { srv *ServerFactory trMu sync.Mutex + trAppAttachPackageServer *AppAttachPackageServerTransport + trAppAttachPackageInfoServer *AppAttachPackageInfoServerTransport trApplicationGroupsServer *ApplicationGroupsServerTransport trApplicationsServer *ApplicationsServerTransport trDesktopsServer *DesktopsServerTransport @@ -82,6 +86,16 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { var err error switch client { + case "AppAttachPackageClient": + initServer(s, &s.trAppAttachPackageServer, func() *AppAttachPackageServerTransport { + return NewAppAttachPackageServerTransport(&s.srv.AppAttachPackageServer) + }) + resp, err = s.trAppAttachPackageServer.Do(req) + case "AppAttachPackageInfoClient": + initServer(s, &s.trAppAttachPackageInfoServer, func() *AppAttachPackageInfoServerTransport { + return NewAppAttachPackageInfoServerTransport(&s.srv.AppAttachPackageInfoServer) + }) + resp, err = s.trAppAttachPackageInfoServer.Do(req) case "ApplicationGroupsClient": initServer(s, &s.trApplicationGroupsServer, func() *ApplicationGroupsServerTransport { return NewApplicationGroupsServerTransport(&s.srv.ApplicationGroupsServer) diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/time_rfc3339.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/time_rfc3339.go index b0535a7b63e6..81f308b0d343 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/time_rfc3339.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/fake/time_rfc3339.go @@ -19,12 +19,16 @@ import ( ) // Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. -var tzOffsetRegex = regexp.MustCompile(`(Z|z|\+|-)(\d+:\d+)*"*$`) +var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`) const ( - utcDateTimeJSON = `"2006-01-02T15:04:05.999999999"` - utcDateTime = "2006-01-02T15:04:05.999999999" - dateTimeJSON = `"` + time.RFC3339Nano + `"` + utcDateTime = "2006-01-02T15:04:05.999999999" + utcDateTimeJSON = `"` + utcDateTime + `"` + utcDateTimeNoT = "2006-01-02 15:04:05.999999999" + utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"` + dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00` + dateTimeJSON = `"` + time.RFC3339Nano + `"` + dateTimeJSONNoT = `"` + dateTimeNoT + `"` ) type dateTimeRFC3339 time.Time @@ -40,17 +44,33 @@ func (t dateTimeRFC3339) MarshalText() ([]byte, error) { } func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { - layout := utcDateTimeJSON - if tzOffsetRegex.Match(data) { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { layout = dateTimeJSON + } else if tzOffset { + layout = dateTimeJSONNoT + } else if hasT { + layout = utcDateTimeJSON + } else { + layout = utcDateTimeJSONNoT } return t.Parse(layout, string(data)) } func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { - layout := utcDateTime - if tzOffsetRegex.Match(data) { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { layout = time.RFC3339Nano + } else if tzOffset { + layout = dateTimeNoT + } else if hasT { + layout = utcDateTime + } else { + layout = utcDateTimeNoT } return t.Parse(layout, string(data)) } @@ -61,6 +81,10 @@ func (t *dateTimeRFC3339) Parse(layout, value string) error { return err } +func (t dateTimeRFC3339) String() string { + return time.Time(t).Format(time.RFC3339Nano) +} + func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { if t == nil { return @@ -74,7 +98,7 @@ func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { } func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || strings.EqualFold(string(data), "null") { + if data == nil || string(data) == "null" { return nil } var aux dateTimeRFC3339 diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/go.mod b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/go.mod index b80281c8aff2..96a2ff4270ac 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/go.mod +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/go.mod @@ -2,20 +2,10 @@ 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.11.1 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.2 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.11.1 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.7.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect - github.com/golang-jwt/jwt/v5 v5.2.1 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect - golang.org/x/crypto v0.22.0 // indirect golang.org/x/net v0.24.0 // indirect - golang.org/x/sys v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect ) diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/go.sum b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/go.sum index 453385ef9f88..ffdff03203f8 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/go.sum +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/go.sum @@ -1,29 +1,12 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.11.1 h1:E+OJmp2tPvt1W+amx48v1eqbjDYsgN+RzP4q16yV5eM= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.11.1/go.mod h1:a6xsAQUZg+VsS3TJ05SRp524Hs4pZ/AeFSr5ENf0Yjo= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.2 h1:FDif4R1+UUR+00q6wquyX90K7A8dN+R5E8GEadoP7sU= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.2/go.mod h1:aiYBYui4BJ/BJCAIKs92XiPyQfTaBWqvHujDwKb6CBU= github.com/Azure/azure-sdk-for-go/sdk/internal v1.7.0 h1:rTfKOCZGy5ViVrlA74ZPE99a+SgoEE2K/yg3RyW9dFA= github.com/Azure/azure-sdk-for-go/sdk/internal v1.7.0/go.mod h1:4OG6tQ9EOP/MT0NMjDlRzWoVFxfu9rN9B2X+tlSVktg= -github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 h1:XHOnouVk1mxXfQidrMEnLlPk9UMeRtyBTnEFtxkV0kU= -github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= -github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= -github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= -golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= -golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/hostpools_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/hostpools_client.go index 2f575130e558..3fcc65b1bfc6 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/hostpools_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/hostpools_client.go @@ -29,7 +29,7 @@ type HostPoolsClient struct { } // NewHostPoolsClient creates a new instance of HostPoolsClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewHostPoolsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*HostPoolsClient, error) { @@ -47,7 +47,7 @@ func NewHostPoolsClient(subscriptionID string, credential azcore.TokenCredential // CreateOrUpdate - Create or update a host pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - hostPoolName - The name of the host pool within the specified resource group // - hostPool - Object containing HostPool definitions. @@ -95,7 +95,7 @@ func (client *HostPoolsClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, hostPool); err != nil { @@ -116,7 +116,7 @@ func (client *HostPoolsClient) createOrUpdateHandleResponse(resp *http.Response) // Delete - Remove a host pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - hostPoolName - The name of the host pool within the specified resource group // - options - HostPoolsClientDeleteOptions contains the optional parameters for the HostPoolsClient.Delete method. @@ -161,7 +161,7 @@ func (client *HostPoolsClient) deleteCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-03") if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } @@ -173,7 +173,7 @@ func (client *HostPoolsClient) deleteCreateRequest(ctx context.Context, resource // Get - Get a host pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - hostPoolName - The name of the host pool within the specified resource group // - options - HostPoolsClientGetOptions contains the optional parameters for the HostPoolsClient.Get method. @@ -219,7 +219,7 @@ func (client *HostPoolsClient) getCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -236,7 +236,7 @@ func (client *HostPoolsClient) getHandleResponse(resp *http.Response) (HostPools // NewListPager - List hostPools in subscription. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - options - HostPoolsClientListOptions contains the optional parameters for the HostPoolsClient.NewListPager method. func (client *HostPoolsClient) NewListPager(options *HostPoolsClientListOptions) *runtime.Pager[HostPoolsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[HostPoolsClientListResponse]{ @@ -273,15 +273,15 @@ func (client *HostPoolsClient) listCreateRequest(ctx context.Context, options *H return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") - if options != nil && options.PageSize != nil { - reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) + reqQP.Set("api-version", "2024-04-03") + if options != nil && options.InitialSkip != nil { + reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) } if options != nil && options.IsDescending != nil { reqQP.Set("isDescending", strconv.FormatBool(*options.IsDescending)) } - if options != nil && options.InitialSkip != nil { - reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) + if options != nil && options.PageSize != nil { + reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} @@ -299,7 +299,7 @@ func (client *HostPoolsClient) listHandleResponse(resp *http.Response) (HostPool // NewListByResourceGroupPager - List hostPools. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - HostPoolsClientListByResourceGroupOptions contains the optional parameters for the HostPoolsClient.NewListByResourceGroupPager // method. @@ -342,15 +342,15 @@ func (client *HostPoolsClient) listByResourceGroupCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") - if options != nil && options.PageSize != nil { - reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) + reqQP.Set("api-version", "2024-04-03") + if options != nil && options.InitialSkip != nil { + reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) } if options != nil && options.IsDescending != nil { reqQP.Set("isDescending", strconv.FormatBool(*options.IsDescending)) } - if options != nil && options.InitialSkip != nil { - reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) + if options != nil && options.PageSize != nil { + reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} @@ -369,7 +369,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 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - hostPoolName - The name of the host pool within the specified resource group // - options - HostPoolsClientRetrieveRegistrationTokenOptions contains the optional parameters for the HostPoolsClient.RetrieveRegistrationToken @@ -416,7 +416,7 @@ func (client *HostPoolsClient) retrieveRegistrationTokenCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -434,7 +434,7 @@ func (client *HostPoolsClient) retrieveRegistrationTokenHandleResponse(resp *htt // Update - Update a host pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - hostPoolName - The name of the host pool within the specified resource group // - options - HostPoolsClientUpdateOptions contains the optional parameters for the HostPoolsClient.Update method. @@ -480,7 +480,7 @@ func (client *HostPoolsClient) updateCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.HostPool != nil { diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/hostpools_client_example_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/hostpools_client_example_test.go deleted file mode 100644 index a91ad4e36c3a..000000000000 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/hostpools_client_example_test.go +++ /dev/null @@ -1,639 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armdesktopvirtualization_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/HostPool_Get.json -func ExampleHostPoolsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewHostPoolsClient().Get(ctx, "resourceGroup1", "hostPool1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.HostPool = armdesktopvirtualization.HostPool{ - // Name: to.Ptr("hostPool1"), - // Type: to.Ptr("/Microsoft.DesktopVirtualization/hostPools"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1"), - // Location: to.Ptr("centralus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armdesktopvirtualization.HostPoolProperties{ - // Description: to.Ptr("des1"), - // AgentUpdate: &armdesktopvirtualization.AgentUpdateProperties{ - // Type: to.Ptr(armdesktopvirtualization.SessionHostComponentUpdateTypeScheduled), - // MaintenanceWindowTimeZone: to.Ptr("Alaskan Standard Time"), - // MaintenanceWindows: []*armdesktopvirtualization.MaintenanceWindowProperties{ - // { - // DayOfWeek: to.Ptr(armdesktopvirtualization.DayOfWeekFriday), - // Hour: to.Ptr[int32](7), - // }, - // { - // DayOfWeek: to.Ptr(armdesktopvirtualization.DayOfWeekSaturday), - // Hour: to.Ptr[int32](8), - // }}, - // UseSessionHostLocalTime: to.Ptr(false), - // }, - // CloudPcResource: to.Ptr(false), - // FriendlyName: to.Ptr("friendly"), - // HostPoolType: to.Ptr(armdesktopvirtualization.HostPoolTypePooled), - // LoadBalancerType: to.Ptr(armdesktopvirtualization.LoadBalancerTypeBreadthFirst), - // MaxSessionLimit: to.Ptr[int32](999999), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // PersonalDesktopAssignmentType: to.Ptr(armdesktopvirtualization.PersonalDesktopAssignmentTypeAutomatic), - // PreferredAppGroupType: to.Ptr(armdesktopvirtualization.PreferredAppGroupTypeDesktop), - // RegistrationInfo: &armdesktopvirtualization.RegistrationInfo{ - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2008-09-22T14:01:54.957Z"); return t}()), - // RegistrationTokenOperation: to.Ptr(armdesktopvirtualization.RegistrationTokenOperationUpdate), - // Token: to.Ptr("token"), - // }, - // SsoClientID: to.Ptr("client"), - // SsoClientSecretKeyVaultPath: to.Ptr("https://keyvault/secret"), - // SsoSecretType: to.Ptr(armdesktopvirtualization.SSOSecretTypeSharedKey), - // SsoadfsAuthority: to.Ptr("https://adfs"), - // StartVMOnConnect: to.Ptr(false), - // VMTemplate: to.Ptr("{json:json}"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/HostPool_Create.json -func ExampleHostPoolsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewHostPoolsClient().CreateOrUpdate(ctx, "resourceGroup1", "hostPool1", armdesktopvirtualization.HostPool{ - Location: to.Ptr("centralus"), - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - Properties: &armdesktopvirtualization.HostPoolProperties{ - Description: to.Ptr("des1"), - AgentUpdate: &armdesktopvirtualization.AgentUpdateProperties{ - Type: to.Ptr(armdesktopvirtualization.SessionHostComponentUpdateTypeScheduled), - MaintenanceWindowTimeZone: to.Ptr("Alaskan Standard Time"), - MaintenanceWindows: []*armdesktopvirtualization.MaintenanceWindowProperties{ - { - DayOfWeek: to.Ptr(armdesktopvirtualization.DayOfWeekFriday), - Hour: to.Ptr[int32](7), - }, - { - DayOfWeek: to.Ptr(armdesktopvirtualization.DayOfWeekSaturday), - Hour: to.Ptr[int32](8), - }}, - UseSessionHostLocalTime: to.Ptr(false), - }, - FriendlyName: to.Ptr("friendly"), - HostPoolType: to.Ptr(armdesktopvirtualization.HostPoolTypePooled), - LoadBalancerType: to.Ptr(armdesktopvirtualization.LoadBalancerTypeBreadthFirst), - MaxSessionLimit: to.Ptr[int32](999999), - PersonalDesktopAssignmentType: to.Ptr(armdesktopvirtualization.PersonalDesktopAssignmentTypeAutomatic), - PreferredAppGroupType: to.Ptr(armdesktopvirtualization.PreferredAppGroupTypeDesktop), - RegistrationInfo: &armdesktopvirtualization.RegistrationInfo{ - ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-01T14:01:54.957Z"); return t }()), - RegistrationTokenOperation: to.Ptr(armdesktopvirtualization.RegistrationTokenOperationUpdate), - }, - SsoClientID: to.Ptr("client"), - SsoClientSecretKeyVaultPath: to.Ptr("https://keyvault/secret"), - SsoSecretType: to.Ptr(armdesktopvirtualization.SSOSecretTypeSharedKey), - SsoadfsAuthority: to.Ptr("https://adfs"), - StartVMOnConnect: to.Ptr(false), - VMTemplate: to.Ptr("{json:json}"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.HostPool = armdesktopvirtualization.HostPool{ - // Name: to.Ptr("hostPool1"), - // Type: to.Ptr("/Microsoft.DesktopVirtualization/hostPools"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1"), - // Location: to.Ptr("centralus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armdesktopvirtualization.HostPoolProperties{ - // Description: to.Ptr("des1"), - // AgentUpdate: &armdesktopvirtualization.AgentUpdateProperties{ - // Type: to.Ptr(armdesktopvirtualization.SessionHostComponentUpdateTypeScheduled), - // MaintenanceWindowTimeZone: to.Ptr("Alaskan Standard Time"), - // MaintenanceWindows: []*armdesktopvirtualization.MaintenanceWindowProperties{ - // { - // DayOfWeek: to.Ptr(armdesktopvirtualization.DayOfWeekFriday), - // Hour: to.Ptr[int32](7), - // }, - // { - // DayOfWeek: to.Ptr(armdesktopvirtualization.DayOfWeekSaturday), - // Hour: to.Ptr[int32](8), - // }}, - // UseSessionHostLocalTime: to.Ptr(false), - // }, - // CloudPcResource: to.Ptr(false), - // FriendlyName: to.Ptr("friendly"), - // HostPoolType: to.Ptr(armdesktopvirtualization.HostPoolTypePooled), - // LoadBalancerType: to.Ptr(armdesktopvirtualization.LoadBalancerTypeBreadthFirst), - // MaxSessionLimit: to.Ptr[int32](999999), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // PersonalDesktopAssignmentType: to.Ptr(armdesktopvirtualization.PersonalDesktopAssignmentTypeAutomatic), - // PreferredAppGroupType: to.Ptr(armdesktopvirtualization.PreferredAppGroupTypeDesktop), - // RegistrationInfo: &armdesktopvirtualization.RegistrationInfo{ - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-01T14:01:54.957Z"); return t}()), - // RegistrationTokenOperation: to.Ptr(armdesktopvirtualization.RegistrationTokenOperationUpdate), - // Token: to.Ptr("token"), - // }, - // SsoClientID: to.Ptr("client"), - // SsoClientSecretKeyVaultPath: to.Ptr("https://keyvault/secret"), - // SsoSecretType: to.Ptr(armdesktopvirtualization.SSOSecretTypeSharedKey), - // SsoadfsAuthority: to.Ptr("https://adfs"), - // StartVMOnConnect: to.Ptr(false), - // VMTemplate: to.Ptr("{json:json}"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/HostPool_Delete.json -func ExampleHostPoolsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewHostPoolsClient().Delete(ctx, "resourceGroup1", "hostPool1", &armdesktopvirtualization.HostPoolsClientDeleteOptions{Force: to.Ptr(true)}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/HostPool_Update.json -func ExampleHostPoolsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewHostPoolsClient().Update(ctx, "resourceGroup1", "hostPool1", &armdesktopvirtualization.HostPoolsClientUpdateOptions{HostPool: &armdesktopvirtualization.HostPoolPatch{ - Properties: &armdesktopvirtualization.HostPoolPatchProperties{ - Description: to.Ptr("des1"), - AgentUpdate: &armdesktopvirtualization.AgentUpdatePatchProperties{ - Type: to.Ptr(armdesktopvirtualization.SessionHostComponentUpdateTypeScheduled), - MaintenanceWindowTimeZone: to.Ptr("Alaskan Standard Time"), - MaintenanceWindows: []*armdesktopvirtualization.MaintenanceWindowPatchProperties{ - { - DayOfWeek: to.Ptr(armdesktopvirtualization.DayOfWeekFriday), - Hour: to.Ptr[int32](7), - }, - { - DayOfWeek: to.Ptr(armdesktopvirtualization.DayOfWeekSaturday), - Hour: to.Ptr[int32](8), - }}, - UseSessionHostLocalTime: to.Ptr(false), - }, - FriendlyName: to.Ptr("friendly"), - LoadBalancerType: to.Ptr(armdesktopvirtualization.LoadBalancerTypeBreadthFirst), - MaxSessionLimit: to.Ptr[int32](999999), - PersonalDesktopAssignmentType: to.Ptr(armdesktopvirtualization.PersonalDesktopAssignmentTypeAutomatic), - RegistrationInfo: &armdesktopvirtualization.RegistrationInfoPatch{ - ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-01T15:01:54.957Z"); return t }()), - RegistrationTokenOperation: to.Ptr(armdesktopvirtualization.RegistrationTokenOperationUpdate), - }, - SsoClientID: to.Ptr("client"), - SsoClientSecretKeyVaultPath: to.Ptr("https://keyvault/secret"), - SsoSecretType: to.Ptr(armdesktopvirtualization.SSOSecretTypeSharedKey), - SsoadfsAuthority: to.Ptr("https://adfs"), - StartVMOnConnect: to.Ptr(false), - VMTemplate: to.Ptr("{json:json}"), - }, - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.HostPool = armdesktopvirtualization.HostPool{ - // Name: to.Ptr("hostPool1"), - // Type: to.Ptr("/Microsoft.DesktopVirtualization/hostPools"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1"), - // Location: to.Ptr("centralus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armdesktopvirtualization.HostPoolProperties{ - // Description: to.Ptr("des1"), - // AgentUpdate: &armdesktopvirtualization.AgentUpdateProperties{ - // Type: to.Ptr(armdesktopvirtualization.SessionHostComponentUpdateTypeScheduled), - // MaintenanceWindowTimeZone: to.Ptr("Alaskan Standard Time"), - // MaintenanceWindows: []*armdesktopvirtualization.MaintenanceWindowProperties{ - // { - // DayOfWeek: to.Ptr(armdesktopvirtualization.DayOfWeekFriday), - // Hour: to.Ptr[int32](7), - // }, - // { - // DayOfWeek: to.Ptr(armdesktopvirtualization.DayOfWeekSaturday), - // Hour: to.Ptr[int32](8), - // }}, - // UseSessionHostLocalTime: to.Ptr(false), - // }, - // CloudPcResource: to.Ptr(false), - // FriendlyName: to.Ptr("friendly"), - // HostPoolType: to.Ptr(armdesktopvirtualization.HostPoolTypePooled), - // LoadBalancerType: to.Ptr(armdesktopvirtualization.LoadBalancerTypeBreadthFirst), - // MaxSessionLimit: to.Ptr[int32](999999), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // PersonalDesktopAssignmentType: to.Ptr(armdesktopvirtualization.PersonalDesktopAssignmentTypeAutomatic), - // PreferredAppGroupType: to.Ptr(armdesktopvirtualization.PreferredAppGroupTypeDesktop), - // RegistrationInfo: &armdesktopvirtualization.RegistrationInfo{ - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2008-09-22T14:01:54.957Z"); return t}()), - // RegistrationTokenOperation: to.Ptr(armdesktopvirtualization.RegistrationTokenOperationUpdate), - // Token: to.Ptr("token"), - // }, - // SsoClientID: to.Ptr("client"), - // SsoClientSecretKeyVaultPath: to.Ptr("https://keyvault/secret"), - // SsoSecretType: to.Ptr(armdesktopvirtualization.SSOSecretTypeSharedKey), - // SsoadfsAuthority: to.Ptr("https://adfs"), - // StartVMOnConnect: to.Ptr(false), - // VMTemplate: to.Ptr("{json:json}"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/HostPool_ListByResourceGroup.json -func ExampleHostPoolsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewHostPoolsClient().NewListByResourceGroupPager("resourceGroup1", &armdesktopvirtualization.HostPoolsClientListByResourceGroupOptions{PageSize: to.Ptr[int32](10), - IsDescending: to.Ptr(true), - InitialSkip: to.Ptr[int32](0), - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.HostPoolList = armdesktopvirtualization.HostPoolList{ - // Value: []*armdesktopvirtualization.HostPool{ - // { - // Name: to.Ptr("hostPool1"), - // Type: to.Ptr("/Microsoft.DesktopVirtualization/hostPools"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1"), - // Location: to.Ptr("centralus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armdesktopvirtualization.HostPoolProperties{ - // Description: to.Ptr("des1"), - // AgentUpdate: &armdesktopvirtualization.AgentUpdateProperties{ - // Type: to.Ptr(armdesktopvirtualization.SessionHostComponentUpdateTypeScheduled), - // MaintenanceWindowTimeZone: to.Ptr("Alaskan Standard Time"), - // MaintenanceWindows: []*armdesktopvirtualization.MaintenanceWindowProperties{ - // { - // DayOfWeek: to.Ptr(armdesktopvirtualization.DayOfWeekFriday), - // Hour: to.Ptr[int32](7), - // }, - // { - // DayOfWeek: to.Ptr(armdesktopvirtualization.DayOfWeekSaturday), - // Hour: to.Ptr[int32](8), - // }}, - // UseSessionHostLocalTime: to.Ptr(false), - // }, - // CloudPcResource: to.Ptr(false), - // FriendlyName: to.Ptr("friendly"), - // HostPoolType: to.Ptr(armdesktopvirtualization.HostPoolTypePooled), - // LoadBalancerType: to.Ptr(armdesktopvirtualization.LoadBalancerTypeBreadthFirst), - // MaxSessionLimit: to.Ptr[int32](999999), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // PersonalDesktopAssignmentType: to.Ptr(armdesktopvirtualization.PersonalDesktopAssignmentTypeAutomatic), - // PreferredAppGroupType: to.Ptr(armdesktopvirtualization.PreferredAppGroupTypeDesktop), - // RegistrationInfo: &armdesktopvirtualization.RegistrationInfo{ - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2008-09-22T14:01:54.957Z"); return t}()), - // RegistrationTokenOperation: to.Ptr(armdesktopvirtualization.RegistrationTokenOperationUpdate), - // Token: to.Ptr("token"), - // }, - // SsoClientID: to.Ptr("client"), - // SsoClientSecretKeyVaultPath: to.Ptr("https://keyvault/secret"), - // SsoSecretType: to.Ptr(armdesktopvirtualization.SSOSecretTypeSharedKey), - // SsoadfsAuthority: to.Ptr("https://adfs"), - // StartVMOnConnect: to.Ptr(false), - // VMTemplate: to.Ptr("{json:json}"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }, - // { - // Name: to.Ptr("hostPool2"), - // Type: to.Ptr("/Microsoft.DesktopVirtualization/hostPools"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool2"), - // Location: to.Ptr("centralus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armdesktopvirtualization.HostPoolProperties{ - // Description: to.Ptr("des1"), - // AgentUpdate: &armdesktopvirtualization.AgentUpdateProperties{ - // Type: to.Ptr(armdesktopvirtualization.SessionHostComponentUpdateTypeScheduled), - // MaintenanceWindowTimeZone: to.Ptr("Alaskan Standard Time"), - // MaintenanceWindows: []*armdesktopvirtualization.MaintenanceWindowProperties{ - // { - // DayOfWeek: to.Ptr(armdesktopvirtualization.DayOfWeekFriday), - // Hour: to.Ptr[int32](7), - // }, - // { - // DayOfWeek: to.Ptr(armdesktopvirtualization.DayOfWeekSaturday), - // Hour: to.Ptr[int32](8), - // }}, - // UseSessionHostLocalTime: to.Ptr(false), - // }, - // CloudPcResource: to.Ptr(false), - // FriendlyName: to.Ptr("friendly"), - // HostPoolType: to.Ptr(armdesktopvirtualization.HostPoolTypePooled), - // LoadBalancerType: to.Ptr(armdesktopvirtualization.LoadBalancerTypeBreadthFirst), - // MaxSessionLimit: to.Ptr[int32](999999), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // PersonalDesktopAssignmentType: to.Ptr(armdesktopvirtualization.PersonalDesktopAssignmentTypeAutomatic), - // PreferredAppGroupType: to.Ptr(armdesktopvirtualization.PreferredAppGroupTypeDesktop), - // RegistrationInfo: &armdesktopvirtualization.RegistrationInfo{ - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2008-09-22T14:01:54.957Z"); return t}()), - // RegistrationTokenOperation: to.Ptr(armdesktopvirtualization.RegistrationTokenOperationUpdate), - // Token: to.Ptr("token"), - // }, - // SsoClientID: to.Ptr("client"), - // SsoClientSecretKeyVaultPath: to.Ptr("https://keyvault/secret"), - // SsoSecretType: to.Ptr(armdesktopvirtualization.SSOSecretTypeSharedKey), - // SsoadfsAuthority: to.Ptr("https://adfs"), - // StartVMOnConnect: to.Ptr(false), - // VMTemplate: to.Ptr("{json:json}"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/HostPool_List.json -func ExampleHostPoolsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewHostPoolsClient().NewListPager(&armdesktopvirtualization.HostPoolsClientListOptions{PageSize: to.Ptr[int32](10), - IsDescending: to.Ptr(true), - InitialSkip: to.Ptr[int32](0), - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.HostPoolList = armdesktopvirtualization.HostPoolList{ - // Value: []*armdesktopvirtualization.HostPool{ - // { - // Name: to.Ptr("hostPool1"), - // Type: to.Ptr("/Microsoft.DesktopVirtualization/hostPools"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1"), - // Location: to.Ptr("centralus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armdesktopvirtualization.HostPoolProperties{ - // Description: to.Ptr("des1"), - // AgentUpdate: &armdesktopvirtualization.AgentUpdateProperties{ - // Type: to.Ptr(armdesktopvirtualization.SessionHostComponentUpdateTypeScheduled), - // MaintenanceWindowTimeZone: to.Ptr("Alaskan Standard Time"), - // MaintenanceWindows: []*armdesktopvirtualization.MaintenanceWindowProperties{ - // { - // DayOfWeek: to.Ptr(armdesktopvirtualization.DayOfWeekFriday), - // Hour: to.Ptr[int32](7), - // }, - // { - // DayOfWeek: to.Ptr(armdesktopvirtualization.DayOfWeekSaturday), - // Hour: to.Ptr[int32](8), - // }}, - // UseSessionHostLocalTime: to.Ptr(false), - // }, - // CloudPcResource: to.Ptr(false), - // FriendlyName: to.Ptr("friendly"), - // HostPoolType: to.Ptr(armdesktopvirtualization.HostPoolTypePooled), - // LoadBalancerType: to.Ptr(armdesktopvirtualization.LoadBalancerTypeBreadthFirst), - // MaxSessionLimit: to.Ptr[int32](999999), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // PersonalDesktopAssignmentType: to.Ptr(armdesktopvirtualization.PersonalDesktopAssignmentTypeAutomatic), - // PreferredAppGroupType: to.Ptr(armdesktopvirtualization.PreferredAppGroupTypeDesktop), - // RegistrationInfo: &armdesktopvirtualization.RegistrationInfo{ - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2008-09-22T14:01:54.957Z"); return t}()), - // RegistrationTokenOperation: to.Ptr(armdesktopvirtualization.RegistrationTokenOperationUpdate), - // Token: to.Ptr("token"), - // }, - // SsoClientID: to.Ptr("client"), - // SsoClientSecretKeyVaultPath: to.Ptr("https://keyvault/secret"), - // SsoSecretType: to.Ptr(armdesktopvirtualization.SSOSecretTypeSharedKey), - // SsoadfsAuthority: to.Ptr("https://adfs"), - // StartVMOnConnect: to.Ptr(false), - // VMTemplate: to.Ptr("{json:json}"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }, - // { - // Name: to.Ptr("hostPool2"), - // Type: to.Ptr("/Microsoft.DesktopVirtualization/hostPools"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool2"), - // Location: to.Ptr("centralus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armdesktopvirtualization.HostPoolProperties{ - // Description: to.Ptr("des1"), - // AgentUpdate: &armdesktopvirtualization.AgentUpdateProperties{ - // Type: to.Ptr(armdesktopvirtualization.SessionHostComponentUpdateTypeScheduled), - // MaintenanceWindowTimeZone: to.Ptr("Alaskan Standard Time"), - // MaintenanceWindows: []*armdesktopvirtualization.MaintenanceWindowProperties{ - // { - // DayOfWeek: to.Ptr(armdesktopvirtualization.DayOfWeekFriday), - // Hour: to.Ptr[int32](7), - // }, - // { - // DayOfWeek: to.Ptr(armdesktopvirtualization.DayOfWeekSaturday), - // Hour: to.Ptr[int32](8), - // }}, - // UseSessionHostLocalTime: to.Ptr(false), - // }, - // CloudPcResource: to.Ptr(false), - // FriendlyName: to.Ptr("friendly"), - // HostPoolType: to.Ptr(armdesktopvirtualization.HostPoolTypePooled), - // LoadBalancerType: to.Ptr(armdesktopvirtualization.LoadBalancerTypeBreadthFirst), - // MaxSessionLimit: to.Ptr[int32](999999), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // PersonalDesktopAssignmentType: to.Ptr(armdesktopvirtualization.PersonalDesktopAssignmentTypeAutomatic), - // PreferredAppGroupType: to.Ptr(armdesktopvirtualization.PreferredAppGroupTypeDesktop), - // RegistrationInfo: &armdesktopvirtualization.RegistrationInfo{ - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2008-09-22T14:01:54.957Z"); return t}()), - // RegistrationTokenOperation: to.Ptr(armdesktopvirtualization.RegistrationTokenOperationUpdate), - // Token: to.Ptr("token"), - // }, - // SsoClientID: to.Ptr("client"), - // SsoClientSecretKeyVaultPath: to.Ptr("https://keyvault/secret"), - // SsoSecretType: to.Ptr(armdesktopvirtualization.SSOSecretTypeSharedKey), - // SsoadfsAuthority: to.Ptr("https://adfs"), - // StartVMOnConnect: to.Ptr(false), - // VMTemplate: to.Ptr("{json:json}"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/HostPools_RetrieveRegistrationToken_Post.json -func ExampleHostPoolsClient_RetrieveRegistrationToken() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewHostPoolsClient().RetrieveRegistrationToken(ctx, "resourceGroup1", "hostPool1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RegistrationInfo = armdesktopvirtualization.RegistrationInfo{ - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2008-09-22T14:01:54.957Z"); return t}()), - // RegistrationTokenOperation: to.Ptr(armdesktopvirtualization.RegistrationTokenOperationUpdate), - // Token: to.Ptr("token"), - // } -} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/models.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/models.go index 3b6e378d188d..06e47795f086 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/models.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/models.go @@ -42,18 +42,153 @@ type AgentUpdateProperties struct { UseSessionHostLocalTime *bool } +// AppAttachPackage - Schema for App Attach Package properties. +type AppAttachPackage struct { + // REQUIRED; The geo-location where the resource lives + Location *string + + // REQUIRED; Detailed properties for App Attach Package + Properties *AppAttachPackageProperties + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// AppAttachPackageInfoProperties - Schema for Import Package Information properties. +type AppAttachPackageInfoProperties struct { + // Date certificate expires, found in the appxmanifest.xml. + CertificateExpiry *time.Time + + // Certificate name found in the appxmanifest.xml. + CertificateName *string + + // User friendly Name to be displayed in the portal. + DisplayName *string + + // VHD/CIM image path on Network Share. + ImagePath *string + + // Make this version of the package the active one across the hostpool. + IsActive *bool + + // Is package timestamped so it can ignore the certificate expiry date + IsPackageTimestamped *PackageTimestamped + + // Specifies how to register Package in feed. + IsRegularRegistration *bool + + // Date Package was last updated, found in the appxmanifest.xml. + LastUpdated *time.Time + + // Alias of App Attach Package. Assigned at import time + PackageAlias *string + + // List of package applications. + PackageApplications []*MsixPackageApplications + + // List of package dependencies. + PackageDependencies []*MsixPackageDependencies + + // Package Family Name from appxmanifest.xml. Contains Package Name and Publisher name. + PackageFamilyName *string + + // Package Full Name from appxmanifest.xml. + PackageFullName *string + + // Package Name from appxmanifest.xml. + PackageName *string + + // Relative Path to the package inside the image. + PackageRelativePath *string + + // Package version found in the appxmanifest.xml. + Version *string +} + +// AppAttachPackageList - List of App Attach Package definitions. +type AppAttachPackageList struct { + // List of App Attach Package definitions. + Value []*AppAttachPackage + + // READ-ONLY; Link to the next page of results. + NextLink *string +} + +// AppAttachPackagePatch - Schema for updatable App Attach Package properties. +type AppAttachPackagePatch struct { + // Detailed properties for App Attach Package + Properties *AppAttachPackagePatchProperties + + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// AppAttachPackagePatchProperties - Schema for patchable fields on an App Attach Package. +type AppAttachPackagePatchProperties struct { + // Parameter indicating how the health check should behave if this package fails staging + FailHealthCheckOnStagingFailure *FailHealthCheckOnStagingFailure + + // List of Hostpool resource Ids. + HostPoolReferences []*string + + // Detailed properties for App Attach Package + Image *AppAttachPackageInfoProperties + + // URL path to certificate name located in keyVault + KeyVaultURL *string +} + +// AppAttachPackageProperties - Schema for App Attach Package properties. +type AppAttachPackageProperties struct { + // Parameter indicating how the health check should behave if this package fails staging + FailHealthCheckOnStagingFailure *FailHealthCheckOnStagingFailure + + // List of Hostpool resource Ids. + HostPoolReferences []*string + + // Detailed properties for App Attach Package + Image *AppAttachPackageInfoProperties + + // URL path to certificate name located in keyVault + KeyVaultURL *string + + // READ-ONLY; The provisioning state of the App Attach Package. + ProvisioningState *ProvisioningState +} + // Application - Schema for Application properties. type Application struct { // REQUIRED; Detailed properties for Application Properties *ApplicationProperties - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" @@ -62,18 +197,18 @@ type Application struct { // ApplicationGroup - Represents a ApplicationGroup definition. type ApplicationGroup struct { + // REQUIRED; The geo-location where the resource lives + Location *string + // REQUIRED; Detailed properties for ApplicationGroup Properties *ApplicationGroupProperties Identity *ResourceModelWithAllowedPropertySetIdentity - // Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are + // Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type. E.g. ApiApps are // a kind of Microsoft.Web/sites type. If supported, the resource provider must // validate and persist this value. Kind *string - // The geo-location where the resource lives - Location *string - // The fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed by another // Azure resource. If this is present, complete mode deployment will not // delete the resource if it is removed from the template since it is managed by another resource. @@ -90,13 +225,13 @@ type ApplicationGroup struct { // (section 14.26), and If-Range (section 14.27) header fields. Etag *string - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" @@ -120,12 +255,15 @@ type ApplicationGroupPatch struct { // tags to be updated Tags map[string]*string - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } @@ -275,13 +413,13 @@ type Desktop struct { // Detailed properties for Desktop Properties *DesktopProperties - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" @@ -338,12 +476,15 @@ type ExpandMsixImage struct { // Detailed properties for ExpandMsixImage Properties *ExpandMsixImageProperties - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } @@ -359,6 +500,12 @@ type ExpandMsixImageList struct { // ExpandMsixImageProperties - Schema for Expand MSIX Image properties. type ExpandMsixImageProperties struct { + // Date certificate expires, found in the appxmanifest.xml. + CertificateExpiry *time.Time + + // Certificate name found in the appxmanifest.xml. + CertificateName *string + // User friendly Name to be displayed in the portal. DisplayName *string @@ -395,24 +542,24 @@ type ExpandMsixImageProperties struct { // Relative Path to the package inside the image. PackageRelativePath *string - // Package Version found in the appxmanifest.xml. + // Package version found in the appxmanifest.xml. Version *string } // HostPool - Represents a HostPool definition. type HostPool struct { + // REQUIRED; The geo-location where the resource lives + Location *string + // REQUIRED; Detailed properties for HostPool Properties *HostPoolProperties Identity *ResourceModelWithAllowedPropertySetIdentity - // Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are + // Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type. E.g. ApiApps are // a kind of Microsoft.Web/sites type. If supported, the resource provider must // validate and persist this value. Kind *string - // The geo-location where the resource lives - Location *string - // The fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed by another // Azure resource. If this is present, complete mode deployment will not // delete the resource if it is removed from the template since it is managed by another resource. @@ -429,13 +576,13 @@ type HostPool struct { // (section 14.26), and If-Range (section 14.27) header fields. Etag *string - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" @@ -459,12 +606,15 @@ type HostPoolPatch struct { // tags to be updated Tags map[string]*string - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } @@ -586,6 +736,9 @@ type HostPoolProperties struct { // Is validation environment. ValidationEnvironment *bool + // READ-ONLY; List of App Attach Package links. + AppAttachPackageReferences []*string + // READ-ONLY; List of applicationGroup links. ApplicationGroupReferences []*string @@ -599,6 +752,15 @@ type HostPoolProperties struct { PrivateEndpointConnections []*PrivateEndpointConnection } +// ImportPackageInfoRequest - Information to import app attach package +type ImportPackageInfoRequest struct { + // Possible device architectures that an app attach package can be configured for + PackageArchitecture *AppAttachPackageArchitectures + + // URI to Image + Path *string +} + // LogSpecification - Specifications of the Log for Azure Monitoring type LogSpecification struct { // Blob duration of the log @@ -622,13 +784,13 @@ type MSIXPackage struct { // REQUIRED; Detailed properties for MSIX Package Properties *MSIXPackageProperties - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" @@ -649,12 +811,15 @@ type MSIXPackagePatch struct { // Detailed properties for MSIX Package Properties *MSIXPackagePatchProperties - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } @@ -703,7 +868,7 @@ type MSIXPackageProperties struct { // Relative Path to the package inside the image. PackageRelativePath *string - // Package Version found in the appxmanifest.xml. + // Package version found in the appxmanifest.xml. Version *string } @@ -767,23 +932,26 @@ type OperationProperties struct { ServiceSpecification *ServiceSpecification } -// PrivateEndpoint - The Private Endpoint resource. +// PrivateEndpoint - The private endpoint resource. type PrivateEndpoint struct { - // READ-ONLY; The ARM identifier for Private Endpoint + // READ-ONLY; The ARM identifier for private endpoint. ID *string } -// PrivateEndpointConnection - The Private Endpoint Connection resource. +// PrivateEndpointConnection - The private endpoint connection resource. type PrivateEndpointConnection struct { // Resource properties. Properties *PrivateEndpointConnectionProperties - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } @@ -798,14 +966,17 @@ type PrivateEndpointConnectionListResultWithSystemData struct { NextLink *string } -// PrivateEndpointConnectionProperties - Properties of the PrivateEndpointConnectProperties. +// PrivateEndpointConnectionProperties - Properties of the private endpoint connection. type PrivateEndpointConnectionProperties struct { // REQUIRED; A collection of information about the state of the connection between service consumer and provider. PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState - // The resource of private end point. + // The private endpoint resource. PrivateEndpoint *PrivateEndpoint + // READ-ONLY; The group ids for the private endpoint resource. + GroupIDs []*string + // READ-ONLY; The provisioning state of the private endpoint connection resource. ProvisioningState *PrivateEndpointConnectionProvisioningState } @@ -815,13 +986,13 @@ type PrivateEndpointConnectionWithSystemData struct { // Resource properties. Properties *PrivateEndpointConnectionProperties - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" @@ -833,12 +1004,15 @@ type PrivateLinkResource struct { // Resource properties. Properties *PrivateLinkResourceProperties - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } @@ -902,10 +1076,10 @@ type ResourceModelWithAllowedPropertySetIdentity struct { // The identity type. Type *string - // READ-ONLY; The principal ID of resource identity. + // READ-ONLY; The principal ID of resource identity. The value must be an UUID. PrincipalID *string - // READ-ONLY; The tenant ID of resource. + // READ-ONLY; The tenant ID of resource. The value must be an UUID. TenantID *string } @@ -928,7 +1102,7 @@ type ResourceModelWithAllowedPropertySetPlan struct { } type ResourceModelWithAllowedPropertySetSKU struct { - // REQUIRED; The name of the SKU. Ex - P3. It is typically a letter+number code + // REQUIRED; The name of the SKU. E.g. P3. It is typically a letter+number code Name *string // If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the @@ -996,18 +1170,18 @@ type ScalingHostPoolReference struct { // ScalingPlan - Represents a scaling plan definition. type ScalingPlan struct { + // REQUIRED; The geo-location where the resource lives + Location *string + // REQUIRED; Detailed properties for scaling plan. Properties *ScalingPlanProperties Identity *ResourceModelWithAllowedPropertySetIdentity - // Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are + // Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type. E.g. ApiApps are // a kind of Microsoft.Web/sites type. If supported, the resource provider must // validate and persist this value. Kind *string - // The geo-location where the resource lives - Location *string - // The fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed by another // Azure resource. If this is present, complete mode deployment will not // delete the resource if it is removed from the template since it is managed by another resource. @@ -1024,13 +1198,13 @@ type ScalingPlan struct { // (section 14.26), and If-Range (section 14.27) header fields. Etag *string - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" @@ -1081,13 +1255,13 @@ type ScalingPlanPersonalSchedule struct { // REQUIRED; Detailed properties for ScalingPlanPersonalSchedule Properties *ScalingPlanPersonalScheduleProperties - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" @@ -1205,13 +1379,13 @@ type ScalingPlanPooledSchedule struct { // REQUIRED; Detailed properties for ScalingPlanPooledSchedule Properties *ScalingPlanPooledScheduleProperties - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" @@ -1232,12 +1406,15 @@ type ScalingPlanPooledSchedulePatch struct { // Detailed properties for ScalingPlanPooledSchedule Properties *ScalingPlanPooledScheduleProperties - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } @@ -1400,13 +1577,13 @@ type SessionHost struct { // Detailed properties for SessionHost Properties *SessionHostProperties - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" @@ -1451,12 +1628,15 @@ type SessionHostPatch struct { // Detailed properties for SessionHost Properties *SessionHostPatchProperties - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } @@ -1532,12 +1712,15 @@ type StartMenuItem struct { // Detailed properties for StartMenuItem Properties *StartMenuItemProperties - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } @@ -1604,13 +1787,13 @@ type UserSession struct { // Detailed properties for UserSession Properties *UserSessionProperties - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" @@ -1649,16 +1832,15 @@ type UserSessionProperties struct { // Workspace - Represents a Workspace definition. type Workspace struct { + // REQUIRED; The geo-location where the resource lives + Location *string Identity *ResourceModelWithAllowedPropertySetIdentity - // Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are + // Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type. E.g. ApiApps are // a kind of Microsoft.Web/sites type. If supported, the resource provider must // validate and persist this value. Kind *string - // The geo-location where the resource lives - Location *string - // The fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed by another // Azure resource. If this is present, complete mode deployment will not // delete the resource if it is removed from the template since it is managed by another resource. @@ -1678,13 +1860,13 @@ type Workspace struct { // (section 14.26), and If-Range (section 14.27) header fields. Etag *string - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/models_serde.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/models_serde.go index 5f5f4e9d977d..7f906279fac0 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/models_serde.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/models_serde.go @@ -94,6 +94,300 @@ func (a *AgentUpdateProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type AppAttachPackage. +func (a AppAttachPackage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", a.ID) + populate(objectMap, "location", a.Location) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "systemData", a.SystemData) + populate(objectMap, "tags", a.Tags) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AppAttachPackage. +func (a *AppAttachPackage) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &a.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &a.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &a.Tags) + delete(rawMsg, key) + 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 AppAttachPackageInfoProperties. +func (a AppAttachPackageInfoProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateDateTimeRFC3339(objectMap, "certificateExpiry", a.CertificateExpiry) + populate(objectMap, "certificateName", a.CertificateName) + populate(objectMap, "displayName", a.DisplayName) + populate(objectMap, "imagePath", a.ImagePath) + populate(objectMap, "isActive", a.IsActive) + populate(objectMap, "isPackageTimestamped", a.IsPackageTimestamped) + populate(objectMap, "isRegularRegistration", a.IsRegularRegistration) + populateDateTimeRFC3339(objectMap, "lastUpdated", a.LastUpdated) + populate(objectMap, "packageAlias", a.PackageAlias) + populate(objectMap, "packageApplications", a.PackageApplications) + populate(objectMap, "packageDependencies", a.PackageDependencies) + populate(objectMap, "packageFamilyName", a.PackageFamilyName) + populate(objectMap, "packageFullName", a.PackageFullName) + populate(objectMap, "packageName", a.PackageName) + populate(objectMap, "packageRelativePath", a.PackageRelativePath) + populate(objectMap, "version", a.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AppAttachPackageInfoProperties. +func (a *AppAttachPackageInfoProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "certificateExpiry": + err = unpopulateDateTimeRFC3339(val, "CertificateExpiry", &a.CertificateExpiry) + delete(rawMsg, key) + case "certificateName": + err = unpopulate(val, "CertificateName", &a.CertificateName) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &a.DisplayName) + delete(rawMsg, key) + case "imagePath": + err = unpopulate(val, "ImagePath", &a.ImagePath) + delete(rawMsg, key) + case "isActive": + err = unpopulate(val, "IsActive", &a.IsActive) + delete(rawMsg, key) + case "isPackageTimestamped": + err = unpopulate(val, "IsPackageTimestamped", &a.IsPackageTimestamped) + delete(rawMsg, key) + case "isRegularRegistration": + err = unpopulate(val, "IsRegularRegistration", &a.IsRegularRegistration) + delete(rawMsg, key) + case "lastUpdated": + err = unpopulateDateTimeRFC3339(val, "LastUpdated", &a.LastUpdated) + delete(rawMsg, key) + case "packageAlias": + err = unpopulate(val, "PackageAlias", &a.PackageAlias) + delete(rawMsg, key) + case "packageApplications": + err = unpopulate(val, "PackageApplications", &a.PackageApplications) + delete(rawMsg, key) + case "packageDependencies": + err = unpopulate(val, "PackageDependencies", &a.PackageDependencies) + delete(rawMsg, key) + case "packageFamilyName": + err = unpopulate(val, "PackageFamilyName", &a.PackageFamilyName) + delete(rawMsg, key) + case "packageFullName": + err = unpopulate(val, "PackageFullName", &a.PackageFullName) + delete(rawMsg, key) + case "packageName": + err = unpopulate(val, "PackageName", &a.PackageName) + delete(rawMsg, key) + case "packageRelativePath": + err = unpopulate(val, "PackageRelativePath", &a.PackageRelativePath) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &a.Version) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AppAttachPackageList. +func (a AppAttachPackageList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AppAttachPackageList. +func (a *AppAttachPackageList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + 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 AppAttachPackagePatch. +func (a AppAttachPackagePatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", a.ID) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "systemData", a.SystemData) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AppAttachPackagePatch. +func (a *AppAttachPackagePatch) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + 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 AppAttachPackagePatchProperties. +func (a AppAttachPackagePatchProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "failHealthCheckOnStagingFailure", a.FailHealthCheckOnStagingFailure) + populate(objectMap, "hostPoolReferences", a.HostPoolReferences) + populate(objectMap, "image", a.Image) + populate(objectMap, "keyVaultURL", a.KeyVaultURL) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AppAttachPackagePatchProperties. +func (a *AppAttachPackagePatchProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "failHealthCheckOnStagingFailure": + err = unpopulate(val, "FailHealthCheckOnStagingFailure", &a.FailHealthCheckOnStagingFailure) + delete(rawMsg, key) + case "hostPoolReferences": + err = unpopulate(val, "HostPoolReferences", &a.HostPoolReferences) + delete(rawMsg, key) + case "image": + err = unpopulate(val, "Image", &a.Image) + delete(rawMsg, key) + case "keyVaultURL": + err = unpopulate(val, "KeyVaultURL", &a.KeyVaultURL) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AppAttachPackageProperties. +func (a AppAttachPackageProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "failHealthCheckOnStagingFailure", a.FailHealthCheckOnStagingFailure) + populate(objectMap, "hostPoolReferences", a.HostPoolReferences) + populate(objectMap, "image", a.Image) + populate(objectMap, "keyVaultURL", a.KeyVaultURL) + populate(objectMap, "provisioningState", a.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AppAttachPackageProperties. +func (a *AppAttachPackageProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "failHealthCheckOnStagingFailure": + err = unpopulate(val, "FailHealthCheckOnStagingFailure", &a.FailHealthCheckOnStagingFailure) + delete(rawMsg, key) + case "hostPoolReferences": + err = unpopulate(val, "HostPoolReferences", &a.HostPoolReferences) + delete(rawMsg, key) + case "image": + err = unpopulate(val, "Image", &a.Image) + delete(rawMsg, key) + case "keyVaultURL": + err = unpopulate(val, "KeyVaultURL", &a.KeyVaultURL) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + 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]any) @@ -249,6 +543,7 @@ func (a ApplicationGroupPatch) MarshalJSON() ([]byte, error) { populate(objectMap, "id", a.ID) populate(objectMap, "name", a.Name) populate(objectMap, "properties", a.Properties) + populate(objectMap, "systemData", a.SystemData) populate(objectMap, "tags", a.Tags) populate(objectMap, "type", a.Type) return json.Marshal(objectMap) @@ -272,6 +567,9 @@ func (a *ApplicationGroupPatch) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &a.Properties) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &a.SystemData) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &a.Tags) delete(rawMsg, key) @@ -514,7 +812,9 @@ func (a ApplicationProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "description", a.Description) populate(objectMap, "filePath", a.FilePath) populate(objectMap, "friendlyName", a.FriendlyName) - populateByteArray(objectMap, "iconContent", a.IconContent, runtime.Base64StdFormat) + populateByteArray(objectMap, "iconContent", a.IconContent, func() any { + return runtime.EncodeByteArray(a.IconContent, runtime.Base64StdFormat) + }) populate(objectMap, "iconHash", a.IconHash) populate(objectMap, "iconIndex", a.IconIndex) populate(objectMap, "iconPath", a.IconPath) @@ -553,7 +853,9 @@ func (a *ApplicationProperties) UnmarshalJSON(data []byte) error { err = unpopulate(val, "FriendlyName", &a.FriendlyName) delete(rawMsg, key) case "iconContent": - err = runtime.DecodeByteArray(string(val), &a.IconContent, runtime.Base64StdFormat) + if val != nil && string(val) != "null" { + err = runtime.DecodeByteArray(string(val), &a.IconContent, runtime.Base64StdFormat) + } delete(rawMsg, key) case "iconHash": err = unpopulate(val, "IconHash", &a.IconHash) @@ -725,7 +1027,9 @@ func (d DesktopProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "description", d.Description) populate(objectMap, "friendlyName", d.FriendlyName) - populateByteArray(objectMap, "iconContent", d.IconContent, runtime.Base64StdFormat) + populateByteArray(objectMap, "iconContent", d.IconContent, func() any { + return runtime.EncodeByteArray(d.IconContent, runtime.Base64StdFormat) + }) populate(objectMap, "iconHash", d.IconHash) populate(objectMap, "objectId", d.ObjectID) return json.Marshal(objectMap) @@ -747,7 +1051,9 @@ func (d *DesktopProperties) UnmarshalJSON(data []byte) error { err = unpopulate(val, "FriendlyName", &d.FriendlyName) delete(rawMsg, key) case "iconContent": - err = runtime.DecodeByteArray(string(val), &d.IconContent, runtime.Base64StdFormat) + if val != nil && string(val) != "null" { + err = runtime.DecodeByteArray(string(val), &d.IconContent, runtime.Base64StdFormat) + } delete(rawMsg, key) case "iconHash": err = unpopulate(val, "IconHash", &d.IconHash) @@ -769,6 +1075,7 @@ func (e ExpandMsixImage) MarshalJSON() ([]byte, error) { populate(objectMap, "id", e.ID) populate(objectMap, "name", e.Name) populate(objectMap, "properties", e.Properties) + populate(objectMap, "systemData", e.SystemData) populate(objectMap, "type", e.Type) return json.Marshal(objectMap) } @@ -791,6 +1098,9 @@ func (e *ExpandMsixImage) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &e.Properties) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &e.SystemData) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &e.Type) delete(rawMsg, key) @@ -836,6 +1146,8 @@ func (e *ExpandMsixImageList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ExpandMsixImageProperties. func (e ExpandMsixImageProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populateDateTimeRFC3339(objectMap, "certificateExpiry", e.CertificateExpiry) + populate(objectMap, "certificateName", e.CertificateName) populate(objectMap, "displayName", e.DisplayName) populate(objectMap, "imagePath", e.ImagePath) populate(objectMap, "isActive", e.IsActive) @@ -861,6 +1173,12 @@ func (e *ExpandMsixImageProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "certificateExpiry": + err = unpopulateDateTimeRFC3339(val, "CertificateExpiry", &e.CertificateExpiry) + delete(rawMsg, key) + case "certificateName": + err = unpopulate(val, "CertificateName", &e.CertificateName) + delete(rawMsg, key) case "displayName": err = unpopulate(val, "DisplayName", &e.DisplayName) delete(rawMsg, key) @@ -1020,6 +1338,7 @@ func (h HostPoolPatch) MarshalJSON() ([]byte, error) { populate(objectMap, "id", h.ID) populate(objectMap, "name", h.Name) populate(objectMap, "properties", h.Properties) + populate(objectMap, "systemData", h.SystemData) populate(objectMap, "tags", h.Tags) populate(objectMap, "type", h.Type) return json.Marshal(objectMap) @@ -1043,6 +1362,9 @@ func (h *HostPoolPatch) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &h.Properties) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &h.SystemData) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &h.Tags) delete(rawMsg, key) @@ -1156,6 +1478,7 @@ func (h *HostPoolPatchProperties) UnmarshalJSON(data []byte) error { func (h HostPoolProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "agentUpdate", h.AgentUpdate) + populate(objectMap, "appAttachPackageReferences", h.AppAttachPackageReferences) populate(objectMap, "applicationGroupReferences", h.ApplicationGroupReferences) populate(objectMap, "cloudPcResource", h.CloudPcResource) populate(objectMap, "customRdpProperty", h.CustomRdpProperty) @@ -1193,6 +1516,9 @@ func (h *HostPoolProperties) UnmarshalJSON(data []byte) error { case "agentUpdate": err = unpopulate(val, "AgentUpdate", &h.AgentUpdate) delete(rawMsg, key) + case "appAttachPackageReferences": + err = unpopulate(val, "AppAttachPackageReferences", &h.AppAttachPackageReferences) + delete(rawMsg, key) case "applicationGroupReferences": err = unpopulate(val, "ApplicationGroupReferences", &h.ApplicationGroupReferences) delete(rawMsg, key) @@ -1267,6 +1593,37 @@ func (h *HostPoolProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ImportPackageInfoRequest. +func (i ImportPackageInfoRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "packageArchitecture", i.PackageArchitecture) + populate(objectMap, "path", i.Path) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ImportPackageInfoRequest. +func (i *ImportPackageInfoRequest) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "packageArchitecture": + err = unpopulate(val, "PackageArchitecture", &i.PackageArchitecture) + delete(rawMsg, key) + case "path": + err = unpopulate(val, "Path", &i.Path) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type LogSpecification. func (l LogSpecification) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -1409,6 +1766,7 @@ func (m MSIXPackagePatch) MarshalJSON() ([]byte, error) { 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) } @@ -1431,6 +1789,9 @@ func (m *MSIXPackagePatch) UnmarshalJSON(data []byte) error { 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) @@ -1614,8 +1975,12 @@ func (m MsixPackageApplications) MarshalJSON() ([]byte, error) { 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) + populateByteArray(objectMap, "rawIcon", m.RawIcon, func() any { + return runtime.EncodeByteArray(m.RawIcon, runtime.Base64StdFormat) + }) + populateByteArray(objectMap, "rawPng", m.RawPNG, func() any { + return runtime.EncodeByteArray(m.RawPNG, runtime.Base64StdFormat) + }) return json.Marshal(objectMap) } @@ -1644,10 +2009,14 @@ func (m *MsixPackageApplications) UnmarshalJSON(data []byte) error { err = unpopulate(val, "IconImageName", &m.IconImageName) delete(rawMsg, key) case "rawIcon": - err = runtime.DecodeByteArray(string(val), &m.RawIcon, runtime.Base64StdFormat) + if val != nil && string(val) != "null" { + err = runtime.DecodeByteArray(string(val), &m.RawIcon, runtime.Base64StdFormat) + } delete(rawMsg, key) case "rawPng": - err = runtime.DecodeByteArray(string(val), &m.RawPNG, runtime.Base64StdFormat) + if val != nil && string(val) != "null" { + err = runtime.DecodeByteArray(string(val), &m.RawPNG, runtime.Base64StdFormat) + } delete(rawMsg, key) } if err != nil { @@ -1752,6 +2121,7 @@ func (p PrivateEndpointConnection) MarshalJSON() ([]byte, error) { populate(objectMap, "id", p.ID) populate(objectMap, "name", p.Name) populate(objectMap, "properties", p.Properties) + populate(objectMap, "systemData", p.SystemData) populate(objectMap, "type", p.Type) return json.Marshal(objectMap) } @@ -1774,6 +2144,9 @@ func (p *PrivateEndpointConnection) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &p.Properties) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &p.Type) delete(rawMsg, key) @@ -1819,6 +2192,7 @@ func (p *PrivateEndpointConnectionListResultWithSystemData) UnmarshalJSON(data [ // MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionProperties. func (p PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "groupIds", p.GroupIDs) populate(objectMap, "privateEndpoint", p.PrivateEndpoint) populate(objectMap, "privateLinkServiceConnectionState", p.PrivateLinkServiceConnectionState) populate(objectMap, "provisioningState", p.ProvisioningState) @@ -1834,6 +2208,9 @@ func (p *PrivateEndpointConnectionProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "groupIds": + err = unpopulate(val, "GroupIDs", &p.GroupIDs) + delete(rawMsg, key) case "privateEndpoint": err = unpopulate(val, "PrivateEndpoint", &p.PrivateEndpoint) delete(rawMsg, key) @@ -1900,6 +2277,7 @@ func (p PrivateLinkResource) MarshalJSON() ([]byte, error) { populate(objectMap, "id", p.ID) populate(objectMap, "name", p.Name) populate(objectMap, "properties", p.Properties) + populate(objectMap, "systemData", p.SystemData) populate(objectMap, "type", p.Type) return json.Marshal(objectMap) } @@ -1922,6 +2300,9 @@ func (p *PrivateLinkResource) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &p.Properties) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &p.Type) delete(rawMsg, key) @@ -2853,6 +3234,7 @@ func (s ScalingPlanPooledSchedulePatch) MarshalJSON() ([]byte, error) { populate(objectMap, "id", s.ID) populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) + populate(objectMap, "systemData", s.SystemData) populate(objectMap, "type", s.Type) return json.Marshal(objectMap) } @@ -2875,6 +3257,9 @@ func (s *ScalingPlanPooledSchedulePatch) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &s.Properties) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &s.Type) delete(rawMsg, key) @@ -3335,6 +3720,7 @@ func (s SessionHostPatch) MarshalJSON() ([]byte, error) { populate(objectMap, "id", s.ID) populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) + populate(objectMap, "systemData", s.SystemData) populate(objectMap, "type", s.Type) return json.Marshal(objectMap) } @@ -3357,6 +3743,9 @@ func (s *SessionHostPatch) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &s.Properties) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &s.Type) delete(rawMsg, key) @@ -3500,6 +3889,7 @@ func (s StartMenuItem) MarshalJSON() ([]byte, error) { populate(objectMap, "id", s.ID) populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) + populate(objectMap, "systemData", s.SystemData) populate(objectMap, "type", s.Type) return json.Marshal(objectMap) } @@ -3522,6 +3912,9 @@ func (s *StartMenuItem) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &s.Properties) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &s.Type) delete(rawMsg, key) @@ -4043,18 +4436,18 @@ func populate(m map[string]any, k string, v any) { } } -func populateByteArray(m map[string]any, k string, b []byte, f runtime.Base64Encoding) { +func populateByteArray[T any](m map[string]any, k string, b []T, convert func() any) { if azcore.IsNullValue(b) { m[k] = nil } else if len(b) == 0 { return } else { - m[k] = runtime.EncodeByteArray(b, f) + m[k] = convert() } } func unpopulate(data json.RawMessage, fn string, v any) error { - if data == nil { + if data == nil || string(data) == "null" { return nil } if err := json.Unmarshal(data, v); err != nil { diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/msiximages_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/msiximages_client.go index ce27604b8214..4f2da2cdb18e 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/msiximages_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/msiximages_client.go @@ -28,7 +28,7 @@ type MsixImagesClient struct { } // NewMsixImagesClient creates a new instance of MsixImagesClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewMsixImagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*MsixImagesClient, error) { @@ -45,7 +45,7 @@ func NewMsixImagesClient(subscriptionID string, credential azcore.TokenCredentia // NewExpandPager - Expands and Lists MSIX packages in an Image, given the Image Path. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - hostPoolName - The name of the host pool within the specified resource group // - msixImageURI - Object containing URI to MSIX Image @@ -93,7 +93,7 @@ func (client *MsixImagesClient) expandCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, msixImageURI); err != nil { diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/msiximages_client_example_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/msiximages_client_example_test.go deleted file mode 100644 index 18b56f73c101..000000000000 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/msiximages_client_example_test.go +++ /dev/null @@ -1,127 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armdesktopvirtualization_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/MsixImage_Expand_Post.json -func ExampleMsixImagesClient_NewExpandPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewMsixImagesClient().NewExpandPager("resourceGroup1", "hostpool1", armdesktopvirtualization.MSIXImageURI{ - URI: to.Ptr("imagepath"), - }, nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ExpandMsixImageList = armdesktopvirtualization.ExpandMsixImageList{ - // Value: []*armdesktopvirtualization.ExpandMsixImage{ - // { - // Name: to.Ptr("hostpool1/expandmsiximage"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/hostpools/expandmsiximage"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourcegroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostpools/hostpool1/expandmsiximage"), - // Properties: &armdesktopvirtualization.ExpandMsixImageProperties{ - // DisplayName: to.Ptr("displayname"), - // ImagePath: to.Ptr("imagepath"), - // IsActive: to.Ptr(false), - // IsRegularRegistration: to.Ptr(false), - // LastUpdated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2008-09-22T14:01:54.957Z"); return t}()), - // PackageAlias: to.Ptr("msixpackagealias"), - // PackageApplications: []*armdesktopvirtualization.MsixPackageApplications{ - // { - // Description: to.Ptr("PackageApplicationDescription"), - // AppID: to.Ptr("AppId"), - // AppUserModelID: to.Ptr("AppUserModelId"), - // FriendlyName: to.Ptr("FriendlyName"), - // IconImageName: to.Ptr("Iconimagename"), - // RawIcon: []byte("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo"), - // RawPNG: []byte("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo"), - // }}, - // PackageDependencies: []*armdesktopvirtualization.MsixPackageDependencies{ - // }, - // PackageFamilyName: to.Ptr("MsixPackage_FamilyName"), - // PackageFullName: to.Ptr("MsixPackage_FullName"), - // PackageName: to.Ptr("MsixPackageName"), - // PackageRelativePath: to.Ptr("packagerelativepath"), - // Version: to.Ptr("packageversion"), - // }, - // }, - // { - // Name: to.Ptr("hostpool1/expandmsiximage"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/hostpools/expandmsiximage"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourcegroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostpools/hostpool1/expandmsiximage"), - // Properties: &armdesktopvirtualization.ExpandMsixImageProperties{ - // DisplayName: to.Ptr("displayname2"), - // ImagePath: to.Ptr("imagepath"), - // IsActive: to.Ptr(false), - // IsRegularRegistration: to.Ptr(false), - // LastUpdated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2008-09-22T14:01:54.957Z"); return t}()), - // PackageAlias: to.Ptr("msixpackagealias2"), - // PackageApplications: []*armdesktopvirtualization.MsixPackageApplications{ - // { - // Description: to.Ptr("PackageApplicationDescription1"), - // AppID: to.Ptr("AppId1"), - // AppUserModelID: to.Ptr("AppUserModelId1"), - // FriendlyName: to.Ptr("FriendlyName1"), - // IconImageName: to.Ptr("Iconimagename1"), - // RawIcon: []byte("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo"), - // RawPNG: []byte("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo"), - // }, - // { - // Description: to.Ptr("PackageApplicationDescription2"), - // AppID: to.Ptr("AppId2"), - // AppUserModelID: to.Ptr("AppUserModelId2"), - // FriendlyName: to.Ptr("FriendlyName2"), - // IconImageName: to.Ptr("Iconimagename2"), - // RawIcon: []byte("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo"), - // RawPNG: []byte("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo"), - // }}, - // PackageDependencies: []*armdesktopvirtualization.MsixPackageDependencies{ - // { - // DependencyName: to.Ptr("MsixPackageDependency1"), - // MinVersion: to.Ptr("ver1"), - // Publisher: to.Ptr("PublisherName1"), - // }, - // { - // DependencyName: to.Ptr("MsixPackageDependency2"), - // MinVersion: to.Ptr("ver2"), - // Publisher: to.Ptr("PublisherName2"), - // }}, - // PackageFamilyName: to.Ptr("MsixPackage_FamilyName2"), - // PackageFullName: to.Ptr("MsixPackage_FullName2"), - // PackageName: to.Ptr("MsixPackageName2"), - // PackageRelativePath: to.Ptr("packagerelativepath2"), - // Version: to.Ptr("packageversion"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/msixpackages_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/msixpackages_client.go index 07359fd6ce4a..42b618003f2c 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/msixpackages_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/msixpackages_client.go @@ -29,7 +29,7 @@ type MSIXPackagesClient struct { } // NewMSIXPackagesClient creates a new instance of MSIXPackagesClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewMSIXPackagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*MSIXPackagesClient, error) { @@ -47,7 +47,7 @@ func NewMSIXPackagesClient(subscriptionID string, credential azcore.TokenCredent // CreateOrUpdate - Create or update a MSIX package. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - hostPoolName - The name of the host pool within the specified resource group // - msixPackageFullName - The version specific package full name of the MSIX package within specified hostpool @@ -100,7 +100,7 @@ func (client *MSIXPackagesClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, msixPackage); err != nil { @@ -121,7 +121,7 @@ func (client *MSIXPackagesClient) createOrUpdateHandleResponse(resp *http.Respon // Delete - Remove an MSIX Package. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - hostPoolName - The name of the host pool within the specified resource group // - msixPackageFullName - The version specific package full name of the MSIX package within specified hostpool @@ -171,7 +171,7 @@ func (client *MSIXPackagesClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -180,7 +180,7 @@ func (client *MSIXPackagesClient) deleteCreateRequest(ctx context.Context, resou // Get - Get a msixpackage. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - hostPoolName - The name of the host pool within the specified resource group // - msixPackageFullName - The version specific package full name of the MSIX package within specified hostpool @@ -231,7 +231,7 @@ func (client *MSIXPackagesClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -248,7 +248,7 @@ func (client *MSIXPackagesClient) getHandleResponse(resp *http.Response) (MSIXPa // NewListPager - List MSIX packages in hostpool. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - hostPoolName - The name of the host pool within the specified resource group // - options - MSIXPackagesClientListOptions contains the optional parameters for the MSIXPackagesClient.NewListPager method. @@ -295,15 +295,15 @@ func (client *MSIXPackagesClient) listCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") - if options != nil && options.PageSize != nil { - reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) + reqQP.Set("api-version", "2024-04-03") + if options != nil && options.InitialSkip != nil { + reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) } if options != nil && options.IsDescending != nil { reqQP.Set("isDescending", strconv.FormatBool(*options.IsDescending)) } - if options != nil && options.InitialSkip != nil { - reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) + if options != nil && options.PageSize != nil { + reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} @@ -322,7 +322,7 @@ func (client *MSIXPackagesClient) listHandleResponse(resp *http.Response) (MSIXP // Update - Update an MSIX Package. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - hostPoolName - The name of the host pool within the specified resource group // - msixPackageFullName - The version specific package full name of the MSIX package within specified hostpool @@ -373,7 +373,7 @@ func (client *MSIXPackagesClient) updateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.MsixPackage != nil { diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/msixpackages_client_example_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/msixpackages_client_example_test.go deleted file mode 100644 index fc8827f5f346..000000000000 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/msixpackages_client_example_test.go +++ /dev/null @@ -1,364 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armdesktopvirtualization_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/MsixPackage_Get.json -func ExampleMSIXPackagesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMSIXPackagesClient().Get(ctx, "resourceGroup1", "hostpool1", "packagefullname", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MSIXPackage = armdesktopvirtualization.MSIXPackage{ - // Name: to.Ptr("hostpool1/MsixPackageFullName"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/hostpools/msixpackages"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourcegroups/resourcegroup1/providers/Microsoft.DesktopVirtualization/hostpools/hostpool1/msixpackages/msixPackageFullName"), - // Properties: &armdesktopvirtualization.MSIXPackageProperties{ - // DisplayName: to.Ptr("dis"), - // ImagePath: to.Ptr("imagepath"), - // IsActive: to.Ptr(false), - // IsRegularRegistration: to.Ptr(false), - // LastUpdated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2008-09-22T14:01:54.957Z"); return t}()), - // PackageApplications: []*armdesktopvirtualization.MsixPackageApplications{ - // { - // Description: to.Ptr("desc"), - // AppID: to.Ptr("Application_Id"), - // AppUserModelID: to.Ptr("Application_ModelID"), - // FriendlyName: to.Ptr("fri"), - // IconImageName: to.Ptr("Apptile"), - // RawIcon: []byte("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo"), - // RawPNG: []byte("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo"), - // }}, - // PackageDependencies: []*armdesktopvirtualization.MsixPackageDependencies{ - // { - // DependencyName: to.Ptr("MsixPackage_Dependency_Name"), - // MinVersion: to.Ptr("packageDep_version"), - // Publisher: to.Ptr("MsixPackage_Dependency_Publisher"), - // }}, - // PackageFamilyName: to.Ptr("MsixPackage_FamilyName"), - // PackageName: to.Ptr("MsixPackage_Name"), - // PackageRelativePath: to.Ptr("MsixPackage_RelativePackageRoot"), - // Version: to.Ptr("version"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/MsixPackage_Create.json -func ExampleMSIXPackagesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMSIXPackagesClient().CreateOrUpdate(ctx, "resourceGroup1", "hostpool1", "msixpackagefullname", armdesktopvirtualization.MSIXPackage{ - Properties: &armdesktopvirtualization.MSIXPackageProperties{ - DisplayName: to.Ptr("displayname"), - ImagePath: to.Ptr("imagepath"), - IsActive: to.Ptr(false), - IsRegularRegistration: to.Ptr(false), - LastUpdated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2008-09-22T14:01:54.957Z"); return t }()), - PackageApplications: []*armdesktopvirtualization.MsixPackageApplications{ - { - Description: to.Ptr("application-desc"), - AppID: to.Ptr("ApplicationId"), - AppUserModelID: to.Ptr("AppUserModelId"), - FriendlyName: to.Ptr("friendlyname"), - IconImageName: to.Ptr("Apptile"), - RawIcon: []byte("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo"), - RawPNG: []byte("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo"), - }}, - PackageDependencies: []*armdesktopvirtualization.MsixPackageDependencies{ - { - DependencyName: to.Ptr("MsixTest_Dependency_Name"), - MinVersion: to.Ptr("version"), - Publisher: to.Ptr("PublishedName"), - }}, - PackageFamilyName: to.Ptr("MsixPackage_FamilyName"), - PackageName: to.Ptr("MsixPackage_name"), - PackageRelativePath: to.Ptr("packagerelativepath"), - Version: to.Ptr("version"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MSIXPackage = armdesktopvirtualization.MSIXPackage{ - // Name: to.Ptr("hostpool1/MsixPackageFullName"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/hostpools/msixpackages"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourcegroups/resourcegroup1/providers/Microsoft.DesktopVirtualization/hostpools/hostpool1/msixpackages/msixPackageFullName"), - // Properties: &armdesktopvirtualization.MSIXPackageProperties{ - // DisplayName: to.Ptr("dis"), - // ImagePath: to.Ptr("imagepath"), - // IsActive: to.Ptr(false), - // IsRegularRegistration: to.Ptr(false), - // LastUpdated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2008-09-22T14:01:54.957Z"); return t}()), - // PackageApplications: []*armdesktopvirtualization.MsixPackageApplications{ - // { - // Description: to.Ptr("desc"), - // AppID: to.Ptr("Application_Id"), - // AppUserModelID: to.Ptr("Application_ModelID"), - // FriendlyName: to.Ptr("fri"), - // IconImageName: to.Ptr("Apptile"), - // RawIcon: []byte("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo"), - // RawPNG: []byte("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo"), - // }}, - // PackageDependencies: []*armdesktopvirtualization.MsixPackageDependencies{ - // { - // DependencyName: to.Ptr("MsixPackage_Dependency_Name"), - // MinVersion: to.Ptr("packageDep_version"), - // Publisher: to.Ptr("MsixPackage_Dependency_Publisher"), - // }}, - // PackageFamilyName: to.Ptr("MsixPackage_FamilyName"), - // PackageName: to.Ptr("MsixPackage_Name"), - // PackageRelativePath: to.Ptr("MsixPackage_RelativePackageRoot"), - // Version: to.Ptr("version"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/MsixPackage_Delete.json -func ExampleMSIXPackagesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewMSIXPackagesClient().Delete(ctx, "resourceGroup1", "hostpool1", "packagefullname", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/MsixPackage_Update.json -func ExampleMSIXPackagesClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMSIXPackagesClient().Update(ctx, "resourceGroup1", "hostpool1", "msixpackagefullname", &armdesktopvirtualization.MSIXPackagesClientUpdateOptions{MsixPackage: &armdesktopvirtualization.MSIXPackagePatch{ - Properties: &armdesktopvirtualization.MSIXPackagePatchProperties{ - DisplayName: to.Ptr("displayname"), - IsActive: to.Ptr(true), - IsRegularRegistration: to.Ptr(false), - }, - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MSIXPackage = armdesktopvirtualization.MSIXPackage{ - // Name: to.Ptr("hostpool1/MsixPackageFullName"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/hostpools/msixpackages"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourcegroups/resourcegroup1/providers/Microsoft.DesktopVirtualization/hostpools/hostpool1/msixpackages/msixPackageFullName"), - // Properties: &armdesktopvirtualization.MSIXPackageProperties{ - // DisplayName: to.Ptr("dis"), - // ImagePath: to.Ptr("imagepath"), - // IsActive: to.Ptr(true), - // IsRegularRegistration: to.Ptr(false), - // LastUpdated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2008-09-22T14:01:54.957Z"); return t}()), - // PackageApplications: []*armdesktopvirtualization.MsixPackageApplications{ - // { - // Description: to.Ptr("desc"), - // AppID: to.Ptr("Application_Id"), - // AppUserModelID: to.Ptr("Application_ModelID"), - // FriendlyName: to.Ptr("fri"), - // IconImageName: to.Ptr("Apptile"), - // RawIcon: []byte("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo"), - // RawPNG: []byte("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo"), - // }}, - // PackageDependencies: []*armdesktopvirtualization.MsixPackageDependencies{ - // { - // DependencyName: to.Ptr("MsixPackage_Dependency_Name"), - // MinVersion: to.Ptr("packageDep_version"), - // Publisher: to.Ptr("MsixPackage_Dependency_Publisher"), - // }}, - // PackageFamilyName: to.Ptr("MsixPackage_FamilyName"), - // PackageName: to.Ptr("MsixPackage_Name"), - // PackageRelativePath: to.Ptr("MsixPackage_RelativePackageRoot"), - // Version: to.Ptr("version"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/MsixPackage_List.json -func ExampleMSIXPackagesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewMSIXPackagesClient().NewListPager("resourceGroup1", "hostpool1", &armdesktopvirtualization.MSIXPackagesClientListOptions{PageSize: to.Ptr[int32](10), - IsDescending: to.Ptr(true), - InitialSkip: to.Ptr[int32](0), - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.MSIXPackageList = armdesktopvirtualization.MSIXPackageList{ - // Value: []*armdesktopvirtualization.MSIXPackage{ - // { - // Name: to.Ptr("hostpool1/MsixPackageFullName"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/hostpools/msixpackages"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourcegroups/resourcegroup1/providers/Microsoft.DesktopVirtualization/hostpools/hostpool1/msixpackages/msixPackageFullName"), - // Properties: &armdesktopvirtualization.MSIXPackageProperties{ - // DisplayName: to.Ptr("dis"), - // ImagePath: to.Ptr("imagepath"), - // IsActive: to.Ptr(false), - // IsRegularRegistration: to.Ptr(false), - // LastUpdated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2008-09-22T14:01:54.957Z"); return t}()), - // PackageApplications: []*armdesktopvirtualization.MsixPackageApplications{ - // { - // Description: to.Ptr("desc"), - // AppID: to.Ptr("Application_Id"), - // AppUserModelID: to.Ptr("Application_ModelID"), - // FriendlyName: to.Ptr("fri"), - // IconImageName: to.Ptr("Apptile"), - // RawIcon: []byte("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo"), - // RawPNG: []byte("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo"), - // }}, - // PackageDependencies: []*armdesktopvirtualization.MsixPackageDependencies{ - // { - // DependencyName: to.Ptr("MsixPackage_Dependency_Name"), - // MinVersion: to.Ptr("packageDep_version"), - // Publisher: to.Ptr("MsixPackage_Dependency_Publisher"), - // }}, - // PackageFamilyName: to.Ptr("MsixPackage_FamilyName"), - // PackageName: to.Ptr("MsixPackage_Name"), - // PackageRelativePath: to.Ptr("MsixPackage_RelativePackageRoot"), - // Version: to.Ptr("version"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }, - // { - // Name: to.Ptr("hostpool1/MsixPackageFullName2"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/hostpools/msixpackages"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourcegroups/resourcegroup1/providers/Microsoft.DesktopVirtualization/hostpools/hostpool1/msixpackages/msixPackageFullName2"), - // Properties: &armdesktopvirtualization.MSIXPackageProperties{ - // DisplayName: to.Ptr("dis2"), - // ImagePath: to.Ptr("imagepath2"), - // IsActive: to.Ptr(false), - // IsRegularRegistration: to.Ptr(false), - // LastUpdated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2008-09-22T14:01:54.957Z"); return t}()), - // PackageApplications: []*armdesktopvirtualization.MsixPackageApplications{ - // { - // Description: to.Ptr("desc2"), - // AppID: to.Ptr("Application_Id2"), - // AppUserModelID: to.Ptr("Application_ModelID2"), - // FriendlyName: to.Ptr("fri2"), - // IconImageName: to.Ptr("Apptile2"), - // RawIcon: []byte("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo"), - // RawPNG: []byte("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo"), - // }}, - // PackageDependencies: []*armdesktopvirtualization.MsixPackageDependencies{ - // { - // DependencyName: to.Ptr("MsixPackage_Dependency_Name2"), - // MinVersion: to.Ptr("packageDep_version2"), - // Publisher: to.Ptr("MsixPackage_Dependency_Publisher2"), - // }}, - // PackageFamilyName: to.Ptr("MsixPackage_FamilyName2"), - // PackageName: to.Ptr("MsixPackage_Name2"), - // PackageRelativePath: to.Ptr("MsixPackage_RelativePackageRoot2"), - // Version: to.Ptr("version2"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/operations_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/operations_client.go index 214e41560db5..fb32651e4b4a 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/operations_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/operations_client.go @@ -39,7 +39,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - List all of the available operations the Desktop Virtualization resource provider supports. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -72,7 +72,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/operations_client_example_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/operations_client_example_test.go deleted file mode 100644 index 89c6fb04ff49..000000000000 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/operations_client_example_test.go +++ /dev/null @@ -1,83 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armdesktopvirtualization_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/OperationDescription_List.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ResourceProviderOperationList = armdesktopvirtualization.ResourceProviderOperationList{ - // Value: []*armdesktopvirtualization.ResourceProviderOperation{ - // { - // Name: to.Ptr("Microsoft.DesktopVirtualization/hostpools/read"), - // Display: &armdesktopvirtualization.ResourceProviderOperationDisplay{ - // Description: to.Ptr("Read hostpool"), - // Operation: to.Ptr("Read hostpool"), - // Provider: to.Ptr("Microsoft.DesktopVirtualization"), - // Resource: to.Ptr("hostpools"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.DesktopVirtualization/hostpools/write"), - // Display: &armdesktopvirtualization.ResourceProviderOperationDisplay{ - // Description: to.Ptr("Write hostpool"), - // Operation: to.Ptr("Write hostpool"), - // Provider: to.Ptr("Microsoft.DesktopVirtualization"), - // Resource: to.Ptr("hostpools"), - // }, - // IsDataAction: to.Ptr(false), - // Properties: &armdesktopvirtualization.OperationProperties{ - // ServiceSpecification: &armdesktopvirtualization.ServiceSpecification{ - // LogSpecifications: []*armdesktopvirtualization.LogSpecification{ - // { - // Name: to.Ptr(""), - // DisplayName: to.Ptr(""), - // }, - // { - // Name: to.Ptr(""), - // DisplayName: to.Ptr(""), - // }, - // { - // Name: to.Ptr(""), - // DisplayName: to.Ptr(""), - // }}, - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/options.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/options.go index fcf371cb656f..cef5fbc9267d 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/options.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/options.go @@ -8,6 +8,48 @@ package armdesktopvirtualization +// AppAttachPackageClientCreateOrUpdateOptions contains the optional parameters for the AppAttachPackageClient.CreateOrUpdate +// method. +type AppAttachPackageClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// AppAttachPackageClientDeleteOptions contains the optional parameters for the AppAttachPackageClient.Delete method. +type AppAttachPackageClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// AppAttachPackageClientGetOptions contains the optional parameters for the AppAttachPackageClient.Get method. +type AppAttachPackageClientGetOptions struct { + // placeholder for future optional parameters +} + +// AppAttachPackageClientListByResourceGroupOptions contains the optional parameters for the AppAttachPackageClient.NewListByResourceGroupPager +// method. +type AppAttachPackageClientListByResourceGroupOptions struct { + // OData filter expression. Valid properties for filtering are package name and host pool. + Filter *string +} + +// AppAttachPackageClientListBySubscriptionOptions contains the optional parameters for the AppAttachPackageClient.NewListBySubscriptionPager +// method. +type AppAttachPackageClientListBySubscriptionOptions struct { + // OData filter expression. Valid properties for filtering are package name, host pool, and resource group. + Filter *string +} + +// AppAttachPackageClientUpdateOptions contains the optional parameters for the AppAttachPackageClient.Update method. +type AppAttachPackageClientUpdateOptions struct { + // Object containing App Attach Package definition. + AppAttachPackagePatch *AppAttachPackagePatch +} + +// AppAttachPackageInfoClientImportOptions contains the optional parameters for the AppAttachPackageInfoClient.NewImportPager +// method. +type AppAttachPackageInfoClientImportOptions struct { + // placeholder for future optional parameters +} + // ApplicationGroupsClientCreateOrUpdateOptions contains the optional parameters for the ApplicationGroupsClient.CreateOrUpdate // method. type ApplicationGroupsClientCreateOrUpdateOptions struct { diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/privateendpointconnections_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/privateendpointconnections_client.go index c66d0ebcf708..71e55c8e667c 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/privateendpointconnections_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/privateendpointconnections_client.go @@ -29,7 +29,7 @@ type PrivateEndpointConnectionsClient struct { } // NewPrivateEndpointConnectionsClient creates a new instance of PrivateEndpointConnectionsClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateEndpointConnectionsClient, error) { @@ -47,10 +47,10 @@ func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcor // DeleteByHostPool - Remove a connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - hostPoolName - The name of the host pool within the specified resource group -// - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource +// - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource. // - options - PrivateEndpointConnectionsClientDeleteByHostPoolOptions contains the optional parameters for the PrivateEndpointConnectionsClient.DeleteByHostPool // method. func (client *PrivateEndpointConnectionsClient) DeleteByHostPool(ctx context.Context, resourceGroupName string, hostPoolName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientDeleteByHostPoolOptions) (PrivateEndpointConnectionsClientDeleteByHostPoolResponse, error) { @@ -98,7 +98,7 @@ func (client *PrivateEndpointConnectionsClient) deleteByHostPoolCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -107,10 +107,10 @@ func (client *PrivateEndpointConnectionsClient) deleteByHostPoolCreateRequest(ct // DeleteByWorkspace - Remove a connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - The name of the workspace -// - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource +// - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource. // - options - PrivateEndpointConnectionsClientDeleteByWorkspaceOptions contains the optional parameters for the PrivateEndpointConnectionsClient.DeleteByWorkspace // method. func (client *PrivateEndpointConnectionsClient) DeleteByWorkspace(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientDeleteByWorkspaceOptions) (PrivateEndpointConnectionsClientDeleteByWorkspaceResponse, error) { @@ -158,7 +158,7 @@ func (client *PrivateEndpointConnectionsClient) deleteByWorkspaceCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -167,10 +167,10 @@ func (client *PrivateEndpointConnectionsClient) deleteByWorkspaceCreateRequest(c // GetByHostPool - Get a private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - hostPoolName - The name of the host pool within the specified resource group -// - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource +// - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource. // - options - PrivateEndpointConnectionsClientGetByHostPoolOptions contains the optional parameters for the PrivateEndpointConnectionsClient.GetByHostPool // method. func (client *PrivateEndpointConnectionsClient) GetByHostPool(ctx context.Context, resourceGroupName string, hostPoolName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientGetByHostPoolOptions) (PrivateEndpointConnectionsClientGetByHostPoolResponse, error) { @@ -219,7 +219,7 @@ func (client *PrivateEndpointConnectionsClient) getByHostPoolCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -237,10 +237,10 @@ func (client *PrivateEndpointConnectionsClient) getByHostPoolHandleResponse(resp // GetByWorkspace - Get a private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - The name of the workspace -// - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource +// - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource. // - options - PrivateEndpointConnectionsClientGetByWorkspaceOptions contains the optional parameters for the PrivateEndpointConnectionsClient.GetByWorkspace // method. func (client *PrivateEndpointConnectionsClient) GetByWorkspace(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientGetByWorkspaceOptions) (PrivateEndpointConnectionsClientGetByWorkspaceResponse, error) { @@ -289,7 +289,7 @@ func (client *PrivateEndpointConnectionsClient) getByWorkspaceCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -306,7 +306,7 @@ func (client *PrivateEndpointConnectionsClient) getByWorkspaceHandleResponse(res // NewListByHostPoolPager - List private endpoint connections associated with hostpool. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - hostPoolName - The name of the host pool within the specified resource group // - options - PrivateEndpointConnectionsClientListByHostPoolOptions contains the optional parameters for the PrivateEndpointConnectionsClient.NewListByHostPoolPager @@ -354,15 +354,15 @@ func (client *PrivateEndpointConnectionsClient) listByHostPoolCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") - if options != nil && options.PageSize != nil { - reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) + reqQP.Set("api-version", "2024-04-03") + if options != nil && options.InitialSkip != nil { + reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) } if options != nil && options.IsDescending != nil { reqQP.Set("isDescending", strconv.FormatBool(*options.IsDescending)) } - if options != nil && options.InitialSkip != nil { - reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) + if options != nil && options.PageSize != nil { + reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} @@ -380,7 +380,7 @@ func (client *PrivateEndpointConnectionsClient) listByHostPoolHandleResponse(res // NewListByWorkspacePager - List private endpoint connections. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - The name of the workspace // - options - PrivateEndpointConnectionsClientListByWorkspaceOptions contains the optional parameters for the PrivateEndpointConnectionsClient.NewListByWorkspacePager @@ -428,7 +428,7 @@ func (client *PrivateEndpointConnectionsClient) listByWorkspaceCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -446,10 +446,10 @@ func (client *PrivateEndpointConnectionsClient) listByWorkspaceHandleResponse(re // UpdateByHostPool - Approve or reject a private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - hostPoolName - The name of the host pool within the specified resource group -// - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource +// - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource. // - connection - Object containing the updated connection. // - options - PrivateEndpointConnectionsClientUpdateByHostPoolOptions contains the optional parameters for the PrivateEndpointConnectionsClient.UpdateByHostPool // method. @@ -499,7 +499,7 @@ func (client *PrivateEndpointConnectionsClient) updateByHostPoolCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, connection); err != nil { @@ -520,10 +520,10 @@ func (client *PrivateEndpointConnectionsClient) updateByHostPoolHandleResponse(r // UpdateByWorkspace - Approve or reject a private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - The name of the workspace -// - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource +// - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource. // - connection - Object containing the updated connection. // - options - PrivateEndpointConnectionsClientUpdateByWorkspaceOptions contains the optional parameters for the PrivateEndpointConnectionsClient.UpdateByWorkspace // method. @@ -573,7 +573,7 @@ func (client *PrivateEndpointConnectionsClient) updateByWorkspaceCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, connection); err != nil { diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/privateendpointconnections_client_example_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/privateendpointconnections_client_example_test.go deleted file mode 100644 index 1515c2563bd6..000000000000 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/privateendpointconnections_client_example_test.go +++ /dev/null @@ -1,352 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armdesktopvirtualization_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/PrivateEndpointConnection_ListByWorkspace.json -func ExamplePrivateEndpointConnectionsClient_NewListByWorkspacePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrivateEndpointConnectionsClient().NewListByWorkspacePager("resourceGroup1", "workspace1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PrivateEndpointConnectionListResultWithSystemData = armdesktopvirtualization.PrivateEndpointConnectionListResultWithSystemData{ - // Value: []*armdesktopvirtualization.PrivateEndpointConnectionWithSystemData{ - // { - // Name: to.Ptr("workspace1.377103f1-5179-4bdf-8556-4cdd3207cc5b"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/workspaces/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/workspaces/workspace1/privateEndpointConnections/workspace1.377103f1-5179-4bdf-8556-4cdd3207cc5b"), - // Properties: &armdesktopvirtualization.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armdesktopvirtualization.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup2/providers/Microsoft.Network/privateEndpoints/endpointName1"), - // }, - // PrivateLinkServiceConnectionState: &armdesktopvirtualization.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Auto-Approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armdesktopvirtualization.PrivateEndpointServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armdesktopvirtualization.PrivateEndpointConnectionProvisioningStateSucceeded), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/PrivateEndpointConnection_GetByWorkspace.json -func ExamplePrivateEndpointConnectionsClient_GetByWorkspace() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateEndpointConnectionsClient().GetByWorkspace(ctx, "resourceGroup1", "workspace1", "workspace1.377103f1-5179-4bdf-8556-4cdd3207cc5b", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateEndpointConnectionWithSystemData = armdesktopvirtualization.PrivateEndpointConnectionWithSystemData{ - // Name: to.Ptr("workspace1.377103f1-5179-4bdf-8556-4cdd3207cc5b"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/workspaces/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/workspaces/workspace1/privateEndpointConnections/workspace1.377103f1-5179-4bdf-8556-4cdd3207cc5b"), - // Properties: &armdesktopvirtualization.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armdesktopvirtualization.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup2/providers/Microsoft.Network/privateEndpoints/endpointName1"), - // }, - // PrivateLinkServiceConnectionState: &armdesktopvirtualization.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Auto-Approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armdesktopvirtualization.PrivateEndpointServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armdesktopvirtualization.PrivateEndpointConnectionProvisioningStateSucceeded), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/PrivateEndpointConnection_DeleteByWorkspace.json -func ExamplePrivateEndpointConnectionsClient_DeleteByWorkspace() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewPrivateEndpointConnectionsClient().DeleteByWorkspace(ctx, "resourceGroup1", "workspace1", "workspace1.377103f1-5179-4bdf-8556-4cdd3207cc5b", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/PrivateEndpointConnection_UpdateByWorkspace.json -func ExamplePrivateEndpointConnectionsClient_UpdateByWorkspace() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateEndpointConnectionsClient().UpdateByWorkspace(ctx, "resourceGroup1", "workspace1", "workspace1.377103f1-5179-4bdf-8556-4cdd3207cc5b", armdesktopvirtualization.PrivateEndpointConnection{ - Properties: &armdesktopvirtualization.PrivateEndpointConnectionProperties{ - PrivateLinkServiceConnectionState: &armdesktopvirtualization.PrivateLinkServiceConnectionState{ - Description: to.Ptr("Approved by admin@consoto.com"), - ActionsRequired: to.Ptr("None"), - Status: to.Ptr(armdesktopvirtualization.PrivateEndpointServiceConnectionStatusApproved), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateEndpointConnectionWithSystemData = armdesktopvirtualization.PrivateEndpointConnectionWithSystemData{ - // Name: to.Ptr("workspace1.377103f1-5179-4bdf-8556-4cdd3207cc5b"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/workspaces/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/workspaces/workspace1/privateEndpointConnections/workspace1.377103f1-5179-4bdf-8556-4cdd3207cc5b"), - // Properties: &armdesktopvirtualization.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armdesktopvirtualization.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup2/providers/Microsoft.Network/privateEndpoints/endpointName1"), - // }, - // PrivateLinkServiceConnectionState: &armdesktopvirtualization.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Approved by admin@consoto.com"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armdesktopvirtualization.PrivateEndpointServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armdesktopvirtualization.PrivateEndpointConnectionProvisioningStateSucceeded), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/PrivateEndpointConnection_ListByHostPool.json -func ExamplePrivateEndpointConnectionsClient_NewListByHostPoolPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrivateEndpointConnectionsClient().NewListByHostPoolPager("resourceGroup1", "hostPool1", &armdesktopvirtualization.PrivateEndpointConnectionsClientListByHostPoolOptions{PageSize: nil, - IsDescending: nil, - InitialSkip: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PrivateEndpointConnectionListResultWithSystemData = armdesktopvirtualization.PrivateEndpointConnectionListResultWithSystemData{ - // Value: []*armdesktopvirtualization.PrivateEndpointConnectionWithSystemData{ - // { - // Name: to.Ptr("hostPool1.377103f1-5179-4bdf-8556-4cdd3207cc5b"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/hostpools/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostpools/hostPool1/privateEndpointConnections/hostPool1.377103f1-5179-4bdf-8556-4cdd3207cc5b"), - // Properties: &armdesktopvirtualization.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armdesktopvirtualization.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup2/providers/Microsoft.Network/privateEndpoints/endpointName1"), - // }, - // PrivateLinkServiceConnectionState: &armdesktopvirtualization.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Auto-Approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armdesktopvirtualization.PrivateEndpointServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armdesktopvirtualization.PrivateEndpointConnectionProvisioningStateSucceeded), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/PrivateEndpointConnection_GetByHostPool.json -func ExamplePrivateEndpointConnectionsClient_GetByHostPool() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateEndpointConnectionsClient().GetByHostPool(ctx, "resourceGroup1", "hostPool1", "hostPool1.377103f1-5179-4bdf-8556-4cdd3207cc5b", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateEndpointConnectionWithSystemData = armdesktopvirtualization.PrivateEndpointConnectionWithSystemData{ - // Name: to.Ptr("hostPool1.377103f1-5179-4bdf-8556-4cdd3207cc5b"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/hostpools/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostpools/hostPool1/privateEndpointConnections/hostPool1.377103f1-5179-4bdf-8556-4cdd3207cc5b"), - // Properties: &armdesktopvirtualization.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armdesktopvirtualization.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup2/providers/Microsoft.Network/privateEndpoints/endpointName1"), - // }, - // PrivateLinkServiceConnectionState: &armdesktopvirtualization.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Auto-Approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armdesktopvirtualization.PrivateEndpointServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armdesktopvirtualization.PrivateEndpointConnectionProvisioningStateSucceeded), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/PrivateEndpointConnection_DeleteByHostPool.json -func ExamplePrivateEndpointConnectionsClient_DeleteByHostPool() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewPrivateEndpointConnectionsClient().DeleteByHostPool(ctx, "resourceGroup1", "hostPool1", "hostPool1.377103f1-5179-4bdf-8556-4cdd3207cc5b", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/PrivateEndpointConnection_UpdateByHostPool.json -func ExamplePrivateEndpointConnectionsClient_UpdateByHostPool() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateEndpointConnectionsClient().UpdateByHostPool(ctx, "resourceGroup1", "hostPool1", "hostPool1.377103f1-5179-4bdf-8556-4cdd3207cc5b", armdesktopvirtualization.PrivateEndpointConnection{ - Properties: &armdesktopvirtualization.PrivateEndpointConnectionProperties{ - PrivateLinkServiceConnectionState: &armdesktopvirtualization.PrivateLinkServiceConnectionState{ - Description: to.Ptr("Approved by admin@consoto.com"), - ActionsRequired: to.Ptr("None"), - Status: to.Ptr(armdesktopvirtualization.PrivateEndpointServiceConnectionStatusApproved), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateEndpointConnectionWithSystemData = armdesktopvirtualization.PrivateEndpointConnectionWithSystemData{ - // Name: to.Ptr("hostPool1.377103f1-5179-4bdf-8556-4cdd3207cc5b"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/hostpools/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostpools/hostPool1/privateEndpointConnections/hostPool1.377103f1-5179-4bdf-8556-4cdd3207cc5b"), - // Properties: &armdesktopvirtualization.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armdesktopvirtualization.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup2/providers/Microsoft.Network/privateEndpoints/endpointName1"), - // }, - // PrivateLinkServiceConnectionState: &armdesktopvirtualization.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Approved by admin@consoto.com"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armdesktopvirtualization.PrivateEndpointServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armdesktopvirtualization.PrivateEndpointConnectionProvisioningStateSucceeded), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // } -} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/privatelinkresources_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/privatelinkresources_client.go index fde5e1452281..b91d03f6b883 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/privatelinkresources_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/privatelinkresources_client.go @@ -29,7 +29,7 @@ type PrivateLinkResourcesClient struct { } // NewPrivateLinkResourcesClient creates a new instance of PrivateLinkResourcesClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateLinkResourcesClient, error) { @@ -46,7 +46,7 @@ func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.Toke // NewListByHostPoolPager - List the private link resources available for this hostpool. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - hostPoolName - The name of the host pool within the specified resource group // - options - PrivateLinkResourcesClientListByHostPoolOptions contains the optional parameters for the PrivateLinkResourcesClient.NewListByHostPoolPager @@ -94,15 +94,15 @@ func (client *PrivateLinkResourcesClient) listByHostPoolCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") - if options != nil && options.PageSize != nil { - reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) + reqQP.Set("api-version", "2024-04-03") + if options != nil && options.InitialSkip != nil { + reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) } if options != nil && options.IsDescending != nil { reqQP.Set("isDescending", strconv.FormatBool(*options.IsDescending)) } - if options != nil && options.InitialSkip != nil { - reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) + if options != nil && options.PageSize != nil { + reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} @@ -120,7 +120,7 @@ func (client *PrivateLinkResourcesClient) listByHostPoolHandleResponse(resp *htt // NewListByWorkspacePager - List the private link resources available for this workspace. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - The name of the workspace // - options - PrivateLinkResourcesClientListByWorkspaceOptions contains the optional parameters for the PrivateLinkResourcesClient.NewListByWorkspacePager @@ -168,15 +168,15 @@ func (client *PrivateLinkResourcesClient) listByWorkspaceCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") - if options != nil && options.PageSize != nil { - reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) + reqQP.Set("api-version", "2024-04-03") + if options != nil && options.InitialSkip != nil { + reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) } if options != nil && options.IsDescending != nil { reqQP.Set("isDescending", strconv.FormatBool(*options.IsDescending)) } - if options != nil && options.InitialSkip != nil { - reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) + if options != nil && options.PageSize != nil { + reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/privatelinkresources_client_example_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/privatelinkresources_client_example_test.go deleted file mode 100644 index bda58a08b98a..000000000000 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/privatelinkresources_client_example_test.go +++ /dev/null @@ -1,110 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armdesktopvirtualization_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/PrivateLinkResources_ListByWorkspace.json -func ExamplePrivateLinkResourcesClient_NewListByWorkspacePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrivateLinkResourcesClient().NewListByWorkspacePager("resourceGroup1", "workspace1", &armdesktopvirtualization.PrivateLinkResourcesClientListByWorkspaceOptions{PageSize: nil, - IsDescending: nil, - InitialSkip: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PrivateLinkResourceListResult = armdesktopvirtualization.PrivateLinkResourceListResult{ - // Value: []*armdesktopvirtualization.PrivateLinkResource{ - // { - // Name: to.Ptr("workspace"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/workspaces/privateLinkResources"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/workspaces/workspace1/privateLinkResources/workspace"), - // Properties: &armdesktopvirtualization.PrivateLinkResourceProperties{ - // GroupID: to.Ptr("workspace"), - // RequiredMembers: []*string{ - // to.Ptr("rdbroker"), - // to.Ptr("rddiagnostics"), - // to.Ptr("rdweb"), - // to.Ptr("rdgateway")}, - // RequiredZoneNames: []*string{ - // to.Ptr("privatelink.wvd.microsoft.com")}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/PrivateLinkResources_ListByHostPool.json -func ExamplePrivateLinkResourcesClient_NewListByHostPoolPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrivateLinkResourcesClient().NewListByHostPoolPager("resourceGroup1", "hostPool1", &armdesktopvirtualization.PrivateLinkResourcesClientListByHostPoolOptions{PageSize: nil, - IsDescending: nil, - InitialSkip: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PrivateLinkResourceListResult = armdesktopvirtualization.PrivateLinkResourceListResult{ - // Value: []*armdesktopvirtualization.PrivateLinkResource{ - // { - // Name: to.Ptr("hostpool"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/hostpools/privateLinkResources"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostpools/hostPool1/privateLinkResources/hostpool"), - // Properties: &armdesktopvirtualization.PrivateLinkResourceProperties{ - // GroupID: to.Ptr("hostpool"), - // RequiredMembers: []*string{ - // to.Ptr("rdbroker"), - // to.Ptr("rddiagnostics"), - // to.Ptr("rdweb"), - // to.Ptr("rdgateway")}, - // RequiredZoneNames: []*string{ - // to.Ptr("privatelink.wvd.microsoft.com")}, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/response_types.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/responses.go similarity index 91% rename from sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/response_types.go rename to sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/responses.go index b02da3f1a5ba..3ba69a04ba4d 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/response_types.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/responses.go @@ -8,6 +8,47 @@ package armdesktopvirtualization +// AppAttachPackageClientCreateOrUpdateResponse contains the response from method AppAttachPackageClient.CreateOrUpdate. +type AppAttachPackageClientCreateOrUpdateResponse struct { + // Schema for App Attach Package properties. + AppAttachPackage +} + +// AppAttachPackageClientDeleteResponse contains the response from method AppAttachPackageClient.Delete. +type AppAttachPackageClientDeleteResponse struct { + // placeholder for future response values +} + +// AppAttachPackageClientGetResponse contains the response from method AppAttachPackageClient.Get. +type AppAttachPackageClientGetResponse struct { + // Schema for App Attach Package properties. + AppAttachPackage +} + +// AppAttachPackageClientListByResourceGroupResponse contains the response from method AppAttachPackageClient.NewListByResourceGroupPager. +type AppAttachPackageClientListByResourceGroupResponse struct { + // List of App Attach Package definitions. + AppAttachPackageList +} + +// AppAttachPackageClientListBySubscriptionResponse contains the response from method AppAttachPackageClient.NewListBySubscriptionPager. +type AppAttachPackageClientListBySubscriptionResponse struct { + // List of App Attach Package definitions. + AppAttachPackageList +} + +// AppAttachPackageClientUpdateResponse contains the response from method AppAttachPackageClient.Update. +type AppAttachPackageClientUpdateResponse struct { + // Schema for App Attach Package properties. + AppAttachPackage +} + +// AppAttachPackageInfoClientImportResponse contains the response from method AppAttachPackageInfoClient.NewImportPager. +type AppAttachPackageInfoClientImportResponse struct { + // List of App Attach Package definitions. + AppAttachPackageList +} + // ApplicationGroupsClientCreateOrUpdateResponse contains the response from method ApplicationGroupsClient.CreateOrUpdate. type ApplicationGroupsClientCreateOrUpdateResponse struct { // Represents a ApplicationGroup definition. diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/scalingplanpersonalschedules_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/scalingplanpersonalschedules_client.go index f8268b53d2e0..e9dc0c107d05 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/scalingplanpersonalschedules_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/scalingplanpersonalschedules_client.go @@ -29,7 +29,7 @@ type ScalingPlanPersonalSchedulesClient struct { } // NewScalingPlanPersonalSchedulesClient creates a new instance of ScalingPlanPersonalSchedulesClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewScalingPlanPersonalSchedulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ScalingPlanPersonalSchedulesClient, error) { @@ -47,7 +47,7 @@ func NewScalingPlanPersonalSchedulesClient(subscriptionID string, credential azc // Create - Create or update a ScalingPlanPersonalSchedule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - scalingPlanName - The name of the scaling plan. // - scalingPlanScheduleName - The name of the ScalingPlanSchedule @@ -100,7 +100,7 @@ func (client *ScalingPlanPersonalSchedulesClient) createCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, scalingPlanSchedule); err != nil { @@ -121,7 +121,7 @@ func (client *ScalingPlanPersonalSchedulesClient) createHandleResponse(resp *htt // Delete - Remove a ScalingPlanPersonalSchedule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - scalingPlanName - The name of the scaling plan. // - scalingPlanScheduleName - The name of the ScalingPlanSchedule @@ -172,7 +172,7 @@ func (client *ScalingPlanPersonalSchedulesClient) deleteCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -181,7 +181,7 @@ func (client *ScalingPlanPersonalSchedulesClient) deleteCreateRequest(ctx contex // Get - Get a ScalingPlanPersonalSchedule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - scalingPlanName - The name of the scaling plan. // - scalingPlanScheduleName - The name of the ScalingPlanSchedule @@ -233,7 +233,7 @@ func (client *ScalingPlanPersonalSchedulesClient) getCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -250,7 +250,7 @@ func (client *ScalingPlanPersonalSchedulesClient) getHandleResponse(resp *http.R // NewListPager - List ScalingPlanPersonalSchedules. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - scalingPlanName - The name of the scaling plan. // - options - ScalingPlanPersonalSchedulesClientListOptions contains the optional parameters for the ScalingPlanPersonalSchedulesClient.NewListPager @@ -298,15 +298,15 @@ func (client *ScalingPlanPersonalSchedulesClient) listCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") - if options != nil && options.PageSize != nil { - reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) + reqQP.Set("api-version", "2024-04-03") + if options != nil && options.InitialSkip != nil { + reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) } if options != nil && options.IsDescending != nil { reqQP.Set("isDescending", strconv.FormatBool(*options.IsDescending)) } - if options != nil && options.InitialSkip != nil { - reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) + if options != nil && options.PageSize != nil { + reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} @@ -325,7 +325,7 @@ func (client *ScalingPlanPersonalSchedulesClient) listHandleResponse(resp *http. // Update - Update a ScalingPlanPersonalSchedule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - scalingPlanName - The name of the scaling plan. // - scalingPlanScheduleName - The name of the ScalingPlanSchedule @@ -377,7 +377,7 @@ func (client *ScalingPlanPersonalSchedulesClient) updateCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.ScalingPlanSchedule != nil { diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/scalingplanpersonalschedules_client_example_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/scalingplanpersonalschedules_client_example_test.go deleted file mode 100644 index b424b2607326..000000000000 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/scalingplanpersonalschedules_client_example_test.go +++ /dev/null @@ -1,488 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armdesktopvirtualization_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlanPersonalSchedule_Get.json -func ExampleScalingPlanPersonalSchedulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewScalingPlanPersonalSchedulesClient().Get(ctx, "resourceGroup1", "PersonalScalingPlan1", "PersonalScalingPlanSchedule", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ScalingPlanPersonalSchedule = armdesktopvirtualization.ScalingPlanPersonalSchedule{ - // Name: to.Ptr("PersonalScalingPlanSchedule"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/scalingPlans/personalSchedules"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/scalingPlans/scalingPlan1/personalSchedules/PersonalScalingPlanScheduleWeekdays1"), - // Properties: &armdesktopvirtualization.ScalingPlanPersonalScheduleProperties{ - // DaysOfWeek: []*armdesktopvirtualization.DayOfWeek{ - // to.Ptr(armdesktopvirtualization.DayOfWeekMonday), - // to.Ptr(armdesktopvirtualization.DayOfWeekTuesday), - // to.Ptr(armdesktopvirtualization.DayOfWeekWednesday), - // to.Ptr(armdesktopvirtualization.DayOfWeekThursday), - // to.Ptr(armdesktopvirtualization.DayOfWeekFriday)}, - // OffPeakActionOnDisconnect: to.Ptr(armdesktopvirtualization.SessionHandlingOperationNone), - // OffPeakActionOnLogoff: to.Ptr(armdesktopvirtualization.SessionHandlingOperationDeallocate), - // OffPeakMinutesToWaitOnDisconnect: to.Ptr[int32](10), - // OffPeakMinutesToWaitOnLogoff: to.Ptr[int32](10), - // OffPeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](20), - // Minute: to.Ptr[int32](0), - // }, - // OffPeakStartVMOnConnect: to.Ptr(armdesktopvirtualization.SetStartVMOnConnectEnable), - // PeakActionOnDisconnect: to.Ptr(armdesktopvirtualization.SessionHandlingOperationNone), - // PeakActionOnLogoff: to.Ptr(armdesktopvirtualization.SessionHandlingOperationDeallocate), - // PeakMinutesToWaitOnDisconnect: to.Ptr[int32](10), - // PeakMinutesToWaitOnLogoff: to.Ptr[int32](10), - // PeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](8), - // Minute: to.Ptr[int32](0), - // }, - // PeakStartVMOnConnect: to.Ptr(armdesktopvirtualization.SetStartVMOnConnectEnable), - // RampDownActionOnDisconnect: to.Ptr(armdesktopvirtualization.SessionHandlingOperationNone), - // RampDownActionOnLogoff: to.Ptr(armdesktopvirtualization.SessionHandlingOperationDeallocate), - // RampDownMinutesToWaitOnDisconnect: to.Ptr[int32](10), - // RampDownMinutesToWaitOnLogoff: to.Ptr[int32](10), - // RampDownStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](18), - // Minute: to.Ptr[int32](0), - // }, - // RampDownStartVMOnConnect: to.Ptr(armdesktopvirtualization.SetStartVMOnConnectEnable), - // RampUpActionOnDisconnect: to.Ptr(armdesktopvirtualization.SessionHandlingOperationNone), - // RampUpActionOnLogoff: to.Ptr(armdesktopvirtualization.SessionHandlingOperationNone), - // RampUpAutoStartHosts: to.Ptr(armdesktopvirtualization.StartupBehaviorAll), - // RampUpMinutesToWaitOnDisconnect: to.Ptr[int32](10), - // RampUpMinutesToWaitOnLogoff: to.Ptr[int32](10), - // RampUpStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](6), - // Minute: to.Ptr[int32](0), - // }, - // RampUpStartVMOnConnect: to.Ptr(armdesktopvirtualization.SetStartVMOnConnectEnable), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlanPersonalSchedule_Create.json -func ExampleScalingPlanPersonalSchedulesClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewScalingPlanPersonalSchedulesClient().Create(ctx, "resourceGroup1", "scalingPlan1", "scalingPlanScheduleWeekdays1", armdesktopvirtualization.ScalingPlanPersonalSchedule{ - Properties: &armdesktopvirtualization.ScalingPlanPersonalScheduleProperties{ - DaysOfWeek: []*armdesktopvirtualization.DayOfWeek{ - to.Ptr(armdesktopvirtualization.DayOfWeekMonday), - to.Ptr(armdesktopvirtualization.DayOfWeekTuesday), - to.Ptr(armdesktopvirtualization.DayOfWeekWednesday), - to.Ptr(armdesktopvirtualization.DayOfWeekThursday), - to.Ptr(armdesktopvirtualization.DayOfWeekFriday)}, - OffPeakActionOnDisconnect: to.Ptr(armdesktopvirtualization.SessionHandlingOperationNone), - OffPeakActionOnLogoff: to.Ptr(armdesktopvirtualization.SessionHandlingOperationDeallocate), - OffPeakMinutesToWaitOnDisconnect: to.Ptr[int32](10), - OffPeakMinutesToWaitOnLogoff: to.Ptr[int32](10), - OffPeakStartTime: &armdesktopvirtualization.Time{ - Hour: to.Ptr[int32](20), - Minute: to.Ptr[int32](0), - }, - OffPeakStartVMOnConnect: to.Ptr(armdesktopvirtualization.SetStartVMOnConnectEnable), - PeakActionOnDisconnect: to.Ptr(armdesktopvirtualization.SessionHandlingOperationNone), - PeakActionOnLogoff: to.Ptr(armdesktopvirtualization.SessionHandlingOperationDeallocate), - PeakMinutesToWaitOnDisconnect: to.Ptr[int32](10), - PeakMinutesToWaitOnLogoff: to.Ptr[int32](10), - PeakStartTime: &armdesktopvirtualization.Time{ - Hour: to.Ptr[int32](8), - Minute: to.Ptr[int32](0), - }, - PeakStartVMOnConnect: to.Ptr(armdesktopvirtualization.SetStartVMOnConnectEnable), - RampDownActionOnDisconnect: to.Ptr(armdesktopvirtualization.SessionHandlingOperationNone), - RampDownActionOnLogoff: to.Ptr(armdesktopvirtualization.SessionHandlingOperationDeallocate), - RampDownMinutesToWaitOnDisconnect: to.Ptr[int32](10), - RampDownMinutesToWaitOnLogoff: to.Ptr[int32](10), - RampDownStartTime: &armdesktopvirtualization.Time{ - Hour: to.Ptr[int32](18), - Minute: to.Ptr[int32](0), - }, - RampDownStartVMOnConnect: to.Ptr(armdesktopvirtualization.SetStartVMOnConnectEnable), - RampUpActionOnDisconnect: to.Ptr(armdesktopvirtualization.SessionHandlingOperationNone), - RampUpActionOnLogoff: to.Ptr(armdesktopvirtualization.SessionHandlingOperationNone), - RampUpAutoStartHosts: to.Ptr(armdesktopvirtualization.StartupBehaviorAll), - RampUpMinutesToWaitOnDisconnect: to.Ptr[int32](10), - RampUpMinutesToWaitOnLogoff: to.Ptr[int32](10), - RampUpStartTime: &armdesktopvirtualization.Time{ - Hour: to.Ptr[int32](6), - Minute: to.Ptr[int32](0), - }, - RampUpStartVMOnConnect: to.Ptr(armdesktopvirtualization.SetStartVMOnConnectEnable), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ScalingPlanPersonalSchedule = armdesktopvirtualization.ScalingPlanPersonalSchedule{ - // Name: to.Ptr("scalingPlanScheduleWeekdays1"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/scalingPlans/personalSchedules"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/scalingPlans/scalingPlan1/personalSchedules/scalingPlanScheduleWeekdays1"), - // Properties: &armdesktopvirtualization.ScalingPlanPersonalScheduleProperties{ - // DaysOfWeek: []*armdesktopvirtualization.DayOfWeek{ - // to.Ptr(armdesktopvirtualization.DayOfWeekMonday), - // to.Ptr(armdesktopvirtualization.DayOfWeekTuesday), - // to.Ptr(armdesktopvirtualization.DayOfWeekWednesday), - // to.Ptr(armdesktopvirtualization.DayOfWeekThursday), - // to.Ptr(armdesktopvirtualization.DayOfWeekFriday)}, - // OffPeakActionOnDisconnect: to.Ptr(armdesktopvirtualization.SessionHandlingOperationNone), - // OffPeakActionOnLogoff: to.Ptr(armdesktopvirtualization.SessionHandlingOperationDeallocate), - // OffPeakMinutesToWaitOnDisconnect: to.Ptr[int32](10), - // OffPeakMinutesToWaitOnLogoff: to.Ptr[int32](10), - // OffPeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](20), - // Minute: to.Ptr[int32](0), - // }, - // OffPeakStartVMOnConnect: to.Ptr(armdesktopvirtualization.SetStartVMOnConnectEnable), - // PeakActionOnDisconnect: to.Ptr(armdesktopvirtualization.SessionHandlingOperationNone), - // PeakActionOnLogoff: to.Ptr(armdesktopvirtualization.SessionHandlingOperationDeallocate), - // PeakMinutesToWaitOnDisconnect: to.Ptr[int32](10), - // PeakMinutesToWaitOnLogoff: to.Ptr[int32](10), - // PeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](8), - // Minute: to.Ptr[int32](0), - // }, - // PeakStartVMOnConnect: to.Ptr(armdesktopvirtualization.SetStartVMOnConnectEnable), - // RampDownActionOnDisconnect: to.Ptr(armdesktopvirtualization.SessionHandlingOperationNone), - // RampDownActionOnLogoff: to.Ptr(armdesktopvirtualization.SessionHandlingOperationDeallocate), - // RampDownMinutesToWaitOnDisconnect: to.Ptr[int32](10), - // RampDownMinutesToWaitOnLogoff: to.Ptr[int32](10), - // RampDownStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](18), - // Minute: to.Ptr[int32](0), - // }, - // RampDownStartVMOnConnect: to.Ptr(armdesktopvirtualization.SetStartVMOnConnectEnable), - // RampUpActionOnDisconnect: to.Ptr(armdesktopvirtualization.SessionHandlingOperationNone), - // RampUpActionOnLogoff: to.Ptr(armdesktopvirtualization.SessionHandlingOperationNone), - // RampUpAutoStartHosts: to.Ptr(armdesktopvirtualization.StartupBehaviorAll), - // RampUpMinutesToWaitOnDisconnect: to.Ptr[int32](10), - // RampUpMinutesToWaitOnLogoff: to.Ptr[int32](10), - // RampUpStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](6), - // Minute: to.Ptr[int32](0), - // }, - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlanPersonalSchedule_Delete.json -func ExampleScalingPlanPersonalSchedulesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewScalingPlanPersonalSchedulesClient().Delete(ctx, "resourceGroup1", "scalingPlan1", "scalingPlanScheduleWeekdays1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlanPersonalSchedule_Update.json -func ExampleScalingPlanPersonalSchedulesClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewScalingPlanPersonalSchedulesClient().Update(ctx, "resourceGroup1", "scalingPlan1", "scalingPlanScheduleWeekdays1", &armdesktopvirtualization.ScalingPlanPersonalSchedulesClientUpdateOptions{ScalingPlanSchedule: &armdesktopvirtualization.ScalingPlanPersonalSchedulePatch{ - Properties: &armdesktopvirtualization.ScalingPlanPersonalScheduleProperties{ - OffPeakActionOnDisconnect: to.Ptr(armdesktopvirtualization.SessionHandlingOperationNone), - OffPeakActionOnLogoff: to.Ptr(armdesktopvirtualization.SessionHandlingOperationDeallocate), - OffPeakMinutesToWaitOnDisconnect: to.Ptr[int32](10), - OffPeakMinutesToWaitOnLogoff: to.Ptr[int32](10), - OffPeakStartTime: &armdesktopvirtualization.Time{ - Hour: to.Ptr[int32](20), - Minute: to.Ptr[int32](0), - }, - OffPeakStartVMOnConnect: to.Ptr(armdesktopvirtualization.SetStartVMOnConnectDisable), - PeakActionOnDisconnect: to.Ptr(armdesktopvirtualization.SessionHandlingOperationNone), - PeakActionOnLogoff: to.Ptr(armdesktopvirtualization.SessionHandlingOperationDeallocate), - PeakMinutesToWaitOnDisconnect: to.Ptr[int32](10), - PeakMinutesToWaitOnLogoff: to.Ptr[int32](10), - PeakStartTime: &armdesktopvirtualization.Time{ - Hour: to.Ptr[int32](8), - Minute: to.Ptr[int32](0), - }, - RampDownActionOnDisconnect: to.Ptr(armdesktopvirtualization.SessionHandlingOperationNone), - RampDownActionOnLogoff: to.Ptr(armdesktopvirtualization.SessionHandlingOperationDeallocate), - RampDownMinutesToWaitOnDisconnect: to.Ptr[int32](10), - RampDownMinutesToWaitOnLogoff: to.Ptr[int32](10), - RampDownStartTime: &armdesktopvirtualization.Time{ - Hour: to.Ptr[int32](18), - Minute: to.Ptr[int32](0), - }, - }, - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ScalingPlanPersonalSchedule = armdesktopvirtualization.ScalingPlanPersonalSchedule{ - // Name: to.Ptr("scalingPlanScheduleWeekdays1"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/scalingPlans/personalSchedules"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/scalingPlans/scalingPlan1/personalSchedules/scalingPlanScheduleWeekdays1"), - // Properties: &armdesktopvirtualization.ScalingPlanPersonalScheduleProperties{ - // DaysOfWeek: []*armdesktopvirtualization.DayOfWeek{ - // to.Ptr(armdesktopvirtualization.DayOfWeekMonday), - // to.Ptr(armdesktopvirtualization.DayOfWeekTuesday), - // to.Ptr(armdesktopvirtualization.DayOfWeekWednesday), - // to.Ptr(armdesktopvirtualization.DayOfWeekThursday), - // to.Ptr(armdesktopvirtualization.DayOfWeekFriday)}, - // OffPeakActionOnDisconnect: to.Ptr(armdesktopvirtualization.SessionHandlingOperationNone), - // OffPeakActionOnLogoff: to.Ptr(armdesktopvirtualization.SessionHandlingOperationDeallocate), - // OffPeakMinutesToWaitOnDisconnect: to.Ptr[int32](10), - // OffPeakMinutesToWaitOnLogoff: to.Ptr[int32](10), - // OffPeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](20), - // Minute: to.Ptr[int32](0), - // }, - // OffPeakStartVMOnConnect: to.Ptr(armdesktopvirtualization.SetStartVMOnConnectDisable), - // PeakActionOnDisconnect: to.Ptr(armdesktopvirtualization.SessionHandlingOperationNone), - // PeakActionOnLogoff: to.Ptr(armdesktopvirtualization.SessionHandlingOperationDeallocate), - // PeakMinutesToWaitOnDisconnect: to.Ptr[int32](10), - // PeakMinutesToWaitOnLogoff: to.Ptr[int32](10), - // PeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](8), - // Minute: to.Ptr[int32](0), - // }, - // PeakStartVMOnConnect: to.Ptr(armdesktopvirtualization.SetStartVMOnConnectEnable), - // RampDownActionOnDisconnect: to.Ptr(armdesktopvirtualization.SessionHandlingOperationNone), - // RampDownActionOnLogoff: to.Ptr(armdesktopvirtualization.SessionHandlingOperationDeallocate), - // RampDownMinutesToWaitOnDisconnect: to.Ptr[int32](10), - // RampDownMinutesToWaitOnLogoff: to.Ptr[int32](10), - // RampDownStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](18), - // Minute: to.Ptr[int32](0), - // }, - // RampDownStartVMOnConnect: to.Ptr(armdesktopvirtualization.SetStartVMOnConnectEnable), - // RampUpActionOnDisconnect: to.Ptr(armdesktopvirtualization.SessionHandlingOperationNone), - // RampUpActionOnLogoff: to.Ptr(armdesktopvirtualization.SessionHandlingOperationNone), - // RampUpAutoStartHosts: to.Ptr(armdesktopvirtualization.StartupBehaviorAll), - // RampUpMinutesToWaitOnDisconnect: to.Ptr[int32](10), - // RampUpMinutesToWaitOnLogoff: to.Ptr[int32](10), - // RampUpStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](6), - // Minute: to.Ptr[int32](0), - // }, - // RampUpStartVMOnConnect: to.Ptr(armdesktopvirtualization.SetStartVMOnConnectEnable), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlanPersonalSchedule_List.json -func ExampleScalingPlanPersonalSchedulesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewScalingPlanPersonalSchedulesClient().NewListPager("resourceGroup1", "scalingPlan", &armdesktopvirtualization.ScalingPlanPersonalSchedulesClientListOptions{PageSize: to.Ptr[int32](10), - IsDescending: to.Ptr(true), - InitialSkip: to.Ptr[int32](0), - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ScalingPlanPersonalScheduleList = armdesktopvirtualization.ScalingPlanPersonalScheduleList{ - // Value: []*armdesktopvirtualization.ScalingPlanPersonalSchedule{ - // { - // Name: to.Ptr("scalingPlanScheduleWeekday"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/scalingPlans/personalSchedules"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/scalingPlans/scalingPlan1/personalSchedules/scalingPlanScheduleWeekdays1"), - // Properties: &armdesktopvirtualization.ScalingPlanPersonalScheduleProperties{ - // DaysOfWeek: []*armdesktopvirtualization.DayOfWeek{ - // to.Ptr(armdesktopvirtualization.DayOfWeekMonday), - // to.Ptr(armdesktopvirtualization.DayOfWeekTuesday), - // to.Ptr(armdesktopvirtualization.DayOfWeekWednesday), - // to.Ptr(armdesktopvirtualization.DayOfWeekThursday), - // to.Ptr(armdesktopvirtualization.DayOfWeekFriday)}, - // OffPeakActionOnDisconnect: to.Ptr(armdesktopvirtualization.SessionHandlingOperationNone), - // OffPeakActionOnLogoff: to.Ptr(armdesktopvirtualization.SessionHandlingOperationDeallocate), - // OffPeakMinutesToWaitOnDisconnect: to.Ptr[int32](10), - // OffPeakMinutesToWaitOnLogoff: to.Ptr[int32](10), - // OffPeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](20), - // Minute: to.Ptr[int32](0), - // }, - // OffPeakStartVMOnConnect: to.Ptr(armdesktopvirtualization.SetStartVMOnConnectEnable), - // PeakActionOnDisconnect: to.Ptr(armdesktopvirtualization.SessionHandlingOperationNone), - // PeakActionOnLogoff: to.Ptr(armdesktopvirtualization.SessionHandlingOperationDeallocate), - // PeakMinutesToWaitOnDisconnect: to.Ptr[int32](10), - // PeakMinutesToWaitOnLogoff: to.Ptr[int32](10), - // PeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](8), - // Minute: to.Ptr[int32](0), - // }, - // PeakStartVMOnConnect: to.Ptr(armdesktopvirtualization.SetStartVMOnConnectEnable), - // RampDownActionOnDisconnect: to.Ptr(armdesktopvirtualization.SessionHandlingOperationNone), - // RampDownActionOnLogoff: to.Ptr(armdesktopvirtualization.SessionHandlingOperationDeallocate), - // RampDownMinutesToWaitOnDisconnect: to.Ptr[int32](10), - // RampDownMinutesToWaitOnLogoff: to.Ptr[int32](10), - // RampDownStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](18), - // Minute: to.Ptr[int32](0), - // }, - // RampDownStartVMOnConnect: to.Ptr(armdesktopvirtualization.SetStartVMOnConnectEnable), - // RampUpActionOnDisconnect: to.Ptr(armdesktopvirtualization.SessionHandlingOperationNone), - // RampUpActionOnLogoff: to.Ptr(armdesktopvirtualization.SessionHandlingOperationNone), - // RampUpAutoStartHosts: to.Ptr(armdesktopvirtualization.StartupBehaviorAll), - // RampUpMinutesToWaitOnDisconnect: to.Ptr[int32](10), - // RampUpMinutesToWaitOnLogoff: to.Ptr[int32](10), - // RampUpStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](6), - // Minute: to.Ptr[int32](0), - // }, - // RampUpStartVMOnConnect: to.Ptr(armdesktopvirtualization.SetStartVMOnConnectEnable), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }, - // { - // Name: to.Ptr("scalingPlanScheduleWeekend"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/scalingPlans/personalSchedules"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/scalingPlans/scalingPlan1/personalSchedules/scalingPlanScheduleWeekends1"), - // Properties: &armdesktopvirtualization.ScalingPlanPersonalScheduleProperties{ - // DaysOfWeek: []*armdesktopvirtualization.DayOfWeek{ - // to.Ptr(armdesktopvirtualization.DayOfWeekSaturday), - // to.Ptr(armdesktopvirtualization.DayOfWeekSunday)}, - // OffPeakActionOnDisconnect: to.Ptr(armdesktopvirtualization.SessionHandlingOperationDeallocate), - // OffPeakActionOnLogoff: to.Ptr(armdesktopvirtualization.SessionHandlingOperationDeallocate), - // OffPeakMinutesToWaitOnDisconnect: to.Ptr[int32](10), - // OffPeakMinutesToWaitOnLogoff: to.Ptr[int32](10), - // OffPeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](16), - // Minute: to.Ptr[int32](0), - // }, - // OffPeakStartVMOnConnect: to.Ptr(armdesktopvirtualization.SetStartVMOnConnectEnable), - // PeakActionOnDisconnect: to.Ptr(armdesktopvirtualization.SessionHandlingOperationDeallocate), - // PeakActionOnLogoff: to.Ptr(armdesktopvirtualization.SessionHandlingOperationDeallocate), - // PeakMinutesToWaitOnDisconnect: to.Ptr[int32](10), - // PeakMinutesToWaitOnLogoff: to.Ptr[int32](10), - // PeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](10), - // Minute: to.Ptr[int32](0), - // }, - // PeakStartVMOnConnect: to.Ptr(armdesktopvirtualization.SetStartVMOnConnectEnable), - // RampDownActionOnDisconnect: to.Ptr(armdesktopvirtualization.SessionHandlingOperationDeallocate), - // RampDownActionOnLogoff: to.Ptr(armdesktopvirtualization.SessionHandlingOperationDeallocate), - // RampDownMinutesToWaitOnDisconnect: to.Ptr[int32](10), - // RampDownMinutesToWaitOnLogoff: to.Ptr[int32](10), - // RampDownStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](14), - // Minute: to.Ptr[int32](0), - // }, - // RampDownStartVMOnConnect: to.Ptr(armdesktopvirtualization.SetStartVMOnConnectEnable), - // RampUpActionOnDisconnect: to.Ptr(armdesktopvirtualization.SessionHandlingOperationNone), - // RampUpActionOnLogoff: to.Ptr(armdesktopvirtualization.SessionHandlingOperationNone), - // RampUpAutoStartHosts: to.Ptr(armdesktopvirtualization.StartupBehaviorAll), - // RampUpMinutesToWaitOnDisconnect: to.Ptr[int32](10), - // RampUpMinutesToWaitOnLogoff: to.Ptr[int32](10), - // RampUpStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](6), - // Minute: to.Ptr[int32](0), - // }, - // RampUpStartVMOnConnect: to.Ptr(armdesktopvirtualization.SetStartVMOnConnectEnable), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/scalingplanpooledschedules_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/scalingplanpooledschedules_client.go index 033733d3df31..e1cec540e936 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/scalingplanpooledschedules_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/scalingplanpooledschedules_client.go @@ -29,7 +29,7 @@ type ScalingPlanPooledSchedulesClient struct { } // NewScalingPlanPooledSchedulesClient creates a new instance of ScalingPlanPooledSchedulesClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewScalingPlanPooledSchedulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ScalingPlanPooledSchedulesClient, error) { @@ -47,7 +47,7 @@ func NewScalingPlanPooledSchedulesClient(subscriptionID string, credential azcor // Create - Create or update a ScalingPlanPooledSchedule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - scalingPlanName - The name of the scaling plan. // - scalingPlanScheduleName - The name of the ScalingPlanSchedule @@ -100,7 +100,7 @@ func (client *ScalingPlanPooledSchedulesClient) createCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, scalingPlanSchedule); err != nil { @@ -121,7 +121,7 @@ func (client *ScalingPlanPooledSchedulesClient) createHandleResponse(resp *http. // Delete - Remove a ScalingPlanPooledSchedule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - scalingPlanName - The name of the scaling plan. // - scalingPlanScheduleName - The name of the ScalingPlanSchedule @@ -172,7 +172,7 @@ func (client *ScalingPlanPooledSchedulesClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -181,7 +181,7 @@ func (client *ScalingPlanPooledSchedulesClient) deleteCreateRequest(ctx context. // Get - Get a ScalingPlanPooledSchedule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - scalingPlanName - The name of the scaling plan. // - scalingPlanScheduleName - The name of the ScalingPlanSchedule @@ -233,7 +233,7 @@ func (client *ScalingPlanPooledSchedulesClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -250,7 +250,7 @@ func (client *ScalingPlanPooledSchedulesClient) getHandleResponse(resp *http.Res // NewListPager - List ScalingPlanPooledSchedules. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - scalingPlanName - The name of the scaling plan. // - options - ScalingPlanPooledSchedulesClientListOptions contains the optional parameters for the ScalingPlanPooledSchedulesClient.NewListPager @@ -298,15 +298,15 @@ func (client *ScalingPlanPooledSchedulesClient) listCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") - if options != nil && options.PageSize != nil { - reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) + reqQP.Set("api-version", "2024-04-03") + if options != nil && options.InitialSkip != nil { + reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) } if options != nil && options.IsDescending != nil { reqQP.Set("isDescending", strconv.FormatBool(*options.IsDescending)) } - if options != nil && options.InitialSkip != nil { - reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) + if options != nil && options.PageSize != nil { + reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} @@ -325,7 +325,7 @@ func (client *ScalingPlanPooledSchedulesClient) listHandleResponse(resp *http.Re // Update - Update a ScalingPlanPooledSchedule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - scalingPlanName - The name of the scaling plan. // - scalingPlanScheduleName - The name of the ScalingPlanSchedule @@ -377,7 +377,7 @@ func (client *ScalingPlanPooledSchedulesClient) updateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.ScalingPlanSchedule != nil { diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/scalingplanpooledschedules_client_example_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/scalingplanpooledschedules_client_example_test.go deleted file mode 100644 index 89408761a854..000000000000 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/scalingplanpooledschedules_client_example_test.go +++ /dev/null @@ -1,419 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armdesktopvirtualization_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlanPooledSchedule_Get.json -func ExampleScalingPlanPooledSchedulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewScalingPlanPooledSchedulesClient().Get(ctx, "resourceGroup1", "scalingPlan1", "scalingPlanScheduleWeekdays1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ScalingPlanPooledSchedule = armdesktopvirtualization.ScalingPlanPooledSchedule{ - // Name: to.Ptr("scalingPlanScheduleWeekdays1"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/scalingPlans/pooledSchedules"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/scalingPlans/scalingPlan1/pooledSchedules/scalingPlanScheduleWeekdays1"), - // Properties: &armdesktopvirtualization.ScalingPlanPooledScheduleProperties{ - // DaysOfWeek: []*armdesktopvirtualization.DayOfWeek{ - // to.Ptr(armdesktopvirtualization.DayOfWeekMonday), - // to.Ptr(armdesktopvirtualization.DayOfWeekTuesday), - // to.Ptr(armdesktopvirtualization.DayOfWeekWednesday), - // to.Ptr(armdesktopvirtualization.DayOfWeekThursday), - // to.Ptr(armdesktopvirtualization.DayOfWeekFriday)}, - // OffPeakLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // OffPeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](20), - // Minute: to.Ptr[int32](0), - // }, - // PeakLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmBreadthFirst), - // PeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](8), - // Minute: to.Ptr[int32](0), - // }, - // RampDownCapacityThresholdPct: to.Ptr[int32](50), - // RampDownForceLogoffUsers: to.Ptr(true), - // RampDownLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // RampDownMinimumHostsPct: to.Ptr[int32](20), - // RampDownNotificationMessage: to.Ptr("message"), - // RampDownStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](18), - // Minute: to.Ptr[int32](0), - // }, - // RampDownWaitTimeMinutes: to.Ptr[int32](30), - // RampUpCapacityThresholdPct: to.Ptr[int32](80), - // RampUpLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // RampUpMinimumHostsPct: to.Ptr[int32](20), - // RampUpStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](6), - // Minute: to.Ptr[int32](0), - // }, - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlanPooledSchedule_Create.json -func ExampleScalingPlanPooledSchedulesClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewScalingPlanPooledSchedulesClient().Create(ctx, "resourceGroup1", "scalingPlan1", "scalingPlanScheduleWeekdays1", armdesktopvirtualization.ScalingPlanPooledSchedule{ - Properties: &armdesktopvirtualization.ScalingPlanPooledScheduleProperties{ - DaysOfWeek: []*armdesktopvirtualization.DayOfWeek{ - to.Ptr(armdesktopvirtualization.DayOfWeekMonday), - to.Ptr(armdesktopvirtualization.DayOfWeekTuesday), - to.Ptr(armdesktopvirtualization.DayOfWeekWednesday), - to.Ptr(armdesktopvirtualization.DayOfWeekThursday), - to.Ptr(armdesktopvirtualization.DayOfWeekFriday)}, - OffPeakLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - OffPeakStartTime: &armdesktopvirtualization.Time{ - Hour: to.Ptr[int32](20), - Minute: to.Ptr[int32](0), - }, - PeakLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmBreadthFirst), - PeakStartTime: &armdesktopvirtualization.Time{ - Hour: to.Ptr[int32](8), - Minute: to.Ptr[int32](0), - }, - RampDownCapacityThresholdPct: to.Ptr[int32](50), - RampDownForceLogoffUsers: to.Ptr(true), - RampDownLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - RampDownMinimumHostsPct: to.Ptr[int32](20), - RampDownNotificationMessage: to.Ptr("message"), - RampDownStartTime: &armdesktopvirtualization.Time{ - Hour: to.Ptr[int32](18), - Minute: to.Ptr[int32](0), - }, - RampDownWaitTimeMinutes: to.Ptr[int32](30), - RampUpCapacityThresholdPct: to.Ptr[int32](80), - RampUpLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - RampUpMinimumHostsPct: to.Ptr[int32](20), - RampUpStartTime: &armdesktopvirtualization.Time{ - Hour: to.Ptr[int32](6), - Minute: to.Ptr[int32](0), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ScalingPlanPooledSchedule = armdesktopvirtualization.ScalingPlanPooledSchedule{ - // Name: to.Ptr("scalingPlanScheduleWeekdays1"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/scalingPlans/pooledSchedules"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/scalingPlans/scalingPlan1/pooledSchedules/scalingPlanScheduleWeekdays1"), - // Properties: &armdesktopvirtualization.ScalingPlanPooledScheduleProperties{ - // DaysOfWeek: []*armdesktopvirtualization.DayOfWeek{ - // to.Ptr(armdesktopvirtualization.DayOfWeekMonday), - // to.Ptr(armdesktopvirtualization.DayOfWeekTuesday), - // to.Ptr(armdesktopvirtualization.DayOfWeekWednesday), - // to.Ptr(armdesktopvirtualization.DayOfWeekThursday), - // to.Ptr(armdesktopvirtualization.DayOfWeekFriday)}, - // OffPeakLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // OffPeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](20), - // Minute: to.Ptr[int32](0), - // }, - // PeakLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmBreadthFirst), - // PeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](8), - // Minute: to.Ptr[int32](0), - // }, - // RampDownCapacityThresholdPct: to.Ptr[int32](50), - // RampDownForceLogoffUsers: to.Ptr(true), - // RampDownLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // RampDownMinimumHostsPct: to.Ptr[int32](20), - // RampDownNotificationMessage: to.Ptr("message"), - // RampDownStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](18), - // Minute: to.Ptr[int32](0), - // }, - // RampDownWaitTimeMinutes: to.Ptr[int32](30), - // RampUpCapacityThresholdPct: to.Ptr[int32](80), - // RampUpLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // RampUpMinimumHostsPct: to.Ptr[int32](20), - // RampUpStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](6), - // Minute: to.Ptr[int32](0), - // }, - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlanPooledSchedule_Delete.json -func ExampleScalingPlanPooledSchedulesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewScalingPlanPooledSchedulesClient().Delete(ctx, "resourceGroup1", "scalingPlan1", "scalingPlanScheduleWeekdays1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlanPooledSchedule_Update.json -func ExampleScalingPlanPooledSchedulesClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewScalingPlanPooledSchedulesClient().Update(ctx, "resourceGroup1", "scalingPlan1", "scalingPlanScheduleWeekdays1", &armdesktopvirtualization.ScalingPlanPooledSchedulesClientUpdateOptions{ScalingPlanSchedule: &armdesktopvirtualization.ScalingPlanPooledSchedulePatch{ - Properties: &armdesktopvirtualization.ScalingPlanPooledScheduleProperties{ - DaysOfWeek: []*armdesktopvirtualization.DayOfWeek{ - to.Ptr(armdesktopvirtualization.DayOfWeekMonday), - to.Ptr(armdesktopvirtualization.DayOfWeekTuesday), - to.Ptr(armdesktopvirtualization.DayOfWeekWednesday), - to.Ptr(armdesktopvirtualization.DayOfWeekThursday), - to.Ptr(armdesktopvirtualization.DayOfWeekFriday)}, - PeakStartTime: &armdesktopvirtualization.Time{ - Hour: to.Ptr[int32](8), - Minute: to.Ptr[int32](0), - }, - RampDownLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - RampDownMinimumHostsPct: to.Ptr[int32](20), - RampDownWaitTimeMinutes: to.Ptr[int32](30), - RampUpCapacityThresholdPct: to.Ptr[int32](80), - RampUpLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - }, - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ScalingPlanPooledSchedule = armdesktopvirtualization.ScalingPlanPooledSchedule{ - // Name: to.Ptr("scalingPlanScheduleWeekdays1"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/scalingPlans/pooledSchedules"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/scalingPlans/scalingPlan1/pooledSchedules/scalingPlanScheduleWeekdays1"), - // Properties: &armdesktopvirtualization.ScalingPlanPooledScheduleProperties{ - // DaysOfWeek: []*armdesktopvirtualization.DayOfWeek{ - // to.Ptr(armdesktopvirtualization.DayOfWeekMonday), - // to.Ptr(armdesktopvirtualization.DayOfWeekTuesday), - // to.Ptr(armdesktopvirtualization.DayOfWeekWednesday), - // to.Ptr(armdesktopvirtualization.DayOfWeekThursday), - // to.Ptr(armdesktopvirtualization.DayOfWeekFriday)}, - // OffPeakLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // OffPeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](20), - // Minute: to.Ptr[int32](0), - // }, - // PeakLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmBreadthFirst), - // PeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](8), - // Minute: to.Ptr[int32](0), - // }, - // RampDownCapacityThresholdPct: to.Ptr[int32](50), - // RampDownForceLogoffUsers: to.Ptr(true), - // RampDownLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // RampDownMinimumHostsPct: to.Ptr[int32](20), - // RampDownNotificationMessage: to.Ptr("message"), - // RampDownStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](18), - // Minute: to.Ptr[int32](0), - // }, - // RampDownWaitTimeMinutes: to.Ptr[int32](30), - // RampUpCapacityThresholdPct: to.Ptr[int32](80), - // RampUpLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // RampUpMinimumHostsPct: to.Ptr[int32](20), - // RampUpStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](6), - // Minute: to.Ptr[int32](0), - // }, - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlanPooledSchedule_List.json -func ExampleScalingPlanPooledSchedulesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewScalingPlanPooledSchedulesClient().NewListPager("resourceGroup1", "scalingPlan1", &armdesktopvirtualization.ScalingPlanPooledSchedulesClientListOptions{PageSize: to.Ptr[int32](10), - IsDescending: to.Ptr(true), - InitialSkip: to.Ptr[int32](0), - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ScalingPlanPooledScheduleList = armdesktopvirtualization.ScalingPlanPooledScheduleList{ - // Value: []*armdesktopvirtualization.ScalingPlanPooledSchedule{ - // { - // Name: to.Ptr("scalingPlanScheduleWeekdays1"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/scalingPlans/pooledSchedules"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/scalingPlans/scalingPlan1/pooledSchedules/scalingPlanScheduleWeekdays1"), - // Properties: &armdesktopvirtualization.ScalingPlanPooledScheduleProperties{ - // DaysOfWeek: []*armdesktopvirtualization.DayOfWeek{ - // to.Ptr(armdesktopvirtualization.DayOfWeekMonday), - // to.Ptr(armdesktopvirtualization.DayOfWeekTuesday), - // to.Ptr(armdesktopvirtualization.DayOfWeekWednesday), - // to.Ptr(armdesktopvirtualization.DayOfWeekThursday), - // to.Ptr(armdesktopvirtualization.DayOfWeekFriday)}, - // OffPeakLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // OffPeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](20), - // Minute: to.Ptr[int32](0), - // }, - // PeakLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmBreadthFirst), - // PeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](8), - // Minute: to.Ptr[int32](0), - // }, - // RampDownCapacityThresholdPct: to.Ptr[int32](50), - // RampDownForceLogoffUsers: to.Ptr(true), - // RampDownLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // RampDownMinimumHostsPct: to.Ptr[int32](20), - // RampDownNotificationMessage: to.Ptr("message"), - // RampDownStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](18), - // Minute: to.Ptr[int32](0), - // }, - // RampDownWaitTimeMinutes: to.Ptr[int32](30), - // RampUpCapacityThresholdPct: to.Ptr[int32](80), - // RampUpLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // RampUpMinimumHostsPct: to.Ptr[int32](20), - // RampUpStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](6), - // Minute: to.Ptr[int32](0), - // }, - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }, - // { - // Name: to.Ptr("scalingPlanScheduleWeekends1"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/scalingPlans/pooledSchedules"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/scalingPlans/scalingPlan1/pooledSchedules/scalingPlanScheduleWeekends1"), - // Properties: &armdesktopvirtualization.ScalingPlanPooledScheduleProperties{ - // DaysOfWeek: []*armdesktopvirtualization.DayOfWeek{ - // to.Ptr(armdesktopvirtualization.DayOfWeekSaturday), - // to.Ptr(armdesktopvirtualization.DayOfWeekSunday)}, - // OffPeakLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // OffPeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](20), - // Minute: to.Ptr[int32](0), - // }, - // PeakLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmBreadthFirst), - // PeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](8), - // Minute: to.Ptr[int32](0), - // }, - // RampDownCapacityThresholdPct: to.Ptr[int32](100), - // RampDownForceLogoffUsers: to.Ptr(true), - // RampDownLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // RampDownMinimumHostsPct: to.Ptr[int32](0), - // RampDownNotificationMessage: to.Ptr("message"), - // RampDownStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](18), - // Minute: to.Ptr[int32](0), - // }, - // RampDownWaitTimeMinutes: to.Ptr[int32](30), - // RampUpCapacityThresholdPct: to.Ptr[int32](90), - // RampUpLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // RampUpMinimumHostsPct: to.Ptr[int32](10), - // RampUpStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](6), - // Minute: to.Ptr[int32](0), - // }, - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/scalingplans_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/scalingplans_client.go index 1e0ccf5694d2..4d09094bf124 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/scalingplans_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/scalingplans_client.go @@ -29,7 +29,7 @@ type ScalingPlansClient struct { } // NewScalingPlansClient creates a new instance of ScalingPlansClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewScalingPlansClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ScalingPlansClient, error) { @@ -47,7 +47,7 @@ func NewScalingPlansClient(subscriptionID string, credential azcore.TokenCredent // Create - Create or update a scaling plan. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - scalingPlanName - The name of the scaling plan. // - scalingPlan - Object containing scaling plan definitions. @@ -94,7 +94,7 @@ func (client *ScalingPlansClient) createCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, scalingPlan); err != nil { @@ -115,7 +115,7 @@ func (client *ScalingPlansClient) createHandleResponse(resp *http.Response) (Sca // Delete - Remove a scaling plan. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - scalingPlanName - The name of the scaling plan. // - options - ScalingPlansClientDeleteOptions contains the optional parameters for the ScalingPlansClient.Delete method. @@ -160,7 +160,7 @@ func (client *ScalingPlansClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -169,7 +169,7 @@ func (client *ScalingPlansClient) deleteCreateRequest(ctx context.Context, resou // Get - Get a scaling plan. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - scalingPlanName - The name of the scaling plan. // - options - ScalingPlansClientGetOptions contains the optional parameters for the ScalingPlansClient.Get method. @@ -215,7 +215,7 @@ func (client *ScalingPlansClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -232,7 +232,7 @@ func (client *ScalingPlansClient) getHandleResponse(resp *http.Response) (Scalin // NewListByHostPoolPager - List scaling plan associated with hostpool. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - hostPoolName - The name of the host pool within the specified resource group // - options - ScalingPlansClientListByHostPoolOptions contains the optional parameters for the ScalingPlansClient.NewListByHostPoolPager @@ -280,15 +280,15 @@ func (client *ScalingPlansClient) listByHostPoolCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") - if options != nil && options.PageSize != nil { - reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) + reqQP.Set("api-version", "2024-04-03") + if options != nil && options.InitialSkip != nil { + reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) } if options != nil && options.IsDescending != nil { reqQP.Set("isDescending", strconv.FormatBool(*options.IsDescending)) } - if options != nil && options.InitialSkip != nil { - reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) + if options != nil && options.PageSize != nil { + reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} @@ -306,7 +306,7 @@ func (client *ScalingPlansClient) listByHostPoolHandleResponse(resp *http.Respon // NewListByResourceGroupPager - List scaling plans. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - ScalingPlansClientListByResourceGroupOptions contains the optional parameters for the ScalingPlansClient.NewListByResourceGroupPager // method. @@ -349,15 +349,15 @@ func (client *ScalingPlansClient) listByResourceGroupCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") - if options != nil && options.PageSize != nil { - reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) + reqQP.Set("api-version", "2024-04-03") + if options != nil && options.InitialSkip != nil { + reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) } if options != nil && options.IsDescending != nil { reqQP.Set("isDescending", strconv.FormatBool(*options.IsDescending)) } - if options != nil && options.InitialSkip != nil { - reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) + if options != nil && options.PageSize != nil { + reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} @@ -375,7 +375,7 @@ func (client *ScalingPlansClient) listByResourceGroupHandleResponse(resp *http.R // NewListBySubscriptionPager - List scaling plans in subscription. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - options - ScalingPlansClientListBySubscriptionOptions contains the optional parameters for the ScalingPlansClient.NewListBySubscriptionPager // method. func (client *ScalingPlansClient) NewListBySubscriptionPager(options *ScalingPlansClientListBySubscriptionOptions) *runtime.Pager[ScalingPlansClientListBySubscriptionResponse] { @@ -413,15 +413,15 @@ func (client *ScalingPlansClient) listBySubscriptionCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") - if options != nil && options.PageSize != nil { - reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) + reqQP.Set("api-version", "2024-04-03") + if options != nil && options.InitialSkip != nil { + reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) } if options != nil && options.IsDescending != nil { reqQP.Set("isDescending", strconv.FormatBool(*options.IsDescending)) } - if options != nil && options.InitialSkip != nil { - reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) + if options != nil && options.PageSize != nil { + reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} @@ -440,7 +440,7 @@ func (client *ScalingPlansClient) listBySubscriptionHandleResponse(resp *http.Re // Update - Update a scaling plan. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - scalingPlanName - The name of the scaling plan. // - options - ScalingPlansClientUpdateOptions contains the optional parameters for the ScalingPlansClient.Update method. @@ -486,7 +486,7 @@ func (client *ScalingPlansClient) updateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.ScalingPlan != nil { diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/scalingplans_client_example_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/scalingplans_client_example_test.go deleted file mode 100644 index 81141d2276b4..000000000000 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/scalingplans_client_example_test.go +++ /dev/null @@ -1,786 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armdesktopvirtualization_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlan_Get.json -func ExampleScalingPlansClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewScalingPlansClient().Get(ctx, "resourceGroup1", "scalingPlan1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ScalingPlan = armdesktopvirtualization.ScalingPlan{ - // Name: to.Ptr("workspace1"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/scalingPlans"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/scalingPlans/scalingPlan1"), - // Location: to.Ptr("centralus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armdesktopvirtualization.ScalingPlanProperties{ - // Description: to.Ptr("Description of scaling plan"), - // ExclusionTag: to.Ptr("value"), - // FriendlyName: to.Ptr("Scaling Plan 1"), - // HostPoolReferences: []*armdesktopvirtualization.ScalingHostPoolReference{ - // { - // HostPoolArmPath: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1"), - // ScalingPlanEnabled: to.Ptr(true), - // }}, - // HostPoolType: to.Ptr(armdesktopvirtualization.ScalingHostPoolTypePooled), - // ObjectID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // Schedules: []*armdesktopvirtualization.ScalingSchedule{ - // { - // Name: to.Ptr("schedule1"), - // DaysOfWeek: []*armdesktopvirtualization.ScalingScheduleDaysOfWeekItem{ - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemMonday), - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemTuesday), - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemWednesday), - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemThursday), - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemFriday)}, - // OffPeakLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // OffPeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](20), - // Minute: to.Ptr[int32](0), - // }, - // PeakLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmBreadthFirst), - // PeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](8), - // Minute: to.Ptr[int32](0), - // }, - // RampDownCapacityThresholdPct: to.Ptr[int32](50), - // RampDownForceLogoffUsers: to.Ptr(true), - // RampDownLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // RampDownMinimumHostsPct: to.Ptr[int32](20), - // RampDownNotificationMessage: to.Ptr("message"), - // RampDownStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](18), - // Minute: to.Ptr[int32](0), - // }, - // RampDownWaitTimeMinutes: to.Ptr[int32](30), - // RampUpCapacityThresholdPct: to.Ptr[int32](80), - // RampUpLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // RampUpMinimumHostsPct: to.Ptr[int32](20), - // RampUpStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](6), - // Minute: to.Ptr[int32](0), - // }, - // }}, - // TimeZone: to.Ptr("Central Standard Time"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlan_Create.json -func ExampleScalingPlansClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewScalingPlansClient().Create(ctx, "resourceGroup1", "scalingPlan1", armdesktopvirtualization.ScalingPlan{ - Location: to.Ptr("centralus"), - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - Properties: &armdesktopvirtualization.ScalingPlanProperties{ - Description: to.Ptr("Description of Scaling Plan"), - ExclusionTag: to.Ptr("value"), - FriendlyName: to.Ptr("Scaling Plan 1"), - HostPoolReferences: []*armdesktopvirtualization.ScalingHostPoolReference{ - { - HostPoolArmPath: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1"), - ScalingPlanEnabled: to.Ptr(true), - }}, - HostPoolType: to.Ptr(armdesktopvirtualization.ScalingHostPoolTypePooled), - Schedules: []*armdesktopvirtualization.ScalingSchedule{ - { - Name: to.Ptr("schedule1"), - DaysOfWeek: []*armdesktopvirtualization.ScalingScheduleDaysOfWeekItem{ - to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemMonday), - to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemTuesday), - to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemWednesday), - to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemThursday), - to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemFriday)}, - OffPeakLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - OffPeakStartTime: &armdesktopvirtualization.Time{ - Hour: to.Ptr[int32](20), - Minute: to.Ptr[int32](0), - }, - PeakLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmBreadthFirst), - PeakStartTime: &armdesktopvirtualization.Time{ - Hour: to.Ptr[int32](8), - Minute: to.Ptr[int32](0), - }, - RampDownCapacityThresholdPct: to.Ptr[int32](50), - RampDownForceLogoffUsers: to.Ptr(true), - RampDownLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - RampDownMinimumHostsPct: to.Ptr[int32](20), - RampDownNotificationMessage: to.Ptr("message"), - RampDownStartTime: &armdesktopvirtualization.Time{ - Hour: to.Ptr[int32](18), - Minute: to.Ptr[int32](0), - }, - RampDownWaitTimeMinutes: to.Ptr[int32](30), - RampUpCapacityThresholdPct: to.Ptr[int32](80), - RampUpLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - RampUpMinimumHostsPct: to.Ptr[int32](20), - RampUpStartTime: &armdesktopvirtualization.Time{ - Hour: to.Ptr[int32](6), - Minute: to.Ptr[int32](0), - }, - }}, - TimeZone: to.Ptr("Central Standard Time"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ScalingPlan = armdesktopvirtualization.ScalingPlan{ - // Name: to.Ptr("scalingPlan1"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/scalingPlans"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/scalingPlans/scalingPlan1"), - // Location: to.Ptr("centralus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armdesktopvirtualization.ScalingPlanProperties{ - // Description: to.Ptr("Description of Scaling Plan"), - // ExclusionTag: to.Ptr("value"), - // FriendlyName: to.Ptr("Scaling Plan 1"), - // HostPoolReferences: []*armdesktopvirtualization.ScalingHostPoolReference{ - // { - // HostPoolArmPath: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1"), - // ScalingPlanEnabled: to.Ptr(true), - // }}, - // HostPoolType: to.Ptr(armdesktopvirtualization.ScalingHostPoolTypePooled), - // ObjectID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // Schedules: []*armdesktopvirtualization.ScalingSchedule{ - // { - // Name: to.Ptr("schedule1"), - // DaysOfWeek: []*armdesktopvirtualization.ScalingScheduleDaysOfWeekItem{ - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemMonday), - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemTuesday), - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemWednesday), - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemThursday), - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemFriday)}, - // OffPeakLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // OffPeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](20), - // Minute: to.Ptr[int32](0), - // }, - // PeakLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmBreadthFirst), - // PeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](8), - // Minute: to.Ptr[int32](0), - // }, - // RampDownCapacityThresholdPct: to.Ptr[int32](50), - // RampDownForceLogoffUsers: to.Ptr(true), - // RampDownLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // RampDownMinimumHostsPct: to.Ptr[int32](20), - // RampDownNotificationMessage: to.Ptr("message"), - // RampDownStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](18), - // Minute: to.Ptr[int32](0), - // }, - // RampDownWaitTimeMinutes: to.Ptr[int32](30), - // RampUpCapacityThresholdPct: to.Ptr[int32](80), - // RampUpLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // RampUpMinimumHostsPct: to.Ptr[int32](20), - // RampUpStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](6), - // Minute: to.Ptr[int32](0), - // }, - // }}, - // TimeZone: to.Ptr("Central Standard Time"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlan_Delete.json -func ExampleScalingPlansClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewScalingPlansClient().Delete(ctx, "resourceGroup1", "scalingPlan1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlan_Update.json -func ExampleScalingPlansClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewScalingPlansClient().Update(ctx, "resourceGroup1", "scalingPlan1", &armdesktopvirtualization.ScalingPlansClientUpdateOptions{ScalingPlan: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ScalingPlan = armdesktopvirtualization.ScalingPlan{ - // Name: to.Ptr("scalingPlan1"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/scalingPlans"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/scalingPlans/scalingPlan1"), - // Location: to.Ptr("centralus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armdesktopvirtualization.ScalingPlanProperties{ - // Description: to.Ptr("Description of Scaling Plan"), - // ExclusionTag: to.Ptr("value"), - // FriendlyName: to.Ptr("Scaling Plan 1"), - // HostPoolReferences: []*armdesktopvirtualization.ScalingHostPoolReference{ - // { - // HostPoolArmPath: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1"), - // ScalingPlanEnabled: to.Ptr(true), - // }}, - // HostPoolType: to.Ptr(armdesktopvirtualization.ScalingHostPoolTypePooled), - // ObjectID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // Schedules: []*armdesktopvirtualization.ScalingSchedule{ - // { - // Name: to.Ptr("schedule1"), - // DaysOfWeek: []*armdesktopvirtualization.ScalingScheduleDaysOfWeekItem{ - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemMonday), - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemTuesday), - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemWednesday), - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemThursday), - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemFriday)}, - // OffPeakLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // OffPeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](20), - // Minute: to.Ptr[int32](0), - // }, - // PeakLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmBreadthFirst), - // PeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](8), - // Minute: to.Ptr[int32](0), - // }, - // RampDownCapacityThresholdPct: to.Ptr[int32](50), - // RampDownForceLogoffUsers: to.Ptr(true), - // RampDownLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // RampDownMinimumHostsPct: to.Ptr[int32](20), - // RampDownNotificationMessage: to.Ptr("message"), - // RampDownStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](18), - // Minute: to.Ptr[int32](0), - // }, - // RampDownWaitTimeMinutes: to.Ptr[int32](30), - // RampUpCapacityThresholdPct: to.Ptr[int32](80), - // RampUpLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // RampUpMinimumHostsPct: to.Ptr[int32](20), - // RampUpStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](6), - // Minute: to.Ptr[int32](0), - // }, - // }}, - // TimeZone: to.Ptr("Central Standard Time"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlan_ListByResourceGroup.json -func ExampleScalingPlansClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewScalingPlansClient().NewListByResourceGroupPager("resourceGroup1", &armdesktopvirtualization.ScalingPlansClientListByResourceGroupOptions{PageSize: to.Ptr[int32](10), - IsDescending: to.Ptr(true), - InitialSkip: to.Ptr[int32](0), - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ScalingPlanList = armdesktopvirtualization.ScalingPlanList{ - // Value: []*armdesktopvirtualization.ScalingPlan{ - // { - // Name: to.Ptr("scalingPlan1"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/scalingPlans"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/scalingPlans/scalingPlan1"), - // Location: to.Ptr("centralus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armdesktopvirtualization.ScalingPlanProperties{ - // Description: to.Ptr("Description of Scaling Plan"), - // ExclusionTag: to.Ptr("value"), - // FriendlyName: to.Ptr("Scaling Plan 1"), - // HostPoolReferences: []*armdesktopvirtualization.ScalingHostPoolReference{ - // { - // HostPoolArmPath: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1"), - // ScalingPlanEnabled: to.Ptr(true), - // }}, - // HostPoolType: to.Ptr(armdesktopvirtualization.ScalingHostPoolTypePooled), - // ObjectID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // Schedules: []*armdesktopvirtualization.ScalingSchedule{ - // { - // Name: to.Ptr("schedule1"), - // DaysOfWeek: []*armdesktopvirtualization.ScalingScheduleDaysOfWeekItem{ - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemMonday), - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemTuesday), - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemWednesday), - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemThursday), - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemFriday)}, - // OffPeakLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // OffPeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](20), - // Minute: to.Ptr[int32](0), - // }, - // PeakLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmBreadthFirst), - // PeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](8), - // Minute: to.Ptr[int32](0), - // }, - // RampDownCapacityThresholdPct: to.Ptr[int32](50), - // RampDownForceLogoffUsers: to.Ptr(true), - // RampDownLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // RampDownMinimumHostsPct: to.Ptr[int32](20), - // RampDownNotificationMessage: to.Ptr("message"), - // RampDownStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](18), - // Minute: to.Ptr[int32](0), - // }, - // RampDownWaitTimeMinutes: to.Ptr[int32](30), - // RampUpCapacityThresholdPct: to.Ptr[int32](80), - // RampUpLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // RampUpMinimumHostsPct: to.Ptr[int32](20), - // RampUpStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](6), - // Minute: to.Ptr[int32](0), - // }, - // }}, - // TimeZone: to.Ptr("Central Standard Time"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }, - // { - // Name: to.Ptr("scalingPlan2"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/scalingPlans"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/scalingPlans/scalingPlan2"), - // Location: to.Ptr("centralus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armdesktopvirtualization.ScalingPlanProperties{ - // Description: to.Ptr("Description of Scaling Plan"), - // ExclusionTag: to.Ptr("value"), - // FriendlyName: to.Ptr("Scaling Plan 1"), - // HostPoolReferences: []*armdesktopvirtualization.ScalingHostPoolReference{ - // { - // HostPoolArmPath: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1"), - // ScalingPlanEnabled: to.Ptr(true), - // }}, - // HostPoolType: to.Ptr(armdesktopvirtualization.ScalingHostPoolTypePooled), - // ObjectID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // Schedules: []*armdesktopvirtualization.ScalingSchedule{ - // { - // Name: to.Ptr("schedule1"), - // DaysOfWeek: []*armdesktopvirtualization.ScalingScheduleDaysOfWeekItem{ - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemMonday), - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemTuesday), - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemWednesday), - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemThursday), - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemFriday)}, - // OffPeakLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // OffPeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](20), - // Minute: to.Ptr[int32](0), - // }, - // PeakLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmBreadthFirst), - // PeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](8), - // Minute: to.Ptr[int32](0), - // }, - // RampDownCapacityThresholdPct: to.Ptr[int32](50), - // RampDownForceLogoffUsers: to.Ptr(false), - // RampDownLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // RampDownMinimumHostsPct: to.Ptr[int32](20), - // RampDownStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](18), - // Minute: to.Ptr[int32](0), - // }, - // RampDownStopHostsWhen: to.Ptr(armdesktopvirtualization.StopHostsWhenZeroSessions), - // RampUpCapacityThresholdPct: to.Ptr[int32](80), - // RampUpLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // RampUpMinimumHostsPct: to.Ptr[int32](20), - // RampUpStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](6), - // Minute: to.Ptr[int32](0), - // }, - // }}, - // TimeZone: to.Ptr("Central Standard Time"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlan_ListBySubscription.json -func ExampleScalingPlansClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewScalingPlansClient().NewListBySubscriptionPager(&armdesktopvirtualization.ScalingPlansClientListBySubscriptionOptions{PageSize: to.Ptr[int32](10), - IsDescending: to.Ptr(true), - InitialSkip: to.Ptr[int32](0), - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ScalingPlanList = armdesktopvirtualization.ScalingPlanList{ - // Value: []*armdesktopvirtualization.ScalingPlan{ - // { - // Name: to.Ptr("scalingPlan1"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/scalingPlans"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/scalingPlans/scalingPlan1"), - // Location: to.Ptr("centralus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armdesktopvirtualization.ScalingPlanProperties{ - // Description: to.Ptr("Description of Scaling Plan"), - // ExclusionTag: to.Ptr("value"), - // FriendlyName: to.Ptr("Scaling Plan 1"), - // HostPoolReferences: []*armdesktopvirtualization.ScalingHostPoolReference{ - // { - // HostPoolArmPath: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1"), - // ScalingPlanEnabled: to.Ptr(true), - // }}, - // HostPoolType: to.Ptr(armdesktopvirtualization.ScalingHostPoolTypePooled), - // ObjectID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // Schedules: []*armdesktopvirtualization.ScalingSchedule{ - // { - // Name: to.Ptr("schedule1"), - // DaysOfWeek: []*armdesktopvirtualization.ScalingScheduleDaysOfWeekItem{ - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemMonday), - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemTuesday), - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemWednesday), - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemThursday), - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemFriday)}, - // OffPeakLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // OffPeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](20), - // Minute: to.Ptr[int32](0), - // }, - // PeakLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmBreadthFirst), - // PeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](8), - // Minute: to.Ptr[int32](0), - // }, - // RampDownCapacityThresholdPct: to.Ptr[int32](50), - // RampDownForceLogoffUsers: to.Ptr(true), - // RampDownLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // RampDownMinimumHostsPct: to.Ptr[int32](20), - // RampDownNotificationMessage: to.Ptr("message"), - // RampDownStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](18), - // Minute: to.Ptr[int32](0), - // }, - // RampDownWaitTimeMinutes: to.Ptr[int32](30), - // RampUpCapacityThresholdPct: to.Ptr[int32](80), - // RampUpLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // RampUpMinimumHostsPct: to.Ptr[int32](20), - // RampUpStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](6), - // Minute: to.Ptr[int32](0), - // }, - // }}, - // TimeZone: to.Ptr("Central Standard Time"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }, - // { - // Name: to.Ptr("scalingPlan2"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/scalingPlans"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/scalingPlans/scalingPlan2"), - // Location: to.Ptr("centralus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armdesktopvirtualization.ScalingPlanProperties{ - // Description: to.Ptr("Description of Scaling Plan"), - // ExclusionTag: to.Ptr("value"), - // FriendlyName: to.Ptr("Scaling Plan 1"), - // HostPoolReferences: []*armdesktopvirtualization.ScalingHostPoolReference{ - // { - // HostPoolArmPath: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1"), - // ScalingPlanEnabled: to.Ptr(true), - // }}, - // HostPoolType: to.Ptr(armdesktopvirtualization.ScalingHostPoolTypePooled), - // ObjectID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // Schedules: []*armdesktopvirtualization.ScalingSchedule{ - // { - // Name: to.Ptr("schedule1"), - // DaysOfWeek: []*armdesktopvirtualization.ScalingScheduleDaysOfWeekItem{ - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemMonday), - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemTuesday), - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemWednesday), - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemThursday), - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemFriday)}, - // OffPeakLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // OffPeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](20), - // Minute: to.Ptr[int32](0), - // }, - // PeakLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmBreadthFirst), - // PeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](8), - // Minute: to.Ptr[int32](0), - // }, - // RampDownCapacityThresholdPct: to.Ptr[int32](50), - // RampDownForceLogoffUsers: to.Ptr(false), - // RampDownLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // RampDownMinimumHostsPct: to.Ptr[int32](20), - // RampDownStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](18), - // Minute: to.Ptr[int32](0), - // }, - // RampDownStopHostsWhen: to.Ptr(armdesktopvirtualization.StopHostsWhenZeroActiveSessions), - // RampUpCapacityThresholdPct: to.Ptr[int32](80), - // RampUpLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // RampUpMinimumHostsPct: to.Ptr[int32](20), - // RampUpStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](6), - // Minute: to.Ptr[int32](0), - // }, - // }}, - // TimeZone: to.Ptr("Central Standard Time"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlan_ListByHostPool.json -func ExampleScalingPlansClient_NewListByHostPoolPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewScalingPlansClient().NewListByHostPoolPager("resourceGroup1", "hostPool1", &armdesktopvirtualization.ScalingPlansClientListByHostPoolOptions{PageSize: to.Ptr[int32](10), - IsDescending: to.Ptr(true), - InitialSkip: to.Ptr[int32](0), - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ScalingPlanList = armdesktopvirtualization.ScalingPlanList{ - // Value: []*armdesktopvirtualization.ScalingPlan{ - // { - // Name: to.Ptr("scalingPlan1"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/scalingPlans"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/scalingPlans/scalingPlan1"), - // Location: to.Ptr("centralus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armdesktopvirtualization.ScalingPlanProperties{ - // Description: to.Ptr("Description of Scaling Plan"), - // ExclusionTag: to.Ptr("value"), - // FriendlyName: to.Ptr("Scaling Plan 1"), - // HostPoolReferences: []*armdesktopvirtualization.ScalingHostPoolReference{ - // { - // HostPoolArmPath: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1"), - // ScalingPlanEnabled: to.Ptr(true), - // }}, - // HostPoolType: to.Ptr(armdesktopvirtualization.ScalingHostPoolTypePooled), - // ObjectID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // Schedules: []*armdesktopvirtualization.ScalingSchedule{ - // { - // Name: to.Ptr("schedule1"), - // DaysOfWeek: []*armdesktopvirtualization.ScalingScheduleDaysOfWeekItem{ - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemMonday), - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemTuesday), - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemWednesday), - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemThursday), - // to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemFriday)}, - // OffPeakLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // OffPeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](20), - // Minute: to.Ptr[int32](0), - // }, - // PeakLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmBreadthFirst), - // PeakStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](8), - // Minute: to.Ptr[int32](0), - // }, - // RampDownCapacityThresholdPct: to.Ptr[int32](50), - // RampDownForceLogoffUsers: to.Ptr(true), - // RampDownLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // RampDownMinimumHostsPct: to.Ptr[int32](20), - // RampDownNotificationMessage: to.Ptr("message"), - // RampDownStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](18), - // Minute: to.Ptr[int32](0), - // }, - // RampDownWaitTimeMinutes: to.Ptr[int32](30), - // RampUpCapacityThresholdPct: to.Ptr[int32](80), - // RampUpLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - // RampUpMinimumHostsPct: to.Ptr[int32](20), - // RampUpStartTime: &armdesktopvirtualization.Time{ - // Hour: to.Ptr[int32](6), - // Minute: to.Ptr[int32](0), - // }, - // }}, - // TimeZone: to.Ptr("Central Standard Time"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/sessionhosts_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/sessionhosts_client.go index 7292fc1a3ca2..5d8dc813dbc9 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/sessionhosts_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/sessionhosts_client.go @@ -29,7 +29,7 @@ type SessionHostsClient struct { } // NewSessionHostsClient creates a new instance of SessionHostsClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewSessionHostsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SessionHostsClient, error) { @@ -47,7 +47,7 @@ func NewSessionHostsClient(subscriptionID string, credential azcore.TokenCredent // Delete - Remove a SessionHost. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - hostPoolName - The name of the host pool within the specified resource group // - sessionHostName - The name of the session host within the specified host pool @@ -97,7 +97,7 @@ func (client *SessionHostsClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-03") if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } @@ -109,7 +109,7 @@ func (client *SessionHostsClient) deleteCreateRequest(ctx context.Context, resou // Get - Get a session host. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - hostPoolName - The name of the host pool within the specified resource group // - sessionHostName - The name of the session host within the specified host pool @@ -160,7 +160,7 @@ func (client *SessionHostsClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -177,7 +177,7 @@ func (client *SessionHostsClient) getHandleResponse(resp *http.Response) (Sessio // NewListPager - List sessionHosts. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - hostPoolName - The name of the host pool within the specified resource group // - options - SessionHostsClientListOptions contains the optional parameters for the SessionHostsClient.NewListPager method. @@ -224,15 +224,15 @@ func (client *SessionHostsClient) listCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") - if options != nil && options.PageSize != nil { - reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) + reqQP.Set("api-version", "2024-04-03") + if options != nil && options.InitialSkip != nil { + reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) } if options != nil && options.IsDescending != nil { reqQP.Set("isDescending", strconv.FormatBool(*options.IsDescending)) } - if options != nil && options.InitialSkip != nil { - reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) + if options != nil && options.PageSize != nil { + reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} @@ -251,7 +251,7 @@ func (client *SessionHostsClient) listHandleResponse(resp *http.Response) (Sessi // Update - Update a session host. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - hostPoolName - The name of the host pool within the specified resource group // - sessionHostName - The name of the session host within the specified host pool @@ -302,7 +302,7 @@ func (client *SessionHostsClient) updateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-03") if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/sessionhosts_client_example_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/sessionhosts_client_example_test.go deleted file mode 100644 index 175864f77c74..000000000000 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/sessionhosts_client_example_test.go +++ /dev/null @@ -1,279 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armdesktopvirtualization_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/SessionHost_Get.json -func ExampleSessionHostsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSessionHostsClient().Get(ctx, "resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SessionHost = armdesktopvirtualization.SessionHost{ - // Name: to.Ptr("sessionHost1.microsoft.com"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/hostPools/sessionHosts"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1/sessionHosts/sessionHost1.microsoft.com"), - // Properties: &armdesktopvirtualization.SessionHostProperties{ - // AgentVersion: to.Ptr("1.0.0.1391"), - // AllowNewSession: to.Ptr(true), - // AssignedUser: to.Ptr("user1@microsoft.com"), - // FriendlyName: to.Ptr("friendly"), - // LastHeartBeat: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2008-09-22T14:01:54.957Z"); return t}()), - // LastUpdateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2008-09-22T14:01:54.957Z"); return t}()), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // OSVersion: to.Ptr("10.0.17763"), - // ResourceID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.Compute/virtualMachines/sessionHost1"), - // SessionHostHealthCheckResults: []*armdesktopvirtualization.SessionHostHealthCheckReport{ - // { - // AdditionalFailureDetails: &armdesktopvirtualization.SessionHostHealthCheckFailureDetails{ - // ErrorCode: to.Ptr[int32](0), - // LastHealthCheckDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-14T02:09:37.623Z"); return t}()), - // Message: to.Ptr("SessionHost healthy: is joined to domain ≤wvdarmtest1.net≥"), - // }, - // HealthCheckName: to.Ptr(armdesktopvirtualization.HealthCheckNameDomainJoinedCheck), - // HealthCheckResult: to.Ptr(armdesktopvirtualization.HealthCheckResultHealthCheckSucceeded), - // }}, - // Sessions: to.Ptr[int32](1), - // Status: to.Ptr(armdesktopvirtualization.StatusAvailable), - // StatusTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2008-09-22T14:01:54.957Z"); return t}()), - // SxSStackVersion: to.Ptr("rdp-sxs190816002"), - // UpdateErrorMessage: to.Ptr(""), - // UpdateState: to.Ptr(armdesktopvirtualization.UpdateStateSucceeded), - // VirtualMachineID: to.Ptr("29491b54-c033-4dec-b09a-18bf0ebafaef"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/SessionHost_Delete.json -func ExampleSessionHostsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewSessionHostsClient().Delete(ctx, "resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", &armdesktopvirtualization.SessionHostsClientDeleteOptions{Force: to.Ptr(true)}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/SessionHost_Update.json -func ExampleSessionHostsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSessionHostsClient().Update(ctx, "resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", &armdesktopvirtualization.SessionHostsClientUpdateOptions{Force: to.Ptr(true), - SessionHost: &armdesktopvirtualization.SessionHostPatch{ - Properties: &armdesktopvirtualization.SessionHostPatchProperties{ - AllowNewSession: to.Ptr(true), - AssignedUser: to.Ptr("user1@microsoft.com"), - FriendlyName: to.Ptr("friendly"), - }, - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SessionHost = armdesktopvirtualization.SessionHost{ - // Name: to.Ptr("sessionHost1.microsoft.com"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/hostPools/sessionhosts"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1/sessionHosts/sessionHost1.microsoft.com"), - // Properties: &armdesktopvirtualization.SessionHostProperties{ - // AgentVersion: to.Ptr("1.0.0.1391"), - // AllowNewSession: to.Ptr(true), - // AssignedUser: to.Ptr("user1@microsoft.com"), - // FriendlyName: to.Ptr("friendly"), - // LastHeartBeat: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-01-11T19:27:13.610Z"); return t}()), - // LastUpdateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2008-09-22T14:01:54.957Z"); return t}()), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // OSVersion: to.Ptr("10.0.17763"), - // ResourceID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.Compute/virtualMachines/sessionHost1"), - // SessionHostHealthCheckResults: []*armdesktopvirtualization.SessionHostHealthCheckReport{ - // { - // AdditionalFailureDetails: &armdesktopvirtualization.SessionHostHealthCheckFailureDetails{ - // ErrorCode: to.Ptr[int32](0), - // LastHealthCheckDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-14T02:09:37.623Z"); return t}()), - // Message: to.Ptr("SessionHost healthy: is joined to domain ≤wvdarmtest1.net≥"), - // }, - // HealthCheckName: to.Ptr(armdesktopvirtualization.HealthCheckNameDomainJoinedCheck), - // HealthCheckResult: to.Ptr(armdesktopvirtualization.HealthCheckResultHealthCheckSucceeded), - // }}, - // Sessions: to.Ptr[int32](1), - // Status: to.Ptr(armdesktopvirtualization.StatusAvailable), - // StatusTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-01-24T20:00:08.289Z"); return t}()), - // SxSStackVersion: to.Ptr("rdp-sxs190816002"), - // UpdateErrorMessage: to.Ptr(""), - // UpdateState: to.Ptr(armdesktopvirtualization.UpdateStateSucceeded), - // VirtualMachineID: to.Ptr("29491b54-c033-4dec-b09a-18bf0ebafaef"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/SessionHost_List.json -func ExampleSessionHostsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSessionHostsClient().NewListPager("resourceGroup1", "hostPool1", &armdesktopvirtualization.SessionHostsClientListOptions{PageSize: to.Ptr[int32](10), - IsDescending: to.Ptr(true), - InitialSkip: to.Ptr[int32](0), - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SessionHostList = armdesktopvirtualization.SessionHostList{ - // Value: []*armdesktopvirtualization.SessionHost{ - // { - // Name: to.Ptr("sessionHost1.microsoft.com"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/hostPools/sessionhosts"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1/sessionHosts/sessionHost1.microsoft.com"), - // Properties: &armdesktopvirtualization.SessionHostProperties{ - // AgentVersion: to.Ptr("1.0.0.1391"), - // AllowNewSession: to.Ptr(true), - // AssignedUser: to.Ptr("user1@microsoft.com"), - // FriendlyName: to.Ptr("friendly"), - // LastHeartBeat: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2008-09-22T14:01:54.957Z"); return t}()), - // LastUpdateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2008-09-22T14:01:54.957Z"); return t}()), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // OSVersion: to.Ptr("10.0.17763"), - // ResourceID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.Compute/virtualMachines/sessionHost1"), - // SessionHostHealthCheckResults: []*armdesktopvirtualization.SessionHostHealthCheckReport{ - // { - // AdditionalFailureDetails: &armdesktopvirtualization.SessionHostHealthCheckFailureDetails{ - // ErrorCode: to.Ptr[int32](0), - // LastHealthCheckDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-14T02:09:37.623Z"); return t}()), - // Message: to.Ptr("SessionHost healthy: is joined to domain ≤wvdarmtest1.net≥"), - // }, - // HealthCheckName: to.Ptr(armdesktopvirtualization.HealthCheckNameDomainJoinedCheck), - // HealthCheckResult: to.Ptr(armdesktopvirtualization.HealthCheckResultHealthCheckSucceeded), - // }}, - // Sessions: to.Ptr[int32](1), - // Status: to.Ptr(armdesktopvirtualization.StatusAvailable), - // StatusTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2008-09-22T14:01:54.957Z"); return t}()), - // SxSStackVersion: to.Ptr("rdp-sxs190816002"), - // UpdateErrorMessage: to.Ptr(""), - // UpdateState: to.Ptr(armdesktopvirtualization.UpdateStateSucceeded), - // VirtualMachineID: to.Ptr("29491b54-c033-4dec-b09a-18bf0ebafaef"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }, - // { - // Name: to.Ptr("sessionHost2.microsoft.com"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/hostPools/sessionhosts"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1/sessionHosts/sessionHost2microsoft.com"), - // Properties: &armdesktopvirtualization.SessionHostProperties{ - // AgentVersion: to.Ptr("1.0.0.1391"), - // AllowNewSession: to.Ptr(true), - // AssignedUser: to.Ptr("user2@microsoft.com"), - // FriendlyName: to.Ptr("friendly"), - // LastHeartBeat: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2008-09-22T14:01:54.957Z"); return t}()), - // LastUpdateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2008-09-22T14:01:54.957Z"); return t}()), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // OSVersion: to.Ptr("10.0.17763"), - // ResourceID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.Compute/virtualMachines/sessionHost2"), - // SessionHostHealthCheckResults: []*armdesktopvirtualization.SessionHostHealthCheckReport{ - // { - // AdditionalFailureDetails: &armdesktopvirtualization.SessionHostHealthCheckFailureDetails{ - // ErrorCode: to.Ptr[int32](0), - // LastHealthCheckDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-14T02:09:37.623Z"); return t}()), - // Message: to.Ptr("SessionHost healthy: is joined to domain ≤wvdarmtest1.net≥"), - // }, - // HealthCheckName: to.Ptr(armdesktopvirtualization.HealthCheckNameDomainJoinedCheck), - // HealthCheckResult: to.Ptr(armdesktopvirtualization.HealthCheckResultHealthCheckSucceeded), - // }}, - // Sessions: to.Ptr[int32](1), - // Status: to.Ptr(armdesktopvirtualization.StatusAvailable), - // StatusTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2008-09-22T14:01:54.957Z"); return t}()), - // SxSStackVersion: to.Ptr("rdp-sxs190816002"), - // UpdateErrorMessage: to.Ptr(""), - // UpdateState: to.Ptr(armdesktopvirtualization.UpdateStateSucceeded), - // VirtualMachineID: to.Ptr("39491b54-c033-4dec-b09a-18bf0ebafaef"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/startmenuitems_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/startmenuitems_client.go index ecb34a1edb78..25dafcf22916 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/startmenuitems_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/startmenuitems_client.go @@ -29,7 +29,7 @@ type StartMenuItemsClient struct { } // NewStartMenuItemsClient creates a new instance of StartMenuItemsClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewStartMenuItemsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*StartMenuItemsClient, error) { @@ -46,7 +46,7 @@ func NewStartMenuItemsClient(subscriptionID string, credential azcore.TokenCrede // NewListPager - List start menu items in the given application group. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - applicationGroupName - The name of the application group // - options - StartMenuItemsClientListOptions contains the optional parameters for the StartMenuItemsClient.NewListPager method. @@ -93,15 +93,15 @@ func (client *StartMenuItemsClient) listCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") - if options != nil && options.PageSize != nil { - reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) + reqQP.Set("api-version", "2024-04-03") + if options != nil && options.InitialSkip != nil { + reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) } if options != nil && options.IsDescending != nil { reqQP.Set("isDescending", strconv.FormatBool(*options.IsDescending)) } - if options != nil && options.InitialSkip != nil { - reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) + if options != nil && options.PageSize != nil { + reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/startmenuitems_client_example_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/startmenuitems_client_example_test.go deleted file mode 100644 index fbb394a94ca4..000000000000 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/startmenuitems_client_example_test.go +++ /dev/null @@ -1,73 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armdesktopvirtualization_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/StartMenuItem_List.json -func ExampleStartMenuItemsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewStartMenuItemsClient().NewListPager("resourceGroup1", "applicationGroup1", &armdesktopvirtualization.StartMenuItemsClientListOptions{PageSize: nil, - IsDescending: nil, - InitialSkip: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.StartMenuItemList = armdesktopvirtualization.StartMenuItemList{ - // Value: []*armdesktopvirtualization.StartMenuItem{ - // { - // Name: to.Ptr("application1"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/applicationGroups/startMenuItems"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/applicationGroups/applicationGroup1/startMenuItem/application1"), - // Properties: &armdesktopvirtualization.StartMenuItemProperties{ - // AppAlias: to.Ptr("word"), - // CommandLineArguments: to.Ptr("arguments"), - // FilePath: to.Ptr("/path/to/file"), - // IconIndex: to.Ptr[int32](1), - // IconPath: to.Ptr("/path/to/icon"), - // }, - // }, - // { - // Name: to.Ptr("application2"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/applicationGroups/startMenuItems"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/applicationGroups/applicationGroup1/startMenuItem/application2"), - // Properties: &armdesktopvirtualization.StartMenuItemProperties{ - // AppAlias: to.Ptr("excel"), - // CommandLineArguments: to.Ptr("arguments"), - // FilePath: to.Ptr("/path/to/file"), - // IconIndex: to.Ptr[int32](1), - // IconPath: to.Ptr("/path/to/icon"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/time_rfc3339.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/time_rfc3339.go index 3eaa4672ec4a..20977df2306f 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/time_rfc3339.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/time_rfc3339.go @@ -19,12 +19,16 @@ import ( ) // Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. -var tzOffsetRegex = regexp.MustCompile(`(Z|z|\+|-)(\d+:\d+)*"*$`) +var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`) const ( - utcDateTimeJSON = `"2006-01-02T15:04:05.999999999"` - utcDateTime = "2006-01-02T15:04:05.999999999" - dateTimeJSON = `"` + time.RFC3339Nano + `"` + utcDateTime = "2006-01-02T15:04:05.999999999" + utcDateTimeJSON = `"` + utcDateTime + `"` + utcDateTimeNoT = "2006-01-02 15:04:05.999999999" + utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"` + dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00` + dateTimeJSON = `"` + time.RFC3339Nano + `"` + dateTimeJSONNoT = `"` + dateTimeNoT + `"` ) type dateTimeRFC3339 time.Time @@ -40,17 +44,33 @@ func (t dateTimeRFC3339) MarshalText() ([]byte, error) { } func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { - layout := utcDateTimeJSON - if tzOffsetRegex.Match(data) { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { layout = dateTimeJSON + } else if tzOffset { + layout = dateTimeJSONNoT + } else if hasT { + layout = utcDateTimeJSON + } else { + layout = utcDateTimeJSONNoT } return t.Parse(layout, string(data)) } func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { - layout := utcDateTime - if tzOffsetRegex.Match(data) { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { layout = time.RFC3339Nano + } else if tzOffset { + layout = dateTimeNoT + } else if hasT { + layout = utcDateTime + } else { + layout = utcDateTimeNoT } return t.Parse(layout, string(data)) } @@ -61,6 +81,10 @@ func (t *dateTimeRFC3339) Parse(layout, value string) error { return err } +func (t dateTimeRFC3339) String() string { + return time.Time(t).Format(time.RFC3339Nano) +} + func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { if t == nil { return @@ -74,7 +98,7 @@ func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { } func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || strings.EqualFold(string(data), "null") { + if data == nil || string(data) == "null" { return nil } var aux dateTimeRFC3339 diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/usersessions_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/usersessions_client.go index 4f59aca0963b..ea0966cf3c07 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/usersessions_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/usersessions_client.go @@ -29,7 +29,7 @@ type UserSessionsClient struct { } // NewUserSessionsClient creates a new instance of UserSessionsClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewUserSessionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*UserSessionsClient, error) { @@ -47,7 +47,7 @@ func NewUserSessionsClient(subscriptionID string, credential azcore.TokenCredent // Delete - Remove a userSession. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - hostPoolName - The name of the host pool within the specified resource group // - sessionHostName - The name of the session host within the specified host pool @@ -102,7 +102,7 @@ func (client *UserSessionsClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-03") if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } @@ -114,7 +114,7 @@ func (client *UserSessionsClient) deleteCreateRequest(ctx context.Context, resou // Disconnect - Disconnect a userSession. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - hostPoolName - The name of the host pool within the specified resource group // - sessionHostName - The name of the session host within the specified host pool @@ -169,7 +169,7 @@ func (client *UserSessionsClient) disconnectCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -178,7 +178,7 @@ func (client *UserSessionsClient) disconnectCreateRequest(ctx context.Context, r // Get - Get a userSession. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - hostPoolName - The name of the host pool within the specified resource group // - sessionHostName - The name of the session host within the specified host pool @@ -234,7 +234,7 @@ func (client *UserSessionsClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -251,7 +251,7 @@ func (client *UserSessionsClient) getHandleResponse(resp *http.Response) (UserSe // NewListPager - List userSessions. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - hostPoolName - The name of the host pool within the specified resource group // - sessionHostName - The name of the session host within the specified host pool @@ -303,15 +303,15 @@ func (client *UserSessionsClient) listCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") - if options != nil && options.PageSize != nil { - reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) + reqQP.Set("api-version", "2024-04-03") + if options != nil && options.InitialSkip != nil { + reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) } if options != nil && options.IsDescending != nil { reqQP.Set("isDescending", strconv.FormatBool(*options.IsDescending)) } - if options != nil && options.InitialSkip != nil { - reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) + if options != nil && options.PageSize != nil { + reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} @@ -329,7 +329,7 @@ func (client *UserSessionsClient) listHandleResponse(resp *http.Response) (UserS // NewListByHostPoolPager - List userSessions. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - hostPoolName - The name of the host pool within the specified resource group // - options - UserSessionsClientListByHostPoolOptions contains the optional parameters for the UserSessionsClient.NewListByHostPoolPager @@ -377,18 +377,18 @@ func (client *UserSessionsClient) listByHostPoolCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - if options != nil && options.PageSize != nil { - reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) + reqQP.Set("api-version", "2024-04-03") + if options != nil && options.InitialSkip != nil { + reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) } if options != nil && options.IsDescending != nil { reqQP.Set("isDescending", strconv.FormatBool(*options.IsDescending)) } - if options != nil && options.InitialSkip != nil { - reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) + if options != nil && options.PageSize != nil { + reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} @@ -407,7 +407,7 @@ func (client *UserSessionsClient) listByHostPoolHandleResponse(resp *http.Respon // SendMessage - Send a message to a user. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - hostPoolName - The name of the host pool within the specified resource group // - sessionHostName - The name of the session host within the specified host pool @@ -463,7 +463,7 @@ func (client *UserSessionsClient) sendMessageCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.SendMessage != nil { diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/usersessions_client_example_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/usersessions_client_example_test.go deleted file mode 100644 index e74dbbfec3d0..000000000000 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/usersessions_client_example_test.go +++ /dev/null @@ -1,262 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armdesktopvirtualization_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/UserSession_ListByHostPool.json -func ExampleUserSessionsClient_NewListByHostPoolPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewUserSessionsClient().NewListByHostPoolPager("resourceGroup1", "hostPool1", &armdesktopvirtualization.UserSessionsClientListByHostPoolOptions{Filter: to.Ptr("userPrincipalName eq 'user1@microsoft.com' and state eq 'active'"), - PageSize: to.Ptr[int32](10), - IsDescending: to.Ptr(true), - InitialSkip: to.Ptr[int32](0), - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.UserSessionList = armdesktopvirtualization.UserSessionList{ - // Value: []*armdesktopvirtualization.UserSession{ - // { - // Name: to.Ptr("1"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/hostPools/sessionHosts/userSessions"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1/sessionHosts/sessionHost1.microsoft.com/userSessions/1"), - // Properties: &armdesktopvirtualization.UserSessionProperties{ - // ActiveDirectoryUserName: to.Ptr("WVDARM\\user1"), - // ApplicationType: to.Ptr(armdesktopvirtualization.ApplicationTypeDesktop), - // CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2008-09-22T14:01:54.957Z"); return t}()), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // SessionState: to.Ptr(armdesktopvirtualization.SessionStateActive), - // UserPrincipalName: to.Ptr("user1@microsoft.com"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }, - // { - // Name: to.Ptr("2"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/hostPools/sessionHosts/userSessions"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1/sessionHosts/sessionHost1.microsoft.com/userSessions/2"), - // Properties: &armdesktopvirtualization.UserSessionProperties{ - // ActiveDirectoryUserName: to.Ptr("WVDARM\\user1"), - // ApplicationType: to.Ptr(armdesktopvirtualization.ApplicationTypeDesktop), - // CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2008-09-22T14:01:54.957Z"); return t}()), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // SessionState: to.Ptr(armdesktopvirtualization.SessionStateActive), - // UserPrincipalName: to.Ptr("user1@microsoft.com"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/UserSession_Get.json -func ExampleUserSessionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewUserSessionsClient().Get(ctx, "resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", "1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.UserSession = armdesktopvirtualization.UserSession{ - // Name: to.Ptr("1"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/hostPools/sessionHosts/userSessions"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1/sessionHosts/sessionHost1.microsoft.com/userSessions/1"), - // Properties: &armdesktopvirtualization.UserSessionProperties{ - // ActiveDirectoryUserName: to.Ptr("WVDARM\\user1"), - // ApplicationType: to.Ptr(armdesktopvirtualization.ApplicationTypeDesktop), - // CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2008-09-22T14:01:54.957Z"); return t}()), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // SessionState: to.Ptr(armdesktopvirtualization.SessionStateActive), - // UserPrincipalName: to.Ptr("user1@microsoft.com"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/UserSession_Delete.json -func ExampleUserSessionsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewUserSessionsClient().Delete(ctx, "resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", "1", &armdesktopvirtualization.UserSessionsClientDeleteOptions{Force: to.Ptr(true)}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/UserSession_List.json -func ExampleUserSessionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewUserSessionsClient().NewListPager("resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", &armdesktopvirtualization.UserSessionsClientListOptions{PageSize: to.Ptr[int32](10), - IsDescending: to.Ptr(true), - InitialSkip: to.Ptr[int32](0), - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.UserSessionList = armdesktopvirtualization.UserSessionList{ - // Value: []*armdesktopvirtualization.UserSession{ - // { - // Name: to.Ptr("1"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/hostPools/sessionHosts/userSessions"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1/sessionHosts/sessionHost1.microsoft.com/userSessions/1"), - // Properties: &armdesktopvirtualization.UserSessionProperties{ - // ActiveDirectoryUserName: to.Ptr("WVDARM\\user1"), - // ApplicationType: to.Ptr(armdesktopvirtualization.ApplicationTypeDesktop), - // CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2008-09-22T14:01:54.957Z"); return t}()), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // SessionState: to.Ptr(armdesktopvirtualization.SessionStateActive), - // UserPrincipalName: to.Ptr("user1@microsoft.com"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }, - // { - // Name: to.Ptr("2"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/hostPools/sessionHosts/userSessions"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1/sessionHosts/sessionHost1.microsoft.com/userSessions/2"), - // Properties: &armdesktopvirtualization.UserSessionProperties{ - // ActiveDirectoryUserName: to.Ptr("WVDARM\\user1"), - // ApplicationType: to.Ptr(armdesktopvirtualization.ApplicationTypeDesktop), - // CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2008-09-22T14:01:54.957Z"); return t}()), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // SessionState: to.Ptr(armdesktopvirtualization.SessionStateActive), - // UserPrincipalName: to.Ptr("user1@microsoft.com"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/UserSession_Disconnect_Post.json -func ExampleUserSessionsClient_Disconnect() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewUserSessionsClient().Disconnect(ctx, "resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", "1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/UserSession_SendMessage_Post.json -func ExampleUserSessionsClient_SendMessage() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewUserSessionsClient().SendMessage(ctx, "resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", "1", &armdesktopvirtualization.UserSessionsClientSendMessageOptions{SendMessage: &armdesktopvirtualization.SendMessage{ - MessageBody: to.Ptr("body"), - MessageTitle: to.Ptr("title"), - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/workspaces_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/workspaces_client.go index 5566650d99d3..b42ebc4c4544 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/workspaces_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/workspaces_client.go @@ -29,7 +29,7 @@ type WorkspacesClient struct { } // NewWorkspacesClient creates a new instance of WorkspacesClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewWorkspacesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*WorkspacesClient, error) { @@ -47,7 +47,7 @@ func NewWorkspacesClient(subscriptionID string, credential azcore.TokenCredentia // CreateOrUpdate - Create or update a workspace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - The name of the workspace // - workspace - Object containing Workspace definitions. @@ -95,7 +95,7 @@ func (client *WorkspacesClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, workspace); err != nil { @@ -116,7 +116,7 @@ func (client *WorkspacesClient) createOrUpdateHandleResponse(resp *http.Response // Delete - Remove a workspace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - The name of the workspace // - options - WorkspacesClientDeleteOptions contains the optional parameters for the WorkspacesClient.Delete method. @@ -161,7 +161,7 @@ func (client *WorkspacesClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -170,7 +170,7 @@ func (client *WorkspacesClient) deleteCreateRequest(ctx context.Context, resourc // Get - Get a workspace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - The name of the workspace // - options - WorkspacesClientGetOptions contains the optional parameters for the WorkspacesClient.Get method. @@ -216,7 +216,7 @@ func (client *WorkspacesClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -233,7 +233,7 @@ func (client *WorkspacesClient) getHandleResponse(resp *http.Response) (Workspac // NewListByResourceGroupPager - List workspaces. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - WorkspacesClientListByResourceGroupOptions contains the optional parameters for the WorkspacesClient.NewListByResourceGroupPager // method. @@ -276,15 +276,15 @@ func (client *WorkspacesClient) listByResourceGroupCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") - if options != nil && options.PageSize != nil { - reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) + reqQP.Set("api-version", "2024-04-03") + if options != nil && options.InitialSkip != nil { + reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) } if options != nil && options.IsDescending != nil { reqQP.Set("isDescending", strconv.FormatBool(*options.IsDescending)) } - if options != nil && options.InitialSkip != nil { - reqQP.Set("initialSkip", strconv.FormatInt(int64(*options.InitialSkip), 10)) + if options != nil && options.PageSize != nil { + reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} @@ -302,7 +302,7 @@ func (client *WorkspacesClient) listByResourceGroupHandleResponse(resp *http.Res // NewListBySubscriptionPager - List workspaces in subscription. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - options - WorkspacesClientListBySubscriptionOptions contains the optional parameters for the WorkspacesClient.NewListBySubscriptionPager // method. func (client *WorkspacesClient) NewListBySubscriptionPager(options *WorkspacesClientListBySubscriptionOptions) *runtime.Pager[WorkspacesClientListBySubscriptionResponse] { @@ -340,7 +340,7 @@ func (client *WorkspacesClient) listBySubscriptionCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -358,7 +358,7 @@ func (client *WorkspacesClient) listBySubscriptionHandleResponse(resp *http.Resp // Update - Update a workspace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-05 +// Generated from API version 2024-04-03 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - The name of the workspace // - options - WorkspacesClientUpdateOptions contains the optional parameters for the WorkspacesClient.Update method. @@ -404,7 +404,7 @@ func (client *WorkspacesClient) updateCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-05") + reqQP.Set("api-version", "2024-04-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Workspace != nil { diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/workspaces_client_example_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/workspaces_client_example_test.go deleted file mode 100644 index 8de508b51204..000000000000 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/workspaces_client_example_test.go +++ /dev/null @@ -1,343 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armdesktopvirtualization_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Workspace_Get.json -func ExampleWorkspacesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewWorkspacesClient().Get(ctx, "resourceGroup1", "workspace1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Workspace = armdesktopvirtualization.Workspace{ - // Name: to.Ptr("workspace1"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/workspaces"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/workspaces/workspace1"), - // Location: to.Ptr("centralus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armdesktopvirtualization.WorkspaceProperties{ - // Description: to.Ptr("des1"), - // CloudPcResource: to.Ptr(false), - // FriendlyName: to.Ptr("friendly"), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Workspace_Create.json -func ExampleWorkspacesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewWorkspacesClient().CreateOrUpdate(ctx, "resourceGroup1", "workspace1", armdesktopvirtualization.Workspace{ - Location: to.Ptr("centralus"), - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - Properties: &armdesktopvirtualization.WorkspaceProperties{ - Description: to.Ptr("des1"), - FriendlyName: to.Ptr("friendly"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Workspace = armdesktopvirtualization.Workspace{ - // Name: to.Ptr("workspace1"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/workspaces"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/workspaces/workspace1"), - // Location: to.Ptr("centralus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armdesktopvirtualization.WorkspaceProperties{ - // Description: to.Ptr("des1"), - // CloudPcResource: to.Ptr(false), - // FriendlyName: to.Ptr("friendly"), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Workspace_Delete.json -func ExampleWorkspacesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewWorkspacesClient().Delete(ctx, "resourceGroup1", "workspace1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Workspace_Update.json -func ExampleWorkspacesClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewWorkspacesClient().Update(ctx, "resourceGroup1", "workspace1", &armdesktopvirtualization.WorkspacesClientUpdateOptions{Workspace: &armdesktopvirtualization.WorkspacePatch{ - Properties: &armdesktopvirtualization.WorkspacePatchProperties{ - Description: to.Ptr("des1"), - FriendlyName: to.Ptr("friendly"), - }, - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Workspace = armdesktopvirtualization.Workspace{ - // Name: to.Ptr("workspace1"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/workspaces"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/workspaces/workspace1"), - // Location: to.Ptr("centralus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armdesktopvirtualization.WorkspaceProperties{ - // Description: to.Ptr("des1"), - // CloudPcResource: to.Ptr(false), - // FriendlyName: to.Ptr("friendly"), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Workspace_ListByResourceGroup.json -func ExampleWorkspacesClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewWorkspacesClient().NewListByResourceGroupPager("resourceGroup1", &armdesktopvirtualization.WorkspacesClientListByResourceGroupOptions{PageSize: to.Ptr[int32](10), - IsDescending: to.Ptr(true), - InitialSkip: to.Ptr[int32](0), - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.WorkspaceList = armdesktopvirtualization.WorkspaceList{ - // Value: []*armdesktopvirtualization.Workspace{ - // { - // Name: to.Ptr("workspace1"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/workspaces"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/workspaces/workspace1"), - // Location: to.Ptr("centralus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armdesktopvirtualization.WorkspaceProperties{ - // Description: to.Ptr("des1"), - // CloudPcResource: to.Ptr(false), - // FriendlyName: to.Ptr("friendly"), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }, - // { - // Name: to.Ptr("workspace2"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/workspaces"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/workspaces/workspace2"), - // Location: to.Ptr("centralus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armdesktopvirtualization.WorkspaceProperties{ - // Description: to.Ptr("des1"), - // CloudPcResource: to.Ptr(false), - // FriendlyName: to.Ptr("friendly"), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Workspace_ListBySubscription.json -func ExampleWorkspacesClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdesktopvirtualization.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewWorkspacesClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.WorkspaceList = armdesktopvirtualization.WorkspaceList{ - // Value: []*armdesktopvirtualization.Workspace{ - // { - // Name: to.Ptr("workspace1"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/workspaces"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/workspaces/workspace1"), - // Location: to.Ptr("centralus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armdesktopvirtualization.WorkspaceProperties{ - // Description: to.Ptr("des1"), - // CloudPcResource: to.Ptr(false), - // FriendlyName: to.Ptr("friendly"), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }, - // { - // Name: to.Ptr("workspace2"), - // Type: to.Ptr("Microsoft.DesktopVirtualization/workspaces"), - // ID: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/workspaces/workspace2"), - // Location: to.Ptr("centralus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armdesktopvirtualization.WorkspaceProperties{ - // Description: to.Ptr("des1"), - // CloudPcResource: to.Ptr(false), - // FriendlyName: to.Ptr("friendly"), - // ObjectID: to.Ptr("7877fb31-4bde-49fd-9df3-c046e0ec5325"), - // }, - // SystemData: &armdesktopvirtualization.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armdesktopvirtualization.CreatedByTypeUser), - // }, - // }}, - // } - } -}