diff --git a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/CHANGELOG.md b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/CHANGELOG.md index 63f0592f3751..85fc7e919b48 100644 --- a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/CHANGELOG.md +++ b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/CHANGELOG.md @@ -1,5 +1,11 @@ # Release History +## 1.1.0 (2023-02-27) +### Features Added + +- New function `*AssignmentsVMSSClient.CreateOrUpdate(context.Context, string, string, string, Assignment, *AssignmentsVMSSClientCreateOrUpdateOptions) (AssignmentsVMSSClientCreateOrUpdateResponse, error)` + + ## 1.0.0 (2022-05-17) The package of `github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/guestconfiguration/armguestconfiguration` is using our [next generation design principles](https://azure.github.io/azure-sdk/general_introduction.html) since version 1.0.0, which contains breaking changes. diff --git a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_assignmentreports_client.go b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/assignmentreports_client.go similarity index 88% rename from sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_assignmentreports_client.go rename to sdk/resourcemanager/guestconfiguration/armguestconfiguration/assignmentreports_client.go index 6ef0aed788a6..b063275415de 100644 --- a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_assignmentreports_client.go +++ b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/assignmentreports_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armguestconfiguration @@ -31,10 +32,10 @@ type AssignmentReportsClient struct { } // NewAssignmentReportsClient creates a new instance of AssignmentReportsClient with the specified values. -// subscriptionID - Subscription ID which uniquely identify Microsoft Azure subscription. The subscription ID forms part of -// the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - Subscription ID which uniquely identify Microsoft Azure subscription. The subscription ID forms part of +// the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewAssignmentReportsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AssignmentReportsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,12 +58,13 @@ func NewAssignmentReportsClient(subscriptionID string, credential azcore.TokenCr // Get - Get a report for the guest configuration assignment, by reportId. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-01-25 -// resourceGroupName - The resource group name. -// guestConfigurationAssignmentName - The guest configuration assignment name. -// reportID - The GUID for the guest configuration assignment report. -// vmName - The name of the virtual machine. -// options - AssignmentReportsClientGetOptions contains the optional parameters for the AssignmentReportsClient.Get method. +// - resourceGroupName - The resource group name. +// - guestConfigurationAssignmentName - The guest configuration assignment name. +// - reportID - The GUID for the guest configuration assignment report. +// - vmName - The name of the virtual machine. +// - options - AssignmentReportsClientGetOptions contains the optional parameters for the AssignmentReportsClient.Get method. func (client *AssignmentReportsClient) Get(ctx context.Context, resourceGroupName string, guestConfigurationAssignmentName string, reportID string, vmName string, options *AssignmentReportsClientGetOptions) (AssignmentReportsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, guestConfigurationAssignmentName, reportID, vmName, options) if err != nil { @@ -123,11 +125,12 @@ func (client *AssignmentReportsClient) getHandleResponse(resp *http.Response) (A // List - List all reports for the guest configuration assignment, latest report first. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-01-25 -// resourceGroupName - The resource group name. -// guestConfigurationAssignmentName - The guest configuration assignment name. -// vmName - The name of the virtual machine. -// options - AssignmentReportsClientListOptions contains the optional parameters for the AssignmentReportsClient.List method. +// - resourceGroupName - The resource group name. +// - guestConfigurationAssignmentName - The guest configuration assignment name. +// - vmName - The name of the virtual machine. +// - options - AssignmentReportsClientListOptions contains the optional parameters for the AssignmentReportsClient.List method. func (client *AssignmentReportsClient) List(ctx context.Context, resourceGroupName string, guestConfigurationAssignmentName string, vmName string, options *AssignmentReportsClientListOptions) (AssignmentReportsClientListResponse, error) { req, err := client.listCreateRequest(ctx, resourceGroupName, guestConfigurationAssignmentName, vmName, options) if err != nil { diff --git a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_assignmentreportsvmss_client.go b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/assignmentreportsvmss_client.go similarity index 88% rename from sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_assignmentreportsvmss_client.go rename to sdk/resourcemanager/guestconfiguration/armguestconfiguration/assignmentreportsvmss_client.go index 8b5f5360f87b..60241a024d03 100644 --- a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_assignmentreportsvmss_client.go +++ b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/assignmentreportsvmss_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armguestconfiguration @@ -31,10 +32,10 @@ type AssignmentReportsVMSSClient struct { } // NewAssignmentReportsVMSSClient creates a new instance of AssignmentReportsVMSSClient with the specified values. -// subscriptionID - Subscription ID which uniquely identify Microsoft Azure subscription. The subscription ID forms part of -// the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - Subscription ID which uniquely identify Microsoft Azure subscription. The subscription ID forms part of +// the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewAssignmentReportsVMSSClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AssignmentReportsVMSSClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,13 +58,14 @@ func NewAssignmentReportsVMSSClient(subscriptionID string, credential azcore.Tok // Get - Get a report for the VMSS guest configuration assignment, by reportId. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-01-25 -// resourceGroupName - The resource group name. -// vmssName - The name of the virtual machine scale set. -// name - The guest configuration assignment name. -// id - The GUID for the guest configuration assignment report. -// options - AssignmentReportsVMSSClientGetOptions contains the optional parameters for the AssignmentReportsVMSSClient.Get -// method. +// - resourceGroupName - The resource group name. +// - vmssName - The name of the virtual machine scale set. +// - name - The guest configuration assignment name. +// - id - The GUID for the guest configuration assignment report. +// - options - AssignmentReportsVMSSClientGetOptions contains the optional parameters for the AssignmentReportsVMSSClient.Get +// method. func (client *AssignmentReportsVMSSClient) Get(ctx context.Context, resourceGroupName string, vmssName string, name string, id string, options *AssignmentReportsVMSSClientGetOptions) (AssignmentReportsVMSSClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, vmssName, name, id, options) if err != nil { @@ -123,13 +125,13 @@ func (client *AssignmentReportsVMSSClient) getHandleResponse(resp *http.Response } // NewListPager - List all reports for the VMSS guest configuration assignment, latest report first. -// If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-01-25 -// resourceGroupName - The resource group name. -// vmssName - The name of the virtual machine scale set. -// name - The guest configuration assignment name. -// options - AssignmentReportsVMSSClientListOptions contains the optional parameters for the AssignmentReportsVMSSClient.List -// method. +// - resourceGroupName - The resource group name. +// - vmssName - The name of the virtual machine scale set. +// - name - The guest configuration assignment name. +// - options - AssignmentReportsVMSSClientListOptions contains the optional parameters for the AssignmentReportsVMSSClient.NewListPager +// method. func (client *AssignmentReportsVMSSClient) NewListPager(resourceGroupName string, vmssName string, name string, options *AssignmentReportsVMSSClientListOptions) *runtime.Pager[AssignmentReportsVMSSClientListResponse] { return runtime.NewPager(runtime.PagingHandler[AssignmentReportsVMSSClientListResponse]{ More: func(page AssignmentReportsVMSSClientListResponse) bool { diff --git a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_assignments_client.go b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/assignments_client.go similarity index 89% rename from sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_assignments_client.go rename to sdk/resourcemanager/guestconfiguration/armguestconfiguration/assignments_client.go index 46042c0addf6..1340a3f391e7 100644 --- a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_assignments_client.go +++ b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/assignments_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armguestconfiguration @@ -31,10 +32,10 @@ type AssignmentsClient struct { } // NewAssignmentsClient creates a new instance of AssignmentsClient with the specified values. -// subscriptionID - Subscription ID which uniquely identify Microsoft Azure subscription. The subscription ID forms part of -// the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - Subscription ID which uniquely identify Microsoft Azure subscription. The subscription ID forms part of +// the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewAssignmentsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AssignmentsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,13 +58,14 @@ func NewAssignmentsClient(subscriptionID string, credential azcore.TokenCredenti // CreateOrUpdate - Creates an association between a VM and guest configuration // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-01-25 -// guestConfigurationAssignmentName - Name of the guest configuration assignment. -// resourceGroupName - The resource group name. -// vmName - The name of the virtual machine. -// parameters - Parameters supplied to the create or update guest configuration assignment. -// options - AssignmentsClientCreateOrUpdateOptions contains the optional parameters for the AssignmentsClient.CreateOrUpdate -// method. +// - guestConfigurationAssignmentName - Name of the guest configuration assignment. +// - resourceGroupName - The resource group name. +// - vmName - The name of the virtual machine. +// - parameters - Parameters supplied to the create or update guest configuration assignment. +// - options - AssignmentsClientCreateOrUpdateOptions contains the optional parameters for the AssignmentsClient.CreateOrUpdate +// method. func (client *AssignmentsClient) CreateOrUpdate(ctx context.Context, guestConfigurationAssignmentName string, resourceGroupName string, vmName string, parameters Assignment, options *AssignmentsClientCreateOrUpdateOptions) (AssignmentsClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, guestConfigurationAssignmentName, resourceGroupName, vmName, parameters, options) if err != nil { @@ -120,11 +122,12 @@ func (client *AssignmentsClient) createOrUpdateHandleResponse(resp *http.Respons // Delete - Delete a guest configuration assignment // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-01-25 -// resourceGroupName - The resource group name. -// guestConfigurationAssignmentName - Name of the guest configuration assignment -// vmName - The name of the virtual machine. -// options - AssignmentsClientDeleteOptions contains the optional parameters for the AssignmentsClient.Delete method. +// - resourceGroupName - The resource group name. +// - guestConfigurationAssignmentName - Name of the guest configuration assignment +// - vmName - The name of the virtual machine. +// - options - AssignmentsClientDeleteOptions contains the optional parameters for the AssignmentsClient.Delete method. func (client *AssignmentsClient) Delete(ctx context.Context, resourceGroupName string, guestConfigurationAssignmentName string, vmName string, options *AssignmentsClientDeleteOptions) (AssignmentsClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, guestConfigurationAssignmentName, vmName, options) if err != nil { @@ -172,11 +175,12 @@ func (client *AssignmentsClient) deleteCreateRequest(ctx context.Context, resour // Get - Get information about a guest configuration assignment // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-01-25 -// resourceGroupName - The resource group name. -// guestConfigurationAssignmentName - The guest configuration assignment name. -// vmName - The name of the virtual machine. -// options - AssignmentsClientGetOptions contains the optional parameters for the AssignmentsClient.Get method. +// - resourceGroupName - The resource group name. +// - guestConfigurationAssignmentName - The guest configuration assignment name. +// - vmName - The name of the virtual machine. +// - options - AssignmentsClientGetOptions contains the optional parameters for the AssignmentsClient.Get method. func (client *AssignmentsClient) Get(ctx context.Context, resourceGroupName string, guestConfigurationAssignmentName string, vmName string, options *AssignmentsClientGetOptions) (AssignmentsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, guestConfigurationAssignmentName, vmName, options) if err != nil { @@ -232,11 +236,11 @@ func (client *AssignmentsClient) getHandleResponse(resp *http.Response) (Assignm } // NewListPager - List all guest configuration assignments for a virtual machine. -// If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-01-25 -// resourceGroupName - The resource group name. -// vmName - The name of the virtual machine. -// options - AssignmentsClientListOptions contains the optional parameters for the AssignmentsClient.List method. +// - resourceGroupName - The resource group name. +// - vmName - The name of the virtual machine. +// - options - AssignmentsClientListOptions contains the optional parameters for the AssignmentsClient.NewListPager method. func (client *AssignmentsClient) NewListPager(resourceGroupName string, vmName string, options *AssignmentsClientListOptions) *runtime.Pager[AssignmentsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[AssignmentsClientListResponse]{ More: func(page AssignmentsClientListResponse) bool { @@ -295,10 +299,10 @@ func (client *AssignmentsClient) listHandleResponse(resp *http.Response) (Assign } // NewRGListPager - List all guest configuration assignments for a resource group. -// If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-01-25 -// resourceGroupName - The resource group name. -// options - AssignmentsClientRGListOptions contains the optional parameters for the AssignmentsClient.RGList method. +// - resourceGroupName - The resource group name. +// - options - AssignmentsClientRGListOptions contains the optional parameters for the AssignmentsClient.NewRGListPager method. func (client *AssignmentsClient) NewRGListPager(resourceGroupName string, options *AssignmentsClientRGListOptions) *runtime.Pager[AssignmentsClientRGListResponse] { return runtime.NewPager(runtime.PagingHandler[AssignmentsClientRGListResponse]{ More: func(page AssignmentsClientRGListResponse) bool { @@ -353,10 +357,10 @@ func (client *AssignmentsClient) rgListHandleResponse(resp *http.Response) (Assi } // NewSubscriptionListPager - List all guest configuration assignments for a subscription. -// If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-01-25 -// options - AssignmentsClientSubscriptionListOptions contains the optional parameters for the AssignmentsClient.SubscriptionList -// method. +// - options - AssignmentsClientSubscriptionListOptions contains the optional parameters for the AssignmentsClient.NewSubscriptionListPager +// method. func (client *AssignmentsClient) NewSubscriptionListPager(options *AssignmentsClientSubscriptionListOptions) *runtime.Pager[AssignmentsClientSubscriptionListResponse] { return runtime.NewPager(runtime.PagingHandler[AssignmentsClientSubscriptionListResponse]{ More: func(page AssignmentsClientSubscriptionListResponse) bool { diff --git a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_assignmentsvmss_client.go b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/assignmentsvmss_client.go similarity index 68% rename from sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_assignmentsvmss_client.go rename to sdk/resourcemanager/guestconfiguration/armguestconfiguration/assignmentsvmss_client.go index 108c1b190041..3d39178489ed 100644 --- a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_assignmentsvmss_client.go +++ b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/assignmentsvmss_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armguestconfiguration @@ -31,10 +32,10 @@ type AssignmentsVMSSClient struct { } // NewAssignmentsVMSSClient creates a new instance of AssignmentsVMSSClient with the specified values. -// subscriptionID - Subscription ID which uniquely identify Microsoft Azure subscription. The subscription ID forms part of -// the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - Subscription ID which uniquely identify Microsoft Azure subscription. The subscription ID forms part of +// the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewAssignmentsVMSSClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AssignmentsVMSSClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -55,13 +56,78 @@ func NewAssignmentsVMSSClient(subscriptionID string, credential azcore.TokenCred return client, nil } +// CreateOrUpdate - Creates an association between a VMSS and guest configuration +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-01-25 +// - resourceGroupName - The resource group name. +// - vmssName - The name of the virtual machine scale set. +// - name - Name of the guest configuration assignment. +// - parameters - Parameters supplied to the create or update guest configuration assignment. +// - options - AssignmentsVMSSClientCreateOrUpdateOptions contains the optional parameters for the AssignmentsVMSSClient.CreateOrUpdate +// method. +func (client *AssignmentsVMSSClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, vmssName string, name string, parameters Assignment, options *AssignmentsVMSSClientCreateOrUpdateOptions) (AssignmentsVMSSClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, vmssName, name, parameters, options) + if err != nil { + return AssignmentsVMSSClientCreateOrUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AssignmentsVMSSClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return AssignmentsVMSSClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.createOrUpdateHandleResponse(resp) +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *AssignmentsVMSSClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, vmssName string, name string, parameters Assignment, options *AssignmentsVMSSClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/{name}" + 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 vmssName == "" { + return nil, errors.New("parameter vmssName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vmssName}", url.PathEscape(vmssName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-01-25") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *AssignmentsVMSSClient) createOrUpdateHandleResponse(resp *http.Response) (AssignmentsVMSSClientCreateOrUpdateResponse, error) { + result := AssignmentsVMSSClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Assignment); err != nil { + return AssignmentsVMSSClientCreateOrUpdateResponse{}, err + } + return result, nil +} + // Delete - Delete a guest configuration assignment for VMSS // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-01-25 -// resourceGroupName - The resource group name. -// vmssName - The name of the virtual machine scale set. -// name - The guest configuration assignment name. -// options - AssignmentsVMSSClientDeleteOptions contains the optional parameters for the AssignmentsVMSSClient.Delete method. +// - resourceGroupName - The resource group name. +// - vmssName - The name of the virtual machine scale set. +// - name - The guest configuration assignment name. +// - options - AssignmentsVMSSClientDeleteOptions contains the optional parameters for the AssignmentsVMSSClient.Delete method. func (client *AssignmentsVMSSClient) Delete(ctx context.Context, resourceGroupName string, vmssName string, name string, options *AssignmentsVMSSClientDeleteOptions) (AssignmentsVMSSClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, vmssName, name, options) if err != nil { @@ -118,11 +184,12 @@ func (client *AssignmentsVMSSClient) deleteHandleResponse(resp *http.Response) ( // Get - Get information about a guest configuration assignment for VMSS // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-01-25 -// resourceGroupName - The resource group name. -// vmssName - The name of the virtual machine scale set. -// name - The guest configuration assignment name. -// options - AssignmentsVMSSClientGetOptions contains the optional parameters for the AssignmentsVMSSClient.Get method. +// - resourceGroupName - The resource group name. +// - vmssName - The name of the virtual machine scale set. +// - name - The guest configuration assignment name. +// - options - AssignmentsVMSSClientGetOptions contains the optional parameters for the AssignmentsVMSSClient.Get method. func (client *AssignmentsVMSSClient) Get(ctx context.Context, resourceGroupName string, vmssName string, name string, options *AssignmentsVMSSClientGetOptions) (AssignmentsVMSSClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, vmssName, name, options) if err != nil { @@ -178,11 +245,12 @@ func (client *AssignmentsVMSSClient) getHandleResponse(resp *http.Response) (Ass } // NewListPager - List all guest configuration assignments for VMSS. -// If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-01-25 -// resourceGroupName - The resource group name. -// vmssName - The name of the virtual machine scale set. -// options - AssignmentsVMSSClientListOptions contains the optional parameters for the AssignmentsVMSSClient.List method. +// - resourceGroupName - The resource group name. +// - vmssName - The name of the virtual machine scale set. +// - options - AssignmentsVMSSClientListOptions contains the optional parameters for the AssignmentsVMSSClient.NewListPager +// method. func (client *AssignmentsVMSSClient) NewListPager(resourceGroupName string, vmssName string, options *AssignmentsVMSSClientListOptions) *runtime.Pager[AssignmentsVMSSClientListResponse] { return runtime.NewPager(runtime.PagingHandler[AssignmentsVMSSClientListResponse]{ More: func(page AssignmentsVMSSClientListResponse) bool { diff --git a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/autorest.md b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/autorest.md index 058f994cf6dc..c57b24ecdccf 100644 --- a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/autorest.md +++ b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/autorest.md @@ -5,9 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/guestconfiguration/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/guestconfiguration/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/guestconfiguration/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/guestconfiguration/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.0.0 +module-version: 1.1.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_constants.go b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/constants.go similarity index 99% rename from sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_constants.go rename to sdk/resourcemanager/guestconfiguration/armguestconfiguration/constants.go index b331a2497500..d370beb433d6 100644 --- a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_constants.go +++ b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/constants.go @@ -5,12 +5,13 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armguestconfiguration const ( moduleName = "armguestconfiguration" - moduleVersion = "v1.0.0" + moduleVersion = "v1.1.0" ) // ActionAfterReboot - Specifies what happens after a reboot during the application of a configuration. The possible values diff --git a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/go.mod b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/go.mod index fb7574c3f37f..a5ca99a81d83 100644 --- a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/go.mod +++ b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/go.mod @@ -2,20 +2,12 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/guestconfiguration/ go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 // indirect - github.com/golang-jwt/jwt v3.2.1+incompatible // indirect - github.com/google/uuid v1.1.1 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 // indirect - golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 // indirect - golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect golang.org/x/text v0.3.7 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/go.sum b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/go.sum index ed5b814680ee..3afb578030a5 100644 --- a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/go.sum +++ b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/go.sum @@ -1,33 +1,15 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 h1:sVPhtT2qjO86rTUaWMr4WoES4TkjGnzcioXcnHV9s5k= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0 h1:Yoicul8bnVdQrhDMTHxdEckRGX01XvwXDHUT9zYZ3k0= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0/go.mod h1:+6sju8gk8FRmSajX3Oz4G5Gm7P+mbqE9FVaXXFYTkCM= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 h1:jp0dGvZ7ZK0mgqnTSClMxa5xuRL7NZgHameVYF6BurY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 h1:WVsrXCnHlDDX8ls+tootqRE87/hL9S/g4ewig9RsD/c= -github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= -github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= -github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= -github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 h1:Qj1ukM4GlMWXNdMBuXcXfz/Kw9s1qm0CLY32QxuSImI= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 h1:Tgea0cVUD0ivh5ADBX4WwuI12DUd2to3nCYe2eayMIw= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 h1:HVyaeDAYux4pnY+D/SiwmLOR36ewZ4iGQIIrtnuCjFA= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_hcrpassignmentreports_client.go b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/hcrpassignmentreports_client.go similarity index 88% rename from sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_hcrpassignmentreports_client.go rename to sdk/resourcemanager/guestconfiguration/armguestconfiguration/hcrpassignmentreports_client.go index 60e09c5a964d..5e9a76ad36ab 100644 --- a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_hcrpassignmentreports_client.go +++ b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/hcrpassignmentreports_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armguestconfiguration @@ -31,10 +32,10 @@ type HCRPAssignmentReportsClient struct { } // NewHCRPAssignmentReportsClient creates a new instance of HCRPAssignmentReportsClient with the specified values. -// subscriptionID - Subscription ID which uniquely identify Microsoft Azure subscription. The subscription ID forms part of -// the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - Subscription ID which uniquely identify Microsoft Azure subscription. The subscription ID forms part of +// the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewHCRPAssignmentReportsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*HCRPAssignmentReportsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,13 +58,14 @@ func NewHCRPAssignmentReportsClient(subscriptionID string, credential azcore.Tok // Get - Get a report for the guest configuration assignment, by reportId. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-01-25 -// resourceGroupName - The resource group name. -// guestConfigurationAssignmentName - The guest configuration assignment name. -// reportID - The GUID for the guest configuration assignment report. -// machineName - The name of the ARC machine. -// options - HCRPAssignmentReportsClientGetOptions contains the optional parameters for the HCRPAssignmentReportsClient.Get -// method. +// - resourceGroupName - The resource group name. +// - guestConfigurationAssignmentName - The guest configuration assignment name. +// - reportID - The GUID for the guest configuration assignment report. +// - machineName - The name of the ARC machine. +// - options - HCRPAssignmentReportsClientGetOptions contains the optional parameters for the HCRPAssignmentReportsClient.Get +// method. func (client *HCRPAssignmentReportsClient) Get(ctx context.Context, resourceGroupName string, guestConfigurationAssignmentName string, reportID string, machineName string, options *HCRPAssignmentReportsClientGetOptions) (HCRPAssignmentReportsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, guestConfigurationAssignmentName, reportID, machineName, options) if err != nil { @@ -124,12 +126,13 @@ func (client *HCRPAssignmentReportsClient) getHandleResponse(resp *http.Response // List - List all reports for the guest configuration assignment, latest report first. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-01-25 -// resourceGroupName - The resource group name. -// guestConfigurationAssignmentName - The guest configuration assignment name. -// machineName - The name of the ARC machine. -// options - HCRPAssignmentReportsClientListOptions contains the optional parameters for the HCRPAssignmentReportsClient.List -// method. +// - resourceGroupName - The resource group name. +// - guestConfigurationAssignmentName - The guest configuration assignment name. +// - machineName - The name of the ARC machine. +// - options - HCRPAssignmentReportsClientListOptions contains the optional parameters for the HCRPAssignmentReportsClient.List +// method. func (client *HCRPAssignmentReportsClient) List(ctx context.Context, resourceGroupName string, guestConfigurationAssignmentName string, machineName string, options *HCRPAssignmentReportsClientListOptions) (HCRPAssignmentReportsClientListResponse, error) { req, err := client.listCreateRequest(ctx, resourceGroupName, guestConfigurationAssignmentName, machineName, options) if err != nil { diff --git a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_hcrpassignments_client.go b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/hcrpassignments_client.go similarity index 89% rename from sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_hcrpassignments_client.go rename to sdk/resourcemanager/guestconfiguration/armguestconfiguration/hcrpassignments_client.go index f39f4e853b90..f3be90a4715a 100644 --- a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_hcrpassignments_client.go +++ b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/hcrpassignments_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armguestconfiguration @@ -31,10 +32,10 @@ type HCRPAssignmentsClient struct { } // NewHCRPAssignmentsClient creates a new instance of HCRPAssignmentsClient with the specified values. -// subscriptionID - Subscription ID which uniquely identify Microsoft Azure subscription. The subscription ID forms part of -// the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - Subscription ID which uniquely identify Microsoft Azure subscription. The subscription ID forms part of +// the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewHCRPAssignmentsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*HCRPAssignmentsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,13 +58,14 @@ func NewHCRPAssignmentsClient(subscriptionID string, credential azcore.TokenCred // CreateOrUpdate - Creates an association between a ARC machine and guest configuration // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-01-25 -// guestConfigurationAssignmentName - Name of the guest configuration assignment. -// resourceGroupName - The resource group name. -// machineName - The name of the ARC machine. -// parameters - Parameters supplied to the create or update guest configuration assignment. -// options - HCRPAssignmentsClientCreateOrUpdateOptions contains the optional parameters for the HCRPAssignmentsClient.CreateOrUpdate -// method. +// - guestConfigurationAssignmentName - Name of the guest configuration assignment. +// - resourceGroupName - The resource group name. +// - machineName - The name of the ARC machine. +// - parameters - Parameters supplied to the create or update guest configuration assignment. +// - options - HCRPAssignmentsClientCreateOrUpdateOptions contains the optional parameters for the HCRPAssignmentsClient.CreateOrUpdate +// method. func (client *HCRPAssignmentsClient) CreateOrUpdate(ctx context.Context, guestConfigurationAssignmentName string, resourceGroupName string, machineName string, parameters Assignment, options *HCRPAssignmentsClientCreateOrUpdateOptions) (HCRPAssignmentsClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, guestConfigurationAssignmentName, resourceGroupName, machineName, parameters, options) if err != nil { @@ -120,11 +122,12 @@ func (client *HCRPAssignmentsClient) createOrUpdateHandleResponse(resp *http.Res // Delete - Delete a guest configuration assignment // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-01-25 -// resourceGroupName - The resource group name. -// guestConfigurationAssignmentName - Name of the guest configuration assignment -// machineName - The name of the ARC machine. -// options - HCRPAssignmentsClientDeleteOptions contains the optional parameters for the HCRPAssignmentsClient.Delete method. +// - resourceGroupName - The resource group name. +// - guestConfigurationAssignmentName - Name of the guest configuration assignment +// - machineName - The name of the ARC machine. +// - options - HCRPAssignmentsClientDeleteOptions contains the optional parameters for the HCRPAssignmentsClient.Delete method. func (client *HCRPAssignmentsClient) Delete(ctx context.Context, resourceGroupName string, guestConfigurationAssignmentName string, machineName string, options *HCRPAssignmentsClientDeleteOptions) (HCRPAssignmentsClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, guestConfigurationAssignmentName, machineName, options) if err != nil { @@ -172,11 +175,12 @@ func (client *HCRPAssignmentsClient) deleteCreateRequest(ctx context.Context, re // Get - Get information about a guest configuration assignment // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-01-25 -// resourceGroupName - The resource group name. -// guestConfigurationAssignmentName - The guest configuration assignment name. -// machineName - The name of the ARC machine. -// options - HCRPAssignmentsClientGetOptions contains the optional parameters for the HCRPAssignmentsClient.Get method. +// - resourceGroupName - The resource group name. +// - guestConfigurationAssignmentName - The guest configuration assignment name. +// - machineName - The name of the ARC machine. +// - options - HCRPAssignmentsClientGetOptions contains the optional parameters for the HCRPAssignmentsClient.Get method. func (client *HCRPAssignmentsClient) Get(ctx context.Context, resourceGroupName string, guestConfigurationAssignmentName string, machineName string, options *HCRPAssignmentsClientGetOptions) (HCRPAssignmentsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, guestConfigurationAssignmentName, machineName, options) if err != nil { @@ -232,11 +236,12 @@ func (client *HCRPAssignmentsClient) getHandleResponse(resp *http.Response) (HCR } // NewListPager - List all guest configuration assignments for an ARC machine. -// If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-01-25 -// resourceGroupName - The resource group name. -// machineName - The name of the ARC machine. -// options - HCRPAssignmentsClientListOptions contains the optional parameters for the HCRPAssignmentsClient.List method. +// - resourceGroupName - The resource group name. +// - machineName - The name of the ARC machine. +// - options - HCRPAssignmentsClientListOptions contains the optional parameters for the HCRPAssignmentsClient.NewListPager +// method. func (client *HCRPAssignmentsClient) NewListPager(resourceGroupName string, machineName string, options *HCRPAssignmentsClientListOptions) *runtime.Pager[HCRPAssignmentsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[HCRPAssignmentsClientListResponse]{ More: func(page HCRPAssignmentsClientListResponse) bool { diff --git a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_models.go b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/models.go similarity index 96% rename from sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_models.go rename to sdk/resourcemanager/guestconfiguration/armguestconfiguration/models.go index 105482fed828..a36cd9fbdf88 100644 --- a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_models.go +++ b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/models.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armguestconfiguration @@ -162,7 +163,7 @@ type AssignmentReportResource struct { ComplianceStatus *ComplianceStatus `json:"complianceStatus,omitempty" azure:"ro"` // READ-ONLY; Properties of a guest configuration assignment resource. - Properties interface{} `json:"properties,omitempty" azure:"ro"` + Properties any `json:"properties,omitempty" azure:"ro"` // READ-ONLY; Name of the guest configuration assignment resource setting. ResourceID *string `json:"resourceId,omitempty" azure:"ro"` @@ -192,7 +193,8 @@ type AssignmentReportsVMSSClientGetOptions struct { // placeholder for future optional parameters } -// AssignmentReportsVMSSClientListOptions contains the optional parameters for the AssignmentReportsVMSSClient.List method. +// AssignmentReportsVMSSClientListOptions contains the optional parameters for the AssignmentReportsVMSSClient.NewListPager +// method. type AssignmentReportsVMSSClientListOptions struct { // placeholder for future optional parameters } @@ -212,21 +214,28 @@ type AssignmentsClientGetOptions struct { // placeholder for future optional parameters } -// AssignmentsClientListOptions contains the optional parameters for the AssignmentsClient.List method. +// AssignmentsClientListOptions contains the optional parameters for the AssignmentsClient.NewListPager method. type AssignmentsClientListOptions struct { // placeholder for future optional parameters } -// AssignmentsClientRGListOptions contains the optional parameters for the AssignmentsClient.RGList method. +// AssignmentsClientRGListOptions contains the optional parameters for the AssignmentsClient.NewRGListPager method. type AssignmentsClientRGListOptions struct { // placeholder for future optional parameters } -// AssignmentsClientSubscriptionListOptions contains the optional parameters for the AssignmentsClient.SubscriptionList method. +// AssignmentsClientSubscriptionListOptions contains the optional parameters for the AssignmentsClient.NewSubscriptionListPager +// method. type AssignmentsClientSubscriptionListOptions struct { // placeholder for future optional parameters } +// AssignmentsVMSSClientCreateOrUpdateOptions contains the optional parameters for the AssignmentsVMSSClient.CreateOrUpdate +// method. +type AssignmentsVMSSClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + // AssignmentsVMSSClientDeleteOptions contains the optional parameters for the AssignmentsVMSSClient.Delete method. type AssignmentsVMSSClientDeleteOptions struct { // placeholder for future optional parameters @@ -237,7 +246,7 @@ type AssignmentsVMSSClientGetOptions struct { // placeholder for future optional parameters } -// AssignmentsVMSSClientListOptions contains the optional parameters for the AssignmentsVMSSClient.List method. +// AssignmentsVMSSClientListOptions contains the optional parameters for the AssignmentsVMSSClient.NewListPager method. type AssignmentsVMSSClientListOptions struct { // placeholder for future optional parameters } @@ -357,7 +366,7 @@ type HCRPAssignmentsClientGetOptions struct { // placeholder for future optional parameters } -// HCRPAssignmentsClientListOptions contains the optional parameters for the HCRPAssignmentsClient.List method. +// HCRPAssignmentsClientListOptions contains the optional parameters for the HCRPAssignmentsClient.NewListPager method. type HCRPAssignmentsClientListOptions struct { // placeholder for future optional parameters } @@ -440,7 +449,7 @@ type OperationProperties struct { StatusCode *string `json:"statusCode,omitempty"` } -// OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. +// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. type OperationsClientListOptions struct { // placeholder for future optional parameters } diff --git a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/models_serde.go b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/models_serde.go new file mode 100644 index 000000000000..55b15120efb3 --- /dev/null +++ b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/models_serde.go @@ -0,0 +1,1067 @@ +//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 armguestconfiguration + +import ( + "encoding/json" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "reflect" +) + +// MarshalJSON implements the json.Marshaller interface for type Assignment. +func (a Assignment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", a.ID) + populate(objectMap, "location", a.Location) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "systemData", a.SystemData) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Assignment. +func (a *Assignment) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &a.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &a.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AssignmentInfo. +func (a AssignmentInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "configuration", a.Configuration) + populate(objectMap, "name", a.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AssignmentInfo. +func (a *AssignmentInfo) 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 "configuration": + err = unpopulate(val, "Configuration", &a.Configuration) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + 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 AssignmentList. +func (a AssignmentList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AssignmentList. +func (a *AssignmentList) 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 "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 AssignmentProperties. +func (a AssignmentProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "assignmentHash", a.AssignmentHash) + populate(objectMap, "complianceStatus", a.ComplianceStatus) + populate(objectMap, "context", a.Context) + populate(objectMap, "guestConfiguration", a.GuestConfiguration) + populateTimeRFC3339(objectMap, "lastComplianceStatusChecked", a.LastComplianceStatusChecked) + populate(objectMap, "latestAssignmentReport", a.LatestAssignmentReport) + populate(objectMap, "latestReportId", a.LatestReportID) + populate(objectMap, "parameterHash", a.ParameterHash) + populate(objectMap, "provisioningState", a.ProvisioningState) + populate(objectMap, "resourceType", a.ResourceType) + populate(objectMap, "targetResourceId", a.TargetResourceID) + populate(objectMap, "vmssVMList", a.VmssVMList) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AssignmentProperties. +func (a *AssignmentProperties) 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 "assignmentHash": + err = unpopulate(val, "AssignmentHash", &a.AssignmentHash) + delete(rawMsg, key) + case "complianceStatus": + err = unpopulate(val, "ComplianceStatus", &a.ComplianceStatus) + delete(rawMsg, key) + case "context": + err = unpopulate(val, "Context", &a.Context) + delete(rawMsg, key) + case "guestConfiguration": + err = unpopulate(val, "GuestConfiguration", &a.GuestConfiguration) + delete(rawMsg, key) + case "lastComplianceStatusChecked": + err = unpopulateTimeRFC3339(val, "LastComplianceStatusChecked", &a.LastComplianceStatusChecked) + delete(rawMsg, key) + case "latestAssignmentReport": + err = unpopulate(val, "LatestAssignmentReport", &a.LatestAssignmentReport) + delete(rawMsg, key) + case "latestReportId": + err = unpopulate(val, "LatestReportID", &a.LatestReportID) + delete(rawMsg, key) + case "parameterHash": + err = unpopulate(val, "ParameterHash", &a.ParameterHash) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + delete(rawMsg, key) + case "resourceType": + err = unpopulate(val, "ResourceType", &a.ResourceType) + delete(rawMsg, key) + case "targetResourceId": + err = unpopulate(val, "TargetResourceID", &a.TargetResourceID) + delete(rawMsg, key) + case "vmssVMList": + err = unpopulate(val, "VmssVMList", &a.VmssVMList) + 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 AssignmentReport. +func (a AssignmentReport) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", a.ID) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AssignmentReport. +func (a *AssignmentReport) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AssignmentReportDetails. +func (a AssignmentReportDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "complianceStatus", a.ComplianceStatus) + populateTimeRFC3339(objectMap, "endTime", a.EndTime) + populate(objectMap, "jobId", a.JobID) + populate(objectMap, "operationType", a.OperationType) + populate(objectMap, "resources", a.Resources) + populateTimeRFC3339(objectMap, "startTime", a.StartTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AssignmentReportDetails. +func (a *AssignmentReportDetails) 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 "complianceStatus": + err = unpopulate(val, "ComplianceStatus", &a.ComplianceStatus) + delete(rawMsg, key) + case "endTime": + err = unpopulateTimeRFC3339(val, "EndTime", &a.EndTime) + delete(rawMsg, key) + case "jobId": + err = unpopulate(val, "JobID", &a.JobID) + delete(rawMsg, key) + case "operationType": + err = unpopulate(val, "OperationType", &a.OperationType) + delete(rawMsg, key) + case "resources": + err = unpopulate(val, "Resources", &a.Resources) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &a.StartTime) + 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 AssignmentReportList. +func (a AssignmentReportList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AssignmentReportList. +func (a *AssignmentReportList) 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 "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 AssignmentReportProperties. +func (a AssignmentReportProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "assignment", a.Assignment) + populate(objectMap, "complianceStatus", a.ComplianceStatus) + populate(objectMap, "details", a.Details) + populateTimeRFC3339(objectMap, "endTime", a.EndTime) + populate(objectMap, "reportId", a.ReportID) + populateTimeRFC3339(objectMap, "startTime", a.StartTime) + populate(objectMap, "vm", a.VM) + populate(objectMap, "vmssResourceId", a.VmssResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AssignmentReportProperties. +func (a *AssignmentReportProperties) 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 "assignment": + err = unpopulate(val, "Assignment", &a.Assignment) + delete(rawMsg, key) + case "complianceStatus": + err = unpopulate(val, "ComplianceStatus", &a.ComplianceStatus) + delete(rawMsg, key) + case "details": + err = unpopulate(val, "Details", &a.Details) + delete(rawMsg, key) + case "endTime": + err = unpopulateTimeRFC3339(val, "EndTime", &a.EndTime) + delete(rawMsg, key) + case "reportId": + err = unpopulate(val, "ReportID", &a.ReportID) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &a.StartTime) + delete(rawMsg, key) + case "vm": + err = unpopulate(val, "VM", &a.VM) + delete(rawMsg, key) + case "vmssResourceId": + err = unpopulate(val, "VmssResourceID", &a.VmssResourceID) + 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 AssignmentReportResource. +func (a AssignmentReportResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "complianceStatus", a.ComplianceStatus) + populate(objectMap, "properties", &a.Properties) + populate(objectMap, "reasons", a.Reasons) + populate(objectMap, "resourceId", a.ResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AssignmentReportResource. +func (a *AssignmentReportResource) 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 "complianceStatus": + err = unpopulate(val, "ComplianceStatus", &a.ComplianceStatus) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "reasons": + err = unpopulate(val, "Reasons", &a.Reasons) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &a.ResourceID) + 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 AssignmentReportResourceComplianceReason. +func (a AssignmentReportResourceComplianceReason) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "code", a.Code) + populate(objectMap, "phrase", a.Phrase) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AssignmentReportResourceComplianceReason. +func (a *AssignmentReportResourceComplianceReason) 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 "code": + err = unpopulate(val, "Code", &a.Code) + delete(rawMsg, key) + case "phrase": + err = unpopulate(val, "Phrase", &a.Phrase) + 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 CommonAssignmentReport. +func (c CommonAssignmentReport) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "assignment", c.Assignment) + populate(objectMap, "complianceStatus", c.ComplianceStatus) + populateTimeRFC3339(objectMap, "endTime", c.EndTime) + populate(objectMap, "id", c.ID) + populate(objectMap, "operationType", c.OperationType) + populate(objectMap, "reportId", c.ReportID) + populate(objectMap, "resources", c.Resources) + populateTimeRFC3339(objectMap, "startTime", c.StartTime) + populate(objectMap, "vm", c.VM) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CommonAssignmentReport. +func (c *CommonAssignmentReport) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "assignment": + err = unpopulate(val, "Assignment", &c.Assignment) + delete(rawMsg, key) + case "complianceStatus": + err = unpopulate(val, "ComplianceStatus", &c.ComplianceStatus) + delete(rawMsg, key) + case "endTime": + err = unpopulateTimeRFC3339(val, "EndTime", &c.EndTime) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "operationType": + err = unpopulate(val, "OperationType", &c.OperationType) + delete(rawMsg, key) + case "reportId": + err = unpopulate(val, "ReportID", &c.ReportID) + delete(rawMsg, key) + case "resources": + err = unpopulate(val, "Resources", &c.Resources) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &c.StartTime) + delete(rawMsg, key) + case "vm": + err = unpopulate(val, "VM", &c.VM) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ConfigurationInfo. +func (c ConfigurationInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", c.Name) + populate(objectMap, "version", c.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationInfo. +func (c *ConfigurationInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &c.Version) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ConfigurationParameter. +func (c ConfigurationParameter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", c.Name) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationParameter. +func (c *ConfigurationParameter) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &c.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ConfigurationSetting. +func (c ConfigurationSetting) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "actionAfterReboot", c.ActionAfterReboot) + populate(objectMap, "allowModuleOverwrite", c.AllowModuleOverwrite) + populate(objectMap, "configurationMode", c.ConfigurationMode) + populate(objectMap, "configurationModeFrequencyMins", c.ConfigurationModeFrequencyMins) + populate(objectMap, "rebootIfNeeded", c.RebootIfNeeded) + populate(objectMap, "refreshFrequencyMins", c.RefreshFrequencyMins) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationSetting. +func (c *ConfigurationSetting) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "actionAfterReboot": + err = unpopulate(val, "ActionAfterReboot", &c.ActionAfterReboot) + delete(rawMsg, key) + case "allowModuleOverwrite": + err = unpopulate(val, "AllowModuleOverwrite", &c.AllowModuleOverwrite) + delete(rawMsg, key) + case "configurationMode": + err = unpopulate(val, "ConfigurationMode", &c.ConfigurationMode) + delete(rawMsg, key) + case "configurationModeFrequencyMins": + err = unpopulate(val, "ConfigurationModeFrequencyMins", &c.ConfigurationModeFrequencyMins) + delete(rawMsg, key) + case "rebootIfNeeded": + err = unpopulate(val, "RebootIfNeeded", &c.RebootIfNeeded) + delete(rawMsg, key) + case "refreshFrequencyMins": + err = unpopulate(val, "RefreshFrequencyMins", &c.RefreshFrequencyMins) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ErrorResponse. +func (e ErrorResponse) 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 ErrorResponse. +func (e *ErrorResponse) 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 ErrorResponseError. +func (e ErrorResponseError) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "code", e.Code) + populate(objectMap, "message", e.Message) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponseError. +func (e *ErrorResponseError) 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 "code": + err = unpopulate(val, "Code", &e.Code) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &e.Message) + 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 Navigation. +func (n Navigation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "assignmentSource", n.AssignmentSource) + populate(objectMap, "assignmentType", n.AssignmentType) + populate(objectMap, "configurationParameter", n.ConfigurationParameter) + populate(objectMap, "configurationProtectedParameter", n.ConfigurationProtectedParameter) + populate(objectMap, "configurationSetting", n.ConfigurationSetting) + populate(objectMap, "contentHash", n.ContentHash) + populate(objectMap, "contentType", n.ContentType) + populate(objectMap, "contentUri", n.ContentURI) + populate(objectMap, "kind", n.Kind) + populate(objectMap, "name", n.Name) + populate(objectMap, "version", n.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Navigation. +func (n *Navigation) 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 "assignmentSource": + err = unpopulate(val, "AssignmentSource", &n.AssignmentSource) + delete(rawMsg, key) + case "assignmentType": + err = unpopulate(val, "AssignmentType", &n.AssignmentType) + delete(rawMsg, key) + case "configurationParameter": + err = unpopulate(val, "ConfigurationParameter", &n.ConfigurationParameter) + delete(rawMsg, key) + case "configurationProtectedParameter": + err = unpopulate(val, "ConfigurationProtectedParameter", &n.ConfigurationProtectedParameter) + delete(rawMsg, key) + case "configurationSetting": + err = unpopulate(val, "ConfigurationSetting", &n.ConfigurationSetting) + delete(rawMsg, key) + case "contentHash": + err = unpopulate(val, "ContentHash", &n.ContentHash) + delete(rawMsg, key) + case "contentType": + err = unpopulate(val, "ContentType", &n.ContentType) + delete(rawMsg, key) + case "contentUri": + err = unpopulate(val, "ContentURI", &n.ContentURI) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &n.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &n.Name) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &n.Version) + 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 Operation. +func (o Operation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "display", o.Display) + populate(objectMap, "name", o.Name) + populate(objectMap, "properties", o.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Operation. +func (o *Operation) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "display": + err = unpopulate(val, "Display", &o.Display) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &o.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationDisplay. +func (o OperationDisplay) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", o.Description) + populate(objectMap, "operation", o.Operation) + populate(objectMap, "provider", o.Provider) + populate(objectMap, "resource", o.Resource) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay. +func (o *OperationDisplay) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &o.Description) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &o.Operation) + delete(rawMsg, key) + case "provider": + err = unpopulate(val, "Provider", &o.Provider) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &o.Resource) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationList. +func (o OperationList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "value", o.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationList. +func (o *OperationList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &o.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationProperties. +func (o OperationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "statusCode", o.StatusCode) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationProperties. +func (o *OperationProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "statusCode": + err = unpopulate(val, "StatusCode", &o.StatusCode) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ProxyResource. +func (p ProxyResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", p.ID) + populate(objectMap, "location", p.Location) + populate(objectMap, "name", p.Name) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResource. +func (p *ProxyResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &p.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", r.ID) + populate(objectMap, "location", r.Location) + populate(objectMap, "name", r.Name) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Resource. +func (r *Resource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &r.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SystemData. +func (s SystemData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) + populate(objectMap, "createdBy", s.CreatedBy) + populate(objectMap, "createdByType", s.CreatedByType) + populateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) + populate(objectMap, "lastModifiedBy", s.LastModifiedBy) + populate(objectMap, "lastModifiedByType", s.LastModifiedByType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. +func (s *SystemData) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "createdAt": + err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) + delete(rawMsg, key) + case "createdBy": + err = unpopulate(val, "CreatedBy", &s.CreatedBy) + delete(rawMsg, key) + case "createdByType": + err = unpopulate(val, "CreatedByType", &s.CreatedByType) + delete(rawMsg, key) + case "lastModifiedAt": + err = unpopulateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) + delete(rawMsg, key) + case "lastModifiedBy": + err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) + delete(rawMsg, key) + case "lastModifiedByType": + err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VMInfo. +func (v VMInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", v.ID) + populate(objectMap, "uuid", v.UUID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VMInfo. +func (v *VMInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &v.ID) + delete(rawMsg, key) + case "uuid": + err = unpopulate(val, "UUID", &v.UUID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VMSSVMInfo. +func (v VMSSVMInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "complianceStatus", v.ComplianceStatus) + populateTimeRFC3339(objectMap, "lastComplianceChecked", v.LastComplianceChecked) + populate(objectMap, "latestReportId", v.LatestReportID) + populate(objectMap, "vmId", v.VMID) + populate(objectMap, "vmResourceId", v.VMResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VMSSVMInfo. +func (v *VMSSVMInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "complianceStatus": + err = unpopulate(val, "ComplianceStatus", &v.ComplianceStatus) + delete(rawMsg, key) + case "lastComplianceChecked": + err = unpopulateTimeRFC3339(val, "LastComplianceChecked", &v.LastComplianceChecked) + delete(rawMsg, key) + case "latestReportId": + err = unpopulate(val, "LatestReportID", &v.LatestReportID) + delete(rawMsg, key) + case "vmId": + err = unpopulate(val, "VMID", &v.VMID) + delete(rawMsg, key) + case "vmResourceId": + err = unpopulate(val, "VMResourceID", &v.VMResourceID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +func populate(m map[string]any, k string, v any) { + if v == nil { + return + } else if azcore.IsNullValue(v) { + m[k] = nil + } else if !reflect.ValueOf(v).IsNil() { + m[k] = v + } +} + +func unpopulate(data json.RawMessage, fn string, v any) error { + if data == nil { + return nil + } + if err := json.Unmarshal(data, v); err != nil { + return fmt.Errorf("struct field %s: %v", fn, err) + } + return nil +} diff --git a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_operations_client.go b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/operations_client.go similarity index 91% rename from sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_operations_client.go rename to sdk/resourcemanager/guestconfiguration/armguestconfiguration/operations_client.go index 23f31383674e..14c5662f768c 100644 --- a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_operations_client.go +++ b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/operations_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armguestconfiguration @@ -27,8 +28,8 @@ type OperationsClient struct { } // NewOperationsClient creates a new instance of OperationsClient with the specified values. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -49,9 +50,9 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO } // NewListPager - Lists all of the available GuestConfiguration REST API operations. -// If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-01-25 -// options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. +// - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ More: func(page OperationsClientListResponse) bool { diff --git a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_response_types.go b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/response_types.go similarity index 87% rename from sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_response_types.go rename to sdk/resourcemanager/guestconfiguration/armguestconfiguration/response_types.go index 79b444da5352..ff32133066a9 100644 --- a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_response_types.go +++ b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/response_types.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armguestconfiguration @@ -23,7 +24,7 @@ type AssignmentReportsVMSSClientGetResponse struct { AssignmentReport } -// AssignmentReportsVMSSClientListResponse contains the response from method AssignmentReportsVMSSClient.List. +// AssignmentReportsVMSSClientListResponse contains the response from method AssignmentReportsVMSSClient.NewListPager. type AssignmentReportsVMSSClientListResponse struct { AssignmentReportList } @@ -43,21 +44,26 @@ type AssignmentsClientGetResponse struct { Assignment } -// AssignmentsClientListResponse contains the response from method AssignmentsClient.List. +// AssignmentsClientListResponse contains the response from method AssignmentsClient.NewListPager. type AssignmentsClientListResponse struct { AssignmentList } -// AssignmentsClientRGListResponse contains the response from method AssignmentsClient.RGList. +// AssignmentsClientRGListResponse contains the response from method AssignmentsClient.NewRGListPager. type AssignmentsClientRGListResponse struct { AssignmentList } -// AssignmentsClientSubscriptionListResponse contains the response from method AssignmentsClient.SubscriptionList. +// AssignmentsClientSubscriptionListResponse contains the response from method AssignmentsClient.NewSubscriptionListPager. type AssignmentsClientSubscriptionListResponse struct { AssignmentList } +// AssignmentsVMSSClientCreateOrUpdateResponse contains the response from method AssignmentsVMSSClient.CreateOrUpdate. +type AssignmentsVMSSClientCreateOrUpdateResponse struct { + Assignment +} + // AssignmentsVMSSClientDeleteResponse contains the response from method AssignmentsVMSSClient.Delete. type AssignmentsVMSSClientDeleteResponse struct { Assignment @@ -68,7 +74,7 @@ type AssignmentsVMSSClientGetResponse struct { Assignment } -// AssignmentsVMSSClientListResponse contains the response from method AssignmentsVMSSClient.List. +// AssignmentsVMSSClientListResponse contains the response from method AssignmentsVMSSClient.NewListPager. type AssignmentsVMSSClientListResponse struct { AssignmentList } @@ -98,12 +104,12 @@ type HCRPAssignmentsClientGetResponse struct { Assignment } -// HCRPAssignmentsClientListResponse contains the response from method HCRPAssignmentsClient.List. +// HCRPAssignmentsClientListResponse contains the response from method HCRPAssignmentsClient.NewListPager. type HCRPAssignmentsClientListResponse struct { AssignmentList } -// OperationsClientListResponse contains the response from method OperationsClient.List. +// OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { OperationList } diff --git a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_time_rfc3339.go b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/time_rfc3339.go similarity index 96% rename from sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_time_rfc3339.go rename to sdk/resourcemanager/guestconfiguration/armguestconfiguration/time_rfc3339.go index 448d935f9295..857a4026e125 100644 --- a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_time_rfc3339.go +++ b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/time_rfc3339.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armguestconfiguration @@ -61,7 +62,7 @@ func (t *timeRFC3339) Parse(layout, value string) error { return err } -func populateTimeRFC3339(m map[string]interface{}, k string, t *time.Time) { +func populateTimeRFC3339(m map[string]any, k string, t *time.Time) { if t == nil { return } else if azcore.IsNullValue(t) { diff --git a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/ze_generated_example_guestconfigurationassignmentreports_client_test.go b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/ze_generated_example_guestconfigurationassignmentreports_client_test.go deleted file mode 100644 index aebdbd824d74..000000000000 --- a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/ze_generated_example_guestconfigurationassignmentreports_client_test.go +++ /dev/null @@ -1,64 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armguestconfiguration_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/guestconfiguration/armguestconfiguration" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/guestconfiguration/resource-manager/Microsoft.GuestConfiguration/stable/2022-01-25/examples/listAllGuestConfigurationAssignmentReports.json -func ExampleAssignmentReportsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armguestconfiguration.NewAssignmentReportsClient("mySubscriptionid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, - "myResourceGroupName", - "AuditSecureProtocol", - "myVMName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/guestconfiguration/resource-manager/Microsoft.GuestConfiguration/stable/2022-01-25/examples/getGuestConfigurationAssignmentReportById.json -func ExampleAssignmentReportsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armguestconfiguration.NewAssignmentReportsClient("mySubscriptionid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myResourceGroupName", - "AuditSecureProtocol", - "7367cbb8-ae99-47d0-a33b-a283564d2cb1", - "myvm", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/ze_generated_example_guestconfigurationassignmentreportsvmss_client_test.go b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/ze_generated_example_guestconfigurationassignmentreportsvmss_client_test.go deleted file mode 100644 index fb868506c157..000000000000 --- a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/ze_generated_example_guestconfigurationassignmentreportsvmss_client_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. - -package armguestconfiguration_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/guestconfiguration/armguestconfiguration" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/guestconfiguration/resource-manager/Microsoft.GuestConfiguration/stable/2022-01-25/examples/listAllVMSSGuestConfigurationAssignmentReports.json -func ExampleAssignmentReportsVMSSClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armguestconfiguration.NewAssignmentReportsVMSSClient("mySubscriptionid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("myResourceGroupName", - "myVMSSName", - "AuditSecureProtocol", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/guestconfiguration/resource-manager/Microsoft.GuestConfiguration/stable/2022-01-25/examples/getVMSSGuestConfigurationAssignmentReportById.json -func ExampleAssignmentReportsVMSSClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armguestconfiguration.NewAssignmentReportsVMSSClient("mySubscriptionid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myResourceGroupName", - "myvmss", - "AuditSecureProtocol", - "7367cbb8-ae99-47d0-a33b-a283564d2cb1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/ze_generated_example_guestconfigurationassignments_client_test.go b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/ze_generated_example_guestconfigurationassignments_client_test.go deleted file mode 100644 index af08163277d6..000000000000 --- a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/ze_generated_example_guestconfigurationassignments_client_test.go +++ /dev/null @@ -1,179 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armguestconfiguration_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/guestconfiguration/armguestconfiguration" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/guestconfiguration/resource-manager/Microsoft.GuestConfiguration/stable/2022-01-25/examples/createOrUpdateGuestConfigurationAssignment.json -func ExampleAssignmentsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armguestconfiguration.NewAssignmentsClient("mySubscriptionId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "NotInstalledApplicationForWindows", - "myResourceGroupName", - "myVMName", - armguestconfiguration.Assignment{ - Name: to.Ptr("NotInstalledApplicationForWindows"), - Location: to.Ptr("westcentralus"), - Properties: &armguestconfiguration.AssignmentProperties{ - Context: to.Ptr("Azure policy"), - GuestConfiguration: &armguestconfiguration.Navigation{ - Name: to.Ptr("NotInstalledApplicationForWindows"), - AssignmentType: to.Ptr(armguestconfiguration.AssignmentTypeApplyAndAutoCorrect), - ConfigurationParameter: []*armguestconfiguration.ConfigurationParameter{ - { - Name: to.Ptr("[InstalledApplication]NotInstalledApplicationResource1;Name"), - Value: to.Ptr("NotePad,sql"), - }}, - ContentHash: to.Ptr("123contenthash"), - ContentURI: to.Ptr("https://thisisfake/pacakge"), - Version: to.Ptr("1.*"), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/guestconfiguration/resource-manager/Microsoft.GuestConfiguration/stable/2022-01-25/examples/getGuestConfigurationAssignment.json -func ExampleAssignmentsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armguestconfiguration.NewAssignmentsClient("mySubscriptionId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myResourceGroupName", - "SecureProtocol", - "myVMName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/guestconfiguration/resource-manager/Microsoft.GuestConfiguration/stable/2022-01-25/examples/deleteGuestConfigurationAssignment.json -func ExampleAssignmentsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armguestconfiguration.NewAssignmentsClient("mySubscriptionId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "myResourceGroupName", - "SecureProtocol", - "myVMName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/guestconfiguration/resource-manager/Microsoft.GuestConfiguration/stable/2022-01-25/examples/listSubGuestConfigurationAssignments.json -func ExampleAssignmentsClient_NewSubscriptionListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armguestconfiguration.NewAssignmentsClient("mySubscriptionId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewSubscriptionListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/guestconfiguration/resource-manager/Microsoft.GuestConfiguration/stable/2022-01-25/examples/listRGGuestConfigurationAssignments.json -func ExampleAssignmentsClient_NewRGListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armguestconfiguration.NewAssignmentsClient("mySubscriptionId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewRGListPager("myResourceGroupName", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/guestconfiguration/resource-manager/Microsoft.GuestConfiguration/stable/2022-01-25/examples/listGuestConfigurationAssignments.json -func ExampleAssignmentsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armguestconfiguration.NewAssignmentsClient("mySubscriptionId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("myResourceGroupName", - "myVMName", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/ze_generated_example_guestconfigurationassignmentsvmss_client_test.go b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/ze_generated_example_guestconfigurationassignmentsvmss_client_test.go deleted file mode 100644 index f1cfd280d866..000000000000 --- a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/ze_generated_example_guestconfigurationassignmentsvmss_client_test.go +++ /dev/null @@ -1,89 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armguestconfiguration_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/guestconfiguration/armguestconfiguration" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/guestconfiguration/resource-manager/Microsoft.GuestConfiguration/stable/2022-01-25/examples/getVMSSGuestConfigurationAssignment.json -func ExampleAssignmentsVMSSClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armguestconfiguration.NewAssignmentsVMSSClient("mySubscriptionId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myResourceGroupName", - "myVMSSName", - "SecureProtocol", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/guestconfiguration/resource-manager/Microsoft.GuestConfiguration/stable/2022-01-25/examples/deleteGuestConfigurationVMSSAssignment.json -func ExampleAssignmentsVMSSClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armguestconfiguration.NewAssignmentsVMSSClient("mySubscriptionId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Delete(ctx, - "myResourceGroupName", - "myVMSSName", - "SecureProtocol", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/guestconfiguration/resource-manager/Microsoft.GuestConfiguration/stable/2022-01-25/examples/listVMSSGuestConfigurationAssignments.json -func ExampleAssignmentsVMSSClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armguestconfiguration.NewAssignmentsVMSSClient("mySubscriptionId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("myResourceGroupName", - "myVMSSName", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/ze_generated_example_guestconfigurationhcrpassignmentreports_client_test.go b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/ze_generated_example_guestconfigurationhcrpassignmentreports_client_test.go deleted file mode 100644 index 9c894275ae7d..000000000000 --- a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/ze_generated_example_guestconfigurationhcrpassignmentreports_client_test.go +++ /dev/null @@ -1,64 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armguestconfiguration_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/guestconfiguration/armguestconfiguration" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/guestconfiguration/resource-manager/Microsoft.GuestConfiguration/stable/2022-01-25/examples/listAllGuestConfigurationHCRPAssignmentReports.json -func ExampleHCRPAssignmentReportsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armguestconfiguration.NewHCRPAssignmentReportsClient("mySubscriptionid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, - "myResourceGroupName", - "AuditSecureProtocol", - "myMachineName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/guestconfiguration/resource-manager/Microsoft.GuestConfiguration/stable/2022-01-25/examples/getGuestConfigurationHCRPAssignmentReportById.json -func ExampleHCRPAssignmentReportsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armguestconfiguration.NewHCRPAssignmentReportsClient("mySubscriptionid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myResourceGroupName", - "AuditSecureProtocol", - "7367cbb8-ae99-47d0-a33b-a283564d2cb1", - "myMachineName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/ze_generated_example_guestconfigurationhcrpassignments_client_test.go b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/ze_generated_example_guestconfigurationhcrpassignments_client_test.go deleted file mode 100644 index bf5e4466efab..000000000000 --- a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/ze_generated_example_guestconfigurationhcrpassignments_client_test.go +++ /dev/null @@ -1,130 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armguestconfiguration_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/guestconfiguration/armguestconfiguration" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/guestconfiguration/resource-manager/Microsoft.GuestConfiguration/stable/2022-01-25/examples/createOrUpdateGuestConfigurationHCRPAssignment.json -func ExampleHCRPAssignmentsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armguestconfiguration.NewHCRPAssignmentsClient("mySubscriptionId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "NotInstalledApplicationForWindows", - "myResourceGroupName", - "myMachineName", - armguestconfiguration.Assignment{ - Name: to.Ptr("NotInstalledApplicationForWindows"), - Location: to.Ptr("westcentralus"), - Properties: &armguestconfiguration.AssignmentProperties{ - Context: to.Ptr("Azure policy"), - GuestConfiguration: &armguestconfiguration.Navigation{ - Name: to.Ptr("NotInstalledApplicationForWindows"), - AssignmentType: to.Ptr(armguestconfiguration.AssignmentTypeApplyAndAutoCorrect), - ConfigurationParameter: []*armguestconfiguration.ConfigurationParameter{ - { - Name: to.Ptr("[InstalledApplication]NotInstalledApplicationResource1;Name"), - Value: to.Ptr("NotePad,sql"), - }}, - ContentHash: to.Ptr("123contenthash"), - ContentURI: to.Ptr("https://thisisfake/pacakge"), - Version: to.Ptr("1.*"), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/guestconfiguration/resource-manager/Microsoft.GuestConfiguration/stable/2022-01-25/examples/getGuestConfigurationHCRPAssignment.json -func ExampleHCRPAssignmentsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armguestconfiguration.NewHCRPAssignmentsClient("mySubscriptionId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myResourceGroupName", - "SecureProtocol", - "myMachineName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/guestconfiguration/resource-manager/Microsoft.GuestConfiguration/stable/2022-01-25/examples/deleteGuestConfigurationHCRPAssignment.json -func ExampleHCRPAssignmentsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armguestconfiguration.NewHCRPAssignmentsClient("mySubscriptionId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "myResourceGroupName", - "SecureProtocol", - "myMachineName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/guestconfiguration/resource-manager/Microsoft.GuestConfiguration/stable/2022-01-25/examples/listGuestConfigurationHCRPAssignments.json -func ExampleHCRPAssignmentsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armguestconfiguration.NewHCRPAssignmentsClient("mySubscriptionId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("myResourceGroupName", - "myMachineName", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/ze_generated_example_operations_client_test.go b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/ze_generated_example_operations_client_test.go deleted file mode 100644 index 56bcbd5b59ad..000000000000 --- a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/ze_generated_example_operations_client_test.go +++ /dev/null @@ -1,41 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armguestconfiguration_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/guestconfiguration/armguestconfiguration" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/guestconfiguration/resource-manager/Microsoft.GuestConfiguration/stable/2022-01-25/examples/listOperations.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armguestconfiguration.NewOperationsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_models_serde.go b/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_models_serde.go deleted file mode 100644 index afcc1690fc10..000000000000 --- a/sdk/resourcemanager/guestconfiguration/armguestconfiguration/zz_generated_models_serde.go +++ /dev/null @@ -1,359 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armguestconfiguration - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" -) - -// MarshalJSON implements the json.Marshaller interface for type AssignmentProperties. -func (a AssignmentProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "assignmentHash", a.AssignmentHash) - populate(objectMap, "complianceStatus", a.ComplianceStatus) - populate(objectMap, "context", a.Context) - populate(objectMap, "guestConfiguration", a.GuestConfiguration) - populateTimeRFC3339(objectMap, "lastComplianceStatusChecked", a.LastComplianceStatusChecked) - populate(objectMap, "latestAssignmentReport", a.LatestAssignmentReport) - populate(objectMap, "latestReportId", a.LatestReportID) - populate(objectMap, "parameterHash", a.ParameterHash) - populate(objectMap, "provisioningState", a.ProvisioningState) - populate(objectMap, "resourceType", a.ResourceType) - populate(objectMap, "targetResourceId", a.TargetResourceID) - populate(objectMap, "vmssVMList", a.VmssVMList) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AssignmentProperties. -func (a *AssignmentProperties) 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 "assignmentHash": - err = unpopulate(val, "AssignmentHash", &a.AssignmentHash) - delete(rawMsg, key) - case "complianceStatus": - err = unpopulate(val, "ComplianceStatus", &a.ComplianceStatus) - delete(rawMsg, key) - case "context": - err = unpopulate(val, "Context", &a.Context) - delete(rawMsg, key) - case "guestConfiguration": - err = unpopulate(val, "GuestConfiguration", &a.GuestConfiguration) - delete(rawMsg, key) - case "lastComplianceStatusChecked": - err = unpopulateTimeRFC3339(val, "LastComplianceStatusChecked", &a.LastComplianceStatusChecked) - delete(rawMsg, key) - case "latestAssignmentReport": - err = unpopulate(val, "LatestAssignmentReport", &a.LatestAssignmentReport) - delete(rawMsg, key) - case "latestReportId": - err = unpopulate(val, "LatestReportID", &a.LatestReportID) - delete(rawMsg, key) - case "parameterHash": - err = unpopulate(val, "ParameterHash", &a.ParameterHash) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) - delete(rawMsg, key) - case "resourceType": - err = unpopulate(val, "ResourceType", &a.ResourceType) - delete(rawMsg, key) - case "targetResourceId": - err = unpopulate(val, "TargetResourceID", &a.TargetResourceID) - delete(rawMsg, key) - case "vmssVMList": - err = unpopulate(val, "VmssVMList", &a.VmssVMList) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AssignmentReportDetails. -func (a *AssignmentReportDetails) 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 "complianceStatus": - err = unpopulate(val, "ComplianceStatus", &a.ComplianceStatus) - delete(rawMsg, key) - case "endTime": - err = unpopulateTimeRFC3339(val, "EndTime", &a.EndTime) - delete(rawMsg, key) - case "jobId": - err = unpopulate(val, "JobID", &a.JobID) - delete(rawMsg, key) - case "operationType": - err = unpopulate(val, "OperationType", &a.OperationType) - delete(rawMsg, key) - case "resources": - err = unpopulate(val, "Resources", &a.Resources) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &a.StartTime) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AssignmentReportProperties. -func (a *AssignmentReportProperties) 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 "assignment": - err = unpopulate(val, "Assignment", &a.Assignment) - delete(rawMsg, key) - case "complianceStatus": - err = unpopulate(val, "ComplianceStatus", &a.ComplianceStatus) - delete(rawMsg, key) - case "details": - err = unpopulate(val, "Details", &a.Details) - delete(rawMsg, key) - case "endTime": - err = unpopulateTimeRFC3339(val, "EndTime", &a.EndTime) - delete(rawMsg, key) - case "reportId": - err = unpopulate(val, "ReportID", &a.ReportID) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &a.StartTime) - delete(rawMsg, key) - case "vm": - err = unpopulate(val, "VM", &a.VM) - delete(rawMsg, key) - case "vmssResourceId": - err = unpopulate(val, "VmssResourceID", &a.VmssResourceID) - 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 AssignmentReportResource. -func (a AssignmentReportResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "complianceStatus", a.ComplianceStatus) - populate(objectMap, "properties", &a.Properties) - populate(objectMap, "reasons", a.Reasons) - populate(objectMap, "resourceId", a.ResourceID) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type CommonAssignmentReport. -func (c CommonAssignmentReport) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "assignment", c.Assignment) - populate(objectMap, "complianceStatus", c.ComplianceStatus) - populateTimeRFC3339(objectMap, "endTime", c.EndTime) - populate(objectMap, "id", c.ID) - populate(objectMap, "operationType", c.OperationType) - populate(objectMap, "reportId", c.ReportID) - populate(objectMap, "resources", c.Resources) - populateTimeRFC3339(objectMap, "startTime", c.StartTime) - populate(objectMap, "vm", c.VM) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CommonAssignmentReport. -func (c *CommonAssignmentReport) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "assignment": - err = unpopulate(val, "Assignment", &c.Assignment) - delete(rawMsg, key) - case "complianceStatus": - err = unpopulate(val, "ComplianceStatus", &c.ComplianceStatus) - delete(rawMsg, key) - case "endTime": - err = unpopulateTimeRFC3339(val, "EndTime", &c.EndTime) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &c.ID) - delete(rawMsg, key) - case "operationType": - err = unpopulate(val, "OperationType", &c.OperationType) - delete(rawMsg, key) - case "reportId": - err = unpopulate(val, "ReportID", &c.ReportID) - delete(rawMsg, key) - case "resources": - err = unpopulate(val, "Resources", &c.Resources) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &c.StartTime) - delete(rawMsg, key) - case "vm": - err = unpopulate(val, "VM", &c.VM) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Navigation. -func (n Navigation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "assignmentSource", n.AssignmentSource) - populate(objectMap, "assignmentType", n.AssignmentType) - populate(objectMap, "configurationParameter", n.ConfigurationParameter) - populate(objectMap, "configurationProtectedParameter", n.ConfigurationProtectedParameter) - populate(objectMap, "configurationSetting", n.ConfigurationSetting) - populate(objectMap, "contentHash", n.ContentHash) - populate(objectMap, "contentType", n.ContentType) - populate(objectMap, "contentUri", n.ContentURI) - populate(objectMap, "kind", n.Kind) - populate(objectMap, "name", n.Name) - populate(objectMap, "version", n.Version) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type SystemData. -func (s SystemData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) - populate(objectMap, "createdBy", s.CreatedBy) - populate(objectMap, "createdByType", s.CreatedByType) - populateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) - populate(objectMap, "lastModifiedBy", s.LastModifiedBy) - populate(objectMap, "lastModifiedByType", s.LastModifiedByType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. -func (s *SystemData) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "createdAt": - err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) - delete(rawMsg, key) - case "createdBy": - err = unpopulate(val, "CreatedBy", &s.CreatedBy) - delete(rawMsg, key) - case "createdByType": - err = unpopulate(val, "CreatedByType", &s.CreatedByType) - delete(rawMsg, key) - case "lastModifiedAt": - err = unpopulateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) - delete(rawMsg, key) - case "lastModifiedBy": - err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) - delete(rawMsg, key) - case "lastModifiedByType": - err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VMSSVMInfo. -func (v VMSSVMInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "complianceStatus", v.ComplianceStatus) - populateTimeRFC3339(objectMap, "lastComplianceChecked", v.LastComplianceChecked) - populate(objectMap, "latestReportId", v.LatestReportID) - populate(objectMap, "vmId", v.VMID) - populate(objectMap, "vmResourceId", v.VMResourceID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VMSSVMInfo. -func (v *VMSSVMInfo) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "complianceStatus": - err = unpopulate(val, "ComplianceStatus", &v.ComplianceStatus) - delete(rawMsg, key) - case "lastComplianceChecked": - err = unpopulateTimeRFC3339(val, "LastComplianceChecked", &v.LastComplianceChecked) - delete(rawMsg, key) - case "latestReportId": - err = unpopulate(val, "LatestReportID", &v.LatestReportID) - delete(rawMsg, key) - case "vmId": - err = unpopulate(val, "VMID", &v.VMID) - delete(rawMsg, key) - case "vmResourceId": - err = unpopulate(val, "VMResourceID", &v.VMResourceID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -func populate(m map[string]interface{}, k string, v interface{}) { - if v == nil { - return - } else if azcore.IsNullValue(v) { - m[k] = nil - } else if !reflect.ValueOf(v).IsNil() { - m[k] = v - } -} - -func unpopulate(data json.RawMessage, fn string, v interface{}) error { - if data == nil { - return nil - } - if err := json.Unmarshal(data, v); err != nil { - return fmt.Errorf("struct field %s: %v", fn, err) - } - return nil -}