From 060d4c8e456df853f3507e07464927c3963830a7 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 26 Jul 2023 03:00:35 +0000 Subject: [PATCH] CodeGen from PR 24970 in Azure/azure-rest-api-specs Merge 1572ba9a4e08b27e67bc470306062c0df1de8194 into 23d88533ddfde4d1565a897fe95d42fb0d9333e5 --- .../armhybridcompute/CHANGELOG.md | 54 ++ .../armhybridcompute/agentversion_client.go | 148 +++++ .../armhybridcompute/autorest.md | 6 +- .../armhybridcompute/client_factory.go | 35 +- .../armhybridcompute/constants.go | 58 +- .../extensionmetadata_client.go | 183 ++++++ .../hybridcompute/armhybridcompute/go.mod | 22 +- .../hybridcompute/armhybridcompute/go.sum | 38 +- .../hybrididentitymetadata_client.go | 180 ++++++ .../machineextensions_client.go | 89 +-- .../machineextensions_client_example_test.go | 287 --------- .../armhybridcompute/machines_client.go | 83 ++- .../machines_client_example_test.go | 494 --------------- .../armhybridcompute/management_client.go | 27 +- .../management_client_example_test.go | 49 -- .../hybridcompute/armhybridcompute/models.go | 384 +++++++----- .../armhybridcompute/models_serde.go | 572 +++++++++++++++++- .../armhybridcompute/networkprofile_client.go | 104 ++++ .../armhybridcompute/operations_client.go | 7 +- .../operations_client_example_test.go | 68 --- .../hybridcompute/armhybridcompute/options.go | 205 +++++++ .../privateendpointconnections_client.go | 65 +- ...endpointconnections_client_example_test.go | 191 ------ .../privatelinkresources_client.go | 22 +- ...rivatelinkresources_client_example_test.go | 98 --- .../privatelinkscopes_client.go | 115 ++-- .../privatelinkscopes_client_example_test.go | 478 --------------- .../armhybridcompute/response_types.go | 65 +- .../armhybridcompute/time_rfc3339.go | 3 +- 29 files changed, 2064 insertions(+), 2066 deletions(-) create mode 100644 sdk/resourcemanager/hybridcompute/armhybridcompute/agentversion_client.go create mode 100644 sdk/resourcemanager/hybridcompute/armhybridcompute/extensionmetadata_client.go create mode 100644 sdk/resourcemanager/hybridcompute/armhybridcompute/hybrididentitymetadata_client.go delete mode 100644 sdk/resourcemanager/hybridcompute/armhybridcompute/machineextensions_client_example_test.go delete mode 100644 sdk/resourcemanager/hybridcompute/armhybridcompute/machines_client_example_test.go delete mode 100644 sdk/resourcemanager/hybridcompute/armhybridcompute/management_client_example_test.go create mode 100644 sdk/resourcemanager/hybridcompute/armhybridcompute/networkprofile_client.go delete mode 100644 sdk/resourcemanager/hybridcompute/armhybridcompute/operations_client_example_test.go create mode 100644 sdk/resourcemanager/hybridcompute/armhybridcompute/options.go delete mode 100644 sdk/resourcemanager/hybridcompute/armhybridcompute/privateendpointconnections_client_example_test.go delete mode 100644 sdk/resourcemanager/hybridcompute/armhybridcompute/privatelinkresources_client_example_test.go delete mode 100644 sdk/resourcemanager/hybridcompute/armhybridcompute/privatelinkscopes_client_example_test.go diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/CHANGELOG.md b/sdk/resourcemanager/hybridcompute/armhybridcompute/CHANGELOG.md index 07943bf92e93..01917010ed26 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-07-26) +### 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..a9ddf9e74d1c --- /dev/null +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/agentversion_client.go @@ -0,0 +1,148 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package 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) { + var err error + req, err := client.getCreateRequest(ctx, osType, version, options) + if err != nil { + return AgentVersionClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AgentVersionClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AgentVersionClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// 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) { + var err error + req, err := client.listCreateRequest(ctx, osType, options) + if err != nil { + return AgentVersionClientListResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AgentVersionClientListResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AgentVersionClientListResponse{}, err + } + resp, err := client.listHandleResponse(httpResp) + return resp, err +} + +// 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..2cd5f22a582f 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/client_factory.go +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/client_factory.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armhybridcompute @@ -38,8 +37,18 @@ func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, }, nil } -func (c *ClientFactory) NewMachinesClient() *MachinesClient { - subClient, _ := NewMachinesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewAgentVersionClient() *AgentVersionClient { + subClient, _ := NewAgentVersionClient(c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewExtensionMetadataClient() *ExtensionMetadataClient { + subClient, _ := NewExtensionMetadataClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewHybridIdentityMetadataClient() *HybridIdentityMetadataClient { + subClient, _ := NewHybridIdentityMetadataClient(c.subscriptionID, c.credential, c.options) return subClient } @@ -48,18 +57,28 @@ func (c *ClientFactory) NewMachineExtensionsClient() *MachineExtensionsClient { return subClient } +func (c *ClientFactory) NewMachinesClient() *MachinesClient { + subClient, _ := NewMachinesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + func (c *ClientFactory) NewManagementClient() *ManagementClient { subClient, _ := NewManagementClient(c.subscriptionID, c.credential, c.options) return subClient } +func (c *ClientFactory) NewNetworkProfileClient() *NetworkProfileClient { + subClient, _ := NewNetworkProfileClient(c.subscriptionID, c.credential, c.options) + return subClient +} + func (c *ClientFactory) NewOperationsClient() *OperationsClient { subClient, _ := NewOperationsClient(c.credential, c.options) return subClient } -func (c *ClientFactory) NewPrivateLinkScopesClient() *PrivateLinkScopesClient { - subClient, _ := NewPrivateLinkScopesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewPrivateEndpointConnectionsClient() *PrivateEndpointConnectionsClient { + subClient, _ := NewPrivateEndpointConnectionsClient(c.subscriptionID, c.credential, c.options) return subClient } @@ -68,7 +87,7 @@ func (c *ClientFactory) NewPrivateLinkResourcesClient() *PrivateLinkResourcesCli return subClient } -func (c *ClientFactory) NewPrivateEndpointConnectionsClient() *PrivateEndpointConnectionsClient { - subClient, _ := NewPrivateEndpointConnectionsClient(c.subscriptionID, c.credential, c.options) +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..a19f319034ca 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/constants.go +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/constants.go @@ -3,17 +3,33 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. 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 +79,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 +115,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..5872dee8f2f6 --- /dev/null +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/extensionmetadata_client.go @@ -0,0 +1,183 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package 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) { + var err error + req, err := client.getCreateRequest(ctx, location, publisher, extensionType, version, options) + if err != nil { + return ExtensionMetadataClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ExtensionMetadataClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ExtensionMetadataClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// 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..17248fd97309 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.6.1 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 - golang.org/x/net v0.7.0 // indirect - golang.org/x/sys v0.5.0 // indirect - golang.org/x/text v0.7.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + golang.org/x/net v0.8.0 // indirect + golang.org/x/text v0.8.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..5c6bee428364 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/Azure/azure-sdk-for-go/sdk/azcore v1.6.1 h1:SEy2xmstIphdPwNBUi7uhvjyjhVKISfwjfOJmuy7kg4= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1/go.mod h1:bjGvMhVMb+EEm3VRNQawDMUyMMjo+S5ewNjflkep/0Q= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 h1:sXr+ck84g/ZlZUOZiNELInmMgOsuGwdjjVkEIde0OtY= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0/go.mod h1:okt5dMMTOFjX/aovMlrjvvXoPMBVSPzk9185BT0+eZM= 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= +golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= +golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= +golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +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..f78f12c3ec78 --- /dev/null +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/hybrididentitymetadata_client.go @@ -0,0 +1,180 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package 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) { + var err error + req, err := client.getCreateRequest(ctx, resourceGroupName, machineName, metadataName, options) + if err != nil { + return HybridIdentityMetadataClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return HybridIdentityMetadataClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return HybridIdentityMetadataClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// 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..c603b3f8a787 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/machineextensions_client.go +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/machineextensions_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armhybridcompute @@ -47,7 +46,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. @@ -60,7 +59,8 @@ func (client *MachineExtensionsClient) BeginCreateOrUpdate(ctx context.Context, if err != nil { return nil, err } - return runtime.NewPoller[MachineExtensionsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[MachineExtensionsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[MachineExtensionsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -69,20 +69,22 @@ 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) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, machineName, extensionName, extensionParameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -109,16 +111,19 @@ 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) + if err := runtime.MarshalAsJSON(req, extensionParameters); err != nil { + return nil, err + } + return req, nil } // 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. @@ -130,7 +135,8 @@ func (client *MachineExtensionsClient) BeginDelete(ctx context.Context, resource if err != nil { return nil, err } - return runtime.NewPoller[MachineExtensionsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[MachineExtensionsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[MachineExtensionsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -139,20 +145,22 @@ 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) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, machineName, extensionName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -179,7 +187,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,24 +196,27 @@ 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. // - options - MachineExtensionsClientGetOptions contains the optional parameters for the MachineExtensionsClient.Get method. func (client *MachineExtensionsClient) Get(ctx context.Context, resourceGroupName string, machineName string, extensionName string, options *MachineExtensionsClientGetOptions) (MachineExtensionsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, machineName, extensionName, options) if err != nil { return MachineExtensionsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return MachineExtensionsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return MachineExtensionsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return MachineExtensionsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -232,7 +243,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 +260,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 +316,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 +334,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. @@ -336,7 +347,8 @@ func (client *MachineExtensionsClient) BeginUpdate(ctx context.Context, resource if err != nil { return nil, err } - return runtime.NewPoller[MachineExtensionsClientUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[MachineExtensionsClientUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[MachineExtensionsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -345,20 +357,22 @@ 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) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, machineName, extensionName, extensionParameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -385,8 +399,11 @@ 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) + if err := runtime.MarshalAsJSON(req, extensionParameters); err != nil { + return nil, err + } + return req, nil } 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..e3a3ca7a47f1 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/machines_client.go +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/machines_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armhybridcompute @@ -44,27 +43,31 @@ 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. // - options - MachinesClientCreateOrUpdateOptions contains the optional parameters for the MachinesClient.CreateOrUpdate method. func (client *MachinesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, machineName string, parameters Machine, options *MachinesClientCreateOrUpdateOptions) (MachinesClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, machineName, parameters, options) if err != nil { return MachinesClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return MachinesClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return MachinesClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return MachinesClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -87,10 +90,13 @@ 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) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -102,24 +108,26 @@ 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. func (client *MachinesClient) Delete(ctx context.Context, resourceGroupName string, machineName string, options *MachinesClientDeleteOptions) (MachinesClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, machineName, options) if err != nil { return MachinesClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return MachinesClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return MachinesClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return MachinesClientDeleteResponse{}, err } return MachinesClientDeleteResponse{}, nil } @@ -144,7 +152,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,23 +161,26 @@ 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. func (client *MachinesClient) Get(ctx context.Context, resourceGroupName string, machineName string, options *MachinesClientGetOptions) (MachinesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, machineName, options) if err != nil { return MachinesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return MachinesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return MachinesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return MachinesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -192,7 +203,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 +224,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 +272,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 +290,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 +333,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,24 +351,27 @@ 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. // - options - MachinesClientUpdateOptions contains the optional parameters for the MachinesClient.Update method. func (client *MachinesClient) Update(ctx context.Context, resourceGroupName string, machineName string, parameters MachineUpdate, options *MachinesClientUpdateOptions) (MachinesClientUpdateResponse, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, machineName, parameters, options) if err != nil { return MachinesClientUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return MachinesClientUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return MachinesClientUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return MachinesClientUpdateResponse{}, err } - return client.updateHandleResponse(resp) + resp, err := client.updateHandleResponse(httpResp) + return resp, err } // updateCreateRequest creates the Update request. @@ -380,10 +394,13 @@ 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) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // updateHandleResponse handles the Update response. 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..4f1a42fd2b10 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/management_client.go +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/management_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armhybridcompute @@ -47,7 +46,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. @@ -59,7 +58,8 @@ func (client *ManagementClient) BeginUpgradeExtensions(ctx context.Context, reso if err != nil { return nil, err } - return runtime.NewPoller[ManagementClientUpgradeExtensionsResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ManagementClientUpgradeExtensionsResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ManagementClientUpgradeExtensionsResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -68,20 +68,22 @@ 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) { + var err error req, err := client.upgradeExtensionsCreateRequest(ctx, resourceGroupName, machineName, extensionUpgradeParameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // upgradeExtensionsCreateRequest creates the UpgradeExtensions request. @@ -104,8 +106,11 @@ 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) + if err := runtime.MarshalAsJSON(req, extensionUpgradeParameters); err != nil { + return nil, err + } + return req, nil } 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..7ebc0a90fa6f 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/models.go +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/models.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armhybridcompute @@ -14,6 +13,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 +39,51 @@ 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 +} + +// 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 +143,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 +168,106 @@ 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 +} + // 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 +} + +// 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 +303,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 +318,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 +345,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 +402,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 +436,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,44 +458,12 @@ 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 } -// MachineExtensionsClientBeginCreateOrUpdateOptions contains the optional parameters for the MachineExtensionsClient.BeginCreateOrUpdate -// method. -type MachineExtensionsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// MachineExtensionsClientBeginDeleteOptions contains the optional parameters for the MachineExtensionsClient.BeginDelete -// method. -type MachineExtensionsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// MachineExtensionsClientBeginUpdateOptions contains the optional parameters for the MachineExtensionsClient.BeginUpdate -// method. -type MachineExtensionsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// MachineExtensionsClientGetOptions contains the optional parameters for the MachineExtensionsClient.Get method. -type MachineExtensionsClientGetOptions struct { - // placeholder for future optional parameters -} - -// MachineExtensionsClientListOptions contains the optional parameters for the MachineExtensionsClient.NewListPager method. -type MachineExtensionsClientListOptions struct { - // The expand expression to apply on the operation. - Expand *string -} - // MachineExtensionsListResult - Describes the Machine Extensions List Result. type MachineExtensionsListResult struct { // The uri to fetch the next page of machine extensions. Call ListNext() with this to fetch the next page of extensions. @@ -347,13 +484,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 +550,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 +577,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 +589,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 @@ -459,44 +608,16 @@ type MachineUpdateProperties struct { PrivateLinkScopeResourceID *string } -// MachinesClientCreateOrUpdateOptions contains the optional parameters for the MachinesClient.CreateOrUpdate method. -type MachinesClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// MachinesClientDeleteOptions contains the optional parameters for the MachinesClient.Delete method. -type MachinesClientDeleteOptions struct { - // placeholder for future optional parameters +// NetworkInterface - Describes a network interface. +type NetworkInterface struct { + // The list of IP addresses in this interface. + IPAddresses []*IPAddress } -// MachinesClientGetOptions contains the optional parameters for the MachinesClient.Get method. -type MachinesClientGetOptions struct { - // The expand expression to apply on the operation. - Expand *InstanceViewTypes -} - -// MachinesClientListByResourceGroupOptions contains the optional parameters for the MachinesClient.NewListByResourceGroupPager -// method. -type MachinesClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// MachinesClientListBySubscriptionOptions contains the optional parameters for the MachinesClient.NewListBySubscriptionPager -// method. -type MachinesClientListBySubscriptionOptions struct { - // placeholder for future optional parameters -} - -// MachinesClientUpdateOptions contains the optional parameters for the MachinesClient.Update method. -type MachinesClientUpdateOptions struct { - // placeholder for future optional parameters -} - -// ManagementClientBeginUpgradeExtensionsOptions contains the optional parameters for the ManagementClient.BeginUpgradeExtensions -// method. -type ManagementClientBeginUpgradeExtensionsOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string +// NetworkProfile - Describes the network information on this machine. +type NetworkProfile struct { + // The list of network interfaces. + NetworkInterfaces []*NetworkInterface } // OSProfile - Specifies the operating system settings for the hybrid machine. @@ -559,11 +680,6 @@ type OperationValueDisplay struct { Resource *string } -// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. -type OperationsClientListOptions struct { - // placeholder for future optional parameters -} - // PatchSettings - Specifies the patch settings. type PatchSettings struct { // Specifies the assessment mode. @@ -584,7 +700,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" @@ -630,32 +746,6 @@ type PrivateEndpointConnectionProperties struct { ProvisioningState *string } -// PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginCreateOrUpdate -// method. -type PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// PrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginDelete -// method. -type PrivateEndpointConnectionsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get -// method. -type PrivateEndpointConnectionsClientGetOptions struct { - // placeholder for future optional parameters -} - -// PrivateEndpointConnectionsClientListByPrivateLinkScopeOptions contains the optional parameters for the PrivateEndpointConnectionsClient.NewListByPrivateLinkScopePager -// method. -type PrivateEndpointConnectionsClientListByPrivateLinkScopeOptions struct { - // placeholder for future optional parameters -} - // PrivateEndpointProperty - Private endpoint which the connection belongs to. type PrivateEndpointProperty struct { // Resource id of the private endpoint. @@ -673,7 +763,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" @@ -701,17 +791,6 @@ type PrivateLinkResourceProperties struct { RequiredZoneNames []*string } -// PrivateLinkResourcesClientGetOptions contains the optional parameters for the PrivateLinkResourcesClient.Get method. -type PrivateLinkResourcesClientGetOptions struct { - // placeholder for future optional parameters -} - -// PrivateLinkResourcesClientListByPrivateLinkScopeOptions contains the optional parameters for the PrivateLinkResourcesClient.NewListByPrivateLinkScopePager -// method. -type PrivateLinkResourcesClientListByPrivateLinkScopeOptions struct { - // placeholder for future optional parameters -} - // PrivateLinkScope - An Azure Arc PrivateLinkScope definition. type PrivateLinkScope struct { // REQUIRED; Resource location @@ -774,52 +853,6 @@ type PrivateLinkScopeValidationDetails struct { ID *string } -// PrivateLinkScopesClientBeginDeleteOptions contains the optional parameters for the PrivateLinkScopesClient.BeginDelete -// method. -type PrivateLinkScopesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// PrivateLinkScopesClientCreateOrUpdateOptions contains the optional parameters for the PrivateLinkScopesClient.CreateOrUpdate -// method. -type PrivateLinkScopesClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// PrivateLinkScopesClientGetOptions contains the optional parameters for the PrivateLinkScopesClient.Get method. -type PrivateLinkScopesClientGetOptions struct { - // placeholder for future optional parameters -} - -// PrivateLinkScopesClientGetValidationDetailsForMachineOptions contains the optional parameters for the PrivateLinkScopesClient.GetValidationDetailsForMachine -// method. -type PrivateLinkScopesClientGetValidationDetailsForMachineOptions struct { - // placeholder for future optional parameters -} - -// PrivateLinkScopesClientGetValidationDetailsOptions contains the optional parameters for the PrivateLinkScopesClient.GetValidationDetails -// method. -type PrivateLinkScopesClientGetValidationDetailsOptions struct { - // placeholder for future optional parameters -} - -// PrivateLinkScopesClientListByResourceGroupOptions contains the optional parameters for the PrivateLinkScopesClient.NewListByResourceGroupPager -// method. -type PrivateLinkScopesClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// PrivateLinkScopesClientListOptions contains the optional parameters for the PrivateLinkScopesClient.NewListPager method. -type PrivateLinkScopesClientListOptions struct { - // placeholder for future optional parameters -} - -// PrivateLinkScopesClientUpdateTagsOptions contains the optional parameters for the PrivateLinkScopesClient.UpdateTags method. -type PrivateLinkScopesClientUpdateTagsOptions struct { - // placeholder for future optional parameters -} - // PrivateLinkScopesResource - An azure resource object type PrivateLinkScopesResource struct { // REQUIRED; Resource location @@ -859,6 +892,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 +907,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 +938,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 +987,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..ec267689cba6 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/models_serde.go +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/models_serde.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armhybridcompute @@ -19,6 +18,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 +38,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 +70,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 +362,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 +432,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 +486,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 +814,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 +840,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 +852,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 +1012,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 +1103,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 +1125,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 +1248,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 +1262,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 +1293,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 +1335,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 +1386,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 +1404,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 +1424,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 +1442,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 +1468,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 +2274,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 +2294,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 +2313,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 +2333,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 +2436,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 +2543,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 +2567,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..bd41070e4ecc --- /dev/null +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/networkprofile_client.go @@ -0,0 +1,104 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package 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) { + var err error + req, err := client.getCreateRequest(ctx, resourceGroupName, machineName, options) + if err != nil { + return NetworkProfileClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NetworkProfileClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return NetworkProfileClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// 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..b0b9fbed645a 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/operations_client.go +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/operations_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armhybridcompute @@ -40,7 +39,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 +71,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/options.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/options.go new file mode 100644 index 000000000000..ba4d82dbf3d7 --- /dev/null +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/options.go @@ -0,0 +1,205 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armhybridcompute + +// 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 +} + +// 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 +} + +// 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 +} + +// MachineExtensionsClientBeginCreateOrUpdateOptions contains the optional parameters for the MachineExtensionsClient.BeginCreateOrUpdate +// method. +type MachineExtensionsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// MachineExtensionsClientBeginDeleteOptions contains the optional parameters for the MachineExtensionsClient.BeginDelete +// method. +type MachineExtensionsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// MachineExtensionsClientBeginUpdateOptions contains the optional parameters for the MachineExtensionsClient.BeginUpdate +// method. +type MachineExtensionsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// MachineExtensionsClientGetOptions contains the optional parameters for the MachineExtensionsClient.Get method. +type MachineExtensionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// MachineExtensionsClientListOptions contains the optional parameters for the MachineExtensionsClient.NewListPager method. +type MachineExtensionsClientListOptions struct { + // The expand expression to apply on the operation. + Expand *string +} + +// MachinesClientCreateOrUpdateOptions contains the optional parameters for the MachinesClient.CreateOrUpdate method. +type MachinesClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// MachinesClientDeleteOptions contains the optional parameters for the MachinesClient.Delete method. +type MachinesClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// MachinesClientGetOptions contains the optional parameters for the MachinesClient.Get method. +type MachinesClientGetOptions struct { + // The expand expression to apply on the operation. + Expand *InstanceViewTypes +} + +// MachinesClientListByResourceGroupOptions contains the optional parameters for the MachinesClient.NewListByResourceGroupPager +// method. +type MachinesClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// MachinesClientListBySubscriptionOptions contains the optional parameters for the MachinesClient.NewListBySubscriptionPager +// method. +type MachinesClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// MachinesClientUpdateOptions contains the optional parameters for the MachinesClient.Update method. +type MachinesClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// ManagementClientBeginUpgradeExtensionsOptions contains the optional parameters for the ManagementClient.BeginUpgradeExtensions +// method. +type ManagementClientBeginUpgradeExtensionsOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkProfileClientGetOptions contains the optional parameters for the NetworkProfileClient.Get method. +type NetworkProfileClientGetOptions struct { + // placeholder for future optional parameters +} + +// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. +type OperationsClientListOptions struct { + // placeholder for future optional parameters +} + +// PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginCreateOrUpdate +// method. +type PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginDelete +// method. +type PrivateEndpointConnectionsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get +// method. +type PrivateEndpointConnectionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// PrivateEndpointConnectionsClientListByPrivateLinkScopeOptions contains the optional parameters for the PrivateEndpointConnectionsClient.NewListByPrivateLinkScopePager +// method. +type PrivateEndpointConnectionsClientListByPrivateLinkScopeOptions struct { + // placeholder for future optional parameters +} + +// PrivateLinkResourcesClientGetOptions contains the optional parameters for the PrivateLinkResourcesClient.Get method. +type PrivateLinkResourcesClientGetOptions struct { + // placeholder for future optional parameters +} + +// PrivateLinkResourcesClientListByPrivateLinkScopeOptions contains the optional parameters for the PrivateLinkResourcesClient.NewListByPrivateLinkScopePager +// method. +type PrivateLinkResourcesClientListByPrivateLinkScopeOptions struct { + // placeholder for future optional parameters +} + +// PrivateLinkScopesClientBeginDeleteOptions contains the optional parameters for the PrivateLinkScopesClient.BeginDelete +// method. +type PrivateLinkScopesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PrivateLinkScopesClientCreateOrUpdateOptions contains the optional parameters for the PrivateLinkScopesClient.CreateOrUpdate +// method. +type PrivateLinkScopesClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// PrivateLinkScopesClientGetOptions contains the optional parameters for the PrivateLinkScopesClient.Get method. +type PrivateLinkScopesClientGetOptions struct { + // placeholder for future optional parameters +} + +// PrivateLinkScopesClientGetValidationDetailsForMachineOptions contains the optional parameters for the PrivateLinkScopesClient.GetValidationDetailsForMachine +// method. +type PrivateLinkScopesClientGetValidationDetailsForMachineOptions struct { + // placeholder for future optional parameters +} + +// PrivateLinkScopesClientGetValidationDetailsOptions contains the optional parameters for the PrivateLinkScopesClient.GetValidationDetails +// method. +type PrivateLinkScopesClientGetValidationDetailsOptions struct { + // placeholder for future optional parameters +} + +// PrivateLinkScopesClientListByResourceGroupOptions contains the optional parameters for the PrivateLinkScopesClient.NewListByResourceGroupPager +// method. +type PrivateLinkScopesClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// PrivateLinkScopesClientListOptions contains the optional parameters for the PrivateLinkScopesClient.NewListPager method. +type PrivateLinkScopesClientListOptions struct { + // placeholder for future optional parameters +} + +// PrivateLinkScopesClientUpdateTagsOptions contains the optional parameters for the PrivateLinkScopesClient.UpdateTags method. +type PrivateLinkScopesClientUpdateTagsOptions struct { + // placeholder for future optional parameters +} diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/privateendpointconnections_client.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/privateendpointconnections_client.go index 33486947f382..1cb0e234647b 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/privateendpointconnections_client.go +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/privateendpointconnections_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armhybridcompute @@ -47,7 +46,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. @@ -59,7 +58,8 @@ func (client *PrivateEndpointConnectionsClient) BeginCreateOrUpdate(ctx context. if err != nil { return nil, err } - return runtime.NewPoller[PrivateEndpointConnectionsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[PrivateEndpointConnectionsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[PrivateEndpointConnectionsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -68,20 +68,22 @@ 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) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, scopeName, privateEndpointConnectionName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -108,16 +110,19 @@ 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) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // 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. @@ -129,7 +134,8 @@ func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, if err != nil { return nil, err } - return runtime.NewPoller[PrivateEndpointConnectionsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[PrivateEndpointConnectionsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[PrivateEndpointConnectionsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -138,20 +144,22 @@ 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) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, scopeName, privateEndpointConnectionName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -178,7 +186,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,25 +195,28 @@ 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. // - options - PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get // method. func (client *PrivateEndpointConnectionsClient) Get(ctx context.Context, resourceGroupName string, scopeName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientGetOptions) (PrivateEndpointConnectionsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, scopeName, privateEndpointConnectionName, options) if err != nil { return PrivateEndpointConnectionsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return PrivateEndpointConnectionsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PrivateEndpointConnectionsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PrivateEndpointConnectionsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -232,7 +243,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 +260,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 +313,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..e1637d39ded6 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/privatelinkresources_client.go +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/privatelinkresources_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armhybridcompute @@ -47,25 +46,28 @@ 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. // - options - PrivateLinkResourcesClientGetOptions contains the optional parameters for the PrivateLinkResourcesClient.Get // method. func (client *PrivateLinkResourcesClient) Get(ctx context.Context, resourceGroupName string, scopeName string, groupName string, options *PrivateLinkResourcesClientGetOptions) (PrivateLinkResourcesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, scopeName, groupName, options) if err != nil { return PrivateLinkResourcesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return PrivateLinkResourcesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PrivateLinkResourcesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PrivateLinkResourcesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -92,7 +94,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 +111,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 +164,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..87e556739012 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/privatelinkscopes_client.go +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/privatelinkscopes_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armhybridcompute @@ -48,25 +47,28 @@ 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. // - options - PrivateLinkScopesClientCreateOrUpdateOptions contains the optional parameters for the PrivateLinkScopesClient.CreateOrUpdate // method. func (client *PrivateLinkScopesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, scopeName string, parameters PrivateLinkScope, options *PrivateLinkScopesClientCreateOrUpdateOptions) (PrivateLinkScopesClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, scopeName, parameters, options) if err != nil { return PrivateLinkScopesClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return PrivateLinkScopesClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return PrivateLinkScopesClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return PrivateLinkScopesClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -89,10 +91,13 @@ 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) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -107,7 +112,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 @@ -118,7 +123,8 @@ func (client *PrivateLinkScopesClient) BeginDelete(ctx context.Context, resource if err != nil { return nil, err } - return runtime.NewPoller[PrivateLinkScopesClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[PrivateLinkScopesClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[PrivateLinkScopesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -127,20 +133,22 @@ 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) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, scopeName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -163,7 +171,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,23 +180,26 @@ 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. func (client *PrivateLinkScopesClient) Get(ctx context.Context, resourceGroupName string, scopeName string, options *PrivateLinkScopesClientGetOptions) (PrivateLinkScopesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, scopeName, options) if err != nil { return PrivateLinkScopesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return PrivateLinkScopesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PrivateLinkScopesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PrivateLinkScopesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -211,7 +222,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,24 +240,27 @@ 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 // method. func (client *PrivateLinkScopesClient) GetValidationDetails(ctx context.Context, location string, privateLinkScopeID string, options *PrivateLinkScopesClientGetValidationDetailsOptions) (PrivateLinkScopesClientGetValidationDetailsResponse, error) { + var err error req, err := client.getValidationDetailsCreateRequest(ctx, location, privateLinkScopeID, options) if err != nil { return PrivateLinkScopesClientGetValidationDetailsResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return PrivateLinkScopesClientGetValidationDetailsResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PrivateLinkScopesClientGetValidationDetailsResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PrivateLinkScopesClientGetValidationDetailsResponse{}, err } - return client.getValidationDetailsHandleResponse(resp) + resp, err := client.getValidationDetailsHandleResponse(httpResp) + return resp, err } // getValidationDetailsCreateRequest creates the GetValidationDetails request. @@ -269,7 +283,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,24 +301,27 @@ 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 // method. func (client *PrivateLinkScopesClient) GetValidationDetailsForMachine(ctx context.Context, resourceGroupName string, machineName string, options *PrivateLinkScopesClientGetValidationDetailsForMachineOptions) (PrivateLinkScopesClientGetValidationDetailsForMachineResponse, error) { + var err error req, err := client.getValidationDetailsForMachineCreateRequest(ctx, resourceGroupName, machineName, options) if err != nil { return PrivateLinkScopesClientGetValidationDetailsForMachineResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return PrivateLinkScopesClientGetValidationDetailsForMachineResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PrivateLinkScopesClientGetValidationDetailsForMachineResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PrivateLinkScopesClientGetValidationDetailsForMachineResponse{}, err } - return client.getValidationDetailsForMachineHandleResponse(resp) + resp, err := client.getValidationDetailsForMachineHandleResponse(httpResp) + return resp, err } // getValidationDetailsForMachineCreateRequest creates the GetValidationDetailsForMachine request. @@ -327,7 +344,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 +361,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 +404,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 +421,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 +469,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,25 +487,28 @@ 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. // - options - PrivateLinkScopesClientUpdateTagsOptions contains the optional parameters for the PrivateLinkScopesClient.UpdateTags // method. func (client *PrivateLinkScopesClient) UpdateTags(ctx context.Context, resourceGroupName string, scopeName string, privateLinkScopeTags TagsResource, options *PrivateLinkScopesClientUpdateTagsOptions) (PrivateLinkScopesClientUpdateTagsResponse, error) { + var err error req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, scopeName, privateLinkScopeTags, options) if err != nil { return PrivateLinkScopesClientUpdateTagsResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return PrivateLinkScopesClientUpdateTagsResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PrivateLinkScopesClientUpdateTagsResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PrivateLinkScopesClientUpdateTagsResponse{}, err } - return client.updateTagsHandleResponse(resp) + resp, err := client.updateTagsHandleResponse(httpResp) + return resp, err } // updateTagsCreateRequest creates the UpdateTags request. @@ -511,10 +531,13 @@ 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) + if err := runtime.MarshalAsJSON(req, privateLinkScopeTags); err != nil { + return nil, err + } + return req, nil } // updateTagsHandleResponse handles the UpdateTags response. 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..c092b46cf435 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/response_types.go +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/response_types.go @@ -3,14 +3,50 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armhybridcompute +// AgentVersionClientGetResponse contains the response from method AgentVersionClient.Get. +type AgentVersionClientGetResponse struct { + // Describes properties of Agent Version. + AgentVersion +} + +// AgentVersionClientListResponse contains the response from method AgentVersionClient.List. +type AgentVersionClientListResponse struct { + // Describes AgentVersions List. + AgentVersionsList +} + +// ExtensionMetadataClientGetResponse contains the response from method ExtensionMetadataClient.Get. +type ExtensionMetadataClientGetResponse struct { + // Describes a Extension Metadata + ExtensionValue +} + +// ExtensionMetadataClientListResponse contains the response from method ExtensionMetadataClient.NewListPager. +type ExtensionMetadataClientListResponse struct { + // The List Extension Metadata response. + ExtensionValueListResult +} + +// HybridIdentityMetadataClientGetResponse contains the response from method HybridIdentityMetadataClient.Get. +type HybridIdentityMetadataClientGetResponse struct { + // Defines the HybridIdentityMetadata. + HybridIdentityMetadata +} + +// HybridIdentityMetadataClientListByMachinesResponse contains the response from method HybridIdentityMetadataClient.NewListByMachinesPager. +type HybridIdentityMetadataClientListByMachinesResponse struct { + // List of HybridIdentityMetadata. + HybridIdentityMetadataList +} + // MachineExtensionsClientCreateOrUpdateResponse contains the response from method MachineExtensionsClient.BeginCreateOrUpdate. type MachineExtensionsClientCreateOrUpdateResponse struct { + // Describes a Machine Extension. MachineExtension } @@ -21,21 +57,25 @@ type MachineExtensionsClientDeleteResponse struct { // MachineExtensionsClientGetResponse contains the response from method MachineExtensionsClient.Get. type MachineExtensionsClientGetResponse struct { + // Describes a Machine Extension. MachineExtension } // MachineExtensionsClientListResponse contains the response from method MachineExtensionsClient.NewListPager. type MachineExtensionsClientListResponse struct { + // Describes the Machine Extensions List Result. MachineExtensionsListResult } // MachineExtensionsClientUpdateResponse contains the response from method MachineExtensionsClient.BeginUpdate. type MachineExtensionsClientUpdateResponse struct { + // Describes a Machine Extension. MachineExtension } // MachinesClientCreateOrUpdateResponse contains the response from method MachinesClient.CreateOrUpdate. type MachinesClientCreateOrUpdateResponse struct { + // Describes a hybrid machine. Machine } @@ -46,21 +86,25 @@ type MachinesClientDeleteResponse struct { // MachinesClientGetResponse contains the response from method MachinesClient.Get. type MachinesClientGetResponse struct { + // Describes a hybrid machine. Machine } // MachinesClientListByResourceGroupResponse contains the response from method MachinesClient.NewListByResourceGroupPager. type MachinesClientListByResourceGroupResponse struct { + // The List hybrid machine operation response. MachineListResult } // MachinesClientListBySubscriptionResponse contains the response from method MachinesClient.NewListBySubscriptionPager. type MachinesClientListBySubscriptionResponse struct { + // The List hybrid machine operation response. MachineListResult } // MachinesClientUpdateResponse contains the response from method MachinesClient.Update. type MachinesClientUpdateResponse struct { + // Describes a hybrid machine. Machine } @@ -69,13 +113,21 @@ type ManagementClientUpgradeExtensionsResponse struct { // placeholder for future response values } +// NetworkProfileClientGetResponse contains the response from method NetworkProfileClient.Get. +type NetworkProfileClientGetResponse struct { + // Describes the network information on this machine. + NetworkProfile +} + // OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { + // The List Compute Operation operation response. OperationListResult } // PrivateEndpointConnectionsClientCreateOrUpdateResponse contains the response from method PrivateEndpointConnectionsClient.BeginCreateOrUpdate. type PrivateEndpointConnectionsClientCreateOrUpdateResponse struct { + // A private endpoint connection PrivateEndpointConnection } @@ -86,26 +138,31 @@ type PrivateEndpointConnectionsClientDeleteResponse struct { // PrivateEndpointConnectionsClientGetResponse contains the response from method PrivateEndpointConnectionsClient.Get. type PrivateEndpointConnectionsClientGetResponse struct { + // A private endpoint connection PrivateEndpointConnection } // PrivateEndpointConnectionsClientListByPrivateLinkScopeResponse contains the response from method PrivateEndpointConnectionsClient.NewListByPrivateLinkScopePager. type PrivateEndpointConnectionsClientListByPrivateLinkScopeResponse struct { + // A list of private endpoint connections. PrivateEndpointConnectionListResult } // PrivateLinkResourcesClientGetResponse contains the response from method PrivateLinkResourcesClient.Get. type PrivateLinkResourcesClientGetResponse struct { + // A private link resource PrivateLinkResource } // PrivateLinkResourcesClientListByPrivateLinkScopeResponse contains the response from method PrivateLinkResourcesClient.NewListByPrivateLinkScopePager. type PrivateLinkResourcesClientListByPrivateLinkScopeResponse struct { + // A list of private link resources PrivateLinkResourceListResult } // PrivateLinkScopesClientCreateOrUpdateResponse contains the response from method PrivateLinkScopesClient.CreateOrUpdate. type PrivateLinkScopesClientCreateOrUpdateResponse struct { + // An Azure Arc PrivateLinkScope definition. PrivateLinkScope } @@ -116,6 +173,7 @@ type PrivateLinkScopesClientDeleteResponse struct { // PrivateLinkScopesClientGetResponse contains the response from method PrivateLinkScopesClient.Get. type PrivateLinkScopesClientGetResponse struct { + // An Azure Arc PrivateLinkScope definition. PrivateLinkScope } @@ -131,15 +189,18 @@ type PrivateLinkScopesClientGetValidationDetailsResponse struct { // PrivateLinkScopesClientListByResourceGroupResponse contains the response from method PrivateLinkScopesClient.NewListByResourceGroupPager. type PrivateLinkScopesClientListByResourceGroupResponse struct { + // Describes the list of Azure Arc PrivateLinkScope resources. PrivateLinkScopeListResult } // PrivateLinkScopesClientListResponse contains the response from method PrivateLinkScopesClient.NewListPager. type PrivateLinkScopesClientListResponse struct { + // Describes the list of Azure Arc PrivateLinkScope resources. PrivateLinkScopeListResult } // PrivateLinkScopesClientUpdateTagsResponse contains the response from method PrivateLinkScopesClient.UpdateTags. type PrivateLinkScopesClientUpdateTagsResponse struct { + // An Azure Arc PrivateLinkScope definition. PrivateLinkScope } diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/time_rfc3339.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/time_rfc3339.go index 11928484add6..33bf0c4c7362 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/time_rfc3339.go +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/time_rfc3339.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armhybridcompute