From bcbb3b48c876498fe0a4a74b013494acbf5e8853 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 6 Mar 2023 15:35:35 +0000 Subject: [PATCH] CodeGen from PR 2740 in test-repo-billy/azure-rest-api-specs Merge 8a4cf883847789c1252123639b217b25131caf45 into 66e7f9b04a2325fe00afd04d8abdab6ed78b7c4a --- .../armhybridcontainerservice/CHANGELOG.md | 18 + .../agentpool_client.go | 150 ++++---- .../agentpool_client_example_test.go | 127 ------- .../armhybridcontainerservice/autorest.md | 6 +- .../armhybridcontainerservice/client.go | 22 +- .../client_example_test.go | 55 --- .../armhybridcontainerservice/constants.go | 2 +- .../armhybridcontainerservice/go.mod | 14 +- .../armhybridcontainerservice/go.sum | 24 +- .../hybrididentitymetadata_client.go | 120 +++---- ...rididentitymetadata_client_example_test.go | 102 ------ .../armhybridcontainerservice/models.go | 110 ++++-- .../armhybridcontainerservice/models_serde.go | 322 +++++++++++++----- .../operations_client.go | 8 +- .../operations_client_example_test.go | 41 --- .../provisionedclusters_client.go | 273 +++++++++++---- ...provisionedclusters_client_example_test.go | 217 ------------ .../response_types.go | 40 ++- .../storagespaces_client.go | 80 +++-- .../storagespaces_client_example_test.go | 165 --------- .../armhybridcontainerservice/time_rfc3339.go | 2 +- .../virtualnetworks_client.go | 82 +++-- .../virtualnetworks_client_example_test.go | 177 ---------- 23 files changed, 823 insertions(+), 1334 deletions(-) delete mode 100644 sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/agentpool_client_example_test.go delete mode 100644 sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/client_example_test.go delete mode 100644 sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/hybrididentitymetadata_client_example_test.go delete mode 100644 sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/operations_client_example_test.go delete mode 100644 sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/provisionedclusters_client_example_test.go delete mode 100644 sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/storagespaces_client_example_test.go delete mode 100644 sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/virtualnetworks_client_example_test.go diff --git a/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/CHANGELOG.md b/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/CHANGELOG.md index 3888bfb61afb..9230ebf513cd 100644 --- a/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/CHANGELOG.md +++ b/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/CHANGELOG.md @@ -1,5 +1,23 @@ # Release History +## 0.2.0 (2023-03-06) +### Breaking Changes + +- Struct `VirtualNetworksPropertiesInfraVnetProfileKubevirt` has been removed +- Field `Kubevirt` of struct `VirtualNetworksPropertiesInfraVnetProfile` has been removed + +### Features Added + +- New function `*ProvisionedClustersClient.GetUpgradeProfile(context.Context, string, string, *ProvisionedClustersClientGetUpgradeProfileOptions) (ProvisionedClustersClientGetUpgradeProfileResponse, error)` +- New function `*ProvisionedClustersClient.BeginUpgradeNodeImageVersionForEntireCluster(context.Context, string, string, *ProvisionedClustersClientBeginUpgradeNodeImageVersionForEntireClusterOptions) (*runtime.Poller[ProvisionedClustersClientUpgradeNodeImageVersionForEntireClusterResponse], error)` +- New struct `ProvisionedClusterPoolUpgradeProfile` +- New struct `ProvisionedClusterPoolUpgradeProfileProperties` +- New struct `ProvisionedClusterUpgradeProfile` +- New struct `ProvisionedClusterUpgradeProfileProperties` +- New struct `VirtualNetworksPropertiesInfraVnetProfileNetworkCloud` +- New field `NetworkCloud` in struct `VirtualNetworksPropertiesInfraVnetProfile` + + ## 0.1.1 (2022-10-12) ### Other Changes - Loosen Go version requirement. diff --git a/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/agentpool_client.go b/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/agentpool_client.go index 6a817222e5aa..6aff4f01d1a1 100644 --- a/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/agentpool_client.go +++ b/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/agentpool_client.go @@ -32,9 +32,9 @@ type AgentPoolClient struct { } // NewAgentPoolClient creates a new instance of AgentPoolClient with the specified values. -// subscriptionID - The ID of the target subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewAgentPoolClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AgentPoolClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,15 +57,16 @@ func NewAgentPoolClient(subscriptionID string, credential azcore.TokenCredential // BeginCreateOrUpdate - Creates the agent pool in the Hybrid AKS provisioned cluster // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// provisionedClustersName - Parameter for the name of the provisioned cluster -// agentPoolName - Parameter for the name of the agent pool in the provisioned cluster -// options - AgentPoolClientBeginCreateOrUpdateOptions contains the optional parameters for the AgentPoolClient.BeginCreateOrUpdate -// method. -func (client *AgentPoolClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, provisionedClustersName string, agentPoolName string, agentPool AgentPool, options *AgentPoolClientBeginCreateOrUpdateOptions) (*runtime.Poller[AgentPoolClientCreateOrUpdateResponse], error) { +// +// Generated from API version 2022-09-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - resourceName - Parameter for the name of the provisioned cluster +// - agentPoolName - Parameter for the name of the agent pool in the provisioned cluster +// - options - AgentPoolClientBeginCreateOrUpdateOptions contains the optional parameters for the AgentPoolClient.BeginCreateOrUpdate +// method. +func (client *AgentPoolClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, agentPool AgentPool, options *AgentPoolClientBeginCreateOrUpdateOptions) (*runtime.Poller[AgentPoolClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, provisionedClustersName, agentPoolName, agentPool, options) + resp, err := client.createOrUpdate(ctx, resourceGroupName, resourceName, agentPoolName, agentPool, options) if err != nil { return nil, err } @@ -79,9 +80,10 @@ func (client *AgentPoolClient) BeginCreateOrUpdate(ctx context.Context, resource // CreateOrUpdate - Creates the agent pool in the Hybrid AKS provisioned cluster // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01-preview -func (client *AgentPoolClient) createOrUpdate(ctx context.Context, resourceGroupName string, provisionedClustersName string, agentPoolName string, agentPool AgentPool, options *AgentPoolClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, provisionedClustersName, agentPoolName, agentPool, options) +// +// Generated from API version 2022-09-01-preview +func (client *AgentPoolClient) createOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, agentPool AgentPool, options *AgentPoolClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, resourceName, agentPoolName, agentPool, options) if err != nil { return nil, err } @@ -96,8 +98,8 @@ func (client *AgentPoolClient) createOrUpdate(ctx context.Context, resourceGroup } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *AgentPoolClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, provisionedClustersName string, agentPoolName string, agentPool AgentPool, options *AgentPoolClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridContainerService/provisionedClusters/{provisionedClustersName}/agentPools/{agentPoolName}" +func (client *AgentPoolClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, agentPool AgentPool, options *AgentPoolClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridContainerService/provisionedClusters/{resourceName}/agentPools/{agentPoolName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -106,10 +108,10 @@ func (client *AgentPoolClient) createOrUpdateCreateRequest(ctx context.Context, return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if provisionedClustersName == "" { - return nil, errors.New("parameter provisionedClustersName cannot be empty") + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") } - urlPath = strings.ReplaceAll(urlPath, "{provisionedClustersName}", url.PathEscape(provisionedClustersName)) + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if agentPoolName == "" { return nil, errors.New("parameter agentPoolName cannot be empty") } @@ -119,7 +121,7 @@ func (client *AgentPoolClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, agentPool) @@ -127,13 +129,14 @@ func (client *AgentPoolClient) createOrUpdateCreateRequest(ctx context.Context, // Delete - Deletes the agent pool in the Hybrid AKS provisioned cluster // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// provisionedClustersName - Parameter for the name of the provisioned cluster -// agentPoolName - Parameter for the name of the agent pool in the provisioned cluster -// options - AgentPoolClientDeleteOptions contains the optional parameters for the AgentPoolClient.Delete method. -func (client *AgentPoolClient) Delete(ctx context.Context, resourceGroupName string, provisionedClustersName string, agentPoolName string, options *AgentPoolClientDeleteOptions) (AgentPoolClientDeleteResponse, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, provisionedClustersName, agentPoolName, options) +// +// Generated from API version 2022-09-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - resourceName - Parameter for the name of the provisioned cluster +// - agentPoolName - Parameter for the name of the agent pool in the provisioned cluster +// - options - AgentPoolClientDeleteOptions contains the optional parameters for the AgentPoolClient.Delete method. +func (client *AgentPoolClient) Delete(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, options *AgentPoolClientDeleteOptions) (AgentPoolClientDeleteResponse, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, resourceName, agentPoolName, options) if err != nil { return AgentPoolClientDeleteResponse{}, err } @@ -148,8 +151,8 @@ func (client *AgentPoolClient) Delete(ctx context.Context, resourceGroupName str } // deleteCreateRequest creates the Delete request. -func (client *AgentPoolClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, provisionedClustersName string, agentPoolName string, options *AgentPoolClientDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridContainerService/provisionedClusters/{provisionedClustersName}/agentPools/{agentPoolName}" +func (client *AgentPoolClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, options *AgentPoolClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridContainerService/provisionedClusters/{resourceName}/agentPools/{agentPoolName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -158,10 +161,10 @@ func (client *AgentPoolClient) deleteCreateRequest(ctx context.Context, resource return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if provisionedClustersName == "" { - return nil, errors.New("parameter provisionedClustersName cannot be empty") + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") } - urlPath = strings.ReplaceAll(urlPath, "{provisionedClustersName}", url.PathEscape(provisionedClustersName)) + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if agentPoolName == "" { return nil, errors.New("parameter agentPoolName cannot be empty") } @@ -171,7 +174,7 @@ func (client *AgentPoolClient) deleteCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -179,13 +182,14 @@ func (client *AgentPoolClient) deleteCreateRequest(ctx context.Context, resource // Get - Gets the agent pool in the Hybrid AKS provisioned cluster // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// provisionedClustersName - Parameter for the name of the provisioned cluster -// agentPoolName - Parameter for the name of the agent pool in the provisioned cluster -// options - AgentPoolClientGetOptions contains the optional parameters for the AgentPoolClient.Get method. -func (client *AgentPoolClient) Get(ctx context.Context, resourceGroupName string, provisionedClustersName string, agentPoolName string, options *AgentPoolClientGetOptions) (AgentPoolClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, provisionedClustersName, agentPoolName, options) +// +// Generated from API version 2022-09-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - resourceName - Parameter for the name of the provisioned cluster +// - agentPoolName - Parameter for the name of the agent pool in the provisioned cluster +// - options - AgentPoolClientGetOptions contains the optional parameters for the AgentPoolClient.Get method. +func (client *AgentPoolClient) Get(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, options *AgentPoolClientGetOptions) (AgentPoolClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, resourceName, agentPoolName, options) if err != nil { return AgentPoolClientGetResponse{}, err } @@ -200,8 +204,8 @@ func (client *AgentPoolClient) Get(ctx context.Context, resourceGroupName string } // getCreateRequest creates the Get request. -func (client *AgentPoolClient) getCreateRequest(ctx context.Context, resourceGroupName string, provisionedClustersName string, agentPoolName string, options *AgentPoolClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridContainerService/provisionedClusters/{provisionedClustersName}/agentPools/{agentPoolName}" +func (client *AgentPoolClient) getCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, options *AgentPoolClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridContainerService/provisionedClusters/{resourceName}/agentPools/{agentPoolName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -210,10 +214,10 @@ func (client *AgentPoolClient) getCreateRequest(ctx context.Context, resourceGro return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if provisionedClustersName == "" { - return nil, errors.New("parameter provisionedClustersName cannot be empty") + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") } - urlPath = strings.ReplaceAll(urlPath, "{provisionedClustersName}", url.PathEscape(provisionedClustersName)) + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if agentPoolName == "" { return nil, errors.New("parameter agentPoolName cannot be empty") } @@ -223,7 +227,7 @@ func (client *AgentPoolClient) getCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -240,13 +244,14 @@ func (client *AgentPoolClient) getHandleResponse(resp *http.Response) (AgentPool // ListByProvisionedCluster - Gets the agent pools in the Hybrid AKS provisioned cluster // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// provisionedClustersName - Parameter for the name of the provisioned cluster -// options - AgentPoolClientListByProvisionedClusterOptions contains the optional parameters for the AgentPoolClient.ListByProvisionedCluster -// method. -func (client *AgentPoolClient) ListByProvisionedCluster(ctx context.Context, resourceGroupName string, provisionedClustersName string, options *AgentPoolClientListByProvisionedClusterOptions) (AgentPoolClientListByProvisionedClusterResponse, error) { - req, err := client.listByProvisionedClusterCreateRequest(ctx, resourceGroupName, provisionedClustersName, options) +// +// Generated from API version 2022-09-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - resourceName - Parameter for the name of the provisioned cluster +// - options - AgentPoolClientListByProvisionedClusterOptions contains the optional parameters for the AgentPoolClient.ListByProvisionedCluster +// method. +func (client *AgentPoolClient) ListByProvisionedCluster(ctx context.Context, resourceGroupName string, resourceName string, options *AgentPoolClientListByProvisionedClusterOptions) (AgentPoolClientListByProvisionedClusterResponse, error) { + req, err := client.listByProvisionedClusterCreateRequest(ctx, resourceGroupName, resourceName, options) if err != nil { return AgentPoolClientListByProvisionedClusterResponse{}, err } @@ -261,8 +266,8 @@ func (client *AgentPoolClient) ListByProvisionedCluster(ctx context.Context, res } // listByProvisionedClusterCreateRequest creates the ListByProvisionedCluster request. -func (client *AgentPoolClient) listByProvisionedClusterCreateRequest(ctx context.Context, resourceGroupName string, provisionedClustersName string, options *AgentPoolClientListByProvisionedClusterOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridContainerService/provisionedClusters/{provisionedClustersName}/agentPools" +func (client *AgentPoolClient) listByProvisionedClusterCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *AgentPoolClientListByProvisionedClusterOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridContainerService/provisionedClusters/{resourceName}/agentPools" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -271,16 +276,16 @@ func (client *AgentPoolClient) listByProvisionedClusterCreateRequest(ctx context return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if provisionedClustersName == "" { - return nil, errors.New("parameter provisionedClustersName cannot be empty") + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") } - urlPath = strings.ReplaceAll(urlPath, "{provisionedClustersName}", url.PathEscape(provisionedClustersName)) + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -297,13 +302,14 @@ func (client *AgentPoolClient) listByProvisionedClusterHandleResponse(resp *http // Update - Updates the agent pool in the Hybrid AKS provisioned cluster // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// provisionedClustersName - Parameter for the name of the provisioned cluster -// agentPoolName - Parameter for the name of the agent pool in the provisioned cluster -// options - AgentPoolClientUpdateOptions contains the optional parameters for the AgentPoolClient.Update method. -func (client *AgentPoolClient) Update(ctx context.Context, resourceGroupName string, provisionedClustersName string, agentPoolName string, agentPool AgentPool, options *AgentPoolClientUpdateOptions) (AgentPoolClientUpdateResponse, error) { - req, err := client.updateCreateRequest(ctx, resourceGroupName, provisionedClustersName, agentPoolName, agentPool, options) +// +// Generated from API version 2022-09-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - resourceName - Parameter for the name of the provisioned cluster +// - agentPoolName - Parameter for the name of the agent pool in the provisioned cluster +// - options - AgentPoolClientUpdateOptions contains the optional parameters for the AgentPoolClient.Update method. +func (client *AgentPoolClient) Update(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, agentPool AgentPool, options *AgentPoolClientUpdateOptions) (AgentPoolClientUpdateResponse, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, resourceName, agentPoolName, agentPool, options) if err != nil { return AgentPoolClientUpdateResponse{}, err } @@ -318,8 +324,8 @@ func (client *AgentPoolClient) Update(ctx context.Context, resourceGroupName str } // updateCreateRequest creates the Update request. -func (client *AgentPoolClient) updateCreateRequest(ctx context.Context, resourceGroupName string, provisionedClustersName string, agentPoolName string, agentPool AgentPool, options *AgentPoolClientUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridContainerService/provisionedClusters/{provisionedClustersName}/agentPools/{agentPoolName}" +func (client *AgentPoolClient) updateCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, agentPool AgentPool, options *AgentPoolClientUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridContainerService/provisionedClusters/{resourceName}/agentPools/{agentPoolName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -328,10 +334,10 @@ func (client *AgentPoolClient) updateCreateRequest(ctx context.Context, resource return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if provisionedClustersName == "" { - return nil, errors.New("parameter provisionedClustersName cannot be empty") + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") } - urlPath = strings.ReplaceAll(urlPath, "{provisionedClustersName}", url.PathEscape(provisionedClustersName)) + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if agentPoolName == "" { return nil, errors.New("parameter agentPoolName cannot be empty") } @@ -341,7 +347,7 @@ func (client *AgentPoolClient) updateCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, agentPool) diff --git a/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/agentpool_client_example_test.go b/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/agentpool_client_example_test.go deleted file mode 100644 index 215481111145..000000000000 --- a/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/agentpool_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. - -package armhybridcontainerservice_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/hybridcontainerservice/armhybridcontainerservice" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/GetAgentPool.json -func ExampleAgentPoolClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybridcontainerservice.NewAgentPoolClient("a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "test-arcappliance-resgrp", "test-hybridakscluster", "test-hybridaksnodepool", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/PutAgentPool.json -func ExampleAgentPoolClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybridcontainerservice.NewAgentPoolClient("a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, "test-arcappliance-resgrp", "test-hybridakscluster", "test-hybridaksnodepool", armhybridcontainerservice.AgentPool{ - Location: to.Ptr("westus"), - Properties: &armhybridcontainerservice.AgentPoolProperties{ - Count: to.Ptr[int32](1), - OSType: to.Ptr(armhybridcontainerservice.OsTypeLinux), - VMSize: to.Ptr("Standard_A4_v2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/DeleteAgentPool.json -func ExampleAgentPoolClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybridcontainerservice.NewAgentPoolClient("a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, "test-arcappliance-resgrp", "test-hybridakscluster", "test-hybridaksnodepool", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/UpdateAgentPool.json -func ExampleAgentPoolClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybridcontainerservice.NewAgentPoolClient("a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, "test-arcappliance-resgrp", "test-hybridakscluster", "test-hybridaksnodepool", armhybridcontainerservice.AgentPool{ - Location: to.Ptr("westus"), - Properties: &armhybridcontainerservice.AgentPoolProperties{ - Count: to.Ptr[int32](3), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/ListAgentPoolByProvisionedCluster.json -func ExampleAgentPoolClient_ListByProvisionedCluster() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybridcontainerservice.NewAgentPoolClient("a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListByProvisionedCluster(ctx, "test-arcappliance-resgrp", "test-hybridakscluster", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/autorest.md b/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/autorest.md index 26c3a30cb869..c5bb3122b4b5 100644 --- a/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/autorest.md +++ b/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/autorest.md @@ -5,9 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/318bb9406aa18f1ef0b130e16f3d15269032d9b4/specification/hybridaks/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/318bb9406aa18f1ef0b130e16f3d15269032d9b4/specification/hybridaks/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/hybridaks/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/hybridaks/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 0.1.1 +module-version: 0.2.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/client.go b/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/client.go index 6669e3878d32..3149559e4a5d 100644 --- a/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/client.go +++ b/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/client.go @@ -29,8 +29,8 @@ type Client struct { } // NewClient creates a new instance of Client with the specified values. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*Client, error) { if options == nil { options = &arm.ClientOptions{} @@ -52,9 +52,10 @@ func NewClient(credential azcore.TokenCredential, options *arm.ClientOptions) (* // ListOrchestrators - Lists the available orchestrators in a custom location for HybridAKS // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01-preview -// customLocationResourceURI - The fully qualified Azure Resource manager identifier of the custom location resource. -// options - ClientListOrchestratorsOptions contains the optional parameters for the Client.ListOrchestrators method. +// +// Generated from API version 2022-09-01-preview +// - customLocationResourceURI - The fully qualified Azure Resource manager identifier of the custom location resource. +// - options - ClientListOrchestratorsOptions contains the optional parameters for the Client.ListOrchestrators method. func (client *Client) ListOrchestrators(ctx context.Context, customLocationResourceURI string, options *ClientListOrchestratorsOptions) (ClientListOrchestratorsResponse, error) { req, err := client.listOrchestratorsCreateRequest(ctx, customLocationResourceURI, options) if err != nil { @@ -79,7 +80,7 @@ func (client *Client) listOrchestratorsCreateRequest(ctx context.Context, custom return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -96,9 +97,10 @@ func (client *Client) listOrchestratorsHandleResponse(resp *http.Response) (Clie // ListVMSKUs - Lists the available VM SKUs in a custom location for HybridAKS // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01-preview -// customLocationResourceURI - The fully qualified Azure Resource manager identifier of the custom location resource. -// options - ClientListVMSKUsOptions contains the optional parameters for the Client.ListVMSKUs method. +// +// Generated from API version 2022-09-01-preview +// - customLocationResourceURI - The fully qualified Azure Resource manager identifier of the custom location resource. +// - options - ClientListVMSKUsOptions contains the optional parameters for the Client.ListVMSKUs method. func (client *Client) ListVMSKUs(ctx context.Context, customLocationResourceURI string, options *ClientListVMSKUsOptions) (ClientListVMSKUsResponse, error) { req, err := client.listVMSKUsCreateRequest(ctx, customLocationResourceURI, options) if err != nil { @@ -123,7 +125,7 @@ func (client *Client) listVMSKUsCreateRequest(ctx context.Context, customLocatio return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/client_example_test.go b/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/client_example_test.go deleted file mode 100644 index e862c20e60dd..000000000000 --- a/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/client_example_test.go +++ /dev/null @@ -1,55 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armhybridcontainerservice_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/ListOrchestrators.json -func ExampleClient_ListOrchestrators() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybridcontainerservice.NewClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListOrchestrators(ctx, "subscriptions/a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b/resourceGroups/test-arcappliance-resgrp/providers/Microsoft.ExtendedLocation/customLocations/testcustomlocation", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/ListVMSkus.json -func ExampleClient_ListVMSKUs() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybridcontainerservice.NewClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListVMSKUs(ctx, "subscriptions/a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b/resourceGroups/test-arcappliance-resgrp/providers/Microsoft.ExtendedLocation/customLocations/testcustomlocation", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/constants.go b/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/constants.go index 14b3653043d1..8ec95c68a7af 100644 --- a/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/constants.go +++ b/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/constants.go @@ -11,7 +11,7 @@ package armhybridcontainerservice const ( moduleName = "armhybridcontainerservice" - moduleVersion = "v0.1.1" + moduleVersion = "v0.2.0" ) type AgentPoolProvisioningState string diff --git a/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/go.mod b/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/go.mod index dcfe45e49956..f693bf5d0957 100644 --- a/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/go.mod +++ b/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/go.mod @@ -2,20 +2,12 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridcontainerserv go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.5.1 // indirect - github.com/golang-jwt/jwt v3.2.1+incompatible // indirect - github.com/google/uuid v1.1.1 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 // indirect - golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 // indirect - golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect golang.org/x/text v0.3.7 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/go.sum b/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/go.sum index 8828b17b1853..3afb578030a5 100644 --- a/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/go.sum +++ b/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/go.sum @@ -1,33 +1,15 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 h1:sVPhtT2qjO86rTUaWMr4WoES4TkjGnzcioXcnHV9s5k= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0 h1:QkAcEIAKbNL4KoFr4SathZPhDhF4mVwpBMFlYjyAqy8= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0/go.mod h1:bhXu1AjYL+wutSL/kpSq6s7733q2Rb0yuot9Zgfqa/0= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 h1:jp0dGvZ7ZK0mgqnTSClMxa5xuRL7NZgHameVYF6BurY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/AzureAD/microsoft-authentication-library-for-go v0.5.1 h1:BWe8a+f/t+7KY7zH2mqygeUD0t8hNFXe08p1Pb3/jKE= -github.com/AzureAD/microsoft-authentication-library-for-go v0.5.1/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= -github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= -github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= -github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 h1:Qj1ukM4GlMWXNdMBuXcXfz/Kw9s1qm0CLY32QxuSImI= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 h1:Tgea0cVUD0ivh5ADBX4WwuI12DUd2to3nCYe2eayMIw= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 h1:HVyaeDAYux4pnY+D/SiwmLOR36ewZ4iGQIIrtnuCjFA= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/hybrididentitymetadata_client.go b/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/hybrididentitymetadata_client.go index b9e02890bfd2..3391be3b3e34 100644 --- a/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/hybrididentitymetadata_client.go +++ b/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/hybrididentitymetadata_client.go @@ -32,9 +32,9 @@ type HybridIdentityMetadataClient struct { } // NewHybridIdentityMetadataClient creates a new instance of HybridIdentityMetadataClient with the specified values. -// subscriptionID - The ID of the target subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewHybridIdentityMetadataClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*HybridIdentityMetadataClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,14 +57,15 @@ func NewHybridIdentityMetadataClient(subscriptionID string, credential azcore.To // Delete - Deletes the hybrid identity metadata proxy resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// provisionedClustersName - Parameter for the name of the provisioned cluster -// hybridIdentityMetadataResourceName - Parameter for the name of the hybrid identity metadata resource. -// options - HybridIdentityMetadataClientDeleteOptions contains the optional parameters for the HybridIdentityMetadataClient.Delete -// method. -func (client *HybridIdentityMetadataClient) Delete(ctx context.Context, resourceGroupName string, provisionedClustersName string, hybridIdentityMetadataResourceName string, options *HybridIdentityMetadataClientDeleteOptions) (HybridIdentityMetadataClientDeleteResponse, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, provisionedClustersName, hybridIdentityMetadataResourceName, options) +// +// Generated from API version 2022-09-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - resourceName - Parameter for the name of the provisioned cluster +// - hybridIdentityMetadataResourceName - Parameter for the name of the hybrid identity metadata resource. +// - options - HybridIdentityMetadataClientDeleteOptions contains the optional parameters for the HybridIdentityMetadataClient.Delete +// method. +func (client *HybridIdentityMetadataClient) Delete(ctx context.Context, resourceGroupName string, resourceName string, hybridIdentityMetadataResourceName string, options *HybridIdentityMetadataClientDeleteOptions) (HybridIdentityMetadataClientDeleteResponse, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, resourceName, hybridIdentityMetadataResourceName, options) if err != nil { return HybridIdentityMetadataClientDeleteResponse{}, err } @@ -79,8 +80,8 @@ func (client *HybridIdentityMetadataClient) Delete(ctx context.Context, resource } // deleteCreateRequest creates the Delete request. -func (client *HybridIdentityMetadataClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, provisionedClustersName string, hybridIdentityMetadataResourceName string, options *HybridIdentityMetadataClientDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridContainerService/provisionedClusters/{provisionedClustersName}/hybridIdentityMetadata/{hybridIdentityMetadataResourceName}" +func (client *HybridIdentityMetadataClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, hybridIdentityMetadataResourceName string, options *HybridIdentityMetadataClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridContainerService/provisionedClusters/{resourceName}/hybridIdentityMetadata/{hybridIdentityMetadataResourceName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -89,10 +90,10 @@ func (client *HybridIdentityMetadataClient) deleteCreateRequest(ctx context.Cont return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if provisionedClustersName == "" { - return nil, errors.New("parameter provisionedClustersName cannot be empty") + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") } - urlPath = strings.ReplaceAll(urlPath, "{provisionedClustersName}", url.PathEscape(provisionedClustersName)) + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if hybridIdentityMetadataResourceName == "" { return nil, errors.New("parameter hybridIdentityMetadataResourceName cannot be empty") } @@ -102,7 +103,7 @@ func (client *HybridIdentityMetadataClient) deleteCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -110,14 +111,15 @@ func (client *HybridIdentityMetadataClient) deleteCreateRequest(ctx context.Cont // Get - Get the hybrid identity metadata proxy resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// provisionedClustersName - Parameter for the name of the provisioned cluster -// hybridIdentityMetadataResourceName - Parameter for the name of the hybrid identity metadata resource. -// options - HybridIdentityMetadataClientGetOptions contains the optional parameters for the HybridIdentityMetadataClient.Get -// method. -func (client *HybridIdentityMetadataClient) Get(ctx context.Context, resourceGroupName string, provisionedClustersName string, hybridIdentityMetadataResourceName string, options *HybridIdentityMetadataClientGetOptions) (HybridIdentityMetadataClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, provisionedClustersName, hybridIdentityMetadataResourceName, options) +// +// Generated from API version 2022-09-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - resourceName - Parameter for the name of the provisioned cluster +// - hybridIdentityMetadataResourceName - Parameter for the name of the hybrid identity metadata resource. +// - options - HybridIdentityMetadataClientGetOptions contains the optional parameters for the HybridIdentityMetadataClient.Get +// method. +func (client *HybridIdentityMetadataClient) Get(ctx context.Context, resourceGroupName string, resourceName string, hybridIdentityMetadataResourceName string, options *HybridIdentityMetadataClientGetOptions) (HybridIdentityMetadataClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, resourceName, hybridIdentityMetadataResourceName, options) if err != nil { return HybridIdentityMetadataClientGetResponse{}, err } @@ -132,8 +134,8 @@ func (client *HybridIdentityMetadataClient) Get(ctx context.Context, resourceGro } // getCreateRequest creates the Get request. -func (client *HybridIdentityMetadataClient) getCreateRequest(ctx context.Context, resourceGroupName string, provisionedClustersName string, hybridIdentityMetadataResourceName string, options *HybridIdentityMetadataClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridContainerService/provisionedClusters/{provisionedClustersName}/hybridIdentityMetadata/{hybridIdentityMetadataResourceName}" +func (client *HybridIdentityMetadataClient) getCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, hybridIdentityMetadataResourceName string, options *HybridIdentityMetadataClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridContainerService/provisionedClusters/{resourceName}/hybridIdentityMetadata/{hybridIdentityMetadataResourceName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -142,10 +144,10 @@ func (client *HybridIdentityMetadataClient) getCreateRequest(ctx context.Context return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if provisionedClustersName == "" { - return nil, errors.New("parameter provisionedClustersName cannot be empty") + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") } - urlPath = strings.ReplaceAll(urlPath, "{provisionedClustersName}", url.PathEscape(provisionedClustersName)) + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if hybridIdentityMetadataResourceName == "" { return nil, errors.New("parameter hybridIdentityMetadataResourceName cannot be empty") } @@ -155,7 +157,7 @@ func (client *HybridIdentityMetadataClient) getCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -171,12 +173,13 @@ func (client *HybridIdentityMetadataClient) getHandleResponse(resp *http.Respons } // NewListByClusterPager - Lists the hybrid identity metadata proxy resource in a cluster. -// Generated from API version 2022-05-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// provisionedClustersName - Parameter for the name of the provisioned cluster -// options - HybridIdentityMetadataClientListByClusterOptions contains the optional parameters for the HybridIdentityMetadataClient.ListByCluster -// method. -func (client *HybridIdentityMetadataClient) NewListByClusterPager(resourceGroupName string, provisionedClustersName string, options *HybridIdentityMetadataClientListByClusterOptions) *runtime.Pager[HybridIdentityMetadataClientListByClusterResponse] { +// +// Generated from API version 2022-09-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - resourceName - Parameter for the name of the provisioned cluster +// - options - HybridIdentityMetadataClientListByClusterOptions contains the optional parameters for the HybridIdentityMetadataClient.NewListByClusterPager +// method. +func (client *HybridIdentityMetadataClient) NewListByClusterPager(resourceGroupName string, resourceName string, options *HybridIdentityMetadataClientListByClusterOptions) *runtime.Pager[HybridIdentityMetadataClientListByClusterResponse] { return runtime.NewPager(runtime.PagingHandler[HybridIdentityMetadataClientListByClusterResponse]{ More: func(page HybridIdentityMetadataClientListByClusterResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 @@ -185,7 +188,7 @@ func (client *HybridIdentityMetadataClient) NewListByClusterPager(resourceGroupN var req *policy.Request var err error if page == nil { - req, err = client.listByClusterCreateRequest(ctx, resourceGroupName, provisionedClustersName, options) + req, err = client.listByClusterCreateRequest(ctx, resourceGroupName, resourceName, options) } else { req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) } @@ -205,8 +208,8 @@ func (client *HybridIdentityMetadataClient) NewListByClusterPager(resourceGroupN } // listByClusterCreateRequest creates the ListByCluster request. -func (client *HybridIdentityMetadataClient) listByClusterCreateRequest(ctx context.Context, resourceGroupName string, provisionedClustersName string, options *HybridIdentityMetadataClientListByClusterOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridContainerService/provisionedClusters/{provisionedClustersName}/hybridIdentityMetadata" +func (client *HybridIdentityMetadataClient) listByClusterCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *HybridIdentityMetadataClientListByClusterOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridContainerService/provisionedClusters/{resourceName}/hybridIdentityMetadata" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -215,16 +218,16 @@ func (client *HybridIdentityMetadataClient) listByClusterCreateRequest(ctx conte return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if provisionedClustersName == "" { - return nil, errors.New("parameter provisionedClustersName cannot be empty") + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") } - urlPath = strings.ReplaceAll(urlPath, "{provisionedClustersName}", url.PathEscape(provisionedClustersName)) + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -241,14 +244,15 @@ func (client *HybridIdentityMetadataClient) listByClusterHandleResponse(resp *ht // Put - Creates the hybrid identity metadata proxy resource that facilitates the managed identity provisioning. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// provisionedClustersName - Parameter for the name of the provisioned cluster -// hybridIdentityMetadataResourceName - Parameter for the name of the hybrid identity metadata resource. -// options - HybridIdentityMetadataClientPutOptions contains the optional parameters for the HybridIdentityMetadataClient.Put -// method. -func (client *HybridIdentityMetadataClient) Put(ctx context.Context, resourceGroupName string, provisionedClustersName string, hybridIdentityMetadataResourceName string, body HybridIdentityMetadata, options *HybridIdentityMetadataClientPutOptions) (HybridIdentityMetadataClientPutResponse, error) { - req, err := client.putCreateRequest(ctx, resourceGroupName, provisionedClustersName, hybridIdentityMetadataResourceName, body, options) +// +// Generated from API version 2022-09-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - resourceName - Parameter for the name of the provisioned cluster +// - hybridIdentityMetadataResourceName - Parameter for the name of the hybrid identity metadata resource. +// - options - HybridIdentityMetadataClientPutOptions contains the optional parameters for the HybridIdentityMetadataClient.Put +// method. +func (client *HybridIdentityMetadataClient) Put(ctx context.Context, resourceGroupName string, resourceName string, hybridIdentityMetadataResourceName string, body HybridIdentityMetadata, options *HybridIdentityMetadataClientPutOptions) (HybridIdentityMetadataClientPutResponse, error) { + req, err := client.putCreateRequest(ctx, resourceGroupName, resourceName, hybridIdentityMetadataResourceName, body, options) if err != nil { return HybridIdentityMetadataClientPutResponse{}, err } @@ -263,8 +267,8 @@ func (client *HybridIdentityMetadataClient) Put(ctx context.Context, resourceGro } // putCreateRequest creates the Put request. -func (client *HybridIdentityMetadataClient) putCreateRequest(ctx context.Context, resourceGroupName string, provisionedClustersName string, hybridIdentityMetadataResourceName string, body HybridIdentityMetadata, options *HybridIdentityMetadataClientPutOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridContainerService/provisionedClusters/{provisionedClustersName}/hybridIdentityMetadata/{hybridIdentityMetadataResourceName}" +func (client *HybridIdentityMetadataClient) putCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, hybridIdentityMetadataResourceName string, body HybridIdentityMetadata, options *HybridIdentityMetadataClientPutOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridContainerService/provisionedClusters/{resourceName}/hybridIdentityMetadata/{hybridIdentityMetadataResourceName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -273,10 +277,10 @@ func (client *HybridIdentityMetadataClient) putCreateRequest(ctx context.Context return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if provisionedClustersName == "" { - return nil, errors.New("parameter provisionedClustersName cannot be empty") + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") } - urlPath = strings.ReplaceAll(urlPath, "{provisionedClustersName}", url.PathEscape(provisionedClustersName)) + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) if hybridIdentityMetadataResourceName == "" { return nil, errors.New("parameter hybridIdentityMetadataResourceName cannot be empty") } @@ -286,7 +290,7 @@ func (client *HybridIdentityMetadataClient) putCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) diff --git a/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/hybrididentitymetadata_client_example_test.go b/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/hybrididentitymetadata_client_example_test.go deleted file mode 100644 index e753b9441ee8..000000000000 --- a/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/hybrididentitymetadata_client_example_test.go +++ /dev/null @@ -1,102 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armhybridcontainerservice_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/hybridcontainerservice/armhybridcontainerservice" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/CreateHybridIdentityMetadata.json -func ExampleHybridIdentityMetadataClient_Put() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybridcontainerservice.NewHybridIdentityMetadataClient("fd3c3665-1729-4b7b-9a38-238e83b0f98b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Put(ctx, "testrg", "ContosoTargetCluster", "default", armhybridcontainerservice.HybridIdentityMetadata{ - Properties: &armhybridcontainerservice.HybridIdentityMetadataProperties{ - PublicKey: to.Ptr("8ec7d60c-9700-40b1-8e6e-e5b2f6f477f2"), - ResourceUID: to.Ptr("f8b82dff-38ef-4220-99ef-d3a3f86ddc6c"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/GetHybridIdentityMetadata.json -func ExampleHybridIdentityMetadataClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybridcontainerservice.NewHybridIdentityMetadataClient("fd3c3665-1729-4b7b-9a38-238e83b0f98b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "testrg", "ContosoTargetCluster", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/DeleteHybridIdentityMetadata.json -func ExampleHybridIdentityMetadataClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybridcontainerservice.NewHybridIdentityMetadataClient("fd3c3665-1729-4b7b-9a38-238e83b0f98b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, "testrg", "ContosoTargetCluster", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/HybridIdentityMetadataListByCluster.json -func ExampleHybridIdentityMetadataClient_NewListByClusterPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybridcontainerservice.NewHybridIdentityMetadataClient("fd3c3665-1729-4b7b-9a38-238e83b0f98b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByClusterPager("testrg", "ContosoTargetCluster", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/models.go b/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/models.go index 0cb767b8c6cc..2947c420020e 100644 --- a/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/models.go +++ b/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/models.go @@ -413,7 +413,7 @@ type HybridIdentityMetadataClientGetOptions struct { // placeholder for future optional parameters } -// HybridIdentityMetadataClientListByClusterOptions contains the optional parameters for the HybridIdentityMetadataClient.ListByCluster +// HybridIdentityMetadataClientListByClusterOptions contains the optional parameters for the HybridIdentityMetadataClient.NewListByClusterPager // method. type HybridIdentityMetadataClientListByClusterOptions struct { // placeholder for future optional parameters @@ -594,7 +594,7 @@ type NetworkProfile struct { ServiceCidrs []*string `json:"serviceCidrs,omitempty"` } -// OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. +// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. type OperationsClientListOptions struct { // placeholder for future optional parameters } @@ -659,6 +659,58 @@ type ProvisionedClusterIdentity struct { TenantID *string `json:"tenantId,omitempty" azure:"ro"` } +// ProvisionedClusterPoolUpgradeProfile - The list of available upgrade versions. +type ProvisionedClusterPoolUpgradeProfile struct { + // List of orchestrator types and versions available for upgrade. + Upgrades []*ProvisionedClusterPoolUpgradeProfileProperties `json:"upgrades,omitempty"` + + // READ-ONLY; The Kubernetes version (major.minor.patch). + KubernetesVersion *string `json:"kubernetesVersion,omitempty" azure:"ro"` + + // READ-ONLY; The Agent Pool name. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; OsType - OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values + // include: 'Linux', 'Windows' + OSType *OsType `json:"osType,omitempty" azure:"ro"` +} + +// ProvisionedClusterPoolUpgradeProfileProperties - The upgrade properties. +type ProvisionedClusterPoolUpgradeProfileProperties struct { + // READ-ONLY; Whether the Kubernetes version is currently in preview. + IsPreview *bool `json:"isPreview,omitempty" azure:"ro"` + + // READ-ONLY; The Kubernetes version (major.minor.patch). + KubernetesVersion *string `json:"kubernetesVersion,omitempty" azure:"ro"` +} + +// ProvisionedClusterUpgradeProfile - The list of available upgrades for compute pools. +type ProvisionedClusterUpgradeProfile struct { + // REQUIRED; The properties of the upgrade profile. + Properties *ProvisionedClusterUpgradeProfileProperties `json:"properties,omitempty"` + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` +} + +// ProvisionedClusterUpgradeProfileProperties - Control plane and agent pool upgrade profiles. +type ProvisionedClusterUpgradeProfileProperties struct { + // REQUIRED; The list of available upgrade versions for agent pools. + AgentPoolProfiles []*ProvisionedClusterPoolUpgradeProfile `json:"agentPoolProfiles,omitempty"` + + // REQUIRED; The list of available upgrade versions for the control plane. + ControlPlaneProfile *ProvisionedClusterPoolUpgradeProfile `json:"controlPlaneProfile,omitempty"` + + // READ-ONLY + ProvisioningState *string `json:"provisioningState,omitempty" azure:"ro"` +} + // ProvisionedClusters - The provisionedClusters resource definition. type ProvisionedClusters struct { // REQUIRED; The geo-location where the resource lives @@ -749,6 +801,13 @@ type ProvisionedClustersClientBeginUpdateOptions struct { ResumeToken string } +// ProvisionedClustersClientBeginUpgradeNodeImageVersionForEntireClusterOptions contains the optional parameters for the ProvisionedClustersClient.BeginUpgradeNodeImageVersionForEntireCluster +// method. +type ProvisionedClustersClientBeginUpgradeNodeImageVersionForEntireClusterOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // ProvisionedClustersClientDeleteOptions contains the optional parameters for the ProvisionedClustersClient.Delete method. type ProvisionedClustersClientDeleteOptions struct { // placeholder for future optional parameters @@ -759,13 +818,19 @@ type ProvisionedClustersClientGetOptions struct { // placeholder for future optional parameters } -// ProvisionedClustersClientListByResourceGroupOptions contains the optional parameters for the ProvisionedClustersClient.ListByResourceGroup +// ProvisionedClustersClientGetUpgradeProfileOptions contains the optional parameters for the ProvisionedClustersClient.GetUpgradeProfile +// method. +type ProvisionedClustersClientGetUpgradeProfileOptions struct { + // placeholder for future optional parameters +} + +// ProvisionedClustersClientListByResourceGroupOptions contains the optional parameters for the ProvisionedClustersClient.NewListByResourceGroupPager // method. type ProvisionedClustersClientListByResourceGroupOptions struct { // placeholder for future optional parameters } -// ProvisionedClustersClientListBySubscriptionOptions contains the optional parameters for the ProvisionedClustersClient.ListBySubscription +// ProvisionedClustersClientListBySubscriptionOptions contains the optional parameters for the ProvisionedClustersClient.NewListBySubscriptionPager // method. type ProvisionedClustersClientListBySubscriptionOptions struct { // placeholder for future optional parameters @@ -989,13 +1054,13 @@ type StorageSpacesClientDeleteOptions struct { // placeholder for future optional parameters } -// StorageSpacesClientListByResourceGroupOptions contains the optional parameters for the StorageSpacesClient.ListByResourceGroup +// StorageSpacesClientListByResourceGroupOptions contains the optional parameters for the StorageSpacesClient.NewListByResourceGroupPager // method. type StorageSpacesClientListByResourceGroupOptions struct { // placeholder for future optional parameters } -// StorageSpacesClientListBySubscriptionOptions contains the optional parameters for the StorageSpacesClient.ListBySubscription +// StorageSpacesClientListBySubscriptionOptions contains the optional parameters for the StorageSpacesClient.NewListBySubscriptionPager // method. type StorageSpacesClientListBySubscriptionOptions struct { // placeholder for future optional parameters @@ -1162,13 +1227,13 @@ type VirtualNetworksClientDeleteOptions struct { // placeholder for future optional parameters } -// VirtualNetworksClientListByResourceGroupOptions contains the optional parameters for the VirtualNetworksClient.ListByResourceGroup +// VirtualNetworksClientListByResourceGroupOptions contains the optional parameters for the VirtualNetworksClient.NewListByResourceGroupPager // method. type VirtualNetworksClientListByResourceGroupOptions struct { // placeholder for future optional parameters } -// VirtualNetworksClientListBySubscriptionOptions contains the optional parameters for the VirtualNetworksClient.ListBySubscription +// VirtualNetworksClientListBySubscriptionOptions contains the optional parameters for the VirtualNetworksClient.NewListBySubscriptionPager // method. type VirtualNetworksClientListBySubscriptionOptions struct { // placeholder for future optional parameters @@ -1200,6 +1265,14 @@ type VirtualNetworksPatch struct { // VirtualNetworksProperties - HybridAKSNetworkSpec defines the desired state of HybridAKSNetwork type VirtualNetworksProperties struct { + // Address of the DNS servers associated with the network + DNSServers []*string `json:"dnsServers,omitempty"` + + // Address of the Gateway associated with the network + Gateway *string `json:"gateway,omitempty"` + + // IP Address Prefix of the network + IPAddressPrefix *string `json:"ipAddressPrefix,omitempty"` InfraVnetProfile *VirtualNetworksPropertiesInfraVnetProfile `json:"infraVnetProfile,omitempty"` // Virtual IP Pool for Kubernetes @@ -1208,18 +1281,9 @@ type VirtualNetworksProperties struct { // IP Pool for Virtual Machines VmipPool []*VirtualNetworksPropertiesVmipPoolItem `json:"vmipPool,omitempty"` - // READ-ONLY; Address of the DNS servers associated with the network - DNSServers []*string `json:"dnsServers,omitempty" azure:"ro"` - // READ-ONLY; Address of the DHCP servers associated with the network DhcpServers []*string `json:"dhcpServers,omitempty" azure:"ro"` - // READ-ONLY; Address of the Gateway associated with the network - Gateway *string `json:"gateway,omitempty" azure:"ro"` - - // READ-ONLY; IP Address Prefix of the network - IPAddressPrefix *string `json:"ipAddressPrefix,omitempty" azure:"ro"` - // READ-ONLY ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` @@ -1234,8 +1298,8 @@ type VirtualNetworksPropertiesInfraVnetProfile struct { // Infra network profile for HCI platform Hci *VirtualNetworksPropertiesInfraVnetProfileHci `json:"hci,omitempty"` - // Infra network profile for KubeVirt platform - Kubevirt *VirtualNetworksPropertiesInfraVnetProfileKubevirt `json:"kubevirt,omitempty"` + // Infra network profile for the NetworkCloud platform + NetworkCloud *VirtualNetworksPropertiesInfraVnetProfileNetworkCloud `json:"networkCloud,omitempty"` // Infra network profile for VMware platform Vmware *VirtualNetworksPropertiesInfraVnetProfileVmware `json:"vmware,omitempty"` @@ -1253,10 +1317,10 @@ type VirtualNetworksPropertiesInfraVnetProfileHci struct { MocVnetName *string `json:"mocVnetName,omitempty"` } -// VirtualNetworksPropertiesInfraVnetProfileKubevirt - Infra network profile for KubeVirt platform -type VirtualNetworksPropertiesInfraVnetProfileKubevirt struct { - // Name of the network in KubeVirt - VnetName *string `json:"vnetName,omitempty"` +// VirtualNetworksPropertiesInfraVnetProfileNetworkCloud - Infra network profile for the NetworkCloud platform +type VirtualNetworksPropertiesInfraVnetProfileNetworkCloud struct { + // The ARM ID of Network Cloud Network Resource to Associate with this VirtualNetwork + NetworkID *string `json:"networkId,omitempty"` } // VirtualNetworksPropertiesInfraVnetProfileVmware - Infra network profile for VMware platform diff --git a/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/models_serde.go b/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/models_serde.go index ed1ac0e68a77..8c0c806022be 100644 --- a/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/models_serde.go +++ b/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/models_serde.go @@ -18,7 +18,7 @@ import ( // MarshalJSON implements the json.Marshaller interface for type AADProfile. func (a AADProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "adminGroupObjectIDs", a.AdminGroupObjectIDs) populate(objectMap, "clientAppID", a.ClientAppID) populate(objectMap, "enableAzureRbac", a.EnableAzureRbac) @@ -69,7 +69,7 @@ func (a *AADProfile) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AADProfileResponse. func (a AADProfileResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "adminGroupObjectIDs", a.AdminGroupObjectIDs) populate(objectMap, "clientAppID", a.ClientAppID) populate(objectMap, "enableAzureRbac", a.EnableAzureRbac) @@ -116,7 +116,7 @@ func (a *AADProfileResponse) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AddonProfiles. func (a AddonProfiles) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "config", a.Config) populate(objectMap, "enabled", a.Enabled) return json.Marshal(objectMap) @@ -147,7 +147,7 @@ func (a *AddonProfiles) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AddonStatus. func (a AddonStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "errorMessage", a.ErrorMessage) populate(objectMap, "phase", a.Phase) populate(objectMap, "ready", a.Ready) @@ -182,7 +182,7 @@ func (a *AddonStatus) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AgentPool. func (a AgentPool) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "extendedLocation", a.ExtendedLocation) populate(objectMap, "id", a.ID) populate(objectMap, "location", a.Location) @@ -237,7 +237,7 @@ func (a *AgentPool) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AgentPoolExtendedLocation. func (a AgentPoolExtendedLocation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "name", a.Name) populate(objectMap, "type", a.Type) return json.Marshal(objectMap) @@ -268,7 +268,7 @@ func (a *AgentPoolExtendedLocation) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AgentPoolListResult. func (a AgentPoolListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", a.NextLink) populate(objectMap, "value", a.Value) return json.Marshal(objectMap) @@ -299,7 +299,7 @@ func (a *AgentPoolListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AgentPoolProperties. func (a AgentPoolProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "availabilityZones", a.AvailabilityZones) populate(objectMap, "cloudProviderProfile", a.CloudProviderProfile) populate(objectMap, "count", a.Count) @@ -378,7 +378,7 @@ func (a *AgentPoolProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AgentPoolProvisioningStatusError. func (a AgentPoolProvisioningStatusError) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "code", a.Code) populate(objectMap, "message", a.Message) return json.Marshal(objectMap) @@ -409,7 +409,7 @@ func (a *AgentPoolProvisioningStatusError) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AgentPoolProvisioningStatusStatus. func (a AgentPoolProvisioningStatusStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "errorMessage", a.ErrorMessage) populate(objectMap, "provisioningStatus", a.ProvisioningStatus) populate(objectMap, "readyReplicas", a.ReadyReplicas) @@ -448,7 +448,7 @@ func (a *AgentPoolProvisioningStatusStatus) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AgentPoolProvisioningStatusStatusProvisioningStatus. func (a AgentPoolProvisioningStatusStatusProvisioningStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "error", a.Error) populate(objectMap, "operationId", a.OperationID) populate(objectMap, "phase", a.Phase) @@ -487,7 +487,7 @@ func (a *AgentPoolProvisioningStatusStatusProvisioningStatus) UnmarshalJSON(data // MarshalJSON implements the json.Marshaller interface for type ArcAgentProfile. func (a ArcAgentProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "agentAutoUpgrade", a.AgentAutoUpgrade) populate(objectMap, "agentVersion", a.AgentVersion) return json.Marshal(objectMap) @@ -518,7 +518,7 @@ func (a *ArcAgentProfile) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ArcAgentStatus. func (a ArcAgentStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "agentVersion", a.AgentVersion) populate(objectMap, "coreCount", a.CoreCount) populate(objectMap, "deploymentState", a.DeploymentState) @@ -569,7 +569,7 @@ func (a *ArcAgentStatus) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type CloudProviderProfile. func (c CloudProviderProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "infraNetworkProfile", c.InfraNetworkProfile) populate(objectMap, "infraStorageProfile", c.InfraStorageProfile) return json.Marshal(objectMap) @@ -600,7 +600,7 @@ func (c *CloudProviderProfile) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type CloudProviderProfileInfraNetworkProfile. func (c CloudProviderProfileInfraNetworkProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "vnetSubnetIds", c.VnetSubnetIDs) return json.Marshal(objectMap) } @@ -627,7 +627,7 @@ func (c *CloudProviderProfileInfraNetworkProfile) UnmarshalJSON(data []byte) err // MarshalJSON implements the json.Marshaller interface for type CloudProviderProfileInfraStorageProfile. func (c CloudProviderProfileInfraStorageProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "storageSpaceIds", c.StorageSpaceIDs) return json.Marshal(objectMap) } @@ -654,7 +654,7 @@ func (c *CloudProviderProfileInfraStorageProfile) UnmarshalJSON(data []byte) err // MarshalJSON implements the json.Marshaller interface for type ControlPlaneEndpointProfileControlPlaneEndpoint. func (c ControlPlaneEndpointProfileControlPlaneEndpoint) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "hostIP", c.HostIP) populate(objectMap, "port", c.Port) return json.Marshal(objectMap) @@ -685,7 +685,7 @@ func (c *ControlPlaneEndpointProfileControlPlaneEndpoint) UnmarshalJSON(data []b // MarshalJSON implements the json.Marshaller interface for type ControlPlaneProfile. func (c ControlPlaneProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "availabilityZones", c.AvailabilityZones) populate(objectMap, "cloudProviderProfile", c.CloudProviderProfile) populate(objectMap, "controlPlaneEndpoint", c.ControlPlaneEndpoint) @@ -768,7 +768,7 @@ func (c *ControlPlaneProfile) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type HTTPProxyConfig. func (h HTTPProxyConfig) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "httpProxy", h.HTTPProxy) populate(objectMap, "httpsProxy", h.HTTPSProxy) populate(objectMap, "noProxy", h.NoProxy) @@ -815,7 +815,7 @@ func (h *HTTPProxyConfig) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type HTTPProxyConfigResponse. func (h HTTPProxyConfigResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "httpProxy", h.HTTPProxy) populate(objectMap, "httpsProxy", h.HTTPSProxy) populate(objectMap, "noProxy", h.NoProxy) @@ -858,7 +858,7 @@ func (h *HTTPProxyConfigResponse) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type HybridIdentityMetadata. func (h HybridIdentityMetadata) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", h.ID) populate(objectMap, "name", h.Name) populate(objectMap, "properties", h.Properties) @@ -901,7 +901,7 @@ func (h *HybridIdentityMetadata) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type HybridIdentityMetadataList. func (h HybridIdentityMetadataList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", h.NextLink) populate(objectMap, "value", h.Value) return json.Marshal(objectMap) @@ -932,7 +932,7 @@ func (h *HybridIdentityMetadataList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type HybridIdentityMetadataProperties. func (h HybridIdentityMetadataProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "identity", h.Identity) populate(objectMap, "provisioningState", h.ProvisioningState) populate(objectMap, "publicKey", h.PublicKey) @@ -971,7 +971,7 @@ func (h *HybridIdentityMetadataProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type LinuxProfileProperties. func (l LinuxProfileProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "adminUsername", l.AdminUsername) populate(objectMap, "ssh", l.SSH) return json.Marshal(objectMap) @@ -1002,7 +1002,7 @@ func (l *LinuxProfileProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type LinuxProfilePropertiesSSH. func (l LinuxProfilePropertiesSSH) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "publicKeys", l.PublicKeys) return json.Marshal(objectMap) } @@ -1029,7 +1029,7 @@ func (l *LinuxProfilePropertiesSSH) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type LinuxProfilePropertiesSSHPublicKeysItem. func (l LinuxProfilePropertiesSSHPublicKeysItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "keyData", l.KeyData) return json.Marshal(objectMap) } @@ -1056,7 +1056,7 @@ func (l *LinuxProfilePropertiesSSHPublicKeysItem) UnmarshalJSON(data []byte) err // MarshalJSON implements the json.Marshaller interface for type LoadBalancerProfile. func (l LoadBalancerProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "availabilityZones", l.AvailabilityZones) populate(objectMap, "cloudProviderProfile", l.CloudProviderProfile) populate(objectMap, "count", l.Count) @@ -1135,7 +1135,7 @@ func (l *LoadBalancerProfile) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type NamedAgentPoolProfile. func (n NamedAgentPoolProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "availabilityZones", n.AvailabilityZones) populate(objectMap, "cloudProviderProfile", n.CloudProviderProfile) populate(objectMap, "count", n.Count) @@ -1210,7 +1210,7 @@ func (n *NamedAgentPoolProfile) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type NetworkProfile. func (n NetworkProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "dnsServiceIP", n.DNSServiceIP) populate(objectMap, "loadBalancerProfile", n.LoadBalancerProfile) populate(objectMap, "loadBalancerSku", n.LoadBalancerSKU) @@ -1265,7 +1265,7 @@ func (n *NetworkProfile) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type OrchestratorProfile. func (o OrchestratorProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "isPreview", o.IsPreview) populate(objectMap, "orchestratorType", o.OrchestratorType) populate(objectMap, "orchestratorVersion", o.OrchestratorVersion) @@ -1300,7 +1300,7 @@ func (o *OrchestratorProfile) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type OrchestratorVersionProfile. func (o OrchestratorVersionProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "default", o.Default) populate(objectMap, "isPreview", o.IsPreview) populate(objectMap, "orchestratorType", o.OrchestratorType) @@ -1343,7 +1343,7 @@ func (o *OrchestratorVersionProfile) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type OrchestratorVersionProfileListResult. func (o OrchestratorVersionProfileListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", o.ID) populate(objectMap, "name", o.Name) populate(objectMap, "orchestrators", o.Orchestrators) @@ -1382,7 +1382,7 @@ func (o *OrchestratorVersionProfileListResult) UnmarshalJSON(data []byte) error // MarshalJSON implements the json.Marshaller interface for type ProvisionedClusterIdentity. func (p ProvisionedClusterIdentity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "principalId", p.PrincipalID) populate(objectMap, "tenantId", p.TenantID) populate(objectMap, "type", p.Type) @@ -1415,9 +1415,153 @@ func (p *ProvisionedClusterIdentity) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ProvisionedClusterPoolUpgradeProfile. +func (p ProvisionedClusterPoolUpgradeProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "kubernetesVersion", p.KubernetesVersion) + populate(objectMap, "name", p.Name) + populate(objectMap, "osType", p.OSType) + populate(objectMap, "upgrades", p.Upgrades) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProvisionedClusterPoolUpgradeProfile. +func (p *ProvisionedClusterPoolUpgradeProfile) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "kubernetesVersion": + err = unpopulate(val, "KubernetesVersion", &p.KubernetesVersion) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "osType": + err = unpopulate(val, "OSType", &p.OSType) + delete(rawMsg, key) + case "upgrades": + err = unpopulate(val, "Upgrades", &p.Upgrades) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ProvisionedClusterPoolUpgradeProfileProperties. +func (p ProvisionedClusterPoolUpgradeProfileProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "isPreview", p.IsPreview) + populate(objectMap, "kubernetesVersion", p.KubernetesVersion) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProvisionedClusterPoolUpgradeProfileProperties. +func (p *ProvisionedClusterPoolUpgradeProfileProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "isPreview": + err = unpopulate(val, "IsPreview", &p.IsPreview) + delete(rawMsg, key) + case "kubernetesVersion": + err = unpopulate(val, "KubernetesVersion", &p.KubernetesVersion) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ProvisionedClusterUpgradeProfile. +func (p ProvisionedClusterUpgradeProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProvisionedClusterUpgradeProfile. +func (p *ProvisionedClusterUpgradeProfile) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ProvisionedClusterUpgradeProfileProperties. +func (p ProvisionedClusterUpgradeProfileProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "agentPoolProfiles", p.AgentPoolProfiles) + populate(objectMap, "controlPlaneProfile", p.ControlPlaneProfile) + populate(objectMap, "provisioningState", p.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProvisionedClusterUpgradeProfileProperties. +func (p *ProvisionedClusterUpgradeProfileProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "agentPoolProfiles": + err = unpopulate(val, "AgentPoolProfiles", &p.AgentPoolProfiles) + delete(rawMsg, key) + case "controlPlaneProfile": + err = unpopulate(val, "ControlPlaneProfile", &p.ControlPlaneProfile) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ProvisionedClusters. func (p ProvisionedClusters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "extendedLocation", p.ExtendedLocation) populate(objectMap, "id", p.ID) populate(objectMap, "identity", p.Identity) @@ -1476,7 +1620,7 @@ func (p *ProvisionedClusters) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ProvisionedClustersAllProperties. func (p ProvisionedClustersAllProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "aadProfile", p.AADProfile) populate(objectMap, "addonProfiles", p.AddonProfiles) populate(objectMap, "agentPoolProfiles", p.AgentPoolProfiles) @@ -1559,7 +1703,7 @@ func (p *ProvisionedClustersAllProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ProvisionedClustersCommonPropertiesFeatures. func (p ProvisionedClustersCommonPropertiesFeatures) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "arcAgentProfile", p.ArcAgentProfile) return json.Marshal(objectMap) } @@ -1586,7 +1730,7 @@ func (p *ProvisionedClustersCommonPropertiesFeatures) UnmarshalJSON(data []byte) // MarshalJSON implements the json.Marshaller interface for type ProvisionedClustersCommonPropertiesStatus. func (p ProvisionedClustersCommonPropertiesStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "addonStatus", p.AddonStatus) populate(objectMap, "errorMessage", p.ErrorMessage) populate(objectMap, "featuresStatus", p.FeaturesStatus) @@ -1625,7 +1769,7 @@ func (p *ProvisionedClustersCommonPropertiesStatus) UnmarshalJSON(data []byte) e // MarshalJSON implements the json.Marshaller interface for type ProvisionedClustersCommonPropertiesStatusFeaturesStatus. func (p ProvisionedClustersCommonPropertiesStatusFeaturesStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "arcAgentStatus", p.ArcAgentStatus) return json.Marshal(objectMap) } @@ -1652,7 +1796,7 @@ func (p *ProvisionedClustersCommonPropertiesStatusFeaturesStatus) UnmarshalJSON( // MarshalJSON implements the json.Marshaller interface for type ProvisionedClustersCommonPropertiesStatusProvisioningStatus. func (p ProvisionedClustersCommonPropertiesStatusProvisioningStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "error", p.Error) populate(objectMap, "operationId", p.OperationID) populate(objectMap, "phase", p.Phase) @@ -1691,7 +1835,7 @@ func (p *ProvisionedClustersCommonPropertiesStatusProvisioningStatus) UnmarshalJ // MarshalJSON implements the json.Marshaller interface for type ProvisionedClustersCommonPropertiesStatusProvisioningStatusError. func (p ProvisionedClustersCommonPropertiesStatusProvisioningStatusError) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "code", p.Code) populate(objectMap, "message", p.Message) return json.Marshal(objectMap) @@ -1722,7 +1866,7 @@ func (p *ProvisionedClustersCommonPropertiesStatusProvisioningStatusError) Unmar // MarshalJSON implements the json.Marshaller interface for type ProvisionedClustersExtendedLocation. func (p ProvisionedClustersExtendedLocation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "name", p.Name) populate(objectMap, "type", p.Type) return json.Marshal(objectMap) @@ -1753,7 +1897,7 @@ func (p *ProvisionedClustersExtendedLocation) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ProvisionedClustersPatch. func (p ProvisionedClustersPatch) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "tags", p.Tags) return json.Marshal(objectMap) } @@ -1780,7 +1924,7 @@ func (p *ProvisionedClustersPatch) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ProvisionedClustersResponse. func (p ProvisionedClustersResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "extendedLocation", p.ExtendedLocation) populate(objectMap, "id", p.ID) populate(objectMap, "identity", p.Identity) @@ -1839,7 +1983,7 @@ func (p *ProvisionedClustersResponse) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ProvisionedClustersResponseExtendedLocation. func (p ProvisionedClustersResponseExtendedLocation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "name", p.Name) populate(objectMap, "type", p.Type) return json.Marshal(objectMap) @@ -1870,7 +2014,7 @@ func (p *ProvisionedClustersResponseExtendedLocation) UnmarshalJSON(data []byte) // MarshalJSON implements the json.Marshaller interface for type ProvisionedClustersResponseListResult. func (p ProvisionedClustersResponseListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", p.NextLink) populate(objectMap, "value", p.Value) return json.Marshal(objectMap) @@ -1901,7 +2045,7 @@ func (p *ProvisionedClustersResponseListResult) UnmarshalJSON(data []byte) error // MarshalJSON implements the json.Marshaller interface for type ProvisionedClustersResponseProperties. func (p ProvisionedClustersResponseProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "aadProfile", p.AADProfile) populate(objectMap, "addonProfiles", p.AddonProfiles) populate(objectMap, "agentPoolProfiles", p.AgentPoolProfiles) @@ -1984,7 +2128,7 @@ func (p *ProvisionedClustersResponseProperties) UnmarshalJSON(data []byte) error // MarshalJSON implements the json.Marshaller interface for type ResourceProviderOperation. func (r ResourceProviderOperation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "display", r.Display) populate(objectMap, "isDataAction", r.IsDataAction) populate(objectMap, "name", r.Name) @@ -2019,7 +2163,7 @@ func (r *ResourceProviderOperation) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ResourceProviderOperationDisplay. func (r ResourceProviderOperationDisplay) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "description", r.Description) populate(objectMap, "operation", r.Operation) populate(objectMap, "provider", r.Provider) @@ -2058,7 +2202,7 @@ func (r *ResourceProviderOperationDisplay) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ResourceProviderOperationList. func (r ResourceProviderOperationList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", r.NextLink) populate(objectMap, "value", r.Value) return json.Marshal(objectMap) @@ -2089,7 +2233,7 @@ func (r *ResourceProviderOperationList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type StorageSpaces. func (s StorageSpaces) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "extendedLocation", s.ExtendedLocation) populate(objectMap, "id", s.ID) populate(objectMap, "location", s.Location) @@ -2144,7 +2288,7 @@ func (s *StorageSpaces) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type StorageSpacesExtendedLocation. func (s StorageSpacesExtendedLocation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "name", s.Name) populate(objectMap, "type", s.Type) return json.Marshal(objectMap) @@ -2175,7 +2319,7 @@ func (s *StorageSpacesExtendedLocation) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type StorageSpacesListResult. func (s StorageSpacesListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", s.NextLink) populate(objectMap, "value", s.Value) return json.Marshal(objectMap) @@ -2206,7 +2350,7 @@ func (s *StorageSpacesListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type StorageSpacesPatch. func (s StorageSpacesPatch) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "tags", s.Tags) return json.Marshal(objectMap) } @@ -2233,7 +2377,7 @@ func (s *StorageSpacesPatch) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type StorageSpacesProperties. func (s StorageSpacesProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "hciStorageProfile", s.HciStorageProfile) populate(objectMap, "provisioningState", s.ProvisioningState) populate(objectMap, "status", s.Status) @@ -2272,7 +2416,7 @@ func (s *StorageSpacesProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type StorageSpacesPropertiesHciStorageProfile. func (s StorageSpacesPropertiesHciStorageProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "mocGroup", s.MocGroup) populate(objectMap, "mocLocation", s.MocLocation) populate(objectMap, "mocStorageContainer", s.MocStorageContainer) @@ -2307,7 +2451,7 @@ func (s *StorageSpacesPropertiesHciStorageProfile) UnmarshalJSON(data []byte) er // MarshalJSON implements the json.Marshaller interface for type StorageSpacesPropertiesStatus. func (s StorageSpacesPropertiesStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "provisioningStatus", s.ProvisioningStatus) return json.Marshal(objectMap) } @@ -2334,7 +2478,7 @@ func (s *StorageSpacesPropertiesStatus) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type StorageSpacesPropertiesStatusProvisioningStatus. func (s StorageSpacesPropertiesStatusProvisioningStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "error", s.Error) populate(objectMap, "operationId", s.OperationID) populate(objectMap, "phase", s.Phase) @@ -2373,7 +2517,7 @@ func (s *StorageSpacesPropertiesStatusProvisioningStatus) UnmarshalJSON(data []b // MarshalJSON implements the json.Marshaller interface for type StorageSpacesPropertiesStatusProvisioningStatusError. func (s StorageSpacesPropertiesStatusProvisioningStatusError) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "code", s.Code) populate(objectMap, "message", s.Message) return json.Marshal(objectMap) @@ -2404,7 +2548,7 @@ func (s *StorageSpacesPropertiesStatusProvisioningStatusError) UnmarshalJSON(dat // MarshalJSON implements the json.Marshaller interface for type StorageSpacesPropertiesVmwareStorageProfile. func (s StorageSpacesPropertiesVmwareStorageProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "datacenter", s.Datacenter) populate(objectMap, "datastore", s.Datastore) populate(objectMap, "folder", s.Folder) @@ -2443,7 +2587,7 @@ func (s *StorageSpacesPropertiesVmwareStorageProfile) UnmarshalJSON(data []byte) // MarshalJSON implements the json.Marshaller interface for type SystemData. func (s SystemData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) populate(objectMap, "createdBy", s.CreatedBy) populate(objectMap, "createdByType", s.CreatedByType) @@ -2490,7 +2634,7 @@ func (s *SystemData) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VMSKUListResult. func (v VMSKUListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", v.ID) populate(objectMap, "name", v.Name) populate(objectMap, "type", v.Type) @@ -2529,7 +2673,7 @@ func (v *VMSKUListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VirtualNetworks. func (v VirtualNetworks) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "extendedLocation", v.ExtendedLocation) populate(objectMap, "id", v.ID) populate(objectMap, "location", v.Location) @@ -2584,7 +2728,7 @@ func (v *VirtualNetworks) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VirtualNetworksExtendedLocation. func (v VirtualNetworksExtendedLocation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "name", v.Name) populate(objectMap, "type", v.Type) return json.Marshal(objectMap) @@ -2615,7 +2759,7 @@ func (v *VirtualNetworksExtendedLocation) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VirtualNetworksListResult. func (v VirtualNetworksListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", v.NextLink) populate(objectMap, "value", v.Value) return json.Marshal(objectMap) @@ -2646,7 +2790,7 @@ func (v *VirtualNetworksListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VirtualNetworksPatch. func (v VirtualNetworksPatch) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "tags", v.Tags) return json.Marshal(objectMap) } @@ -2673,7 +2817,7 @@ func (v *VirtualNetworksPatch) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VirtualNetworksProperties. func (v VirtualNetworksProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "dnsServers", v.DNSServers) populate(objectMap, "dhcpServers", v.DhcpServers) populate(objectMap, "gateway", v.Gateway) @@ -2736,9 +2880,9 @@ func (v *VirtualNetworksProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VirtualNetworksPropertiesInfraVnetProfile. func (v VirtualNetworksPropertiesInfraVnetProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "hci", v.Hci) - populate(objectMap, "kubevirt", v.Kubevirt) + populate(objectMap, "networkCloud", v.NetworkCloud) populate(objectMap, "vmware", v.Vmware) return json.Marshal(objectMap) } @@ -2755,8 +2899,8 @@ func (v *VirtualNetworksPropertiesInfraVnetProfile) UnmarshalJSON(data []byte) e case "hci": err = unpopulate(val, "Hci", &v.Hci) delete(rawMsg, key) - case "kubevirt": - err = unpopulate(val, "Kubevirt", &v.Kubevirt) + case "networkCloud": + err = unpopulate(val, "NetworkCloud", &v.NetworkCloud) delete(rawMsg, key) case "vmware": err = unpopulate(val, "Vmware", &v.Vmware) @@ -2771,7 +2915,7 @@ func (v *VirtualNetworksPropertiesInfraVnetProfile) UnmarshalJSON(data []byte) e // MarshalJSON implements the json.Marshaller interface for type VirtualNetworksPropertiesInfraVnetProfileHci. func (v VirtualNetworksPropertiesInfraVnetProfileHci) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "mocGroup", v.MocGroup) populate(objectMap, "mocLocation", v.MocLocation) populate(objectMap, "mocVnetName", v.MocVnetName) @@ -2804,15 +2948,15 @@ func (v *VirtualNetworksPropertiesInfraVnetProfileHci) UnmarshalJSON(data []byte return nil } -// MarshalJSON implements the json.Marshaller interface for type VirtualNetworksPropertiesInfraVnetProfileKubevirt. -func (v VirtualNetworksPropertiesInfraVnetProfileKubevirt) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "vnetName", v.VnetName) +// MarshalJSON implements the json.Marshaller interface for type VirtualNetworksPropertiesInfraVnetProfileNetworkCloud. +func (v VirtualNetworksPropertiesInfraVnetProfileNetworkCloud) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "networkId", v.NetworkID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworksPropertiesInfraVnetProfileKubevirt. -func (v *VirtualNetworksPropertiesInfraVnetProfileKubevirt) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworksPropertiesInfraVnetProfileNetworkCloud. +func (v *VirtualNetworksPropertiesInfraVnetProfileNetworkCloud) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", v, err) @@ -2820,8 +2964,8 @@ func (v *VirtualNetworksPropertiesInfraVnetProfileKubevirt) UnmarshalJSON(data [ for key, val := range rawMsg { var err error switch key { - case "vnetName": - err = unpopulate(val, "VnetName", &v.VnetName) + case "networkId": + err = unpopulate(val, "NetworkID", &v.NetworkID) delete(rawMsg, key) } if err != nil { @@ -2833,7 +2977,7 @@ func (v *VirtualNetworksPropertiesInfraVnetProfileKubevirt) UnmarshalJSON(data [ // MarshalJSON implements the json.Marshaller interface for type VirtualNetworksPropertiesInfraVnetProfileVmware. func (v VirtualNetworksPropertiesInfraVnetProfileVmware) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "segmentName", v.SegmentName) return json.Marshal(objectMap) } @@ -2860,7 +3004,7 @@ func (v *VirtualNetworksPropertiesInfraVnetProfileVmware) UnmarshalJSON(data []b // MarshalJSON implements the json.Marshaller interface for type VirtualNetworksPropertiesStatus. func (v VirtualNetworksPropertiesStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "provisioningStatus", v.ProvisioningStatus) return json.Marshal(objectMap) } @@ -2887,7 +3031,7 @@ func (v *VirtualNetworksPropertiesStatus) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VirtualNetworksPropertiesStatusProvisioningStatus. func (v VirtualNetworksPropertiesStatusProvisioningStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "error", v.Error) populate(objectMap, "operationId", v.OperationID) populate(objectMap, "phase", v.Phase) @@ -2926,7 +3070,7 @@ func (v *VirtualNetworksPropertiesStatusProvisioningStatus) UnmarshalJSON(data [ // MarshalJSON implements the json.Marshaller interface for type VirtualNetworksPropertiesStatusProvisioningStatusError. func (v VirtualNetworksPropertiesStatusProvisioningStatusError) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "code", v.Code) populate(objectMap, "message", v.Message) return json.Marshal(objectMap) @@ -2957,7 +3101,7 @@ func (v *VirtualNetworksPropertiesStatusProvisioningStatusError) UnmarshalJSON(d // MarshalJSON implements the json.Marshaller interface for type VirtualNetworksPropertiesVipPoolItem. func (v VirtualNetworksPropertiesVipPoolItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "endIP", v.EndIP) populate(objectMap, "startIP", v.StartIP) return json.Marshal(objectMap) @@ -2988,7 +3132,7 @@ func (v *VirtualNetworksPropertiesVipPoolItem) UnmarshalJSON(data []byte) error // MarshalJSON implements the json.Marshaller interface for type VirtualNetworksPropertiesVmipPoolItem. func (v VirtualNetworksPropertiesVmipPoolItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "endIP", v.EndIP) populate(objectMap, "startIP", v.StartIP) return json.Marshal(objectMap) @@ -3019,7 +3163,7 @@ func (v *VirtualNetworksPropertiesVmipPoolItem) UnmarshalJSON(data []byte) error // MarshalJSON implements the json.Marshaller interface for type WindowsProfile. func (w WindowsProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "adminPassword", w.AdminPassword) populate(objectMap, "adminUsername", w.AdminUsername) populate(objectMap, "enableCsiProxy", w.EnableCsiProxy) @@ -3058,7 +3202,7 @@ func (w *WindowsProfile) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type WindowsProfileResponse. func (w WindowsProfileResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "adminUsername", w.AdminUsername) populate(objectMap, "enableCsiProxy", w.EnableCsiProxy) populate(objectMap, "licenseType", w.LicenseType) @@ -3091,7 +3235,7 @@ func (w *WindowsProfileResponse) UnmarshalJSON(data []byte) error { return nil } -func populate(m map[string]interface{}, k string, v interface{}) { +func populate(m map[string]any, k string, v any) { if v == nil { return } else if azcore.IsNullValue(v) { @@ -3101,7 +3245,7 @@ func populate(m map[string]interface{}, k string, v interface{}) { } } -func unpopulate(data json.RawMessage, fn string, v interface{}) error { +func unpopulate(data json.RawMessage, fn string, v any) error { if data == nil { return nil } diff --git a/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/operations_client.go b/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/operations_client.go index 393d84e7d65f..7f674ab1972e 100644 --- a/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/operations_client.go +++ b/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/operations_client.go @@ -28,8 +28,8 @@ type OperationsClient struct { } // NewOperationsClient creates a new instance of OperationsClient with the specified values. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -49,7 +49,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO return client, nil } -// options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. +// - 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]{ More: func(page OperationsClientListResponse) bool { @@ -86,7 +86,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/operations_client_example_test.go b/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/operations_client_example_test.go deleted file mode 100644 index 4e7303ee71d8..000000000000 --- a/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/operations_client_example_test.go +++ /dev/null @@ -1,41 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armhybridcontainerservice_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/ListOperations.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybridcontainerservice.NewOperationsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/provisionedclusters_client.go b/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/provisionedclusters_client.go index 88ff659f883a..74873a0f61c3 100644 --- a/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/provisionedclusters_client.go +++ b/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/provisionedclusters_client.go @@ -32,9 +32,9 @@ type ProvisionedClustersClient struct { } // NewProvisionedClustersClient creates a new instance of ProvisionedClustersClient with the specified values. -// subscriptionID - The ID of the target subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewProvisionedClustersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ProvisionedClustersClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,14 +57,15 @@ func NewProvisionedClustersClient(subscriptionID string, credential azcore.Token // BeginCreateOrUpdate - Creates the Hybrid AKS provisioned cluster // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// provisionedClustersName - Parameter for the name of the provisioned cluster -// options - ProvisionedClustersClientBeginCreateOrUpdateOptions contains the optional parameters for the ProvisionedClustersClient.BeginCreateOrUpdate -// method. -func (client *ProvisionedClustersClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, provisionedClustersName string, provisionedClusters ProvisionedClusters, options *ProvisionedClustersClientBeginCreateOrUpdateOptions) (*runtime.Poller[ProvisionedClustersClientCreateOrUpdateResponse], error) { +// +// Generated from API version 2022-09-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - resourceName - Parameter for the name of the provisioned cluster +// - options - ProvisionedClustersClientBeginCreateOrUpdateOptions contains the optional parameters for the ProvisionedClustersClient.BeginCreateOrUpdate +// method. +func (client *ProvisionedClustersClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, provisionedClusters ProvisionedClusters, options *ProvisionedClustersClientBeginCreateOrUpdateOptions) (*runtime.Poller[ProvisionedClustersClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, provisionedClustersName, provisionedClusters, options) + resp, err := client.createOrUpdate(ctx, resourceGroupName, resourceName, provisionedClusters, options) if err != nil { return nil, err } @@ -78,9 +79,10 @@ func (client *ProvisionedClustersClient) BeginCreateOrUpdate(ctx context.Context // CreateOrUpdate - Creates the Hybrid AKS provisioned cluster // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01-preview -func (client *ProvisionedClustersClient) createOrUpdate(ctx context.Context, resourceGroupName string, provisionedClustersName string, provisionedClusters ProvisionedClusters, options *ProvisionedClustersClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, provisionedClustersName, provisionedClusters, options) +// +// Generated from API version 2022-09-01-preview +func (client *ProvisionedClustersClient) createOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, provisionedClusters ProvisionedClusters, options *ProvisionedClustersClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, resourceName, provisionedClusters, options) if err != nil { return nil, err } @@ -95,8 +97,8 @@ func (client *ProvisionedClustersClient) createOrUpdate(ctx context.Context, res } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ProvisionedClustersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, provisionedClustersName string, provisionedClusters ProvisionedClusters, options *ProvisionedClustersClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridContainerService/provisionedClusters/{provisionedClustersName}" +func (client *ProvisionedClustersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, provisionedClusters ProvisionedClusters, options *ProvisionedClustersClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridContainerService/provisionedClusters/{resourceName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -105,16 +107,16 @@ func (client *ProvisionedClustersClient) createOrUpdateCreateRequest(ctx context return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if provisionedClustersName == "" { - return nil, errors.New("parameter provisionedClustersName cannot be empty") + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") } - urlPath = strings.ReplaceAll(urlPath, "{provisionedClustersName}", url.PathEscape(provisionedClustersName)) + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, provisionedClusters) @@ -122,13 +124,14 @@ func (client *ProvisionedClustersClient) createOrUpdateCreateRequest(ctx context // Delete - Deletes the Hybrid AKS provisioned cluster // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// provisionedClustersName - Parameter for the name of the provisioned cluster -// options - ProvisionedClustersClientDeleteOptions contains the optional parameters for the ProvisionedClustersClient.Delete -// method. -func (client *ProvisionedClustersClient) Delete(ctx context.Context, resourceGroupName string, provisionedClustersName string, options *ProvisionedClustersClientDeleteOptions) (ProvisionedClustersClientDeleteResponse, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, provisionedClustersName, options) +// +// Generated from API version 2022-09-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - resourceName - Parameter for the name of the provisioned cluster +// - options - ProvisionedClustersClientDeleteOptions contains the optional parameters for the ProvisionedClustersClient.Delete +// method. +func (client *ProvisionedClustersClient) Delete(ctx context.Context, resourceGroupName string, resourceName string, options *ProvisionedClustersClientDeleteOptions) (ProvisionedClustersClientDeleteResponse, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, resourceName, options) if err != nil { return ProvisionedClustersClientDeleteResponse{}, err } @@ -143,8 +146,8 @@ func (client *ProvisionedClustersClient) Delete(ctx context.Context, resourceGro } // deleteCreateRequest creates the Delete request. -func (client *ProvisionedClustersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, provisionedClustersName string, options *ProvisionedClustersClientDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridContainerService/provisionedClusters/{provisionedClustersName}" +func (client *ProvisionedClustersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *ProvisionedClustersClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridContainerService/provisionedClusters/{resourceName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -153,16 +156,16 @@ func (client *ProvisionedClustersClient) deleteCreateRequest(ctx context.Context return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if provisionedClustersName == "" { - return nil, errors.New("parameter provisionedClustersName cannot be empty") + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") } - urlPath = strings.ReplaceAll(urlPath, "{provisionedClustersName}", url.PathEscape(provisionedClustersName)) + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -170,12 +173,13 @@ func (client *ProvisionedClustersClient) deleteCreateRequest(ctx context.Context // Get - Gets the Hybrid AKS provisioned cluster // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// provisionedClustersName - Parameter for the name of the provisioned cluster -// options - ProvisionedClustersClientGetOptions contains the optional parameters for the ProvisionedClustersClient.Get method. -func (client *ProvisionedClustersClient) Get(ctx context.Context, resourceGroupName string, provisionedClustersName string, options *ProvisionedClustersClientGetOptions) (ProvisionedClustersClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, provisionedClustersName, options) +// +// Generated from API version 2022-09-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - resourceName - Parameter for the name of the provisioned cluster +// - options - ProvisionedClustersClientGetOptions contains the optional parameters for the ProvisionedClustersClient.Get method. +func (client *ProvisionedClustersClient) Get(ctx context.Context, resourceGroupName string, resourceName string, options *ProvisionedClustersClientGetOptions) (ProvisionedClustersClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, resourceName, options) if err != nil { return ProvisionedClustersClientGetResponse{}, err } @@ -190,8 +194,8 @@ func (client *ProvisionedClustersClient) Get(ctx context.Context, resourceGroupN } // getCreateRequest creates the Get request. -func (client *ProvisionedClustersClient) getCreateRequest(ctx context.Context, resourceGroupName string, provisionedClustersName string, options *ProvisionedClustersClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridContainerService/provisionedClusters/{provisionedClustersName}" +func (client *ProvisionedClustersClient) getCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *ProvisionedClustersClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridContainerService/provisionedClusters/{resourceName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -200,16 +204,16 @@ func (client *ProvisionedClustersClient) getCreateRequest(ctx context.Context, r return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if provisionedClustersName == "" { - return nil, errors.New("parameter provisionedClustersName cannot be empty") + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") } - urlPath = strings.ReplaceAll(urlPath, "{provisionedClustersName}", url.PathEscape(provisionedClustersName)) + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -224,11 +228,70 @@ func (client *ProvisionedClustersClient) getHandleResponse(resp *http.Response) return result, nil } +// GetUpgradeProfile - Gets the upgrade profile of a provisioned cluster. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - resourceName - Parameter for the name of the provisioned cluster +// - options - ProvisionedClustersClientGetUpgradeProfileOptions contains the optional parameters for the ProvisionedClustersClient.GetUpgradeProfile +// method. +func (client *ProvisionedClustersClient) GetUpgradeProfile(ctx context.Context, resourceGroupName string, resourceName string, options *ProvisionedClustersClientGetUpgradeProfileOptions) (ProvisionedClustersClientGetUpgradeProfileResponse, error) { + req, err := client.getUpgradeProfileCreateRequest(ctx, resourceGroupName, resourceName, options) + if err != nil { + return ProvisionedClustersClientGetUpgradeProfileResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ProvisionedClustersClientGetUpgradeProfileResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ProvisionedClustersClientGetUpgradeProfileResponse{}, runtime.NewResponseError(resp) + } + return client.getUpgradeProfileHandleResponse(resp) +} + +// getUpgradeProfileCreateRequest creates the GetUpgradeProfile request. +func (client *ProvisionedClustersClient) getUpgradeProfileCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *ProvisionedClustersClientGetUpgradeProfileOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridContainerService/provisionedClusters/{resourceName}/upgradeProfiles/default" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-09-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getUpgradeProfileHandleResponse handles the GetUpgradeProfile response. +func (client *ProvisionedClustersClient) getUpgradeProfileHandleResponse(resp *http.Response) (ProvisionedClustersClientGetUpgradeProfileResponse, error) { + result := ProvisionedClustersClientGetUpgradeProfileResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ProvisionedClusterUpgradeProfile); err != nil { + return ProvisionedClustersClientGetUpgradeProfileResponse{}, err + } + return result, nil +} + // NewListByResourceGroupPager - Gets the Hybrid AKS provisioned cluster in a resource group -// Generated from API version 2022-05-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// options - ProvisionedClustersClientListByResourceGroupOptions contains the optional parameters for the ProvisionedClustersClient.ListByResourceGroup -// method. +// +// Generated from API version 2022-09-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - options - ProvisionedClustersClientListByResourceGroupOptions contains the optional parameters for the ProvisionedClustersClient.NewListByResourceGroupPager +// method. func (client *ProvisionedClustersClient) NewListByResourceGroupPager(resourceGroupName string, options *ProvisionedClustersClientListByResourceGroupOptions) *runtime.Pager[ProvisionedClustersClientListByResourceGroupResponse] { return runtime.NewPager(runtime.PagingHandler[ProvisionedClustersClientListByResourceGroupResponse]{ More: func(page ProvisionedClustersClientListByResourceGroupResponse) bool { @@ -273,7 +336,7 @@ func (client *ProvisionedClustersClient) listByResourceGroupCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -289,9 +352,10 @@ func (client *ProvisionedClustersClient) listByResourceGroupHandleResponse(resp } // NewListBySubscriptionPager - Gets the Hybrid AKS provisioned cluster in a subscription -// Generated from API version 2022-05-01-preview -// options - ProvisionedClustersClientListBySubscriptionOptions contains the optional parameters for the ProvisionedClustersClient.ListBySubscription -// method. +// +// Generated from API version 2022-09-01-preview +// - options - ProvisionedClustersClientListBySubscriptionOptions contains the optional parameters for the ProvisionedClustersClient.NewListBySubscriptionPager +// method. func (client *ProvisionedClustersClient) NewListBySubscriptionPager(options *ProvisionedClustersClientListBySubscriptionOptions) *runtime.Pager[ProvisionedClustersClientListBySubscriptionResponse] { return runtime.NewPager(runtime.PagingHandler[ProvisionedClustersClientListBySubscriptionResponse]{ More: func(page ProvisionedClustersClientListBySubscriptionResponse) bool { @@ -332,7 +396,7 @@ func (client *ProvisionedClustersClient) listBySubscriptionCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -349,14 +413,15 @@ func (client *ProvisionedClustersClient) listBySubscriptionHandleResponse(resp * // BeginUpdate - Updates the Hybrid AKS provisioned cluster // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// provisionedClustersName - Parameter for the name of the provisioned cluster -// options - ProvisionedClustersClientBeginUpdateOptions contains the optional parameters for the ProvisionedClustersClient.BeginUpdate -// method. -func (client *ProvisionedClustersClient) BeginUpdate(ctx context.Context, resourceGroupName string, provisionedClustersName string, provisionedClusters ProvisionedClustersPatch, options *ProvisionedClustersClientBeginUpdateOptions) (*runtime.Poller[ProvisionedClustersClientUpdateResponse], error) { +// +// Generated from API version 2022-09-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - resourceName - Parameter for the name of the provisioned cluster +// - options - ProvisionedClustersClientBeginUpdateOptions contains the optional parameters for the ProvisionedClustersClient.BeginUpdate +// method. +func (client *ProvisionedClustersClient) BeginUpdate(ctx context.Context, resourceGroupName string, resourceName string, provisionedClusters ProvisionedClustersPatch, options *ProvisionedClustersClientBeginUpdateOptions) (*runtime.Poller[ProvisionedClustersClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, provisionedClustersName, provisionedClusters, options) + resp, err := client.update(ctx, resourceGroupName, resourceName, provisionedClusters, options) if err != nil { return nil, err } @@ -370,9 +435,10 @@ func (client *ProvisionedClustersClient) BeginUpdate(ctx context.Context, resour // Update - Updates the Hybrid AKS provisioned cluster // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01-preview -func (client *ProvisionedClustersClient) update(ctx context.Context, resourceGroupName string, provisionedClustersName string, provisionedClusters ProvisionedClustersPatch, options *ProvisionedClustersClientBeginUpdateOptions) (*http.Response, error) { - req, err := client.updateCreateRequest(ctx, resourceGroupName, provisionedClustersName, provisionedClusters, options) +// +// Generated from API version 2022-09-01-preview +func (client *ProvisionedClustersClient) update(ctx context.Context, resourceGroupName string, resourceName string, provisionedClusters ProvisionedClustersPatch, options *ProvisionedClustersClientBeginUpdateOptions) (*http.Response, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, resourceName, provisionedClusters, options) if err != nil { return nil, err } @@ -387,8 +453,8 @@ func (client *ProvisionedClustersClient) update(ctx context.Context, resourceGro } // updateCreateRequest creates the Update request. -func (client *ProvisionedClustersClient) updateCreateRequest(ctx context.Context, resourceGroupName string, provisionedClustersName string, provisionedClusters ProvisionedClustersPatch, options *ProvisionedClustersClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridContainerService/provisionedClusters/{provisionedClustersName}" +func (client *ProvisionedClustersClient) updateCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, provisionedClusters ProvisionedClustersPatch, options *ProvisionedClustersClientBeginUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridContainerService/provisionedClusters/{resourceName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -397,17 +463,86 @@ func (client *ProvisionedClustersClient) updateCreateRequest(ctx context.Context return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if provisionedClustersName == "" { - return nil, errors.New("parameter provisionedClustersName cannot be empty") + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") } - urlPath = strings.ReplaceAll(urlPath, "{provisionedClustersName}", url.PathEscape(provisionedClustersName)) + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, provisionedClusters) } + +// BeginUpgradeNodeImageVersionForEntireCluster - Upgrading the node image version of a cluster applies the newest OS and +// runtime updates to the nodes. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - resourceName - Parameter for the name of the provisioned cluster +// - options - ProvisionedClustersClientBeginUpgradeNodeImageVersionForEntireClusterOptions contains the optional parameters +// for the ProvisionedClustersClient.BeginUpgradeNodeImageVersionForEntireCluster method. +func (client *ProvisionedClustersClient) BeginUpgradeNodeImageVersionForEntireCluster(ctx context.Context, resourceGroupName string, resourceName string, options *ProvisionedClustersClientBeginUpgradeNodeImageVersionForEntireClusterOptions) (*runtime.Poller[ProvisionedClustersClientUpgradeNodeImageVersionForEntireClusterResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.upgradeNodeImageVersionForEntireCluster(ctx, resourceGroupName, resourceName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ProvisionedClustersClientUpgradeNodeImageVersionForEntireClusterResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[ProvisionedClustersClientUpgradeNodeImageVersionForEntireClusterResponse](options.ResumeToken, client.pl, nil) + } +} + +// UpgradeNodeImageVersionForEntireCluster - Upgrading the node image version of a cluster applies the newest OS and runtime +// updates to the nodes. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01-preview +func (client *ProvisionedClustersClient) upgradeNodeImageVersionForEntireCluster(ctx context.Context, resourceGroupName string, resourceName string, options *ProvisionedClustersClientBeginUpgradeNodeImageVersionForEntireClusterOptions) (*http.Response, error) { + req, err := client.upgradeNodeImageVersionForEntireClusterCreateRequest(ctx, resourceGroupName, resourceName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// upgradeNodeImageVersionForEntireClusterCreateRequest creates the UpgradeNodeImageVersionForEntireCluster request. +func (client *ProvisionedClustersClient) upgradeNodeImageVersionForEntireClusterCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *ProvisionedClustersClientBeginUpgradeNodeImageVersionForEntireClusterOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridContainerService/provisionedClusters/{resourceName}/upgradeNodeImageVersionForEntireCluster" + 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 resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-09-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} diff --git a/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/provisionedclusters_client_example_test.go b/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/provisionedclusters_client_example_test.go deleted file mode 100644 index e124d7b5b460..000000000000 --- a/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/provisionedclusters_client_example_test.go +++ /dev/null @@ -1,217 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armhybridcontainerservice_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/hybridcontainerservice/armhybridcontainerservice" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/GetProvisionedCluster.json -func ExampleProvisionedClustersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybridcontainerservice.NewProvisionedClustersClient("a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "test-arcappliance-resgrp", "test-hybridakscluster", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/PutProvisionedCluster.json -func ExampleProvisionedClustersClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybridcontainerservice.NewProvisionedClustersClient("a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, "test-arcappliance-resgrp", "test-hybridakscluster", armhybridcontainerservice.ProvisionedClusters{ - Location: to.Ptr("westus"), - ExtendedLocation: &armhybridcontainerservice.ProvisionedClustersExtendedLocation{ - Name: to.Ptr("/subscriptions/a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b/resourcegroups/test-arcappliance-resgrp/providers/microsoft.extendedlocation/customlocations/testcustomlocation"), - Type: to.Ptr("CustomLocation"), - }, - Properties: &armhybridcontainerservice.ProvisionedClustersAllProperties{ - AgentPoolProfiles: []*armhybridcontainerservice.NamedAgentPoolProfile{ - { - Name: to.Ptr("default-nodepool-1"), - Count: to.Ptr[int32](1), - OSType: to.Ptr(armhybridcontainerservice.OsTypeLinux), - VMSize: to.Ptr("Standard_A4_v2"), - }}, - CloudProviderProfile: &armhybridcontainerservice.CloudProviderProfile{ - InfraNetworkProfile: &armhybridcontainerservice.CloudProviderProfileInfraNetworkProfile{ - VnetSubnetIDs: []*string{ - to.Ptr("/subscriptions/a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b/resourceGroups/test-arcappliance-resgrp/providers/Microsoft.HybridContainerService/virtualNetworks/test-vnet-static")}, - }, - InfraStorageProfile: &armhybridcontainerservice.CloudProviderProfileInfraStorageProfile{ - StorageSpaceIDs: []*string{ - to.Ptr("/subscriptions/a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b/resourceGroups/test-arcappliance-resgrp/providers/Microsoft.HybridContainerService/storageSpaces/test-storage")}, - }, - }, - ControlPlane: &armhybridcontainerservice.ControlPlaneProfile{ - LinuxProfile: &armhybridcontainerservice.LinuxProfileProperties{ - SSH: &armhybridcontainerservice.LinuxProfilePropertiesSSH{ - PublicKeys: []*armhybridcontainerservice.LinuxProfilePropertiesSSHPublicKeysItem{ - { - KeyData: to.Ptr("ssh-rsa AAAAB1NzaC1yc2EAAAADAQABAAACAQCY......"), - }}, - }, - }, - Count: to.Ptr[int32](1), - OSType: to.Ptr(armhybridcontainerservice.OsTypeLinux), - VMSize: to.Ptr("Standard_A4_v2"), - }, - KubernetesVersion: to.Ptr("v1.20.5"), - LinuxProfile: &armhybridcontainerservice.LinuxProfileProperties{ - SSH: &armhybridcontainerservice.LinuxProfilePropertiesSSH{ - PublicKeys: []*armhybridcontainerservice.LinuxProfilePropertiesSSHPublicKeysItem{ - { - KeyData: to.Ptr("ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCY......."), - }}, - }, - }, - NetworkProfile: &armhybridcontainerservice.NetworkProfile{ - LoadBalancerProfile: &armhybridcontainerservice.LoadBalancerProfile{ - LinuxProfile: &armhybridcontainerservice.LinuxProfileProperties{ - SSH: &armhybridcontainerservice.LinuxProfilePropertiesSSH{ - PublicKeys: []*armhybridcontainerservice.LinuxProfilePropertiesSSHPublicKeysItem{ - { - KeyData: to.Ptr("ssh-rsa AAAAB2NzaC1yc2EAAAADAQABAAACAQCY......"), - }}, - }, - }, - Count: to.Ptr[int32](1), - OSType: to.Ptr(armhybridcontainerservice.OsTypeLinux), - VMSize: to.Ptr("Standard_K8S3_v1"), - }, - LoadBalancerSKU: to.Ptr(armhybridcontainerservice.LoadBalancerSKUUnstackedHaproxy), - NetworkPolicy: to.Ptr(armhybridcontainerservice.NetworkPolicyCalico), - PodCidr: to.Ptr("10.244.0.0/16"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/DeleteProvisionedCluster.json -func ExampleProvisionedClustersClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybridcontainerservice.NewProvisionedClustersClient("a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, "test-arcappliance-resgrp", "test-hybridakscluster", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/UpdateProvisionedCluster.json -func ExampleProvisionedClustersClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybridcontainerservice.NewProvisionedClustersClient("a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, "test-arcappliance-resgrp", "test-hybridakscluster", armhybridcontainerservice.ProvisionedClustersPatch{ - Tags: map[string]*string{ - "additionalProperties": to.Ptr("sample"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/ListProvisionedClusterByResourceGroup.json -func ExampleProvisionedClustersClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybridcontainerservice.NewProvisionedClustersClient("a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("test-arcappliance-resgrp", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/ListProvisionedClusterBySubscription.json -func ExampleProvisionedClustersClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybridcontainerservice.NewProvisionedClustersClient("a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySubscriptionPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/response_types.go b/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/response_types.go index 553870b7ac73..d41bf2b04e23 100644 --- a/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/response_types.go +++ b/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/response_types.go @@ -9,7 +9,7 @@ package armhybridcontainerservice -// AgentPoolClientCreateOrUpdateResponse contains the response from method AgentPoolClient.CreateOrUpdate. +// AgentPoolClientCreateOrUpdateResponse contains the response from method AgentPoolClient.BeginCreateOrUpdate. type AgentPoolClientCreateOrUpdateResponse struct { AgentPool } @@ -54,7 +54,7 @@ type HybridIdentityMetadataClientGetResponse struct { HybridIdentityMetadata } -// HybridIdentityMetadataClientListByClusterResponse contains the response from method HybridIdentityMetadataClient.ListByCluster. +// HybridIdentityMetadataClientListByClusterResponse contains the response from method HybridIdentityMetadataClient.NewListByClusterPager. type HybridIdentityMetadataClientListByClusterResponse struct { HybridIdentityMetadataList } @@ -64,12 +64,12 @@ type HybridIdentityMetadataClientPutResponse struct { HybridIdentityMetadata } -// OperationsClientListResponse contains the response from method OperationsClient.List. +// OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { ResourceProviderOperationList } -// ProvisionedClustersClientCreateOrUpdateResponse contains the response from method ProvisionedClustersClient.CreateOrUpdate. +// ProvisionedClustersClientCreateOrUpdateResponse contains the response from method ProvisionedClustersClient.BeginCreateOrUpdate. type ProvisionedClustersClientCreateOrUpdateResponse struct { ProvisionedClustersResponse } @@ -84,22 +84,32 @@ type ProvisionedClustersClientGetResponse struct { ProvisionedClustersResponse } -// ProvisionedClustersClientListByResourceGroupResponse contains the response from method ProvisionedClustersClient.ListByResourceGroup. +// ProvisionedClustersClientGetUpgradeProfileResponse contains the response from method ProvisionedClustersClient.GetUpgradeProfile. +type ProvisionedClustersClientGetUpgradeProfileResponse struct { + ProvisionedClusterUpgradeProfile +} + +// ProvisionedClustersClientListByResourceGroupResponse contains the response from method ProvisionedClustersClient.NewListByResourceGroupPager. type ProvisionedClustersClientListByResourceGroupResponse struct { ProvisionedClustersResponseListResult } -// ProvisionedClustersClientListBySubscriptionResponse contains the response from method ProvisionedClustersClient.ListBySubscription. +// ProvisionedClustersClientListBySubscriptionResponse contains the response from method ProvisionedClustersClient.NewListBySubscriptionPager. type ProvisionedClustersClientListBySubscriptionResponse struct { ProvisionedClustersResponseListResult } -// ProvisionedClustersClientUpdateResponse contains the response from method ProvisionedClustersClient.Update. +// ProvisionedClustersClientUpdateResponse contains the response from method ProvisionedClustersClient.BeginUpdate. type ProvisionedClustersClientUpdateResponse struct { ProvisionedClustersResponse } -// StorageSpacesClientCreateOrUpdateResponse contains the response from method StorageSpacesClient.CreateOrUpdate. +// ProvisionedClustersClientUpgradeNodeImageVersionForEntireClusterResponse contains the response from method ProvisionedClustersClient.BeginUpgradeNodeImageVersionForEntireCluster. +type ProvisionedClustersClientUpgradeNodeImageVersionForEntireClusterResponse struct { + // placeholder for future response values +} + +// StorageSpacesClientCreateOrUpdateResponse contains the response from method StorageSpacesClient.BeginCreateOrUpdate. type StorageSpacesClientCreateOrUpdateResponse struct { StorageSpaces } @@ -109,12 +119,12 @@ type StorageSpacesClientDeleteResponse struct { // placeholder for future response values } -// StorageSpacesClientListByResourceGroupResponse contains the response from method StorageSpacesClient.ListByResourceGroup. +// StorageSpacesClientListByResourceGroupResponse contains the response from method StorageSpacesClient.NewListByResourceGroupPager. type StorageSpacesClientListByResourceGroupResponse struct { StorageSpacesListResult } -// StorageSpacesClientListBySubscriptionResponse contains the response from method StorageSpacesClient.ListBySubscription. +// StorageSpacesClientListBySubscriptionResponse contains the response from method StorageSpacesClient.NewListBySubscriptionPager. type StorageSpacesClientListBySubscriptionResponse struct { StorageSpacesListResult } @@ -124,12 +134,12 @@ type StorageSpacesClientRetrieveResponse struct { StorageSpaces } -// StorageSpacesClientUpdateResponse contains the response from method StorageSpacesClient.Update. +// StorageSpacesClientUpdateResponse contains the response from method StorageSpacesClient.BeginUpdate. type StorageSpacesClientUpdateResponse struct { StorageSpaces } -// VirtualNetworksClientCreateOrUpdateResponse contains the response from method VirtualNetworksClient.CreateOrUpdate. +// VirtualNetworksClientCreateOrUpdateResponse contains the response from method VirtualNetworksClient.BeginCreateOrUpdate. type VirtualNetworksClientCreateOrUpdateResponse struct { VirtualNetworks } @@ -139,12 +149,12 @@ type VirtualNetworksClientDeleteResponse struct { // placeholder for future response values } -// VirtualNetworksClientListByResourceGroupResponse contains the response from method VirtualNetworksClient.ListByResourceGroup. +// VirtualNetworksClientListByResourceGroupResponse contains the response from method VirtualNetworksClient.NewListByResourceGroupPager. type VirtualNetworksClientListByResourceGroupResponse struct { VirtualNetworksListResult } -// VirtualNetworksClientListBySubscriptionResponse contains the response from method VirtualNetworksClient.ListBySubscription. +// VirtualNetworksClientListBySubscriptionResponse contains the response from method VirtualNetworksClient.NewListBySubscriptionPager. type VirtualNetworksClientListBySubscriptionResponse struct { VirtualNetworksListResult } @@ -154,7 +164,7 @@ type VirtualNetworksClientRetrieveResponse struct { VirtualNetworks } -// VirtualNetworksClientUpdateResponse contains the response from method VirtualNetworksClient.Update. +// VirtualNetworksClientUpdateResponse contains the response from method VirtualNetworksClient.BeginUpdate. type VirtualNetworksClientUpdateResponse struct { VirtualNetworks } diff --git a/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/storagespaces_client.go b/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/storagespaces_client.go index 980d1c999269..8c6dfa65a7e0 100644 --- a/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/storagespaces_client.go +++ b/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/storagespaces_client.go @@ -32,9 +32,9 @@ type StorageSpacesClient struct { } // NewStorageSpacesClient creates a new instance of StorageSpacesClient with the specified values. -// subscriptionID - The ID of the target subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewStorageSpacesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*StorageSpacesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,11 +57,12 @@ func NewStorageSpacesClient(subscriptionID string, credential azcore.TokenCreden // BeginCreateOrUpdate - Puts the Hybrid AKS storage object // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// storageSpacesName - Parameter for the name of the storage object -// options - StorageSpacesClientBeginCreateOrUpdateOptions contains the optional parameters for the StorageSpacesClient.BeginCreateOrUpdate -// method. +// +// Generated from API version 2022-09-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - storageSpacesName - Parameter for the name of the storage object +// - options - StorageSpacesClientBeginCreateOrUpdateOptions contains the optional parameters for the StorageSpacesClient.BeginCreateOrUpdate +// method. func (client *StorageSpacesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, storageSpacesName string, storageSpaces StorageSpaces, options *StorageSpacesClientBeginCreateOrUpdateOptions) (*runtime.Poller[StorageSpacesClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, storageSpacesName, storageSpaces, options) @@ -78,7 +79,8 @@ func (client *StorageSpacesClient) BeginCreateOrUpdate(ctx context.Context, reso // CreateOrUpdate - Puts the Hybrid AKS storage object // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01-preview +// +// Generated from API version 2022-09-01-preview func (client *StorageSpacesClient) createOrUpdate(ctx context.Context, resourceGroupName string, storageSpacesName string, storageSpaces StorageSpaces, options *StorageSpacesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, storageSpacesName, storageSpaces, options) if err != nil { @@ -114,7 +116,7 @@ func (client *StorageSpacesClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, storageSpaces) @@ -122,10 +124,11 @@ func (client *StorageSpacesClient) createOrUpdateCreateRequest(ctx context.Conte // Delete - Deletes the Hybrid AKS storage object // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// storageSpacesName - Parameter for the name of the storage object -// options - StorageSpacesClientDeleteOptions contains the optional parameters for the StorageSpacesClient.Delete method. +// +// Generated from API version 2022-09-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - storageSpacesName - Parameter for the name of the storage object +// - options - StorageSpacesClientDeleteOptions contains the optional parameters for the StorageSpacesClient.Delete method. func (client *StorageSpacesClient) Delete(ctx context.Context, resourceGroupName string, storageSpacesName string, options *StorageSpacesClientDeleteOptions) (StorageSpacesClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, storageSpacesName, options) if err != nil { @@ -161,17 +164,18 @@ func (client *StorageSpacesClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // NewListByResourceGroupPager - List the Hybrid AKS storage object by resource group -// Generated from API version 2022-05-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// options - StorageSpacesClientListByResourceGroupOptions contains the optional parameters for the StorageSpacesClient.ListByResourceGroup -// method. +// +// Generated from API version 2022-09-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - options - StorageSpacesClientListByResourceGroupOptions contains the optional parameters for the StorageSpacesClient.NewListByResourceGroupPager +// method. func (client *StorageSpacesClient) NewListByResourceGroupPager(resourceGroupName string, options *StorageSpacesClientListByResourceGroupOptions) *runtime.Pager[StorageSpacesClientListByResourceGroupResponse] { return runtime.NewPager(runtime.PagingHandler[StorageSpacesClientListByResourceGroupResponse]{ More: func(page StorageSpacesClientListByResourceGroupResponse) bool { @@ -216,7 +220,7 @@ func (client *StorageSpacesClient) listByResourceGroupCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -232,9 +236,10 @@ func (client *StorageSpacesClient) listByResourceGroupHandleResponse(resp *http. } // NewListBySubscriptionPager - List the Hybrid AKS storage object by subscription -// Generated from API version 2022-05-01-preview -// options - StorageSpacesClientListBySubscriptionOptions contains the optional parameters for the StorageSpacesClient.ListBySubscription -// method. +// +// Generated from API version 2022-09-01-preview +// - options - StorageSpacesClientListBySubscriptionOptions contains the optional parameters for the StorageSpacesClient.NewListBySubscriptionPager +// method. func (client *StorageSpacesClient) NewListBySubscriptionPager(options *StorageSpacesClientListBySubscriptionOptions) *runtime.Pager[StorageSpacesClientListBySubscriptionResponse] { return runtime.NewPager(runtime.PagingHandler[StorageSpacesClientListBySubscriptionResponse]{ More: func(page StorageSpacesClientListBySubscriptionResponse) bool { @@ -275,7 +280,7 @@ func (client *StorageSpacesClient) listBySubscriptionCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -292,10 +297,11 @@ func (client *StorageSpacesClient) listBySubscriptionHandleResponse(resp *http.R // Retrieve - Gets the Hybrid AKS storage space object // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// storageSpacesName - Parameter for the name of the storage object -// options - StorageSpacesClientRetrieveOptions contains the optional parameters for the StorageSpacesClient.Retrieve method. +// +// Generated from API version 2022-09-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - storageSpacesName - Parameter for the name of the storage object +// - options - StorageSpacesClientRetrieveOptions contains the optional parameters for the StorageSpacesClient.Retrieve method. func (client *StorageSpacesClient) Retrieve(ctx context.Context, resourceGroupName string, storageSpacesName string, options *StorageSpacesClientRetrieveOptions) (StorageSpacesClientRetrieveResponse, error) { req, err := client.retrieveCreateRequest(ctx, resourceGroupName, storageSpacesName, options) if err != nil { @@ -331,7 +337,7 @@ func (client *StorageSpacesClient) retrieveCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -348,11 +354,12 @@ func (client *StorageSpacesClient) retrieveHandleResponse(resp *http.Response) ( // BeginUpdate - Patches the Hybrid AKS storage object // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// storageSpacesName - Parameter for the name of the storage object -// options - StorageSpacesClientBeginUpdateOptions contains the optional parameters for the StorageSpacesClient.BeginUpdate -// method. +// +// Generated from API version 2022-09-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - storageSpacesName - Parameter for the name of the storage object +// - options - StorageSpacesClientBeginUpdateOptions contains the optional parameters for the StorageSpacesClient.BeginUpdate +// method. func (client *StorageSpacesClient) BeginUpdate(ctx context.Context, resourceGroupName string, storageSpacesName string, storageSpaces StorageSpacesPatch, options *StorageSpacesClientBeginUpdateOptions) (*runtime.Poller[StorageSpacesClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, resourceGroupName, storageSpacesName, storageSpaces, options) @@ -369,7 +376,8 @@ func (client *StorageSpacesClient) BeginUpdate(ctx context.Context, resourceGrou // Update - Patches the Hybrid AKS storage object // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01-preview +// +// Generated from API version 2022-09-01-preview func (client *StorageSpacesClient) update(ctx context.Context, resourceGroupName string, storageSpacesName string, storageSpaces StorageSpacesPatch, options *StorageSpacesClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, storageSpacesName, storageSpaces, options) if err != nil { @@ -405,7 +413,7 @@ func (client *StorageSpacesClient) updateCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, storageSpaces) diff --git a/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/storagespaces_client_example_test.go b/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/storagespaces_client_example_test.go deleted file mode 100644 index 787646662617..000000000000 --- a/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/storagespaces_client_example_test.go +++ /dev/null @@ -1,165 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armhybridcontainerservice_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/hybridcontainerservice/armhybridcontainerservice" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/GetStorageSpace.json -func ExampleStorageSpacesClient_Retrieve() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybridcontainerservice.NewStorageSpacesClient("a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Retrieve(ctx, "test-arcappliance-resgrp", "test-storage", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/PutStorageSpace.json -func ExampleStorageSpacesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybridcontainerservice.NewStorageSpacesClient("a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, "test-arcappliance-resgrp", "test-storage", armhybridcontainerservice.StorageSpaces{ - Location: to.Ptr("westus"), - ExtendedLocation: &armhybridcontainerservice.StorageSpacesExtendedLocation{ - Name: to.Ptr("/subscriptions/a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b/resourcegroups/test-arcappliance-resgrp/providers/microsoft.extendedlocation/customlocations/testcustomlocation"), - Type: to.Ptr("CustomLocation"), - }, - Properties: &armhybridcontainerservice.StorageSpacesProperties{ - HciStorageProfile: &armhybridcontainerservice.StorageSpacesPropertiesHciStorageProfile{ - MocGroup: to.Ptr("target-group"), - MocLocation: to.Ptr("MocLocation"), - MocStorageContainer: to.Ptr("WssdStorageContainer"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/DeleteStorageSpace.json -func ExampleStorageSpacesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybridcontainerservice.NewStorageSpacesClient("a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, "test-arcappliance-resgrp", "test-storage", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/UpdateStorageSpace.json -func ExampleStorageSpacesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybridcontainerservice.NewStorageSpacesClient("a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, "test-arcappliance-resgrp", "test-storage", armhybridcontainerservice.StorageSpacesPatch{ - Tags: map[string]*string{ - "additionalProperties": to.Ptr("sample"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/ListStorageSpaceByResourceGroup.json -func ExampleStorageSpacesClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybridcontainerservice.NewStorageSpacesClient("a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("test-arcappliance-resgrp", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/ListStorageSpaceBySubscription.json -func ExampleStorageSpacesClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybridcontainerservice.NewStorageSpacesClient("a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySubscriptionPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/time_rfc3339.go b/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/time_rfc3339.go index 83773554d4a4..523e6b43d02d 100644 --- a/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/time_rfc3339.go +++ b/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/time_rfc3339.go @@ -62,7 +62,7 @@ func (t *timeRFC3339) Parse(layout, value string) error { return err } -func populateTimeRFC3339(m map[string]interface{}, k string, t *time.Time) { +func populateTimeRFC3339(m map[string]any, k string, t *time.Time) { if t == nil { return } else if azcore.IsNullValue(t) { diff --git a/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/virtualnetworks_client.go b/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/virtualnetworks_client.go index a5e10cd30c31..c01fe02e97f4 100644 --- a/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/virtualnetworks_client.go +++ b/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/virtualnetworks_client.go @@ -32,9 +32,9 @@ type VirtualNetworksClient struct { } // NewVirtualNetworksClient creates a new instance of VirtualNetworksClient with the specified values. -// subscriptionID - The ID of the target subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewVirtualNetworksClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualNetworksClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,11 +57,12 @@ func NewVirtualNetworksClient(subscriptionID string, credential azcore.TokenCred // BeginCreateOrUpdate - Puts the Hybrid AKS virtual network // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// virtualNetworksName - Parameter for the name of the virtual network -// options - VirtualNetworksClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualNetworksClient.BeginCreateOrUpdate -// method. +// +// Generated from API version 2022-09-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - virtualNetworksName - Parameter for the name of the virtual network +// - options - VirtualNetworksClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualNetworksClient.BeginCreateOrUpdate +// method. func (client *VirtualNetworksClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworksName string, virtualNetworks VirtualNetworks, options *VirtualNetworksClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualNetworksClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, virtualNetworksName, virtualNetworks, options) @@ -78,7 +79,8 @@ func (client *VirtualNetworksClient) BeginCreateOrUpdate(ctx context.Context, re // CreateOrUpdate - Puts the Hybrid AKS virtual network // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01-preview +// +// Generated from API version 2022-09-01-preview func (client *VirtualNetworksClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworksName string, virtualNetworks VirtualNetworks, options *VirtualNetworksClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, virtualNetworksName, virtualNetworks, options) if err != nil { @@ -114,7 +116,7 @@ func (client *VirtualNetworksClient) createOrUpdateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, virtualNetworks) @@ -122,10 +124,11 @@ func (client *VirtualNetworksClient) createOrUpdateCreateRequest(ctx context.Con // Delete - Deletes the Hybrid AKS virtual network // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// virtualNetworksName - Parameter for the name of the virtual network -// options - VirtualNetworksClientDeleteOptions contains the optional parameters for the VirtualNetworksClient.Delete method. +// +// Generated from API version 2022-09-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - virtualNetworksName - Parameter for the name of the virtual network +// - options - VirtualNetworksClientDeleteOptions contains the optional parameters for the VirtualNetworksClient.Delete method. func (client *VirtualNetworksClient) Delete(ctx context.Context, resourceGroupName string, virtualNetworksName string, options *VirtualNetworksClientDeleteOptions) (VirtualNetworksClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, virtualNetworksName, options) if err != nil { @@ -161,17 +164,18 @@ func (client *VirtualNetworksClient) deleteCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // NewListByResourceGroupPager - Lists the Hybrid AKS virtual networks by resource group -// Generated from API version 2022-05-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// options - VirtualNetworksClientListByResourceGroupOptions contains the optional parameters for the VirtualNetworksClient.ListByResourceGroup -// method. +// +// Generated from API version 2022-09-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - options - VirtualNetworksClientListByResourceGroupOptions contains the optional parameters for the VirtualNetworksClient.NewListByResourceGroupPager +// method. func (client *VirtualNetworksClient) NewListByResourceGroupPager(resourceGroupName string, options *VirtualNetworksClientListByResourceGroupOptions) *runtime.Pager[VirtualNetworksClientListByResourceGroupResponse] { return runtime.NewPager(runtime.PagingHandler[VirtualNetworksClientListByResourceGroupResponse]{ More: func(page VirtualNetworksClientListByResourceGroupResponse) bool { @@ -216,7 +220,7 @@ func (client *VirtualNetworksClient) listByResourceGroupCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -232,9 +236,10 @@ func (client *VirtualNetworksClient) listByResourceGroupHandleResponse(resp *htt } // NewListBySubscriptionPager - Lists the Hybrid AKS virtual networks by subscription -// Generated from API version 2022-05-01-preview -// options - VirtualNetworksClientListBySubscriptionOptions contains the optional parameters for the VirtualNetworksClient.ListBySubscription -// method. +// +// Generated from API version 2022-09-01-preview +// - options - VirtualNetworksClientListBySubscriptionOptions contains the optional parameters for the VirtualNetworksClient.NewListBySubscriptionPager +// method. func (client *VirtualNetworksClient) NewListBySubscriptionPager(options *VirtualNetworksClientListBySubscriptionOptions) *runtime.Pager[VirtualNetworksClientListBySubscriptionResponse] { return runtime.NewPager(runtime.PagingHandler[VirtualNetworksClientListBySubscriptionResponse]{ More: func(page VirtualNetworksClientListBySubscriptionResponse) bool { @@ -275,7 +280,7 @@ func (client *VirtualNetworksClient) listBySubscriptionCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -292,11 +297,12 @@ func (client *VirtualNetworksClient) listBySubscriptionHandleResponse(resp *http // Retrieve - Gets the Hybrid AKS virtual network // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// virtualNetworksName - Parameter for the name of the virtual network -// options - VirtualNetworksClientRetrieveOptions contains the optional parameters for the VirtualNetworksClient.Retrieve -// method. +// +// Generated from API version 2022-09-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - virtualNetworksName - Parameter for the name of the virtual network +// - options - VirtualNetworksClientRetrieveOptions contains the optional parameters for the VirtualNetworksClient.Retrieve +// method. func (client *VirtualNetworksClient) Retrieve(ctx context.Context, resourceGroupName string, virtualNetworksName string, options *VirtualNetworksClientRetrieveOptions) (VirtualNetworksClientRetrieveResponse, error) { req, err := client.retrieveCreateRequest(ctx, resourceGroupName, virtualNetworksName, options) if err != nil { @@ -332,7 +338,7 @@ func (client *VirtualNetworksClient) retrieveCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -349,11 +355,12 @@ func (client *VirtualNetworksClient) retrieveHandleResponse(resp *http.Response) // BeginUpdate - Patches the Hybrid AKS virtual network // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// virtualNetworksName - Parameter for the name of the virtual network -// options - VirtualNetworksClientBeginUpdateOptions contains the optional parameters for the VirtualNetworksClient.BeginUpdate -// method. +// +// Generated from API version 2022-09-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - virtualNetworksName - Parameter for the name of the virtual network +// - options - VirtualNetworksClientBeginUpdateOptions contains the optional parameters for the VirtualNetworksClient.BeginUpdate +// method. func (client *VirtualNetworksClient) BeginUpdate(ctx context.Context, resourceGroupName string, virtualNetworksName string, virtualNetworks VirtualNetworksPatch, options *VirtualNetworksClientBeginUpdateOptions) (*runtime.Poller[VirtualNetworksClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, resourceGroupName, virtualNetworksName, virtualNetworks, options) @@ -370,7 +377,8 @@ func (client *VirtualNetworksClient) BeginUpdate(ctx context.Context, resourceGr // Update - Patches the Hybrid AKS virtual network // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01-preview +// +// Generated from API version 2022-09-01-preview func (client *VirtualNetworksClient) update(ctx context.Context, resourceGroupName string, virtualNetworksName string, virtualNetworks VirtualNetworksPatch, options *VirtualNetworksClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, virtualNetworksName, virtualNetworks, options) if err != nil { @@ -406,7 +414,7 @@ func (client *VirtualNetworksClient) updateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, virtualNetworks) diff --git a/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/virtualnetworks_client_example_test.go b/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/virtualnetworks_client_example_test.go deleted file mode 100644 index 85b66a4201a1..000000000000 --- a/sdk/resourcemanager/hybridcontainerservice/armhybridcontainerservice/virtualnetworks_client_example_test.go +++ /dev/null @@ -1,177 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armhybridcontainerservice_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/hybridcontainerservice/armhybridcontainerservice" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/GetVirtualNetwork.json -func ExampleVirtualNetworksClient_Retrieve() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybridcontainerservice.NewVirtualNetworksClient("a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Retrieve(ctx, "test-arcappliance-resgrp", "test-vnet-static", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/PutVirtualNetwork.json -func ExampleVirtualNetworksClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybridcontainerservice.NewVirtualNetworksClient("a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, "test-arcappliance-resgrp", "test-vnet-static", armhybridcontainerservice.VirtualNetworks{ - Location: to.Ptr("westus"), - ExtendedLocation: &armhybridcontainerservice.VirtualNetworksExtendedLocation{ - Name: to.Ptr("/subscriptions/a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b/resourcegroups/test-arcappliance-resgrp/providers/microsoft.extendedlocation/customlocations/testcustomlocation"), - Type: to.Ptr("CustomLocation"), - }, - Properties: &armhybridcontainerservice.VirtualNetworksProperties{ - InfraVnetProfile: &armhybridcontainerservice.VirtualNetworksPropertiesInfraVnetProfile{ - Hci: &armhybridcontainerservice.VirtualNetworksPropertiesInfraVnetProfileHci{ - MocGroup: to.Ptr("target-group"), - MocLocation: to.Ptr("MocLocation"), - MocVnetName: to.Ptr("test-vnet"), - }, - }, - VipPool: []*armhybridcontainerservice.VirtualNetworksPropertiesVipPoolItem{ - { - EndIP: to.Ptr("192.168.0.50"), - StartIP: to.Ptr("192.168.0.10"), - }}, - VmipPool: []*armhybridcontainerservice.VirtualNetworksPropertiesVmipPoolItem{ - { - EndIP: to.Ptr("192.168.0.130"), - StartIP: to.Ptr("192.168.0.110"), - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/DeleteVirtualNetwork.json -func ExampleVirtualNetworksClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybridcontainerservice.NewVirtualNetworksClient("a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, "test-arcappliance-resgrp", "test-vnet-static", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/UpdateVirtualNetwork.json -func ExampleVirtualNetworksClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybridcontainerservice.NewVirtualNetworksClient("a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, "test-arcappliance-resgrp", "test-vnet-static", armhybridcontainerservice.VirtualNetworksPatch{ - Tags: map[string]*string{ - "additionalProperties": to.Ptr("sample"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/ListVirtualNetworkByResourceGroup.json -func ExampleVirtualNetworksClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybridcontainerservice.NewVirtualNetworksClient("a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("test-arcappliance-resgrp", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/ListVirtualNetworkBySubscription.json -func ExampleVirtualNetworksClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armhybridcontainerservice.NewVirtualNetworksClient("a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySubscriptionPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -}