diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/CHANGELOG.md b/sdk/resourcemanager/hybridcompute/armhybridcompute/CHANGELOG.md index 07943bf92e93..035bf5d4eddf 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/CHANGELOG.md +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/CHANGELOG.md @@ -1,5 +1,59 @@ # Release History +## 2.0.0-beta.1 (2023-04-25) +### Breaking Changes + +- Type of `MachineExtensionProperties.ProtectedSettings` has been changed from `any` to `map[string]any` +- Type of `MachineExtensionProperties.Settings` has been changed from `any` to `map[string]any` +- Type of `MachineExtensionUpdateProperties.ProtectedSettings` has been changed from `any` to `map[string]any` +- Type of `MachineExtensionUpdateProperties.Settings` has been changed from `any` to `map[string]any` + +### Features Added + +- New enum type `AgentConfigurationMode` with values `AgentConfigurationModeFull`, `AgentConfigurationModeMonitor` +- New enum type `LastAttemptStatusEnum` with values `LastAttemptStatusEnumFailed`, `LastAttemptStatusEnumSuccess` +- New enum type `PrivateCloudKind` with values `PrivateCloudKindAVS`, `PrivateCloudKindHCI`, `PrivateCloudKindSCVMM`, `PrivateCloudKindVMware` +- New function `NewAgentVersionClient(azcore.TokenCredential, *arm.ClientOptions) (*AgentVersionClient, error)` +- New function `*AgentVersionClient.Get(context.Context, string, string, *AgentVersionClientGetOptions) (AgentVersionClientGetResponse, error)` +- New function `*AgentVersionClient.List(context.Context, string, *AgentVersionClientListOptions) (AgentVersionClientListResponse, error)` +- New function `*ClientFactory.NewAgentVersionClient() *AgentVersionClient` +- New function `*ClientFactory.NewExtensionMetadataClient() *ExtensionMetadataClient` +- New function `*ClientFactory.NewHybridIdentityMetadataClient() *HybridIdentityMetadataClient` +- New function `*ClientFactory.NewNetworkProfileClient() *NetworkProfileClient` +- New function `NewExtensionMetadataClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ExtensionMetadataClient, error)` +- New function `*ExtensionMetadataClient.Get(context.Context, string, string, string, string, *ExtensionMetadataClientGetOptions) (ExtensionMetadataClientGetResponse, error)` +- New function `*ExtensionMetadataClient.NewListPager(string, string, string, *ExtensionMetadataClientListOptions) *runtime.Pager[ExtensionMetadataClientListResponse]` +- New function `NewHybridIdentityMetadataClient(string, azcore.TokenCredential, *arm.ClientOptions) (*HybridIdentityMetadataClient, error)` +- New function `*HybridIdentityMetadataClient.Get(context.Context, string, string, string, *HybridIdentityMetadataClientGetOptions) (HybridIdentityMetadataClientGetResponse, error)` +- New function `*HybridIdentityMetadataClient.NewListByMachinesPager(string, string, *HybridIdentityMetadataClientListByMachinesOptions) *runtime.Pager[HybridIdentityMetadataClientListByMachinesResponse]` +- New function `NewNetworkProfileClient(string, azcore.TokenCredential, *arm.ClientOptions) (*NetworkProfileClient, error)` +- New function `*NetworkProfileClient.Get(context.Context, string, string, *NetworkProfileClientGetOptions) (NetworkProfileClientGetResponse, error)` +- New struct `AgentUpgrade` +- New struct `AgentVersion` +- New struct `AgentVersionsList` +- New struct `ErrorDetailAutoGenerated` +- New struct `ErrorResponseAutoGenerated` +- New struct `ExtensionValue` +- New struct `ExtensionValueListResult` +- New struct `ExtensionValueProperties` +- New struct `HybridIdentityMetadata` +- New struct `HybridIdentityMetadataList` +- New struct `HybridIdentityMetadataProperties` +- New struct `IPAddress` +- New struct `NetworkInterface` +- New struct `NetworkProfile` +- New struct `Subnet` +- New field `ConfigMode` in struct `AgentConfiguration` +- New field `Kind`, `Resources` in struct `Machine` +- New field `EnableAutomaticUpgrade` in struct `MachineExtensionUpdateProperties` +- New field `AgentUpgrade`, `NetworkProfile` in struct `MachineProperties` +- New field `Kind` in struct `MachineUpdate` +- New field `AgentUpgrade` in struct `MachineUpdateProperties` +- New field `SystemData` in struct `ProxyResource` +- New field `SystemData` in struct `Resource` +- New field `SystemData` in struct `TrackedResource` + + ## 1.1.1 (2023-04-14) ### Bug Fixes diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/agentversion_client.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/agentversion_client.go new file mode 100644 index 000000000000..4e763d089cc1 --- /dev/null +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/agentversion_client.go @@ -0,0 +1,143 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armhybridcompute + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// AgentVersionClient contains the methods for the AgentVersion group. +// Don't use this type directly, use NewAgentVersionClient() instead. +type AgentVersionClient struct { + internal *arm.Client +} + +// NewAgentVersionClient creates a new instance of AgentVersionClient with the specified values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewAgentVersionClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*AgentVersionClient, error) { + cl, err := arm.NewClient(moduleName+".AgentVersionClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &AgentVersionClient{ + internal: cl, + } + return client, nil +} + +// Get - Gets an Agent Version along with the download link currently present. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-03-15-preview +// - osType - Defines the os type +// - version - Defines the agent version. To get latest, use latest or else a specific agent version. +// - options - AgentVersionClientGetOptions contains the optional parameters for the AgentVersionClient.Get method. +func (client *AgentVersionClient) Get(ctx context.Context, osType string, version string, options *AgentVersionClientGetOptions) (AgentVersionClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, osType, version, options) + if err != nil { + return AgentVersionClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AgentVersionClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AgentVersionClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *AgentVersionClient) getCreateRequest(ctx context.Context, osType string, version string, options *AgentVersionClientGetOptions) (*policy.Request, error) { + urlPath := "/providers/Microsoft.HybridCompute/osType/{osType}/agentVersions/{version}" + if osType == "" { + return nil, errors.New("parameter osType cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{osType}", url.PathEscape(osType)) + if version == "" { + return nil, errors.New("parameter version cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{version}", url.PathEscape(version)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-03-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *AgentVersionClient) getHandleResponse(resp *http.Response) (AgentVersionClientGetResponse, error) { + result := AgentVersionClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AgentVersion); err != nil { + return AgentVersionClientGetResponse{}, err + } + return result, nil +} + +// List - Gets all Agent Versions along with the download link currently present. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-03-15-preview +// - osType - Defines the os type. +// - options - AgentVersionClientListOptions contains the optional parameters for the AgentVersionClient.List method. +func (client *AgentVersionClient) List(ctx context.Context, osType string, options *AgentVersionClientListOptions) (AgentVersionClientListResponse, error) { + req, err := client.listCreateRequest(ctx, osType, options) + if err != nil { + return AgentVersionClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AgentVersionClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AgentVersionClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) +} + +// listCreateRequest creates the List request. +func (client *AgentVersionClient) listCreateRequest(ctx context.Context, osType string, options *AgentVersionClientListOptions) (*policy.Request, error) { + urlPath := "/providers/Microsoft.HybridCompute/osType/{osType}/agentVersions" + if osType == "" { + return nil, errors.New("parameter osType cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{osType}", url.PathEscape(osType)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-03-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *AgentVersionClient) listHandleResponse(resp *http.Response) (AgentVersionClientListResponse, error) { + result := AgentVersionClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AgentVersionsList); err != nil { + return AgentVersionClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/autorest.md b/sdk/resourcemanager/hybridcompute/armhybridcompute/autorest.md index 2de0ae740f4e..37b159d5fc5b 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/autorest.md +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/autorest.md @@ -5,9 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridcompute/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridcompute/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/hybridcompute/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/hybridcompute/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.1.1 +module-version: 2.0.0-beta.1 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/client_factory.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/client_factory.go index 9c1de7e1a4e2..a5f41f810542 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/client_factory.go +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/client_factory.go @@ -53,11 +53,31 @@ func (c *ClientFactory) NewManagementClient() *ManagementClient { return subClient } +func (c *ClientFactory) NewExtensionMetadataClient() *ExtensionMetadataClient { + subClient, _ := NewExtensionMetadataClient(c.subscriptionID, c.credential, c.options) + return subClient +} + func (c *ClientFactory) NewOperationsClient() *OperationsClient { subClient, _ := NewOperationsClient(c.credential, c.options) return subClient } +func (c *ClientFactory) NewNetworkProfileClient() *NetworkProfileClient { + subClient, _ := NewNetworkProfileClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewHybridIdentityMetadataClient() *HybridIdentityMetadataClient { + subClient, _ := NewHybridIdentityMetadataClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewAgentVersionClient() *AgentVersionClient { + subClient, _ := NewAgentVersionClient(c.credential, c.options) + return subClient +} + func (c *ClientFactory) NewPrivateLinkScopesClient() *PrivateLinkScopesClient { subClient, _ := NewPrivateLinkScopesClient(c.subscriptionID, c.credential, c.options) return subClient diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/constants.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/constants.go index e405334a18ee..bb571e34013a 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/constants.go +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/constants.go @@ -11,9 +11,26 @@ package armhybridcompute const ( moduleName = "armhybridcompute" - moduleVersion = "v1.1.1" + moduleVersion = "v2.0.0-beta.1" ) +// AgentConfigurationMode - Name of configuration mode to use. Modes are pre-defined configurations of security controls, +// extension allowlists and guest configuration, maintained by Microsoft. +type AgentConfigurationMode string + +const ( + AgentConfigurationModeFull AgentConfigurationMode = "full" + AgentConfigurationModeMonitor AgentConfigurationMode = "monitor" +) + +// PossibleAgentConfigurationModeValues returns the possible values for the AgentConfigurationMode const type. +func PossibleAgentConfigurationModeValues() []AgentConfigurationMode { + return []AgentConfigurationMode{ + AgentConfigurationModeFull, + AgentConfigurationModeMonitor, + } +} + // AssessmentModeTypes - Specifies the assessment mode. type AssessmentModeTypes string @@ -63,6 +80,22 @@ func PossibleInstanceViewTypesValues() []InstanceViewTypes { } } +// LastAttemptStatusEnum - Specifies the status of Agent Upgrade. +type LastAttemptStatusEnum string + +const ( + LastAttemptStatusEnumFailed LastAttemptStatusEnum = "Failed" + LastAttemptStatusEnumSuccess LastAttemptStatusEnum = "Success" +) + +// PossibleLastAttemptStatusEnumValues returns the possible values for the LastAttemptStatusEnum const type. +func PossibleLastAttemptStatusEnumValues() []LastAttemptStatusEnum { + return []LastAttemptStatusEnum{ + LastAttemptStatusEnumFailed, + LastAttemptStatusEnumSuccess, + } +} + // PatchModeTypes - Specifies the patch mode. type PatchModeTypes string @@ -83,6 +116,26 @@ func PossiblePatchModeTypesValues() []PatchModeTypes { } } +// PrivateCloudKind - Indicates which kind of VM fabric the instance is an instance of, such as HCI or SCVMM etc. +type PrivateCloudKind string + +const ( + PrivateCloudKindAVS PrivateCloudKind = "AVS" + PrivateCloudKindHCI PrivateCloudKind = "HCI" + PrivateCloudKindSCVMM PrivateCloudKind = "SCVMM" + PrivateCloudKindVMware PrivateCloudKind = "VMware" +) + +// PossiblePrivateCloudKindValues returns the possible values for the PrivateCloudKind const type. +func PossiblePrivateCloudKindValues() []PrivateCloudKind { + return []PrivateCloudKind{ + PrivateCloudKindAVS, + PrivateCloudKindHCI, + PrivateCloudKindSCVMM, + PrivateCloudKindVMware, + } +} + // PublicNetworkAccessType - The network access policy to determine if Azure Arc agents can use public Azure Arc service endpoints. // Defaults to disabled (access to Azure Arc services only via private link). type PublicNetworkAccessType string diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/extensionmetadata_client.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/extensionmetadata_client.go new file mode 100644 index 000000000000..37a2b73455a9 --- /dev/null +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/extensionmetadata_client.go @@ -0,0 +1,181 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armhybridcompute + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// ExtensionMetadataClient contains the methods for the ExtensionMetadata group. +// Don't use this type directly, use NewExtensionMetadataClient() instead. +type ExtensionMetadataClient struct { + internal *arm.Client + subscriptionID string +} + +// NewExtensionMetadataClient creates a new instance of ExtensionMetadataClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewExtensionMetadataClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ExtensionMetadataClient, error) { + cl, err := arm.NewClient(moduleName+".ExtensionMetadataClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ExtensionMetadataClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Get - Gets an Extension Metadata based on location, publisher, extensionType and version +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-03-15-preview +// - location - The location of the Extension being received. +// - publisher - The publisher of the Extension being received. +// - extensionType - The extensionType of the Extension being received. +// - version - The version of the Extension being received. +// - options - ExtensionMetadataClientGetOptions contains the optional parameters for the ExtensionMetadataClient.Get method. +func (client *ExtensionMetadataClient) Get(ctx context.Context, location string, publisher string, extensionType string, version string, options *ExtensionMetadataClientGetOptions) (ExtensionMetadataClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, location, publisher, extensionType, version, options) + if err != nil { + return ExtensionMetadataClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ExtensionMetadataClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ExtensionMetadataClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *ExtensionMetadataClient) getCreateRequest(ctx context.Context, location string, publisher string, extensionType string, version string, options *ExtensionMetadataClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/locations/{location}/publishers/{publisher}/extensionTypes/{extensionType}/versions/{version}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) + if publisher == "" { + return nil, errors.New("parameter publisher cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publisher}", url.PathEscape(publisher)) + if extensionType == "" { + return nil, errors.New("parameter extensionType cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{extensionType}", url.PathEscape(extensionType)) + if version == "" { + return nil, errors.New("parameter version cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{version}", url.PathEscape(version)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-03-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ExtensionMetadataClient) getHandleResponse(resp *http.Response) (ExtensionMetadataClientGetResponse, error) { + result := ExtensionMetadataClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ExtensionValue); err != nil { + return ExtensionMetadataClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Gets all Extension versions based on location, publisher, extensionType +// +// Generated from API version 2023-03-15-preview +// - location - The location of the Extension being received. +// - publisher - The publisher of the Extension being received. +// - extensionType - The extensionType of the Extension being received. +// - options - ExtensionMetadataClientListOptions contains the optional parameters for the ExtensionMetadataClient.NewListPager +// method. +func (client *ExtensionMetadataClient) NewListPager(location string, publisher string, extensionType string, options *ExtensionMetadataClientListOptions) *runtime.Pager[ExtensionMetadataClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[ExtensionMetadataClientListResponse]{ + More: func(page ExtensionMetadataClientListResponse) bool { + return false + }, + Fetcher: func(ctx context.Context, page *ExtensionMetadataClientListResponse) (ExtensionMetadataClientListResponse, error) { + req, err := client.listCreateRequest(ctx, location, publisher, extensionType, options) + if err != nil { + return ExtensionMetadataClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ExtensionMetadataClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ExtensionMetadataClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *ExtensionMetadataClient) listCreateRequest(ctx context.Context, location string, publisher string, extensionType string, options *ExtensionMetadataClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/locations/{location}/publishers/{publisher}/extensionTypes/{extensionType}/versions" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) + if publisher == "" { + return nil, errors.New("parameter publisher cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publisher}", url.PathEscape(publisher)) + if extensionType == "" { + return nil, errors.New("parameter extensionType cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{extensionType}", url.PathEscape(extensionType)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-03-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *ExtensionMetadataClient) listHandleResponse(resp *http.Response) (ExtensionMetadataClientListResponse, error) { + result := ExtensionMetadataClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ExtensionValueListResult); err != nil { + return ExtensionMetadataClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/go.mod b/sdk/resourcemanager/hybridcompute/armhybridcompute/go.mod index 2d0c7d6192b1..e05e5daeb1bc 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/go.mod +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/go.mod @@ -1,21 +1,13 @@ -module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridcompute/armhybridcompute +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridcompute/armhybridcompute/v2 go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 // indirect - github.com/golang-jwt/jwt/v4 v4.5.0 // indirect - github.com/google/uuid v1.3.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect - golang.org/x/crypto v0.6.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect golang.org/x/net v0.7.0 // indirect - golang.org/x/sys v0.5.0 // indirect golang.org/x/text v0.7.0 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/go.sum b/sdk/resourcemanager/hybridcompute/armhybridcompute/go.sum index 8ba445a8c4da..b6bd7eaad1ba 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/go.sum +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/go.sum @@ -1,31 +1,15 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 h1:rTnT/Jrcm+figWlYz4Ixzt0SJVR2cMC8lvZcimipiEY= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0/go.mod h1:ON4tFdPTwRcgWEaVDrN3584Ef+b7GgSJaXxe5fW9t4M= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 h1:uqM+VoHjVH6zdlkLF2b6O0ZANcHoj3rO0PoQ3jglUJA= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2/go.mod h1:twTKAa1E6hLmSDjLhaCkbTMQKc7p/rNLU40rLxGEOCI= github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 h1:leh5DwKv6Ihwi+h60uHtn6UWAxBbZ0q8DwQVMzf61zw= github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 h1:UE9n9rkJF62ArLb1F3DEjRt8O3jLwMWdSoypKV4f3MU= -github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0/go.mod h1:kgDmCTgBzIEPFElEF+FK0SdjAor06dRq2Go927dnQ6o= 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/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= -github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= +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.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc= -golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -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/hybridcompute/armhybridcompute/hybrididentitymetadata_client.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/hybrididentitymetadata_client.go new file mode 100644 index 000000000000..b7953d43f91a --- /dev/null +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/hybrididentitymetadata_client.go @@ -0,0 +1,178 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armhybridcompute + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// HybridIdentityMetadataClient contains the methods for the HybridIdentityMetadata group. +// Don't use this type directly, use NewHybridIdentityMetadataClient() instead. +type HybridIdentityMetadataClient struct { + internal *arm.Client + subscriptionID string +} + +// 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. +func NewHybridIdentityMetadataClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*HybridIdentityMetadataClient, error) { + cl, err := arm.NewClient(moduleName+".HybridIdentityMetadataClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &HybridIdentityMetadataClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Get - Implements HybridIdentityMetadata GET method. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-03-15-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - machineName - The name of the hybrid machine. +// - metadataName - Name of the HybridIdentityMetadata. +// - options - HybridIdentityMetadataClientGetOptions contains the optional parameters for the HybridIdentityMetadataClient.Get +// method. +func (client *HybridIdentityMetadataClient) Get(ctx context.Context, resourceGroupName string, machineName string, metadataName string, options *HybridIdentityMetadataClientGetOptions) (HybridIdentityMetadataClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, machineName, metadataName, options) + if err != nil { + return HybridIdentityMetadataClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return HybridIdentityMetadataClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return HybridIdentityMetadataClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *HybridIdentityMetadataClient) getCreateRequest(ctx context.Context, resourceGroupName string, machineName string, metadataName string, options *HybridIdentityMetadataClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/hybridIdentityMetadata/{metadataName}" + 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 machineName == "" { + return nil, errors.New("parameter machineName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{machineName}", url.PathEscape(machineName)) + if metadataName == "" { + return nil, errors.New("parameter metadataName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{metadataName}", url.PathEscape(metadataName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-03-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *HybridIdentityMetadataClient) getHandleResponse(resp *http.Response) (HybridIdentityMetadataClientGetResponse, error) { + result := HybridIdentityMetadataClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.HybridIdentityMetadata); err != nil { + return HybridIdentityMetadataClientGetResponse{}, err + } + return result, nil +} + +// NewListByMachinesPager - Returns the list of HybridIdentityMetadata of the given machine. +// +// Generated from API version 2023-03-15-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - machineName - The name of the hybrid machine. +// - options - HybridIdentityMetadataClientListByMachinesOptions contains the optional parameters for the HybridIdentityMetadataClient.NewListByMachinesPager +// method. +func (client *HybridIdentityMetadataClient) NewListByMachinesPager(resourceGroupName string, machineName string, options *HybridIdentityMetadataClientListByMachinesOptions) *runtime.Pager[HybridIdentityMetadataClientListByMachinesResponse] { + return runtime.NewPager(runtime.PagingHandler[HybridIdentityMetadataClientListByMachinesResponse]{ + More: func(page HybridIdentityMetadataClientListByMachinesResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *HybridIdentityMetadataClientListByMachinesResponse) (HybridIdentityMetadataClientListByMachinesResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByMachinesCreateRequest(ctx, resourceGroupName, machineName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return HybridIdentityMetadataClientListByMachinesResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return HybridIdentityMetadataClientListByMachinesResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return HybridIdentityMetadataClientListByMachinesResponse{}, runtime.NewResponseError(resp) + } + return client.listByMachinesHandleResponse(resp) + }, + }) +} + +// listByMachinesCreateRequest creates the ListByMachines request. +func (client *HybridIdentityMetadataClient) listByMachinesCreateRequest(ctx context.Context, resourceGroupName string, machineName string, options *HybridIdentityMetadataClientListByMachinesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/hybridIdentityMetadata" + 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 machineName == "" { + return nil, errors.New("parameter machineName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{machineName}", url.PathEscape(machineName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-03-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByMachinesHandleResponse handles the ListByMachines response. +func (client *HybridIdentityMetadataClient) listByMachinesHandleResponse(resp *http.Response) (HybridIdentityMetadataClientListByMachinesResponse, error) { + result := HybridIdentityMetadataClientListByMachinesResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.HybridIdentityMetadataList); err != nil { + return HybridIdentityMetadataClientListByMachinesResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/machineextensions_client.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/machineextensions_client.go index e1b16675f4e4..d7a2aa943a67 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/machineextensions_client.go +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/machineextensions_client.go @@ -47,7 +47,7 @@ func NewMachineExtensionsClient(subscriptionID string, credential azcore.TokenCr // BeginCreateOrUpdate - The operation to create or update the extension. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-03-10 +// Generated from API version 2023-03-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - machineName - The name of the machine where the extension should be created or updated. // - extensionName - The name of the machine extension. @@ -69,7 +69,7 @@ func (client *MachineExtensionsClient) BeginCreateOrUpdate(ctx context.Context, // CreateOrUpdate - The operation to create or update the extension. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-03-10 +// Generated from API version 2023-03-15-preview func (client *MachineExtensionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, machineName string, extensionName string, extensionParameters MachineExtension, options *MachineExtensionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, machineName, extensionName, extensionParameters, options) if err != nil { @@ -109,7 +109,7 @@ func (client *MachineExtensionsClient) createOrUpdateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-10") + reqQP.Set("api-version", "2023-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, extensionParameters) @@ -118,7 +118,7 @@ func (client *MachineExtensionsClient) createOrUpdateCreateRequest(ctx context.C // BeginDelete - The operation to delete the extension. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-03-10 +// Generated from API version 2023-03-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - machineName - The name of the machine where the extension should be deleted. // - extensionName - The name of the machine extension. @@ -139,7 +139,7 @@ func (client *MachineExtensionsClient) BeginDelete(ctx context.Context, resource // Delete - The operation to delete the extension. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-03-10 +// Generated from API version 2023-03-15-preview func (client *MachineExtensionsClient) deleteOperation(ctx context.Context, resourceGroupName string, machineName string, extensionName string, options *MachineExtensionsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, machineName, extensionName, options) if err != nil { @@ -179,7 +179,7 @@ func (client *MachineExtensionsClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-10") + reqQP.Set("api-version", "2023-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -188,7 +188,7 @@ func (client *MachineExtensionsClient) deleteCreateRequest(ctx context.Context, // Get - The operation to get the extension. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-03-10 +// Generated from API version 2023-03-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - machineName - The name of the machine containing the extension. // - extensionName - The name of the machine extension. @@ -232,7 +232,7 @@ func (client *MachineExtensionsClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-10") + reqQP.Set("api-version", "2023-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -249,7 +249,7 @@ func (client *MachineExtensionsClient) getHandleResponse(resp *http.Response) (M // NewListPager - The operation to get all extensions of a non-Azure machine // -// Generated from API version 2022-03-10 +// Generated from API version 2023-03-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - machineName - The name of the machine containing the extension. // - options - MachineExtensionsClientListOptions contains the optional parameters for the MachineExtensionsClient.NewListPager @@ -305,7 +305,7 @@ func (client *MachineExtensionsClient) listCreateRequest(ctx context.Context, re if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2022-03-10") + reqQP.Set("api-version", "2023-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -323,7 +323,7 @@ func (client *MachineExtensionsClient) listHandleResponse(resp *http.Response) ( // BeginUpdate - The operation to create or update the extension. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-03-10 +// Generated from API version 2023-03-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - machineName - The name of the machine where the extension should be created or updated. // - extensionName - The name of the machine extension. @@ -345,7 +345,7 @@ func (client *MachineExtensionsClient) BeginUpdate(ctx context.Context, resource // Update - The operation to create or update the extension. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-03-10 +// Generated from API version 2023-03-15-preview func (client *MachineExtensionsClient) update(ctx context.Context, resourceGroupName string, machineName string, extensionName string, extensionParameters MachineExtensionUpdate, options *MachineExtensionsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, machineName, extensionName, extensionParameters, options) if err != nil { @@ -385,7 +385,7 @@ func (client *MachineExtensionsClient) updateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-10") + reqQP.Set("api-version", "2023-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, extensionParameters) diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/machineextensions_client_example_test.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/machineextensions_client_example_test.go deleted file mode 100644 index 982d2c0bf58f..000000000000 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/machineextensions_client_example_test.go +++ /dev/null @@ -1,287 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armhybridcompute_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/hybridcompute/armhybridcompute" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-03-10/examples/PUTExtension.json -func ExampleMachineExtensionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewMachineExtensionsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myMachine", "CustomScriptExtension", armhybridcompute.MachineExtension{ - Location: to.Ptr("eastus2euap"), - Properties: &armhybridcompute.MachineExtensionProperties{ - Type: to.Ptr("CustomScriptExtension"), - Publisher: to.Ptr("Microsoft.Compute"), - Settings: map[string]any{ - "commandToExecute": "powershell.exe -c \"Get-Process | Where-Object { $_.CPU -gt 10000 }\"", - }, - TypeHandlerVersion: to.Ptr("1.10"), - }, - }, 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MachineExtension = armhybridcompute.MachineExtension{ - // Name: to.Ptr("CustomScriptExtension"), - // Type: to.Ptr("Microsoft.HybridCompute/machines/extensions"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/Machines/myMachine/Extensions/CustomScriptExtension"), - // Location: to.Ptr("eastus2euap"), - // Properties: &armhybridcompute.MachineExtensionProperties{ - // Type: to.Ptr("string"), - // AutoUpgradeMinorVersion: to.Ptr(false), - // InstanceView: &armhybridcompute.MachineExtensionInstanceView{ - // Name: to.Ptr("CustomScriptExtension"), - // Type: to.Ptr("CustomScriptExtension"), - // Status: &armhybridcompute.MachineExtensionInstanceViewStatus{ - // Code: to.Ptr("success"), - // Level: to.Ptr(armhybridcompute.StatusLevelTypes("Information")), - // Message: to.Ptr("Finished executing command, StdOut: , StdErr:"), - // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-08-08T20:42:10.999Z"); return t}()), - // }, - // TypeHandlerVersion: to.Ptr("1.10.3"), - // }, - // ProtectedSettings: map[string]any{ - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // Publisher: to.Ptr("Microsoft.Compute"), - // Settings: "@{commandToExecute=powershell.exe -c \"Get-Process | Where-Object { $_.CPU -gt 10000 }\"}", - // TypeHandlerVersion: to.Ptr("1.10.3"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-03-10/examples/UpdateExtension.json -func ExampleMachineExtensionsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewMachineExtensionsClient().BeginUpdate(ctx, "myResourceGroup", "myMachine", "CustomScriptExtension", armhybridcompute.MachineExtensionUpdate{ - Properties: &armhybridcompute.MachineExtensionUpdateProperties{ - Type: to.Ptr("CustomScriptExtension"), - Publisher: to.Ptr("Microsoft.Compute"), - Settings: map[string]any{ - "commandToExecute": "powershell.exe -c \"Get-Process | Where-Object { $_.CPU -lt 100 }\"", - }, - TypeHandlerVersion: to.Ptr("1.10"), - }, - }, 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MachineExtension = armhybridcompute.MachineExtension{ - // Name: to.Ptr("CustomScriptExtension"), - // Type: to.Ptr("Microsoft.HybridCompute/machines/extensions"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/Machines/myMachine/Extensions/CustomScriptExtension"), - // Location: to.Ptr("eastus2euap"), - // Properties: &armhybridcompute.MachineExtensionProperties{ - // Type: to.Ptr("string"), - // AutoUpgradeMinorVersion: to.Ptr(false), - // InstanceView: &armhybridcompute.MachineExtensionInstanceView{ - // Name: to.Ptr("CustomScriptExtension"), - // Type: to.Ptr("CustomScriptExtension"), - // Status: &armhybridcompute.MachineExtensionInstanceViewStatus{ - // Code: to.Ptr("success"), - // Level: to.Ptr(armhybridcompute.StatusLevelTypes("Information")), - // Message: to.Ptr("Finished executing command, StdOut: , StdErr:"), - // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-08T20:42:10.999Z"); return t}()), - // }, - // TypeHandlerVersion: to.Ptr("1.10.3"), - // }, - // ProtectedSettings: map[string]any{ - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // Publisher: to.Ptr("Microsoft.Compute"), - // Settings: "@{commandToExecute=powershell.exe -c \"Get-Process | Where-Object { $_.CPU -lt 100 }\"}", - // TypeHandlerVersion: to.Ptr("1.10.3"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-03-10/examples/DELETEExtension.json -func ExampleMachineExtensionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewMachineExtensionsClient().BeginDelete(ctx, "myResourceGroup", "myMachine", "MMA", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-03-10/examples/GETExtension.json -func ExampleMachineExtensionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMachineExtensionsClient().Get(ctx, "myResourceGroup", "myMachine", "CustomScriptExtension", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MachineExtension = armhybridcompute.MachineExtension{ - // Name: to.Ptr("CustomScriptExtension"), - // Type: to.Ptr("Microsoft.HybridCompute/machines/extensions"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/Machines/myMachine/Extensions/CustomScriptExtension"), - // Location: to.Ptr("eastus2euap"), - // Properties: &armhybridcompute.MachineExtensionProperties{ - // Type: to.Ptr("string"), - // AutoUpgradeMinorVersion: to.Ptr(false), - // InstanceView: &armhybridcompute.MachineExtensionInstanceView{ - // Name: to.Ptr("CustomScriptExtension"), - // Type: to.Ptr("CustomScriptExtension"), - // Status: &armhybridcompute.MachineExtensionInstanceViewStatus{ - // Code: to.Ptr("success"), - // DisplayStatus: to.Ptr("Provisioning succeeded"), - // Level: to.Ptr(armhybridcompute.StatusLevelTypes("Information")), - // Message: to.Ptr("Finished executing command, StdOut: , StdErr:"), - // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-08-08T20:42:10.999Z"); return t}()), - // }, - // TypeHandlerVersion: to.Ptr("1.10.3"), - // }, - // ProtectedSettings: map[string]any{ - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // Publisher: to.Ptr("Microsoft.Compute"), - // Settings: "@{commandToExecute=powershell.exe -c \"Get-Process | Where-Object { $_.CPU -gt 10000 }\"}", - // TypeHandlerVersion: to.Ptr("1.10.3"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-03-10/examples/LISTExtension.json -func ExampleMachineExtensionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewMachineExtensionsClient().NewListPager("myResourceGroup", "myMachine", &armhybridcompute.MachineExtensionsClientListOptions{Expand: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.MachineExtensionsListResult = armhybridcompute.MachineExtensionsListResult{ - // Value: []*armhybridcompute.MachineExtension{ - // { - // Name: to.Ptr("CustomScriptExtension"), - // Type: to.Ptr("Microsoft.HybridCompute/machines/extensions"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/Machines/myMachine/Extensions/CustomScriptExtension"), - // Location: to.Ptr("eastus2euap"), - // Properties: &armhybridcompute.MachineExtensionProperties{ - // Type: to.Ptr("CustomScriptExtension"), - // AutoUpgradeMinorVersion: to.Ptr(false), - // InstanceView: &armhybridcompute.MachineExtensionInstanceView{ - // Name: to.Ptr("CustomScriptExtension"), - // Type: to.Ptr("CustomScriptExtension"), - // Status: &armhybridcompute.MachineExtensionInstanceViewStatus{ - // Code: to.Ptr("success"), - // DisplayStatus: to.Ptr("Provisioning succeeded"), - // Level: to.Ptr(armhybridcompute.StatusLevelTypes("Information")), - // Message: to.Ptr("formattedMessage: Finished executing command, StdOut: , StdErr: "), - // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-08-13T17:18:57.405Z"); return t}()), - // }, - // TypeHandlerVersion: to.Ptr("1.10.3"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // Publisher: to.Ptr("Microsoft.Compute"), - // Settings: map[string]any{ - // "commandToExecute": "powershell.exe -c \"Get-Process | Where-Object { $_.CPU -gt 10000 }\"", - // }, - // TypeHandlerVersion: to.Ptr("1.10.3"), - // }, - // }, - // { - // Name: to.Ptr("winosupdateextension"), - // Type: to.Ptr("Microsoft.HybridCompute/machines/extensions"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/Machines/myMachine/Extensions/winosupdateextension"), - // Location: to.Ptr("eastus2euap"), - // Properties: &armhybridcompute.MachineExtensionProperties{ - // Type: to.Ptr("windowsosupdateextension"), - // AutoUpgradeMinorVersion: to.Ptr(false), - // InstanceView: &armhybridcompute.MachineExtensionInstanceView{ - // Name: to.Ptr("winosupdateextension"), - // Type: to.Ptr("windowsosupdateextension"), - // Status: &armhybridcompute.MachineExtensionInstanceViewStatus{ - // }, - // TypeHandlerVersion: to.Ptr("1.0.0.0"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // Publisher: to.Ptr("microsoft.softwareupdatemanagement.test"), - // Settings: map[string]any{ - // }, - // TypeHandlerVersion: to.Ptr("1.0.0.0"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/machines_client.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/machines_client.go index da87fe95a307..67f78b01e359 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/machines_client.go +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/machines_client.go @@ -44,10 +44,11 @@ func NewMachinesClient(subscriptionID string, credential azcore.TokenCredential, return client, nil } -// CreateOrUpdate - The operation to create or update a hybrid machine resource identity in Azure. +// CreateOrUpdate - The operation to create or update a hybrid machine. Please note some properties can be set only during +// machine creation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-03-10 +// Generated from API version 2023-03-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - machineName - The name of the hybrid machine. // - parameters - Parameters supplied to the Create hybrid machine operation. @@ -87,7 +88,7 @@ func (client *MachinesClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-10") + reqQP.Set("api-version", "2023-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -102,10 +103,10 @@ func (client *MachinesClient) createOrUpdateHandleResponse(resp *http.Response) return result, nil } -// Delete - The operation to remove a hybrid machine identity in Azure. +// Delete - The operation to delete a hybrid machine. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-03-10 +// Generated from API version 2023-03-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - machineName - The name of the hybrid machine. // - options - MachinesClientDeleteOptions contains the optional parameters for the MachinesClient.Delete method. @@ -144,7 +145,7 @@ func (client *MachinesClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-10") + reqQP.Set("api-version", "2023-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -153,7 +154,7 @@ func (client *MachinesClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Retrieves information about the model view or the instance view of a hybrid machine. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-03-10 +// Generated from API version 2023-03-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - machineName - The name of the hybrid machine. // - options - MachinesClientGetOptions contains the optional parameters for the MachinesClient.Get method. @@ -192,7 +193,7 @@ func (client *MachinesClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-10") + reqQP.Set("api-version", "2023-03-15-preview") if options != nil && options.Expand != nil { reqQP.Set("$expand", string(*options.Expand)) } @@ -213,7 +214,7 @@ func (client *MachinesClient) getHandleResponse(resp *http.Response) (MachinesCl // NewListByResourceGroupPager - Lists all the hybrid machines in the specified resource group. Use the nextLink property // in the response to get the next page of hybrid machines. // -// Generated from API version 2022-03-10 +// Generated from API version 2023-03-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - MachinesClientListByResourceGroupOptions contains the optional parameters for the MachinesClient.NewListByResourceGroupPager // method. @@ -261,7 +262,7 @@ func (client *MachinesClient) listByResourceGroupCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-10") + reqQP.Set("api-version", "2023-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -279,7 +280,7 @@ func (client *MachinesClient) listByResourceGroupHandleResponse(resp *http.Respo // NewListBySubscriptionPager - Lists all the hybrid machines in the specified subscription. Use the nextLink property in // the response to get the next page of hybrid machines. // -// Generated from API version 2022-03-10 +// Generated from API version 2023-03-15-preview // - options - MachinesClientListBySubscriptionOptions contains the optional parameters for the MachinesClient.NewListBySubscriptionPager // method. func (client *MachinesClient) NewListBySubscriptionPager(options *MachinesClientListBySubscriptionOptions) *runtime.Pager[MachinesClientListBySubscriptionResponse] { @@ -322,7 +323,7 @@ func (client *MachinesClient) listBySubscriptionCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-10") + reqQP.Set("api-version", "2023-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -340,7 +341,7 @@ func (client *MachinesClient) listBySubscriptionHandleResponse(resp *http.Respon // Update - The operation to update a hybrid machine. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-03-10 +// Generated from API version 2023-03-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - machineName - The name of the hybrid machine. // - parameters - Parameters supplied to the Update hybrid machine operation. @@ -380,7 +381,7 @@ func (client *MachinesClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-10") + reqQP.Set("api-version", "2023-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/machines_client_example_test.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/machines_client_example_test.go deleted file mode 100644 index cae4b7ec6ced..000000000000 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/machines_client_example_test.go +++ /dev/null @@ -1,494 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armhybridcompute_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/hybridcompute/armhybridcompute" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-03-10/examples/Machines_CreateOrUpdate.json -func ExampleMachinesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMachinesClient().CreateOrUpdate(ctx, "myResourceGroup", "myMachine", armhybridcompute.Machine{ - Location: to.Ptr("eastus2euap"), - Identity: &armhybridcompute.Identity{ - Type: to.Ptr("SystemAssigned"), - }, - Properties: &armhybridcompute.MachineProperties{ - ClientPublicKey: to.Ptr("string"), - LocationData: &armhybridcompute.LocationData{ - Name: to.Ptr("Redmond"), - }, - ParentClusterResourceID: to.Ptr("{AzureStackHCIResourceId}"), - PrivateLinkScopeResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName"), - VMID: to.Ptr("b7a098cc-b0b8-46e8-a205-62f301a62a8f"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Machine = armhybridcompute.Machine{ - // Name: to.Ptr("myMachine"), - // Type: to.Ptr("Microsoft.HybridCompute/machines"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/machines/myMachine"), - // Location: to.Ptr("eastus2euap"), - // Identity: &armhybridcompute.Identity{ - // Type: to.Ptr("SystemAssigned"), - // PrincipalID: to.Ptr("string"), - // TenantID: to.Ptr("string"), - // }, - // Properties: &armhybridcompute.MachineProperties{ - // ClientPublicKey: to.Ptr("string"), - // DetectedProperties: map[string]*string{ - // "cloudprovider": to.Ptr("N/A"), - // "manufacturer": to.Ptr("Microsoft Corporation"), - // "model": to.Ptr("Virtual Machine"), - // }, - // LocationData: &armhybridcompute.LocationData{ - // Name: to.Ptr("Redmond"), - // City: to.Ptr("redmond"), - // CountryOrRegion: to.Ptr("usa"), - // }, - // MssqlDiscovered: to.Ptr("false"), - // OSProfile: &armhybridcompute.OSProfile{ - // LinuxConfiguration: &armhybridcompute.OSProfileLinuxConfiguration{ - // PatchSettings: &armhybridcompute.PatchSettings{ - // }, - // }, - // WindowsConfiguration: &armhybridcompute.OSProfileWindowsConfiguration{ - // PatchSettings: &armhybridcompute.PatchSettings{ - // }, - // }, - // }, - // ParentClusterResourceID: to.Ptr("{AzureStackHCIResourceId}"), - // PrivateLinkScopeResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName"), - // ProvisioningState: to.Ptr("Succeeded"), - // VMID: to.Ptr("b7a098cc-b0b8-46e8-a205-62f301a62a8f"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-03-10/examples/Machines_Update.json -func ExampleMachinesClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMachinesClient().Update(ctx, "myResourceGroup", "myMachine", armhybridcompute.MachineUpdate{ - Identity: &armhybridcompute.Identity{ - Type: to.Ptr("SystemAssigned"), - }, - Properties: &armhybridcompute.MachineUpdateProperties{ - LocationData: &armhybridcompute.LocationData{ - Name: to.Ptr("Redmond"), - }, - OSProfile: &armhybridcompute.OSProfile{ - LinuxConfiguration: &armhybridcompute.OSProfileLinuxConfiguration{ - PatchSettings: &armhybridcompute.PatchSettings{ - AssessmentMode: to.Ptr(armhybridcompute.AssessmentModeTypesImageDefault), - PatchMode: to.Ptr(armhybridcompute.PatchModeTypesManual), - }, - }, - WindowsConfiguration: &armhybridcompute.OSProfileWindowsConfiguration{ - PatchSettings: &armhybridcompute.PatchSettings{ - AssessmentMode: to.Ptr(armhybridcompute.AssessmentModeTypesImageDefault), - PatchMode: to.Ptr(armhybridcompute.PatchModeTypesManual), - }, - }, - }, - ParentClusterResourceID: to.Ptr("{AzureStackHCIResourceId}"), - PrivateLinkScopeResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Machine = armhybridcompute.Machine{ - // Name: to.Ptr("myMachine"), - // Type: to.Ptr("Microsoft.HybridCompute/machines"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/machines/myMachine"), - // Location: to.Ptr("eastus2euap"), - // Identity: &armhybridcompute.Identity{ - // Type: to.Ptr("SystemAssigned"), - // PrincipalID: to.Ptr("string"), - // TenantID: to.Ptr("string"), - // }, - // Properties: &armhybridcompute.MachineProperties{ - // ClientPublicKey: to.Ptr("string"), - // LocationData: &armhybridcompute.LocationData{ - // Name: to.Ptr("Redmond"), - // }, - // OSProfile: &armhybridcompute.OSProfile{ - // LinuxConfiguration: &armhybridcompute.OSProfileLinuxConfiguration{ - // PatchSettings: &armhybridcompute.PatchSettings{ - // AssessmentMode: to.Ptr(armhybridcompute.AssessmentModeTypesImageDefault), - // PatchMode: to.Ptr(armhybridcompute.PatchModeTypesManual), - // }, - // }, - // WindowsConfiguration: &armhybridcompute.OSProfileWindowsConfiguration{ - // PatchSettings: &armhybridcompute.PatchSettings{ - // AssessmentMode: to.Ptr(armhybridcompute.AssessmentModeTypesImageDefault), - // PatchMode: to.Ptr(armhybridcompute.PatchModeTypesManual), - // }, - // }, - // }, - // ParentClusterResourceID: to.Ptr("{AzureStackHCIResourceId}"), - // PrivateLinkScopeResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName"), - // ProvisioningState: to.Ptr("Succeeded"), - // VMID: to.Ptr("b7a098cc-b0b8-46e8-a205-62f301a62a8f"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-03-10/examples/Machines_Delete.json -func ExampleMachinesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewMachinesClient().Delete(ctx, "myResourceGroup", "myMachine", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-03-10/examples/Machines_Get.json -func ExampleMachinesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMachinesClient().Get(ctx, "myResourceGroup", "myMachine", &armhybridcompute.MachinesClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Machine = armhybridcompute.Machine{ - // Name: to.Ptr("myMachine"), - // Type: to.Ptr("Microsoft.HybridCompute/machines"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/machines/myMachine"), - // Location: to.Ptr("eastus2euap"), - // Identity: &armhybridcompute.Identity{ - // Type: to.Ptr("SystemAssigned"), - // PrincipalID: to.Ptr("string"), - // TenantID: to.Ptr("string"), - // }, - // Properties: &armhybridcompute.MachineProperties{ - // AgentConfiguration: &armhybridcompute.AgentConfiguration{ - // ExtensionsEnabled: to.Ptr("true"), - // GuestConfigurationEnabled: to.Ptr("true"), - // IncomingConnectionsPorts: []*string{ - // to.Ptr("22"), - // to.Ptr("23")}, - // ProxyBypass: []*string{ - // to.Ptr("proxy1"), - // to.Ptr("proxy2")}, - // ProxyURL: to.Ptr("https://test.test"), - // }, - // ClientPublicKey: to.Ptr("string"), - // DetectedProperties: map[string]*string{ - // "cloudprovider": to.Ptr("N/A"), - // "manufacturer": to.Ptr("Microsoft Corporation"), - // "model": to.Ptr("Virtual Machine"), - // }, - // LocationData: &armhybridcompute.LocationData{ - // Name: to.Ptr("Redmond"), - // City: to.Ptr("redmond"), - // CountryOrRegion: to.Ptr("usa"), - // }, - // MssqlDiscovered: to.Ptr("false"), - // OSProfile: &armhybridcompute.OSProfile{ - // LinuxConfiguration: &armhybridcompute.OSProfileLinuxConfiguration{ - // PatchSettings: &armhybridcompute.PatchSettings{ - // }, - // }, - // WindowsConfiguration: &armhybridcompute.OSProfileWindowsConfiguration{ - // PatchSettings: &armhybridcompute.PatchSettings{ - // }, - // }, - // }, - // ParentClusterResourceID: to.Ptr("{AzureStackHCIResourceId}"), - // PrivateLinkScopeResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName"), - // ProvisioningState: to.Ptr("Succeeded"), - // ServiceStatuses: &armhybridcompute.ServiceStatuses{ - // ExtensionService: &armhybridcompute.ServiceStatus{ - // StartupType: to.Ptr("Automatic"), - // Status: to.Ptr("Running"), - // }, - // GuestConfigurationService: &armhybridcompute.ServiceStatus{ - // StartupType: to.Ptr("Automatic"), - // Status: to.Ptr("Running"), - // }, - // }, - // VMID: to.Ptr("b7a098cc-b0b8-46e8-a205-62f301a62a8f"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-03-10/examples/Machines_ListByResourceGroup.json -func ExampleMachinesClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewMachinesClient().NewListByResourceGroupPager("myResourceGroup", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.MachineListResult = armhybridcompute.MachineListResult{ - // Value: []*armhybridcompute.Machine{ - // { - // Name: to.Ptr("myMachine"), - // Type: to.Ptr("Microsoft.HybridCompute/machines"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/machines/myMachine"), - // Location: to.Ptr("eastus2euap"), - // Identity: &armhybridcompute.Identity{ - // Type: to.Ptr("SystemAssigned"), - // PrincipalID: to.Ptr("f7a068cc-b0b8-46e8-a203-22f301a62a8f"), - // TenantID: to.Ptr("c4098cc-91b8-46c2-a205-d82ab1a62a8f"), - // }, - // Properties: &armhybridcompute.MachineProperties{ - // AgentConfiguration: &armhybridcompute.AgentConfiguration{ - // IncomingConnectionsPorts: []*string{ - // to.Ptr("22"), - // to.Ptr("23")}, - // ProxyURL: to.Ptr("https://test.test"), - // }, - // ClientPublicKey: to.Ptr("string"), - // DetectedProperties: map[string]*string{ - // "cloudprovider": to.Ptr("N/A"), - // "manufacturer": to.Ptr("Microsoft Corporation"), - // "model": to.Ptr("Virtual Machine"), - // }, - // LocationData: &armhybridcompute.LocationData{ - // Name: to.Ptr("Redmond"), - // }, - // MssqlDiscovered: to.Ptr("false"), - // OSProfile: &armhybridcompute.OSProfile{ - // LinuxConfiguration: &armhybridcompute.OSProfileLinuxConfiguration{ - // PatchSettings: &armhybridcompute.PatchSettings{ - // }, - // }, - // WindowsConfiguration: &armhybridcompute.OSProfileWindowsConfiguration{ - // PatchSettings: &armhybridcompute.PatchSettings{ - // }, - // }, - // }, - // PrivateLinkScopeResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName"), - // ProvisioningState: to.Ptr("Succeeded"), - // VMID: to.Ptr("b7a098cc-b0b8-46e8-a205-62f301a62a8f"), - // }, - // }, - // { - // Name: to.Ptr("myMachine2"), - // Type: to.Ptr("Microsoft.HybridCompute/machines"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/machines/myMachine2"), - // Location: to.Ptr("westus2"), - // Identity: &armhybridcompute.Identity{ - // Type: to.Ptr("SystemAssigned"), - // PrincipalID: to.Ptr("e7a068cc-b0b8-46e8-a203-22f301a62a8f"), - // TenantID: to.Ptr("c4098cc-91b8-46c2-a205-d82ab1a62a8f"), - // }, - // Properties: &armhybridcompute.MachineProperties{ - // AgentConfiguration: &armhybridcompute.AgentConfiguration{ - // IncomingConnectionsPorts: []*string{ - // to.Ptr("22"), - // to.Ptr("23")}, - // ProxyURL: to.Ptr("https://test.test"), - // }, - // ClientPublicKey: to.Ptr("string"), - // DetectedProperties: map[string]*string{ - // "cloudprovider": to.Ptr("N/A"), - // "manufacturer": to.Ptr("Microsoft Corporation"), - // "model": to.Ptr("Surfacebook"), - // }, - // LocationData: &armhybridcompute.LocationData{ - // Name: to.Ptr("Redmond"), - // }, - // MssqlDiscovered: to.Ptr("true"), - // OSProfile: &armhybridcompute.OSProfile{ - // LinuxConfiguration: &armhybridcompute.OSProfileLinuxConfiguration{ - // PatchSettings: &armhybridcompute.PatchSettings{ - // }, - // }, - // WindowsConfiguration: &armhybridcompute.OSProfileWindowsConfiguration{ - // PatchSettings: &armhybridcompute.PatchSettings{ - // }, - // }, - // }, - // ParentClusterResourceID: to.Ptr("{AzureStackHCIResourceId}"), - // PrivateLinkScopeResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName"), - // ProvisioningState: to.Ptr("Succeeded"), - // VMID: to.Ptr("a4a098cc-b0b8-46e8-a205-62f301a62a8f"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-03-10/examples/Machines_ListBySubscription.json -func ExampleMachinesClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewMachinesClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.MachineListResult = armhybridcompute.MachineListResult{ - // Value: []*armhybridcompute.Machine{ - // { - // Name: to.Ptr("myMachine"), - // Type: to.Ptr("Microsoft.HybridCompute/machines"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/machines/myMachine"), - // Location: to.Ptr("eastus2euap"), - // Identity: &armhybridcompute.Identity{ - // Type: to.Ptr("SystemAssigned"), - // PrincipalID: to.Ptr("string"), - // TenantID: to.Ptr("string"), - // }, - // Properties: &armhybridcompute.MachineProperties{ - // AgentConfiguration: &armhybridcompute.AgentConfiguration{ - // IncomingConnectionsPorts: []*string{ - // to.Ptr("22"), - // to.Ptr("23")}, - // ProxyURL: to.Ptr("https://test.test"), - // }, - // ClientPublicKey: to.Ptr("string"), - // DetectedProperties: map[string]*string{ - // "cloudprovider": to.Ptr("N/A"), - // "manufacturer": to.Ptr("Microsoft Corporation"), - // "model": to.Ptr("Virtual Machine"), - // }, - // LocationData: &armhybridcompute.LocationData{ - // Name: to.Ptr("Redmond"), - // }, - // MssqlDiscovered: to.Ptr("false"), - // OSProfile: &armhybridcompute.OSProfile{ - // LinuxConfiguration: &armhybridcompute.OSProfileLinuxConfiguration{ - // PatchSettings: &armhybridcompute.PatchSettings{ - // }, - // }, - // WindowsConfiguration: &armhybridcompute.OSProfileWindowsConfiguration{ - // PatchSettings: &armhybridcompute.PatchSettings{ - // }, - // }, - // }, - // PrivateLinkScopeResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName"), - // ProvisioningState: to.Ptr("Succeeded"), - // VMID: to.Ptr("b7a098cc-b0b8-46e8-a205-62f301a62a8f"), - // }, - // }, - // { - // Name: to.Ptr("myMachine2"), - // Type: to.Ptr("Microsoft.HybridCompute/machines"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup2/providers/Microsoft.HybridCompute/machines/myMachine2"), - // Location: to.Ptr("westus2"), - // Identity: &armhybridcompute.Identity{ - // Type: to.Ptr("SystemAssigned"), - // PrincipalID: to.Ptr("e7a068cc-b0b8-46e8-a203-22f301a62a8f"), - // TenantID: to.Ptr("c4098cc-91b8-46c2-a205-d82ab1a62a8f"), - // }, - // Properties: &armhybridcompute.MachineProperties{ - // AgentConfiguration: &armhybridcompute.AgentConfiguration{ - // IncomingConnectionsPorts: []*string{ - // to.Ptr("22"), - // to.Ptr("23")}, - // ProxyURL: to.Ptr("https://test.test"), - // }, - // ClientPublicKey: to.Ptr("string"), - // DetectedProperties: map[string]*string{ - // "cloudprovider": to.Ptr("N/A"), - // "manufacturer": to.Ptr("Microsoft Corporation"), - // "model": to.Ptr("Surfacebook"), - // }, - // LocationData: &armhybridcompute.LocationData{ - // Name: to.Ptr("Redmond"), - // }, - // MssqlDiscovered: to.Ptr("true"), - // OSProfile: &armhybridcompute.OSProfile{ - // LinuxConfiguration: &armhybridcompute.OSProfileLinuxConfiguration{ - // PatchSettings: &armhybridcompute.PatchSettings{ - // }, - // }, - // WindowsConfiguration: &armhybridcompute.OSProfileWindowsConfiguration{ - // PatchSettings: &armhybridcompute.PatchSettings{ - // }, - // }, - // }, - // ParentClusterResourceID: to.Ptr("{AzureStackHCIResourceId}"), - // ProvisioningState: to.Ptr("Succeeded"), - // VMID: to.Ptr("a4a098cc-b0b8-46e8-a205-62f301a62a8f"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/management_client.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/management_client.go index 304730e40838..ed32a2ab573d 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/management_client.go +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/management_client.go @@ -47,7 +47,7 @@ func NewManagementClient(subscriptionID string, credential azcore.TokenCredentia // BeginUpgradeExtensions - The operation to Upgrade Machine Extensions. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-03-10 +// Generated from API version 2023-03-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - machineName - The name of the hybrid machine. // - extensionUpgradeParameters - Parameters supplied to the Upgrade Extensions operation. @@ -68,7 +68,7 @@ func (client *ManagementClient) BeginUpgradeExtensions(ctx context.Context, reso // UpgradeExtensions - The operation to Upgrade Machine Extensions. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-03-10 +// Generated from API version 2023-03-15-preview func (client *ManagementClient) upgradeExtensions(ctx context.Context, resourceGroupName string, machineName string, extensionUpgradeParameters MachineExtensionUpgrade, options *ManagementClientBeginUpgradeExtensionsOptions) (*http.Response, error) { req, err := client.upgradeExtensionsCreateRequest(ctx, resourceGroupName, machineName, extensionUpgradeParameters, options) if err != nil { @@ -104,7 +104,7 @@ func (client *ManagementClient) upgradeExtensionsCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-10") + reqQP.Set("api-version", "2023-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, extensionUpgradeParameters) diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/management_client_example_test.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/management_client_example_test.go deleted file mode 100644 index c79a1f833326..000000000000 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/management_client_example_test.go +++ /dev/null @@ -1,49 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armhybridcompute_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/hybridcompute/armhybridcompute" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-03-10/examples/Extensions_Upgrade.json -func ExampleManagementClient_BeginUpgradeExtensions() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagementClient().BeginUpgradeExtensions(ctx, "myResourceGroup", "myMachine", armhybridcompute.MachineExtensionUpgrade{ - ExtensionTargets: map[string]*armhybridcompute.ExtensionTargetProperties{ - "Microsoft.Azure.Monitoring": { - TargetVersion: to.Ptr("2.0"), - }, - "Microsoft.Compute.CustomScriptExtension": { - TargetVersion: to.Ptr("1.10"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/models.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/models.go index d5e55cb5dd94..705bcffa1488 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/models.go +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/models.go @@ -14,6 +14,10 @@ import "time" // AgentConfiguration - Configurable properties that the user can set locally via the azcmagent config command, or remotely // via ARM. type AgentConfiguration struct { + // READ-ONLY; Name of configuration mode to use. Modes are pre-defined configurations of security controls, extension allowlists + // and guest configuration, maintained by Microsoft. + ConfigMode *AgentConfigurationMode + // READ-ONLY; Array of extensions that are allowed to be installed or updated. ExtensionsAllowList []*ConfigurationExtension @@ -36,6 +40,61 @@ type AgentConfiguration struct { ProxyURL *string } +// AgentUpgrade - The info w.r.t Agent Upgrade. +type AgentUpgrade struct { + // The correlation ID passed in from RSM per upgrade. + CorrelationID *string + + // Specifies the version info w.r.t AgentUpgrade for the machine. + DesiredVersion *string + + // Specifies if RSM should try to upgrade this machine + EnableAutomaticUpgrade *bool + + // READ-ONLY; Specifies the version of the last attempt + LastAttemptDesiredVersion *string + + // READ-ONLY; Failure message of last upgrade attempt if any. + LastAttemptMessage *string + + // READ-ONLY; Specifies the status of Agent Upgrade. + LastAttemptStatus *LastAttemptStatusEnum + + // READ-ONLY; Timestamp of last upgrade attempt + LastAttemptTimestamp *string +} + +// AgentVersion - Describes properties of Agent Version. +type AgentVersion struct { + // Represents the agent version. + AgentVersion *string + + // Represents the download link of specific agent version. + DownloadLink *string + + // Defines the os type. + OSType *string +} + +// AgentVersionClientGetOptions contains the optional parameters for the AgentVersionClient.Get method. +type AgentVersionClientGetOptions struct { + // placeholder for future optional parameters +} + +// AgentVersionClientListOptions contains the optional parameters for the AgentVersionClient.List method. +type AgentVersionClientListOptions struct { + // placeholder for future optional parameters +} + +// AgentVersionsList - Describes AgentVersions List. +type AgentVersionsList struct { + // The URI to fetch the next 10 available Agent Versions. + NextLink *string + + // The list of available Agent Versions. + Value []*AgentVersion +} + // CloudMetadata - The metadata of the cloud environment (Azure/GCP/AWS/OCI…). type CloudMetadata struct { // READ-ONLY; Specifies the cloud provider (Azure/AWS/GCP…). @@ -95,6 +154,24 @@ type ErrorDetail struct { Target *string } +// ErrorDetailAutoGenerated - The error detail. +type ErrorDetailAutoGenerated struct { + // READ-ONLY; The error additional info. + AdditionalInfo []*ErrorAdditionalInfo + + // READ-ONLY; The error code. + Code *string + + // READ-ONLY; The error details. + Details []*ErrorDetailAutoGenerated + + // READ-ONLY; The error message. + Message *string + + // READ-ONLY; The error target. + Target *string +} + // ErrorResponse - Common error response for all Azure Resource Manager APIs to return error details for failed operations. // (This also follows the OData error response format.). type ErrorResponse struct { @@ -102,12 +179,127 @@ type ErrorResponse struct { Error *ErrorDetail } +// ErrorResponseAutoGenerated - Common error response for all Azure Resource Manager APIs to return error details for failed +// operations. (This also follows the OData error response format.). +type ErrorResponseAutoGenerated struct { + // The error object. + Error *ErrorDetailAutoGenerated +} + +// ExtensionMetadataClientGetOptions contains the optional parameters for the ExtensionMetadataClient.Get method. +type ExtensionMetadataClientGetOptions struct { + // placeholder for future optional parameters +} + +// ExtensionMetadataClientListOptions contains the optional parameters for the ExtensionMetadataClient.NewListPager method. +type ExtensionMetadataClientListOptions struct { + // placeholder for future optional parameters +} + // ExtensionTargetProperties - Describes the Machine Extension Target Version Properties type ExtensionTargetProperties struct { // Properties for the specified Extension to Upgrade. TargetVersion *string } +// ExtensionValue - Describes a Extension Metadata +type ExtensionValue struct { + // The single extension based on search criteria + Properties *ExtensionValueProperties + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// ExtensionValueListResult - The List Extension Metadata response. +type ExtensionValueListResult struct { + // READ-ONLY; The list of extension metadata + Value []*ExtensionValue +} + +// ExtensionValueProperties - Describes Extension Metadata properties +type ExtensionValueProperties struct { + // READ-ONLY; The type of the Extension being received. + ExtensionType *string + + // READ-ONLY; The publisher of the Extension being received. + Publisher *string + + // READ-ONLY; The version of the Extension being received. + Version *string +} + +// HybridIdentityMetadata - Defines the HybridIdentityMetadata. +type HybridIdentityMetadata struct { + // REQUIRED; Resource properties. + Properties *HybridIdentityMetadataProperties + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// HybridIdentityMetadataClientGetOptions contains the optional parameters for the HybridIdentityMetadataClient.Get method. +type HybridIdentityMetadataClientGetOptions struct { + // placeholder for future optional parameters +} + +// HybridIdentityMetadataClientListByMachinesOptions contains the optional parameters for the HybridIdentityMetadataClient.NewListByMachinesPager +// method. +type HybridIdentityMetadataClientListByMachinesOptions struct { + // placeholder for future optional parameters +} + +// HybridIdentityMetadataList - List of HybridIdentityMetadata. +type HybridIdentityMetadataList struct { + // REQUIRED; Array of HybridIdentityMetadata + Value []*HybridIdentityMetadata + + // Url to follow for getting next page of HybridIdentityMetadata. + NextLink *string +} + +// HybridIdentityMetadataProperties - Defines the resource properties. +type HybridIdentityMetadataProperties struct { + // The Public Key. + PublicKey *string + + // The unique identifier for the resource. + VMID *string + + // READ-ONLY; Identity for the resource. + Identity *Identity +} + +// IPAddress - Describes properties of the IP address. +type IPAddress struct { + // Represents the IP Address. + Address *string + + // Represents the Ip Address Version. + IPAddressVersion *string + + // READ-ONLY; The subnet to which this IP address belongs. + Subnet *Subnet +} + // Identity for the resource. type Identity struct { // The identity type. @@ -143,6 +335,9 @@ type Machine struct { // Identity for the resource. Identity *Identity + // Indicates which kind of VM fabric the instance is an instance of, such as HCI or SCVMM etc. + Kind *PrivateCloudKind + // Hybrid Compute Machine properties Properties *MachineProperties @@ -155,7 +350,10 @@ type Machine struct { // READ-ONLY; The name of the resource Name *string - // READ-ONLY; The system meta data relating to this resource. + // READ-ONLY; The list of extensions affiliated to the machine + Resources []*MachineExtension + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" @@ -179,7 +377,7 @@ type MachineExtension struct { // READ-ONLY; The name of the resource Name *string - // READ-ONLY; The system meta data relating to this resource. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" @@ -236,13 +434,13 @@ type MachineExtensionProperties struct { InstanceView *MachineExtensionInstanceView // The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. - ProtectedSettings any + ProtectedSettings map[string]any // The name of the extension handler publisher. Publisher *string // Json formatted public settings for the extension. - Settings any + Settings map[string]any // Specifies the type of the extension; an example is "CustomScriptExtension". Type *string @@ -270,17 +468,20 @@ type MachineExtensionUpdateProperties struct { // with this property set to true. AutoUpgradeMinorVersion *bool + // Indicates whether the extension should be automatically upgraded by the platform if there is a newer version available. + EnableAutomaticUpgrade *bool + // How the extension handler should be forced to update even if the extension configuration has not changed. ForceUpdateTag *string // The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. - ProtectedSettings any + ProtectedSettings map[string]any // The name of the extension handler publisher. Publisher *string // Json formatted public settings for the extension. - Settings any + Settings map[string]any // Specifies the type of the extension; an example is "CustomScriptExtension". Type *string @@ -289,7 +490,7 @@ type MachineExtensionUpdateProperties struct { TypeHandlerVersion *string } -// MachineExtensionUpgrade - Describes the Machine Extension Upgrade Properties +// MachineExtensionUpgrade - Describes the Machine Extension Upgrade Properties. type MachineExtensionUpgrade struct { // Describes the Extension Target Properties. ExtensionTargets map[string]*ExtensionTargetProperties @@ -347,13 +548,16 @@ type MachineListResult struct { // MachineProperties - Describes the properties of a hybrid machine. type MachineProperties struct { + // The info of the machine w.r.t Agent Upgrade + AgentUpgrade *AgentUpgrade + // Public Key that the client provides to be used during initial resource onboarding ClientPublicKey *string // The metadata of the cloud environment (Azure/GCP/AWS/OCI…). CloudMetadata *CloudMetadata - // Machine Extensions information + // Machine Extensions information (deprecated field) Extensions []*MachineExtensionInstanceView // Metadata pertaining to the geographic location of the resource. @@ -410,6 +614,9 @@ type MachineProperties struct { // READ-ONLY; Specifies the hybrid machine FQDN. MachineFqdn *string + // READ-ONLY; Information about the network the machine is on. + NetworkProfile *NetworkProfile + // READ-ONLY; The Operating System running on the hybrid machine. OSName *string @@ -434,6 +641,9 @@ type MachineUpdate struct { // Identity for the resource. Identity *Identity + // Indicates which kind of VM fabric the instance is an instance of, such as HCI or SCVMM etc. + Kind *PrivateCloudKind + // Hybrid Compute Machine properties Properties *MachineUpdateProperties @@ -443,6 +653,9 @@ type MachineUpdate struct { // MachineUpdateProperties - Describes the ARM updatable properties of a hybrid machine. type MachineUpdateProperties struct { + // The info of the machine w.r.t Agent Upgrade + AgentUpgrade *AgentUpgrade + // The metadata of the cloud environment (Azure/GCP/AWS/OCI…). CloudMetadata *CloudMetadata @@ -499,6 +712,23 @@ type ManagementClientBeginUpgradeExtensionsOptions struct { ResumeToken string } +// NetworkInterface - Describes a network interface. +type NetworkInterface struct { + // The list of IP addresses in this interface. + IPAddresses []*IPAddress +} + +// NetworkProfile - Describes the network information on this machine. +type NetworkProfile struct { + // The list of network interfaces. + NetworkInterfaces []*NetworkInterface +} + +// NetworkProfileClientGetOptions contains the optional parameters for the NetworkProfileClient.Get method. +type NetworkProfileClientGetOptions struct { + // placeholder for future optional parameters +} + // OSProfile - Specifies the operating system settings for the hybrid machine. type OSProfile struct { // Specifies the linux configuration for update management. @@ -584,7 +814,7 @@ type PrivateEndpointConnection struct { // READ-ONLY; The name of the resource Name *string - // READ-ONLY; The system meta data relating to this resource. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" @@ -673,7 +903,7 @@ type PrivateLinkResource struct { // READ-ONLY; The name of the resource Name *string - // READ-ONLY; The system meta data relating to this resource. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" @@ -859,6 +1089,9 @@ type ProxyResource struct { // READ-ONLY; The name of the resource Name *string + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } @@ -871,6 +1104,9 @@ type Resource struct { // READ-ONLY; The name of the resource Name *string + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } @@ -899,6 +1135,12 @@ type ServiceStatuses struct { GuestConfigurationService *ServiceStatus } +// Subnet - Describes the subnet. +type Subnet struct { + // Represents address prefix. + AddressPrefix *string +} + // SystemData - Metadata pertaining to creation and last modification of the resource. type SystemData struct { // The timestamp of resource creation (UTC). @@ -942,6 +1184,9 @@ type TrackedResource struct { // READ-ONLY; The name of the resource Name *string + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/models_serde.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/models_serde.go index ee1d027bb6a0..92623c0adde6 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/models_serde.go +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/models_serde.go @@ -19,6 +19,7 @@ import ( // MarshalJSON implements the json.Marshaller interface for type AgentConfiguration. func (a AgentConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "configMode", a.ConfigMode) populate(objectMap, "extensionsAllowList", a.ExtensionsAllowList) populate(objectMap, "extensionsBlockList", a.ExtensionsBlockList) populate(objectMap, "extensionsEnabled", a.ExtensionsEnabled) @@ -38,6 +39,9 @@ func (a *AgentConfiguration) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "configMode": + err = unpopulate(val, "ConfigMode", &a.ConfigMode) + delete(rawMsg, key) case "extensionsAllowList": err = unpopulate(val, "ExtensionsAllowList", &a.ExtensionsAllowList) delete(rawMsg, key) @@ -67,6 +71,123 @@ func (a *AgentConfiguration) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type AgentUpgrade. +func (a AgentUpgrade) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "correlationId", a.CorrelationID) + populate(objectMap, "desiredVersion", a.DesiredVersion) + populate(objectMap, "enableAutomaticUpgrade", a.EnableAutomaticUpgrade) + populate(objectMap, "lastAttemptDesiredVersion", a.LastAttemptDesiredVersion) + populate(objectMap, "lastAttemptMessage", a.LastAttemptMessage) + populate(objectMap, "lastAttemptStatus", a.LastAttemptStatus) + populate(objectMap, "lastAttemptTimestamp", a.LastAttemptTimestamp) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AgentUpgrade. +func (a *AgentUpgrade) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "correlationId": + err = unpopulate(val, "CorrelationID", &a.CorrelationID) + delete(rawMsg, key) + case "desiredVersion": + err = unpopulate(val, "DesiredVersion", &a.DesiredVersion) + delete(rawMsg, key) + case "enableAutomaticUpgrade": + err = unpopulate(val, "EnableAutomaticUpgrade", &a.EnableAutomaticUpgrade) + delete(rawMsg, key) + case "lastAttemptDesiredVersion": + err = unpopulate(val, "LastAttemptDesiredVersion", &a.LastAttemptDesiredVersion) + delete(rawMsg, key) + case "lastAttemptMessage": + err = unpopulate(val, "LastAttemptMessage", &a.LastAttemptMessage) + delete(rawMsg, key) + case "lastAttemptStatus": + err = unpopulate(val, "LastAttemptStatus", &a.LastAttemptStatus) + delete(rawMsg, key) + case "lastAttemptTimestamp": + err = unpopulate(val, "LastAttemptTimestamp", &a.LastAttemptTimestamp) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AgentVersion. +func (a AgentVersion) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "agentVersion", a.AgentVersion) + populate(objectMap, "downloadLink", a.DownloadLink) + populate(objectMap, "osType", a.OSType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AgentVersion. +func (a *AgentVersion) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "agentVersion": + err = unpopulate(val, "AgentVersion", &a.AgentVersion) + delete(rawMsg, key) + case "downloadLink": + err = unpopulate(val, "DownloadLink", &a.DownloadLink) + delete(rawMsg, key) + case "osType": + err = unpopulate(val, "OSType", &a.OSType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AgentVersionsList. +func (a AgentVersionsList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AgentVersionsList. +func (a *AgentVersionsList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &a.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &a.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type CloudMetadata. func (c CloudMetadata) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -242,6 +363,49 @@ func (e *ErrorDetail) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ErrorDetailAutoGenerated. +func (e ErrorDetailAutoGenerated) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "additionalInfo", e.AdditionalInfo) + populate(objectMap, "code", e.Code) + populate(objectMap, "details", e.Details) + populate(objectMap, "message", e.Message) + populate(objectMap, "target", e.Target) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetailAutoGenerated. +func (e *ErrorDetailAutoGenerated) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "additionalInfo": + err = unpopulate(val, "AdditionalInfo", &e.AdditionalInfo) + delete(rawMsg, key) + case "code": + err = unpopulate(val, "Code", &e.Code) + delete(rawMsg, key) + case "details": + err = unpopulate(val, "Details", &e.Details) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &e.Message) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &e.Target) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ErrorResponse. func (e ErrorResponse) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -269,6 +433,33 @@ func (e *ErrorResponse) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ErrorResponseAutoGenerated. +func (e ErrorResponseAutoGenerated) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "error", e.Error) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponseAutoGenerated. +func (e *ErrorResponseAutoGenerated) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "error": + err = unpopulate(val, "Error", &e.Error) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ExtensionTargetProperties. func (e ExtensionTargetProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -296,6 +487,255 @@ func (e *ExtensionTargetProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ExtensionValue. +func (e ExtensionValue) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", e.ID) + populate(objectMap, "name", e.Name) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "systemData", e.SystemData) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExtensionValue. +func (e *ExtensionValue) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &e.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &e.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &e.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ExtensionValueListResult. +func (e ExtensionValueListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "value", e.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExtensionValueListResult. +func (e *ExtensionValueListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &e.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ExtensionValueProperties. +func (e ExtensionValueProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "extensionType", e.ExtensionType) + populate(objectMap, "publisher", e.Publisher) + populate(objectMap, "version", e.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExtensionValueProperties. +func (e *ExtensionValueProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "extensionType": + err = unpopulate(val, "ExtensionType", &e.ExtensionType) + delete(rawMsg, key) + case "publisher": + err = unpopulate(val, "Publisher", &e.Publisher) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &e.Version) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type HybridIdentityMetadata. +func (h HybridIdentityMetadata) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", h.ID) + populate(objectMap, "name", h.Name) + populate(objectMap, "properties", h.Properties) + populate(objectMap, "systemData", h.SystemData) + populate(objectMap, "type", h.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HybridIdentityMetadata. +func (h *HybridIdentityMetadata) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &h.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &h.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &h.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &h.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &h.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type HybridIdentityMetadataList. +func (h HybridIdentityMetadataList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", h.NextLink) + populate(objectMap, "value", h.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HybridIdentityMetadataList. +func (h *HybridIdentityMetadataList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &h.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &h.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type HybridIdentityMetadataProperties. +func (h HybridIdentityMetadataProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "identity", h.Identity) + populate(objectMap, "publicKey", h.PublicKey) + populate(objectMap, "vmId", h.VMID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HybridIdentityMetadataProperties. +func (h *HybridIdentityMetadataProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "identity": + err = unpopulate(val, "Identity", &h.Identity) + delete(rawMsg, key) + case "publicKey": + err = unpopulate(val, "PublicKey", &h.PublicKey) + delete(rawMsg, key) + case "vmId": + err = unpopulate(val, "VMID", &h.VMID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IPAddress. +func (i IPAddress) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "address", i.Address) + populate(objectMap, "ipAddressVersion", i.IPAddressVersion) + populate(objectMap, "subnet", i.Subnet) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IPAddress. +func (i *IPAddress) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "address": + err = unpopulate(val, "Address", &i.Address) + delete(rawMsg, key) + case "ipAddressVersion": + err = unpopulate(val, "IPAddressVersion", &i.IPAddressVersion) + delete(rawMsg, key) + case "subnet": + err = unpopulate(val, "Subnet", &i.Subnet) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type Identity. func (i Identity) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -375,9 +815,11 @@ func (m Machine) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", m.ID) populate(objectMap, "identity", m.Identity) + populate(objectMap, "kind", m.Kind) populate(objectMap, "location", m.Location) populate(objectMap, "name", m.Name) populate(objectMap, "properties", m.Properties) + populate(objectMap, "resources", m.Resources) populate(objectMap, "systemData", m.SystemData) populate(objectMap, "tags", m.Tags) populate(objectMap, "type", m.Type) @@ -399,6 +841,9 @@ func (m *Machine) UnmarshalJSON(data []byte) error { case "identity": err = unpopulate(val, "Identity", &m.Identity) delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &m.Kind) + delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &m.Location) delete(rawMsg, key) @@ -408,6 +853,9 @@ func (m *Machine) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &m.Properties) delete(rawMsg, key) + case "resources": + err = unpopulate(val, "Resources", &m.Resources) + delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &m.SystemData) delete(rawMsg, key) @@ -565,10 +1013,10 @@ func (m MachineExtensionProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "enableAutomaticUpgrade", m.EnableAutomaticUpgrade) populate(objectMap, "forceUpdateTag", m.ForceUpdateTag) populate(objectMap, "instanceView", m.InstanceView) - populateAny(objectMap, "protectedSettings", m.ProtectedSettings) + populate(objectMap, "protectedSettings", m.ProtectedSettings) populate(objectMap, "provisioningState", m.ProvisioningState) populate(objectMap, "publisher", m.Publisher) - populateAny(objectMap, "settings", m.Settings) + populate(objectMap, "settings", m.Settings) populate(objectMap, "type", m.Type) populate(objectMap, "typeHandlerVersion", m.TypeHandlerVersion) return json.Marshal(objectMap) @@ -656,10 +1104,11 @@ func (m *MachineExtensionUpdate) UnmarshalJSON(data []byte) error { func (m MachineExtensionUpdateProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "autoUpgradeMinorVersion", m.AutoUpgradeMinorVersion) + populate(objectMap, "enableAutomaticUpgrade", m.EnableAutomaticUpgrade) populate(objectMap, "forceUpdateTag", m.ForceUpdateTag) - populateAny(objectMap, "protectedSettings", m.ProtectedSettings) + populate(objectMap, "protectedSettings", m.ProtectedSettings) populate(objectMap, "publisher", m.Publisher) - populateAny(objectMap, "settings", m.Settings) + populate(objectMap, "settings", m.Settings) populate(objectMap, "type", m.Type) populate(objectMap, "typeHandlerVersion", m.TypeHandlerVersion) return json.Marshal(objectMap) @@ -677,6 +1126,9 @@ func (m *MachineExtensionUpdateProperties) UnmarshalJSON(data []byte) error { case "autoUpgradeMinorVersion": err = unpopulate(val, "AutoUpgradeMinorVersion", &m.AutoUpgradeMinorVersion) delete(rawMsg, key) + case "enableAutomaticUpgrade": + err = unpopulate(val, "EnableAutomaticUpgrade", &m.EnableAutomaticUpgrade) + delete(rawMsg, key) case "forceUpdateTag": err = unpopulate(val, "ForceUpdateTag", &m.ForceUpdateTag) delete(rawMsg, key) @@ -797,6 +1249,7 @@ func (m MachineProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "adFqdn", m.AdFqdn) populate(objectMap, "agentConfiguration", m.AgentConfiguration) + populate(objectMap, "agentUpgrade", m.AgentUpgrade) populate(objectMap, "agentVersion", m.AgentVersion) populate(objectMap, "clientPublicKey", m.ClientPublicKey) populate(objectMap, "cloudMetadata", m.CloudMetadata) @@ -810,6 +1263,7 @@ func (m MachineProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "locationData", m.LocationData) populate(objectMap, "machineFqdn", m.MachineFqdn) populate(objectMap, "mssqlDiscovered", m.MssqlDiscovered) + populate(objectMap, "networkProfile", m.NetworkProfile) populate(objectMap, "osName", m.OSName) populate(objectMap, "osProfile", m.OSProfile) populate(objectMap, "osSku", m.OSSKU) @@ -840,6 +1294,9 @@ func (m *MachineProperties) UnmarshalJSON(data []byte) error { case "agentConfiguration": err = unpopulate(val, "AgentConfiguration", &m.AgentConfiguration) delete(rawMsg, key) + case "agentUpgrade": + err = unpopulate(val, "AgentUpgrade", &m.AgentUpgrade) + delete(rawMsg, key) case "agentVersion": err = unpopulate(val, "AgentVersion", &m.AgentVersion) delete(rawMsg, key) @@ -879,6 +1336,9 @@ func (m *MachineProperties) UnmarshalJSON(data []byte) error { case "mssqlDiscovered": err = unpopulate(val, "MssqlDiscovered", &m.MssqlDiscovered) delete(rawMsg, key) + case "networkProfile": + err = unpopulate(val, "NetworkProfile", &m.NetworkProfile) + delete(rawMsg, key) case "osName": err = unpopulate(val, "OSName", &m.OSName) delete(rawMsg, key) @@ -927,6 +1387,7 @@ func (m *MachineProperties) UnmarshalJSON(data []byte) error { func (m MachineUpdate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "identity", m.Identity) + populate(objectMap, "kind", m.Kind) populate(objectMap, "properties", m.Properties) populate(objectMap, "tags", m.Tags) return json.Marshal(objectMap) @@ -944,6 +1405,9 @@ func (m *MachineUpdate) UnmarshalJSON(data []byte) error { case "identity": err = unpopulate(val, "Identity", &m.Identity) delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &m.Kind) + delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &m.Properties) delete(rawMsg, key) @@ -961,6 +1425,7 @@ func (m *MachineUpdate) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type MachineUpdateProperties. func (m MachineUpdateProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "agentUpgrade", m.AgentUpgrade) populate(objectMap, "cloudMetadata", m.CloudMetadata) populate(objectMap, "locationData", m.LocationData) populate(objectMap, "osProfile", m.OSProfile) @@ -978,6 +1443,9 @@ func (m *MachineUpdateProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "agentUpgrade": + err = unpopulate(val, "AgentUpgrade", &m.AgentUpgrade) + delete(rawMsg, key) case "cloudMetadata": err = unpopulate(val, "CloudMetadata", &m.CloudMetadata) delete(rawMsg, key) @@ -1001,6 +1469,60 @@ func (m *MachineUpdateProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type NetworkInterface. +func (n NetworkInterface) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "ipAddresses", n.IPAddresses) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkInterface. +func (n *NetworkInterface) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "ipAddresses": + err = unpopulate(val, "IPAddresses", &n.IPAddresses) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkProfile. +func (n NetworkProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "networkInterfaces", n.NetworkInterfaces) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkProfile. +func (n *NetworkProfile) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "networkInterfaces": + err = unpopulate(val, "NetworkInterfaces", &n.NetworkInterfaces) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type OSProfile. func (o OSProfile) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -1753,6 +2275,7 @@ func (p ProxyResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", p.ID) populate(objectMap, "name", p.Name) + populate(objectMap, "systemData", p.SystemData) populate(objectMap, "type", p.Type) return json.Marshal(objectMap) } @@ -1772,6 +2295,9 @@ func (p *ProxyResource) UnmarshalJSON(data []byte) error { case "name": err = unpopulate(val, "Name", &p.Name) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &p.Type) delete(rawMsg, key) @@ -1788,6 +2314,7 @@ func (r Resource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", r.ID) populate(objectMap, "name", r.Name) + populate(objectMap, "systemData", r.SystemData) populate(objectMap, "type", r.Type) return json.Marshal(objectMap) } @@ -1807,6 +2334,9 @@ func (r *Resource) UnmarshalJSON(data []byte) error { case "name": err = unpopulate(val, "Name", &r.Name) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &r.SystemData) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &r.Type) delete(rawMsg, key) @@ -1907,6 +2437,33 @@ func (s *ServiceStatuses) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type Subnet. +func (s Subnet) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "addressPrefix", s.AddressPrefix) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Subnet. +func (s *Subnet) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "addressPrefix": + err = unpopulate(val, "AddressPrefix", &s.AddressPrefix) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type SystemData. func (s SystemData) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -1987,6 +2544,7 @@ func (t TrackedResource) MarshalJSON() ([]byte, error) { populate(objectMap, "id", t.ID) populate(objectMap, "location", t.Location) populate(objectMap, "name", t.Name) + populate(objectMap, "systemData", t.SystemData) populate(objectMap, "tags", t.Tags) populate(objectMap, "type", t.Type) return json.Marshal(objectMap) @@ -2010,6 +2568,9 @@ func (t *TrackedResource) UnmarshalJSON(data []byte) error { case "name": err = unpopulate(val, "Name", &t.Name) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &t.SystemData) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &t.Tags) delete(rawMsg, key) diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/networkprofile_client.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/networkprofile_client.go new file mode 100644 index 000000000000..e86bdd688427 --- /dev/null +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/networkprofile_client.go @@ -0,0 +1,102 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armhybridcompute + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// NetworkProfileClient contains the methods for the NetworkProfile group. +// Don't use this type directly, use NewNetworkProfileClient() instead. +type NetworkProfileClient struct { + internal *arm.Client + subscriptionID string +} + +// NewNetworkProfileClient creates a new instance of NetworkProfileClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewNetworkProfileClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NetworkProfileClient, error) { + cl, err := arm.NewClient(moduleName+".NetworkProfileClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &NetworkProfileClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Get - The operation to get network information of hybrid machine +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-03-15-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - machineName - The name of the hybrid machine. +// - options - NetworkProfileClientGetOptions contains the optional parameters for the NetworkProfileClient.Get method. +func (client *NetworkProfileClient) Get(ctx context.Context, resourceGroupName string, machineName string, options *NetworkProfileClientGetOptions) (NetworkProfileClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, machineName, options) + if err != nil { + return NetworkProfileClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NetworkProfileClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return NetworkProfileClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *NetworkProfileClient) getCreateRequest(ctx context.Context, resourceGroupName string, machineName string, options *NetworkProfileClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/networkProfile" + 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 machineName == "" { + return nil, errors.New("parameter machineName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{machineName}", url.PathEscape(machineName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-03-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *NetworkProfileClient) getHandleResponse(resp *http.Response) (NetworkProfileClientGetResponse, error) { + result := NetworkProfileClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NetworkProfile); err != nil { + return NetworkProfileClientGetResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/operations_client.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/operations_client.go index 7a9f6844822b..103933e79eed 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/operations_client.go +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/operations_client.go @@ -40,7 +40,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - Gets a list of hybrid compute operations. // -// Generated from API version 2022-03-10 +// Generated from API version 2023-03-15-preview // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -72,7 +72,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-10") + reqQP.Set("api-version", "2023-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/operations_client_example_test.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/operations_client_example_test.go deleted file mode 100644 index c2624eb512fc..000000000000 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/operations_client_example_test.go +++ /dev/null @@ -1,68 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armhybridcompute_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridcompute/armhybridcompute" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-03-10/examples/Operations_List.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OperationListResult = armhybridcompute.OperationListResult{ - // Value: []*armhybridcompute.OperationValue{ - // { - // Name: to.Ptr("Microsoft.HybridCompute/operations/read"), - // Display: &armhybridcompute.OperationValueDisplay{ - // Description: to.Ptr("Read all Operations for Azure Arc for Servers"), - // Operation: to.Ptr("Read all Operations"), - // Provider: to.Ptr("Microsoft HybridCompute"), - // Resource: to.Ptr("Microsoft.HybridCompute Resource Provider"), - // }, - // IsDataAction: to.Ptr(true), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.HybridCompute/register/action"), - // Display: &armhybridcompute.OperationValueDisplay{ - // Description: to.Ptr("Registers the subscription for the Microsoft.HybridCompute Resource Provider"), - // Operation: to.Ptr("Register Subscription for Azure Arc for Servers"), - // Provider: to.Ptr("Microsoft HybridCompute"), - // Resource: to.Ptr("Microsoft.HybridCompute Resource Provider"), - // }, - // IsDataAction: to.Ptr(true), - // Origin: to.Ptr("user,system"), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/privateendpointconnections_client.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/privateendpointconnections_client.go index 33486947f382..14d9d8c54a15 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/privateendpointconnections_client.go +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/privateendpointconnections_client.go @@ -47,7 +47,7 @@ func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcor // BeginCreateOrUpdate - Approve or reject a private endpoint connection with a given name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-03-10 +// Generated from API version 2023-03-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - scopeName - The name of the Azure Arc PrivateLinkScope resource. // - privateEndpointConnectionName - The name of the private endpoint connection. @@ -68,7 +68,7 @@ func (client *PrivateEndpointConnectionsClient) BeginCreateOrUpdate(ctx context. // CreateOrUpdate - Approve or reject a private endpoint connection with a given name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-03-10 +// Generated from API version 2023-03-15-preview func (client *PrivateEndpointConnectionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, scopeName string, privateEndpointConnectionName string, parameters PrivateEndpointConnection, options *PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, scopeName, privateEndpointConnectionName, parameters, options) if err != nil { @@ -108,7 +108,7 @@ func (client *PrivateEndpointConnectionsClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-10") + reqQP.Set("api-version", "2023-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -117,7 +117,7 @@ func (client *PrivateEndpointConnectionsClient) createOrUpdateCreateRequest(ctx // BeginDelete - Deletes a private endpoint connection with a given name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-03-10 +// Generated from API version 2023-03-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - scopeName - The name of the Azure Arc PrivateLinkScope resource. // - privateEndpointConnectionName - The name of the private endpoint connection. @@ -138,7 +138,7 @@ func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, // Delete - Deletes a private endpoint connection with a given name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-03-10 +// Generated from API version 2023-03-15-preview func (client *PrivateEndpointConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, scopeName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, scopeName, privateEndpointConnectionName, options) if err != nil { @@ -178,7 +178,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-10") + reqQP.Set("api-version", "2023-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -187,7 +187,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. // Get - Gets a private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-03-10 +// Generated from API version 2023-03-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - scopeName - The name of the Azure Arc PrivateLinkScope resource. // - privateEndpointConnectionName - The name of the private endpoint connection. @@ -232,7 +232,7 @@ func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-10") + reqQP.Set("api-version", "2023-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -249,7 +249,7 @@ func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *http.Res // NewListByPrivateLinkScopePager - Gets all private endpoint connections on a private link scope. // -// Generated from API version 2022-03-10 +// Generated from API version 2023-03-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - scopeName - The name of the Azure Arc PrivateLinkScope resource. // - options - PrivateEndpointConnectionsClientListByPrivateLinkScopeOptions contains the optional parameters for the PrivateEndpointConnectionsClient.NewListByPrivateLinkScopePager @@ -302,7 +302,7 @@ func (client *PrivateEndpointConnectionsClient) listByPrivateLinkScopeCreateRequ return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-10") + reqQP.Set("api-version", "2023-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/privateendpointconnections_client_example_test.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/privateendpointconnections_client_example_test.go deleted file mode 100644 index 538a2a6322b7..000000000000 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/privateendpointconnections_client_example_test.go +++ /dev/null @@ -1,191 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armhybridcompute_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/hybridcompute/armhybridcompute" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-03-10/examples/PrivateEndpointConnectionGet.json -func ExamplePrivateEndpointConnectionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateEndpointConnectionsClient().Get(ctx, "myResourceGroup", "myPrivateLinkScope", "private-endpoint-connection-name", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateEndpointConnection = armhybridcompute.PrivateEndpointConnection{ - // Name: to.Ptr("private-endpoint-connection-name"), - // Type: to.Ptr("Microsoft.HybridCompute/privateLinkScopes/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/privateLinkScopes/myPrivateLinkScope/privateEndpointConnections/private-endpoint-connection-name"), - // Properties: &armhybridcompute.PrivateEndpointConnectionProperties{ - // GroupIDs: []*string{ - // to.Ptr("hybridcompute")}, - // PrivateEndpoint: &armhybridcompute.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armhybridcompute.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-03-10/examples/PrivateEndpointConnectionUpdate.json -func ExamplePrivateEndpointConnectionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myPrivateLinkScope", "private-endpoint-connection-name", armhybridcompute.PrivateEndpointConnection{ - Properties: &armhybridcompute.PrivateEndpointConnectionProperties{ - PrivateLinkServiceConnectionState: &armhybridcompute.PrivateLinkServiceConnectionStateProperty{ - Description: to.Ptr("Approved by johndoe@contoso.com"), - Status: to.Ptr("Approved"), - }, - }, - }, 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateEndpointConnection = armhybridcompute.PrivateEndpointConnection{ - // Name: to.Ptr("private-endpoint-connection-name"), - // Type: to.Ptr("Microsoft.HybridCompute/privateLinkScopes/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/privateLinkScopes/myPrivateLinkScope/privateEndpointConnections/private-endpoint-connection-name"), - // Properties: &armhybridcompute.PrivateEndpointConnectionProperties{ - // GroupIDs: []*string{ - // to.Ptr("hybridcompute")}, - // PrivateEndpoint: &armhybridcompute.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armhybridcompute.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Approved by johndoe@contoso.com"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-03-10/examples/PrivateEndpointConnectionDelete.json -func ExamplePrivateEndpointConnectionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginDelete(ctx, "myResourceGroup", "myPrivateLinkScope", "private-endpoint-connection-name", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-03-10/examples/PrivateEndpointConnectionList.json -func ExamplePrivateEndpointConnectionsClient_NewListByPrivateLinkScopePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrivateEndpointConnectionsClient().NewListByPrivateLinkScopePager("myResourceGroup", "myPrivateLinkScope", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PrivateEndpointConnectionListResult = armhybridcompute.PrivateEndpointConnectionListResult{ - // Value: []*armhybridcompute.PrivateEndpointConnection{ - // { - // Name: to.Ptr("private-endpoint-connection-name"), - // Type: to.Ptr("Microsoft.HybridCompute/privateLinkScopes/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/privateLinkScopes/myPrivateLinkScope/privateEndpointConnections/private-endpoint-connection-name-2"), - // Properties: &armhybridcompute.PrivateEndpointConnectionProperties{ - // GroupIDs: []*string{ - // to.Ptr("hybridcompute")}, - // PrivateEndpoint: &armhybridcompute.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armhybridcompute.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // }, - // { - // Name: to.Ptr("private-endpoint-connection-name-2"), - // Type: to.Ptr("Microsoft.HybridCompute/privateLinkScopes/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/privateLinkScopes/myPrivateLinkScope/privateEndpointConnections/private-endpoint-connection-name-2"), - // Properties: &armhybridcompute.PrivateEndpointConnectionProperties{ - // GroupIDs: []*string{ - // to.Ptr("hybridcompute")}, - // PrivateEndpoint: &armhybridcompute.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name-2"), - // }, - // PrivateLinkServiceConnectionState: &armhybridcompute.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Please approve my connection."), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Pending"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/privatelinkresources_client.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/privatelinkresources_client.go index 2dada9607828..582a2d390e1a 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/privatelinkresources_client.go +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/privatelinkresources_client.go @@ -47,7 +47,7 @@ func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.Toke // Get - Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-03-10 +// Generated from API version 2023-03-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - scopeName - The name of the Azure Arc PrivateLinkScope resource. // - groupName - The name of the private link resource. @@ -92,7 +92,7 @@ func (client *PrivateLinkResourcesClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-10") + reqQP.Set("api-version", "2023-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -109,7 +109,7 @@ func (client *PrivateLinkResourcesClient) getHandleResponse(resp *http.Response) // NewListByPrivateLinkScopePager - Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. // -// Generated from API version 2022-03-10 +// Generated from API version 2023-03-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - scopeName - The name of the Azure Arc PrivateLinkScope resource. // - options - PrivateLinkResourcesClientListByPrivateLinkScopeOptions contains the optional parameters for the PrivateLinkResourcesClient.NewListByPrivateLinkScopePager @@ -162,7 +162,7 @@ func (client *PrivateLinkResourcesClient) listByPrivateLinkScopeCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-10") + reqQP.Set("api-version", "2023-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/privatelinkresources_client_example_test.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/privatelinkresources_client_example_test.go deleted file mode 100644 index 1bbfb2fb3fd3..000000000000 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/privatelinkresources_client_example_test.go +++ /dev/null @@ -1,98 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armhybridcompute_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridcompute/armhybridcompute" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-03-10/examples/PrivateLinkScopePrivateLinkResourceListGet.json -func ExamplePrivateLinkResourcesClient_NewListByPrivateLinkScopePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrivateLinkResourcesClient().NewListByPrivateLinkScopePager("myResourceGroup", "myPrivateLinkScope", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PrivateLinkResourceListResult = armhybridcompute.PrivateLinkResourceListResult{ - // Value: []*armhybridcompute.PrivateLinkResource{ - // { - // Name: to.Ptr("hybridcompute"), - // Type: to.Ptr("Microsoft.HybridCompute/privateLinkScopes/privateLinkResources"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/privateLinkScopes/myPrivateLinkScope/privateLinkResources/hybridcompute"), - // Properties: &armhybridcompute.PrivateLinkResourceProperties{ - // GroupID: to.Ptr("hybridcompute"), - // RequiredMembers: []*string{ - // to.Ptr("HybridCompute.ServerDP"), - // to.Ptr("HybridCompute.K8sConfigurationDP"), - // to.Ptr("HybridCompute.GuestConfigDP")}, - // RequiredZoneNames: []*string{ - // to.Ptr("privatelink.his.arc.azure.com"), - // to.Ptr("privatelink.kubernetesconfiguration.azure.com"), - // to.Ptr("privatelink.Guestconfiguration.azure.com")}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-03-10/examples/PrivateLinkScopePrivateLinkResourceGet.json -func ExamplePrivateLinkResourcesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateLinkResourcesClient().Get(ctx, "myResourceGroup", "myPrivateLinkScope", "hybridcompute", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateLinkResource = armhybridcompute.PrivateLinkResource{ - // Name: to.Ptr("hybridcompute"), - // Type: to.Ptr("Microsoft.HybridCompute/privateLinkScopes/privateLinkResources"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/privateLinkScopes/myPrivateLinkScope/privateLinkResources/hybridcompute"), - // Properties: &armhybridcompute.PrivateLinkResourceProperties{ - // GroupID: to.Ptr("hybridcompute"), - // RequiredMembers: []*string{ - // to.Ptr("HybridCompute.Server"), - // to.Ptr("HybridCompute.K8sConfiguration"), - // to.Ptr("GuestConfig.DP")}, - // RequiredZoneNames: []*string{ - // to.Ptr("privatelink.his.arc.azure.com"), - // to.Ptr("privatelink.kubernetesconfiguration.azure.com"), - // to.Ptr("privatelink.Guestconfiguration.azure.com")}, - // }, - // } -} diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/privatelinkscopes_client.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/privatelinkscopes_client.go index 7e126d0a9036..aee4d8045566 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/privatelinkscopes_client.go +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/privatelinkscopes_client.go @@ -48,7 +48,7 @@ func NewPrivateLinkScopesClient(subscriptionID string, credential azcore.TokenCr // nor AppId in the Put operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-03-10 +// Generated from API version 2023-03-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - scopeName - The name of the Azure Arc PrivateLinkScope resource. // - parameters - Properties that need to be specified to create or update a Azure Arc for Servers and Clusters PrivateLinkScope. @@ -89,7 +89,7 @@ func (client *PrivateLinkScopesClient) createOrUpdateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-10") + reqQP.Set("api-version", "2023-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -107,7 +107,7 @@ func (client *PrivateLinkScopesClient) createOrUpdateHandleResponse(resp *http.R // BeginDelete - Deletes a Azure Arc PrivateLinkScope. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-03-10 +// Generated from API version 2023-03-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - scopeName - The name of the Azure Arc PrivateLinkScope resource. // - options - PrivateLinkScopesClientBeginDeleteOptions contains the optional parameters for the PrivateLinkScopesClient.BeginDelete @@ -127,7 +127,7 @@ func (client *PrivateLinkScopesClient) BeginDelete(ctx context.Context, resource // Delete - Deletes a Azure Arc PrivateLinkScope. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-03-10 +// Generated from API version 2023-03-15-preview func (client *PrivateLinkScopesClient) deleteOperation(ctx context.Context, resourceGroupName string, scopeName string, options *PrivateLinkScopesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, scopeName, options) if err != nil { @@ -163,7 +163,7 @@ func (client *PrivateLinkScopesClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-10") + reqQP.Set("api-version", "2023-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -172,7 +172,7 @@ func (client *PrivateLinkScopesClient) deleteCreateRequest(ctx context.Context, // Get - Returns a Azure Arc PrivateLinkScope. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-03-10 +// Generated from API version 2023-03-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - scopeName - The name of the Azure Arc PrivateLinkScope resource. // - options - PrivateLinkScopesClientGetOptions contains the optional parameters for the PrivateLinkScopesClient.Get method. @@ -211,7 +211,7 @@ func (client *PrivateLinkScopesClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-10") + reqQP.Set("api-version", "2023-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -229,7 +229,7 @@ func (client *PrivateLinkScopesClient) getHandleResponse(resp *http.Response) (P // GetValidationDetails - Returns a Azure Arc PrivateLinkScope's validation details. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-03-10 +// Generated from API version 2023-03-15-preview // - location - The location of the target resource. // - privateLinkScopeID - The id (Guid) of the Azure Arc PrivateLinkScope resource. // - options - PrivateLinkScopesClientGetValidationDetailsOptions contains the optional parameters for the PrivateLinkScopesClient.GetValidationDetails @@ -269,7 +269,7 @@ func (client *PrivateLinkScopesClient) getValidationDetailsCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-10") + reqQP.Set("api-version", "2023-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -287,7 +287,7 @@ func (client *PrivateLinkScopesClient) getValidationDetailsHandleResponse(resp * // GetValidationDetailsForMachine - Returns a Azure Arc PrivateLinkScope's validation details for a given machine. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-03-10 +// Generated from API version 2023-03-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - machineName - The name of the target machine to get the private link scope validation details for. // - options - PrivateLinkScopesClientGetValidationDetailsForMachineOptions contains the optional parameters for the PrivateLinkScopesClient.GetValidationDetailsForMachine @@ -327,7 +327,7 @@ func (client *PrivateLinkScopesClient) getValidationDetailsForMachineCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-10") + reqQP.Set("api-version", "2023-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -344,7 +344,7 @@ func (client *PrivateLinkScopesClient) getValidationDetailsForMachineHandleRespo // NewListPager - Gets a list of all Azure Arc PrivateLinkScopes within a subscription. // -// Generated from API version 2022-03-10 +// Generated from API version 2023-03-15-preview // - options - PrivateLinkScopesClientListOptions contains the optional parameters for the PrivateLinkScopesClient.NewListPager // method. func (client *PrivateLinkScopesClient) NewListPager(options *PrivateLinkScopesClientListOptions) *runtime.Pager[PrivateLinkScopesClientListResponse] { @@ -387,7 +387,7 @@ func (client *PrivateLinkScopesClient) listCreateRequest(ctx context.Context, op return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-10") + reqQP.Set("api-version", "2023-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -404,7 +404,7 @@ func (client *PrivateLinkScopesClient) listHandleResponse(resp *http.Response) ( // NewListByResourceGroupPager - Gets a list of Azure Arc PrivateLinkScopes within a resource group. // -// Generated from API version 2022-03-10 +// Generated from API version 2023-03-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - PrivateLinkScopesClientListByResourceGroupOptions contains the optional parameters for the PrivateLinkScopesClient.NewListByResourceGroupPager // method. @@ -452,7 +452,7 @@ func (client *PrivateLinkScopesClient) listByResourceGroupCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-10") + reqQP.Set("api-version", "2023-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -470,7 +470,7 @@ func (client *PrivateLinkScopesClient) listByResourceGroupHandleResponse(resp *h // UpdateTags - Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate method. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-03-10 +// Generated from API version 2023-03-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - scopeName - The name of the Azure Arc PrivateLinkScope resource. // - privateLinkScopeTags - Updated tag information to set into the PrivateLinkScope instance. @@ -511,7 +511,7 @@ func (client *PrivateLinkScopesClient) updateTagsCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-10") + reqQP.Set("api-version", "2023-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, privateLinkScopeTags) diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/privatelinkscopes_client_example_test.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/privatelinkscopes_client_example_test.go deleted file mode 100644 index 3f726ca528d2..000000000000 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/privatelinkscopes_client_example_test.go +++ /dev/null @@ -1,478 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armhybridcompute_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/hybridcompute/armhybridcompute" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-03-10/examples/PrivateLinkScopesList.json -func ExamplePrivateLinkScopesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrivateLinkScopesClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PrivateLinkScopeListResult = armhybridcompute.PrivateLinkScopeListResult{ - // Value: []*armhybridcompute.PrivateLinkScope{ - // { - // Name: to.Ptr("my-privatelinkscope"), - // Type: to.Ptr("Microsoft.HybridCompute/privateLinkScopes"), - // ID: to.Ptr("/subscriptions/86dc51d3-92ed-4d7e-947a-775ea79b4919/resourceGroups/my-resource-group/providers/microsoft.hybridcompute/privateLinkScopes/my-privatelinkscope"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // }, - // Properties: &armhybridcompute.PrivateLinkScopeProperties{ - // PrivateLinkScopeID: to.Ptr("e5dc51d3-92ed-4d7e-947a-775ea79b4919"), - // ProvisioningState: to.Ptr("Succeeded"), - // PublicNetworkAccess: to.Ptr(armhybridcompute.PublicNetworkAccessTypeDisabled), - // }, - // }, - // { - // Name: to.Ptr("my-other-privatelinkscope"), - // Type: to.Ptr("Microsoft.HybridCompute/privateLinkScopes"), - // ID: to.Ptr("/subscriptions/86dc51d3-92ed-4d7e-947a-775ea79b4919/resourceGroups/my-resource-group/providers/microsoft.hybridcompute/privateLinkScopes/my-other-privatelinkscope"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // }, - // Properties: &armhybridcompute.PrivateLinkScopeProperties{ - // PrivateEndpointConnections: []*armhybridcompute.PrivateEndpointConnectionDataModel{ - // { - // Name: to.Ptr("private-endpoint-connection-name"), - // Type: to.Ptr("Microsoft.HybridCompute/privateLinkScopes/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/privateLinkScopes/myPrivateLinkScope/privateEndpointConnections/private-endpoint-connection-name"), - // Properties: &armhybridcompute.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armhybridcompute.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armhybridcompute.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // }}, - // PrivateLinkScopeID: to.Ptr("f5dc51d3-92ed-4d7e-947a-775ea79b4919"), - // ProvisioningState: to.Ptr("Succeeded"), - // PublicNetworkAccess: to.Ptr(armhybridcompute.PublicNetworkAccessTypeDisabled), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-03-10/examples/PrivateLinkScopesListByResourceGroup.json -func ExamplePrivateLinkScopesClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrivateLinkScopesClient().NewListByResourceGroupPager("my-resource-group", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PrivateLinkScopeListResult = armhybridcompute.PrivateLinkScopeListResult{ - // Value: []*armhybridcompute.PrivateLinkScope{ - // { - // Name: to.Ptr("my-privatelinkscope"), - // Type: to.Ptr("Microsoft.HybridCompute/privateLinkScopes"), - // ID: to.Ptr("/subscriptions/86dc51d3-92ed-4d7e-947a-775ea79b4919/resourceGroups/my-resource-group/providers/microsoft.hybridcompute/privateLinkScopes/my-privatelinkscope"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // }, - // Properties: &armhybridcompute.PrivateLinkScopeProperties{ - // PrivateEndpointConnections: []*armhybridcompute.PrivateEndpointConnectionDataModel{ - // { - // Name: to.Ptr("private-endpoint-connection-name"), - // Type: to.Ptr("Microsoft.HybridCompute/privateLinkScopes/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/privateLinkScopes/myPrivateLinkScope/privateEndpointConnections/private-endpoint-connection-name"), - // Properties: &armhybridcompute.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armhybridcompute.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armhybridcompute.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // }}, - // PrivateLinkScopeID: to.Ptr("f5dc51d3-92ed-4d7e-947a-775ea79b4919"), - // ProvisioningState: to.Ptr("Succeeded"), - // PublicNetworkAccess: to.Ptr(armhybridcompute.PublicNetworkAccessTypeDisabled), - // }, - // }, - // { - // Name: to.Ptr("my-other-privatelinkscope"), - // Type: to.Ptr("Microsoft.HybridCompute/privateLinkScopes"), - // ID: to.Ptr("/subscriptions/86dc51d3-92ed-4d7e-947a-775ea79b4919/resourceGroups/my-resource-group/providers/microsoft.hybridcompute/privateLinkScopes/my-other-privatelinkscope"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // }, - // Properties: &armhybridcompute.PrivateLinkScopeProperties{ - // PrivateEndpointConnections: []*armhybridcompute.PrivateEndpointConnectionDataModel{ - // { - // Name: to.Ptr("private-endpoint-connection-name"), - // Type: to.Ptr("Microsoft.HybridCompute/privateLinkScopes/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/privateLinkScopes/myPrivateLinkScope/privateEndpointConnections/private-endpoint-connection-name"), - // Properties: &armhybridcompute.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armhybridcompute.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armhybridcompute.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // }}, - // PrivateLinkScopeID: to.Ptr("a5dc51d3-92ed-4d7e-947a-775ea79b4919"), - // ProvisioningState: to.Ptr("Succeeded"), - // PublicNetworkAccess: to.Ptr(armhybridcompute.PublicNetworkAccessTypeDisabled), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-03-10/examples/PrivateLinkScopesDelete.json -func ExamplePrivateLinkScopesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateLinkScopesClient().BeginDelete(ctx, "my-resource-group", "my-privatelinkscope", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-03-10/examples/PrivateLinkScopesGet.json -func ExamplePrivateLinkScopesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateLinkScopesClient().Get(ctx, "my-resource-group", "my-privatelinkscope", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateLinkScope = armhybridcompute.PrivateLinkScope{ - // Name: to.Ptr("my-privatelinkscope"), - // Type: to.Ptr("Microsoft.HybridCompute/privateLinkScopes"), - // ID: to.Ptr("/subscriptions/86dc51d3-92ed-4d7e-947a-775ea79b4919/resourceGroups/my-resource-group/providers/microsoft.hybridcompute/privateLinkScopes/my-privatelinkscope"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // }, - // Properties: &armhybridcompute.PrivateLinkScopeProperties{ - // PrivateEndpointConnections: []*armhybridcompute.PrivateEndpointConnectionDataModel{ - // { - // Name: to.Ptr("private-endpoint-connection-name"), - // Type: to.Ptr("Microsoft.HybridCompute/privateLinkScopes/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/privateLinkScopes/myPrivateLinkScope/privateEndpointConnections/private-endpoint-connection-name"), - // Properties: &armhybridcompute.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armhybridcompute.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armhybridcompute.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // }}, - // PrivateLinkScopeID: to.Ptr("f5dc51d3-92ed-4d7e-947a-775ea79b4919"), - // ProvisioningState: to.Ptr("Succeeded"), - // PublicNetworkAccess: to.Ptr(armhybridcompute.PublicNetworkAccessTypeDisabled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-03-10/examples/PrivateLinkScopesCreate.json -func ExamplePrivateLinkScopesClient_CreateOrUpdate_privateLinkScopeCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateLinkScopesClient().CreateOrUpdate(ctx, "my-resource-group", "my-privatelinkscope", armhybridcompute.PrivateLinkScope{ - Location: to.Ptr("westus"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateLinkScope = armhybridcompute.PrivateLinkScope{ - // Name: to.Ptr("my-privatelinkscope"), - // Type: to.Ptr("Microsoft.HybridCompute/privateLinkScopes"), - // ID: to.Ptr("/subscriptions/86dc51d3-92ed-4d7e-947a-775ea79b4919/resourceGroups/my-resource-group/providers/microsoft.hybridcompute/privateLinkScopes/my-privatelinkscope"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // }, - // Properties: &armhybridcompute.PrivateLinkScopeProperties{ - // PrivateEndpointConnections: []*armhybridcompute.PrivateEndpointConnectionDataModel{ - // { - // Name: to.Ptr("private-endpoint-connection-name"), - // Type: to.Ptr("Microsoft.HybridCompute/privateLinkScopes/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/privateLinkScopes/myPrivateLinkScope/privateEndpointConnections/private-endpoint-connection-name"), - // Properties: &armhybridcompute.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armhybridcompute.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armhybridcompute.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // }}, - // PrivateLinkScopeID: to.Ptr("e5dc51d3-92ed-4d7e-947a-775ea79b4919"), - // ProvisioningState: to.Ptr("Succeeded"), - // PublicNetworkAccess: to.Ptr(armhybridcompute.PublicNetworkAccessTypeDisabled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-03-10/examples/PrivateLinkScopesUpdate.json -func ExamplePrivateLinkScopesClient_CreateOrUpdate_privateLinkScopeUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateLinkScopesClient().CreateOrUpdate(ctx, "my-resource-group", "my-privatelinkscope", armhybridcompute.PrivateLinkScope{ - Location: to.Ptr("westus"), - Tags: map[string]*string{ - "Tag1": to.Ptr("Value1"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateLinkScope = armhybridcompute.PrivateLinkScope{ - // Name: to.Ptr("my-privatelinkscope"), - // Type: to.Ptr("Microsoft.HybridCompute/privateLinkScopes"), - // ID: to.Ptr("/subscriptions/86dc51d3-92ed-4d7e-947a-775ea79b4919/resourceGroups/my-resource-group/providers/microsoft.hybridCompute/privateLinkScopes/my-privatelinkscope"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "Tag1": to.Ptr("Value1"), - // }, - // Properties: &armhybridcompute.PrivateLinkScopeProperties{ - // PrivateEndpointConnections: []*armhybridcompute.PrivateEndpointConnectionDataModel{ - // { - // Name: to.Ptr("private-endpoint-connection-name"), - // Type: to.Ptr("Microsoft.HybridCompute/privateLinkScopes/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/privateLinkScopes/myPrivateLinkScope/privateEndpointConnections/private-endpoint-connection-name"), - // Properties: &armhybridcompute.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armhybridcompute.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armhybridcompute.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // }}, - // PrivateLinkScopeID: to.Ptr("e5dc51d3-92ed-4d7e-947a-775ea79b4919"), - // ProvisioningState: to.Ptr("Succeeded"), - // PublicNetworkAccess: to.Ptr(armhybridcompute.PublicNetworkAccessTypeDisabled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-03-10/examples/PrivateLinkScopesUpdateTagsOnly.json -func ExamplePrivateLinkScopesClient_UpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateLinkScopesClient().UpdateTags(ctx, "my-resource-group", "my-privatelinkscope", armhybridcompute.TagsResource{ - Tags: map[string]*string{ - "Tag1": to.Ptr("Value1"), - "Tag2": to.Ptr("Value2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateLinkScope = armhybridcompute.PrivateLinkScope{ - // Name: to.Ptr("my-privatelinkscope"), - // Type: to.Ptr("Microsoft.HybridCompute/privateLinkScopes"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/my-resource-group/providers/microsoft.hybridcompute/privateLinkScopes/my-privatelinkscope"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "Tag1": to.Ptr("Value1"), - // "Tag2": to.Ptr("Value2"), - // }, - // Properties: &armhybridcompute.PrivateLinkScopeProperties{ - // PrivateEndpointConnections: []*armhybridcompute.PrivateEndpointConnectionDataModel{ - // { - // Name: to.Ptr("private-endpoint-connection-name"), - // Type: to.Ptr("Microsoft.HybridCompute/privateLinkScopes/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/privateLinkScopes/myPrivateLinkScope/privateEndpointConnections/private-endpoint-connection-name"), - // Properties: &armhybridcompute.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armhybridcompute.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armhybridcompute.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // }}, - // PrivateLinkScopeID: to.Ptr("e5dc51d3-92ed-4d7e-947a-775ea79b4919"), - // ProvisioningState: to.Ptr("Succeeded"), - // PublicNetworkAccess: to.Ptr(armhybridcompute.PublicNetworkAccessTypeDisabled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-03-10/examples/PrivateLinkScopesGetValidation.json -func ExamplePrivateLinkScopesClient_GetValidationDetails() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateLinkScopesClient().GetValidationDetails(ctx, "wus2", "f5dc51d3-92ed-4d7e-947a-775ea79b4919", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateLinkScopeValidationDetails = armhybridcompute.PrivateLinkScopeValidationDetails{ - // ConnectionDetails: []*armhybridcompute.ConnectionDetail{ - // { - // GroupID: to.Ptr("groupId"), - // ID: to.Ptr("id"), - // LinkIdentifier: to.Ptr("linkId"), - // MemberName: to.Ptr("memberName"), - // PrivateIPAddress: to.Ptr("ip"), - // }}, - // ID: to.Ptr("/subscriptions/86dc51d3-92ed-4d7e-947a-775ea79b4919/resourceGroups/my-resource-group/providers/microsoft.hybridcompute/privateLinkScopes/my-privatelinkscope"), - // PublicNetworkAccess: to.Ptr(armhybridcompute.PublicNetworkAccessTypeDisabled), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-03-10/examples/PrivateLinkScopesGetValidationForMachine.json -func ExamplePrivateLinkScopesClient_GetValidationDetailsForMachine() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateLinkScopesClient().GetValidationDetailsForMachine(ctx, "my-resource-group", "machineName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateLinkScopeValidationDetails = armhybridcompute.PrivateLinkScopeValidationDetails{ - // ConnectionDetails: []*armhybridcompute.ConnectionDetail{ - // { - // GroupID: to.Ptr("groupId"), - // ID: to.Ptr("id"), - // LinkIdentifier: to.Ptr("linkId"), - // MemberName: to.Ptr("memberName"), - // PrivateIPAddress: to.Ptr("ip"), - // }}, - // ID: to.Ptr("/subscriptions/86dc51d3-92ed-4d7e-947a-775ea79b4919/resourceGroups/my-resource-group/providers/microsoft.hybridcompute/privateLinkScopes/my-privatelinkscope"), - // PublicNetworkAccess: to.Ptr(armhybridcompute.PublicNetworkAccessTypeDisabled), - // } -} diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/response_types.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/response_types.go index 25b4052f5fdf..40ba8da62bb5 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/response_types.go +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/response_types.go @@ -9,6 +9,36 @@ package armhybridcompute +// AgentVersionClientGetResponse contains the response from method AgentVersionClient.Get. +type AgentVersionClientGetResponse struct { + AgentVersion +} + +// AgentVersionClientListResponse contains the response from method AgentVersionClient.List. +type AgentVersionClientListResponse struct { + AgentVersionsList +} + +// ExtensionMetadataClientGetResponse contains the response from method ExtensionMetadataClient.Get. +type ExtensionMetadataClientGetResponse struct { + ExtensionValue +} + +// ExtensionMetadataClientListResponse contains the response from method ExtensionMetadataClient.NewListPager. +type ExtensionMetadataClientListResponse struct { + ExtensionValueListResult +} + +// HybridIdentityMetadataClientGetResponse contains the response from method HybridIdentityMetadataClient.Get. +type HybridIdentityMetadataClientGetResponse struct { + HybridIdentityMetadata +} + +// HybridIdentityMetadataClientListByMachinesResponse contains the response from method HybridIdentityMetadataClient.NewListByMachinesPager. +type HybridIdentityMetadataClientListByMachinesResponse struct { + HybridIdentityMetadataList +} + // MachineExtensionsClientCreateOrUpdateResponse contains the response from method MachineExtensionsClient.BeginCreateOrUpdate. type MachineExtensionsClientCreateOrUpdateResponse struct { MachineExtension @@ -69,6 +99,11 @@ type ManagementClientUpgradeExtensionsResponse struct { // placeholder for future response values } +// NetworkProfileClientGetResponse contains the response from method NetworkProfileClient.Get. +type NetworkProfileClientGetResponse struct { + NetworkProfile +} + // OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { OperationListResult