diff --git a/sdk/resourcemanager/maintenance/armmaintenance/CHANGELOG.md b/sdk/resourcemanager/maintenance/armmaintenance/CHANGELOG.md index 2ff359196802..37a1374ad60b 100644 --- a/sdk/resourcemanager/maintenance/armmaintenance/CHANGELOG.md +++ b/sdk/resourcemanager/maintenance/armmaintenance/CHANGELOG.md @@ -1,5 +1,17 @@ # Release History +## 1.1.0-beta.3 (2023-01-17) +### Breaking Changes + +- Type of `Operation.Properties` has been changed from `interface{}` to `any` + +### Features Added + +- New struct `ConfigurationOverrides` +- New struct `OverrideProperties` +- New field `Overrides` in struct `ConfigurationProperties` + + ## 1.1.0-beta.2 (2023-01-27) ### Features Added diff --git a/sdk/resourcemanager/maintenance/armmaintenance/applyupdateforresourcegroup_client.go b/sdk/resourcemanager/maintenance/armmaintenance/applyupdateforresourcegroup_client.go index 7fe77c3b4806..b150fd292030 100644 --- a/sdk/resourcemanager/maintenance/armmaintenance/applyupdateforresourcegroup_client.go +++ b/sdk/resourcemanager/maintenance/armmaintenance/applyupdateforresourcegroup_client.go @@ -32,10 +32,10 @@ type ApplyUpdateForResourceGroupClient struct { } // NewApplyUpdateForResourceGroupClient creates a new instance of ApplyUpdateForResourceGroupClient with the specified values. -// subscriptionID - Subscription credentials that uniquely identify a 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 credentials that uniquely identify a 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 NewApplyUpdateForResourceGroupClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ApplyUpdateForResourceGroupClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,10 +57,11 @@ func NewApplyUpdateForResourceGroupClient(subscriptionID string, credential azco } // NewListPager - Get Configuration records within a subscription and resource group -// Generated from API version 2022-07-01-preview -// resourceGroupName - Resource Group Name -// options - ApplyUpdateForResourceGroupClientListOptions contains the optional parameters for the ApplyUpdateForResourceGroupClient.List -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - Resource Group Name +// - options - ApplyUpdateForResourceGroupClientListOptions contains the optional parameters for the ApplyUpdateForResourceGroupClient.NewListPager +// method. func (client *ApplyUpdateForResourceGroupClient) NewListPager(resourceGroupName string, options *ApplyUpdateForResourceGroupClientListOptions) *runtime.Pager[ApplyUpdateForResourceGroupClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ApplyUpdateForResourceGroupClientListResponse]{ More: func(page ApplyUpdateForResourceGroupClientListResponse) bool { @@ -99,7 +100,7 @@ func (client *ApplyUpdateForResourceGroupClient) listCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/maintenance/armmaintenance/applyupdateforresourcegroup_client_example_test.go b/sdk/resourcemanager/maintenance/armmaintenance/applyupdateforresourcegroup_client_example_test.go deleted file mode 100644 index d249ee86a85f..000000000000 --- a/sdk/resourcemanager/maintenance/armmaintenance/applyupdateforresourcegroup_client_example_test.go +++ /dev/null @@ -1,41 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armmaintenance_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/maintenance/armmaintenance" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2022-07-01-preview/examples/ApplyUpdatesResourceGroup_List.json -func ExampleApplyUpdateForResourceGroupClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmaintenance.NewApplyUpdateForResourceGroupClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("examplerg", 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/maintenance/armmaintenance/applyupdates_client.go b/sdk/resourcemanager/maintenance/armmaintenance/applyupdates_client.go index 5e1058d45922..0b00ae5890a2 100644 --- a/sdk/resourcemanager/maintenance/armmaintenance/applyupdates_client.go +++ b/sdk/resourcemanager/maintenance/armmaintenance/applyupdates_client.go @@ -32,10 +32,10 @@ type ApplyUpdatesClient struct { } // NewApplyUpdatesClient creates a new instance of ApplyUpdatesClient with the specified values. -// subscriptionID - Subscription credentials that uniquely identify a 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 credentials that uniquely identify a 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 NewApplyUpdatesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ApplyUpdatesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,13 +58,14 @@ func NewApplyUpdatesClient(subscriptionID string, credential azcore.TokenCredent // CreateOrUpdate - Apply maintenance updates to resource // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview -// resourceGroupName - Resource group name -// providerName - Resource provider name -// resourceType - Resource type -// resourceName - Resource identifier -// options - ApplyUpdatesClientCreateOrUpdateOptions contains the optional parameters for the ApplyUpdatesClient.CreateOrUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - Resource group name +// - providerName - Resource provider name +// - resourceType - Resource type +// - resourceName - Resource identifier +// - options - ApplyUpdatesClientCreateOrUpdateOptions contains the optional parameters for the ApplyUpdatesClient.CreateOrUpdate +// method. func (client *ApplyUpdatesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, providerName string, resourceType string, resourceName string, options *ApplyUpdatesClientCreateOrUpdateOptions) (ApplyUpdatesClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, providerName, resourceType, resourceName, options) if err != nil { @@ -108,7 +109,7 @@ func (client *ApplyUpdatesClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -125,15 +126,16 @@ func (client *ApplyUpdatesClient) createOrUpdateHandleResponse(resp *http.Respon // CreateOrUpdateParent - Apply maintenance updates to resource with parent // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview -// resourceGroupName - Resource group name -// providerName - Resource provider name -// resourceParentType - Resource parent type -// resourceParentName - Resource parent identifier -// resourceType - Resource type -// resourceName - Resource identifier -// options - ApplyUpdatesClientCreateOrUpdateParentOptions contains the optional parameters for the ApplyUpdatesClient.CreateOrUpdateParent -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - Resource group name +// - providerName - Resource provider name +// - resourceParentType - Resource parent type +// - resourceParentName - Resource parent identifier +// - resourceType - Resource type +// - resourceName - Resource identifier +// - options - ApplyUpdatesClientCreateOrUpdateParentOptions contains the optional parameters for the ApplyUpdatesClient.CreateOrUpdateParent +// method. func (client *ApplyUpdatesClient) CreateOrUpdateParent(ctx context.Context, resourceGroupName string, providerName string, resourceParentType string, resourceParentName string, resourceType string, resourceName string, options *ApplyUpdatesClientCreateOrUpdateParentOptions) (ApplyUpdatesClientCreateOrUpdateParentResponse, error) { req, err := client.createOrUpdateParentCreateRequest(ctx, resourceGroupName, providerName, resourceParentType, resourceParentName, resourceType, resourceName, options) if err != nil { @@ -185,7 +187,7 @@ func (client *ApplyUpdatesClient) createOrUpdateParentCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -202,13 +204,14 @@ func (client *ApplyUpdatesClient) createOrUpdateParentHandleResponse(resp *http. // Get - Track maintenance updates to resource // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview -// resourceGroupName - Resource group name -// providerName - Resource provider name -// resourceType - Resource type -// resourceName - Resource identifier -// applyUpdateName - applyUpdate Id -// options - ApplyUpdatesClientGetOptions contains the optional parameters for the ApplyUpdatesClient.Get method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - Resource group name +// - providerName - Resource provider name +// - resourceType - Resource type +// - resourceName - Resource identifier +// - applyUpdateName - applyUpdate Id +// - options - ApplyUpdatesClientGetOptions contains the optional parameters for the ApplyUpdatesClient.Get method. func (client *ApplyUpdatesClient) Get(ctx context.Context, resourceGroupName string, providerName string, resourceType string, resourceName string, applyUpdateName string, options *ApplyUpdatesClientGetOptions) (ApplyUpdatesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, providerName, resourceType, resourceName, applyUpdateName, options) if err != nil { @@ -256,7 +259,7 @@ func (client *ApplyUpdatesClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -271,17 +274,18 @@ func (client *ApplyUpdatesClient) getHandleResponse(resp *http.Response) (ApplyU return result, nil } -// GetParent - Track maintenance updates to resource with parent +// GetParent - Track apply maintenance updates to resource with parent // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview -// resourceGroupName - Resource group name -// resourceParentType - Resource parent type -// resourceParentName - Resource parent identifier -// providerName - Resource provider name -// resourceType - Resource type -// resourceName - Resource identifier -// applyUpdateName - applyUpdate Id -// options - ApplyUpdatesClientGetParentOptions contains the optional parameters for the ApplyUpdatesClient.GetParent method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - Resource group name +// - resourceParentType - Resource parent type +// - resourceParentName - Resource parent identifier +// - providerName - Resource provider name +// - resourceType - Resource type +// - resourceName - Resource identifier +// - applyUpdateName - applyUpdate Id +// - options - ApplyUpdatesClientGetParentOptions contains the optional parameters for the ApplyUpdatesClient.GetParent method. func (client *ApplyUpdatesClient) GetParent(ctx context.Context, resourceGroupName string, resourceParentType string, resourceParentName string, providerName string, resourceType string, resourceName string, applyUpdateName string, options *ApplyUpdatesClientGetParentOptions) (ApplyUpdatesClientGetParentResponse, error) { req, err := client.getParentCreateRequest(ctx, resourceGroupName, resourceParentType, resourceParentName, providerName, resourceType, resourceName, applyUpdateName, options) if err != nil { @@ -337,7 +341,7 @@ func (client *ApplyUpdatesClient) getParentCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -353,8 +357,9 @@ func (client *ApplyUpdatesClient) getParentHandleResponse(resp *http.Response) ( } // NewListPager - Get Configuration records within a subscription -// Generated from API version 2022-07-01-preview -// options - ApplyUpdatesClientListOptions contains the optional parameters for the ApplyUpdatesClient.List method. +// +// Generated from API version 2022-11-01-preview +// - options - ApplyUpdatesClientListOptions contains the optional parameters for the ApplyUpdatesClient.NewListPager method. func (client *ApplyUpdatesClient) NewListPager(options *ApplyUpdatesClientListOptions) *runtime.Pager[ApplyUpdatesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ApplyUpdatesClientListResponse]{ More: func(page ApplyUpdatesClientListResponse) bool { @@ -389,7 +394,7 @@ func (client *ApplyUpdatesClient) listCreateRequest(ctx context.Context, options return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/maintenance/armmaintenance/applyupdates_client_example_test.go b/sdk/resourcemanager/maintenance/armmaintenance/applyupdates_client_example_test.go deleted file mode 100644 index 1b28573a5375..000000000000 --- a/sdk/resourcemanager/maintenance/armmaintenance/applyupdates_client_example_test.go +++ /dev/null @@ -1,117 +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 armmaintenance_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/maintenance/armmaintenance" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2022-07-01-preview/examples/ApplyUpdates_GetParent.json -func ExampleApplyUpdatesClient_GetParent() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmaintenance.NewApplyUpdatesClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetParent(ctx, "examplerg", "virtualMachineScaleSets", "smdtest1", "Microsoft.Compute", "virtualMachines", "smdvm1", "e9b9685d-78e4-44c4-a81c-64a14f9b87b6", 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/maintenance/resource-manager/Microsoft.Maintenance/preview/2022-07-01-preview/examples/ApplyUpdates_Get.json -func ExampleApplyUpdatesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmaintenance.NewApplyUpdatesClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "examplerg", "Microsoft.Compute", "virtualMachineScaleSets", "smdtest1", "e9b9685d-78e4-44c4-a81c-64a14f9b87b6", 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/maintenance/resource-manager/Microsoft.Maintenance/preview/2022-07-01-preview/examples/ApplyUpdates_CreateOrUpdateParent.json -func ExampleApplyUpdatesClient_CreateOrUpdateParent() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmaintenance.NewApplyUpdatesClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdateParent(ctx, "examplerg", "Microsoft.Compute", "virtualMachineScaleSets", "smdtest1", "virtualMachines", "smdvm1", 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/maintenance/resource-manager/Microsoft.Maintenance/preview/2022-07-01-preview/examples/ApplyUpdates_CreateOrUpdate.json -func ExampleApplyUpdatesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmaintenance.NewApplyUpdatesClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, "examplerg", "Microsoft.Compute", "virtualMachineScaleSets", "smdtest1", 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/maintenance/resource-manager/Microsoft.Maintenance/preview/2022-07-01-preview/examples/ApplyUpdates_List.json -func ExampleApplyUpdatesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmaintenance.NewApplyUpdatesClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", 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/maintenance/armmaintenance/autorest.md b/sdk/resourcemanager/maintenance/armmaintenance/autorest.md index 95f42edf1b29..0a88133c8f4e 100644 --- a/sdk/resourcemanager/maintenance/armmaintenance/autorest.md +++ b/sdk/resourcemanager/maintenance/armmaintenance/autorest.md @@ -5,9 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/0b1c0be5c97dcd5dadea4e7f975a556a78f58d60/specification/maintenance/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/0b1c0be5c97dcd5dadea4e7f975a556a78f58d60/specification/maintenance/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/maintenance/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/maintenance/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.1.0-beta.2 +module-version: 1.1.0-beta.3 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/maintenance/armmaintenance/configurationassignments_client.go b/sdk/resourcemanager/maintenance/armmaintenance/configurationassignments_client.go index 6871b48e560f..65ec5e5795b7 100644 --- a/sdk/resourcemanager/maintenance/armmaintenance/configurationassignments_client.go +++ b/sdk/resourcemanager/maintenance/armmaintenance/configurationassignments_client.go @@ -32,10 +32,10 @@ type ConfigurationAssignmentsClient struct { } // NewConfigurationAssignmentsClient creates a new instance of ConfigurationAssignmentsClient with the specified values. -// subscriptionID - Subscription credentials that uniquely identify a 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 credentials that uniquely identify a 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 NewConfigurationAssignmentsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ConfigurationAssignmentsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,15 +58,16 @@ func NewConfigurationAssignmentsClient(subscriptionID string, credential azcore. // CreateOrUpdate - Register configuration for resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview -// resourceGroupName - Resource group name -// providerName - Resource provider name -// resourceType - Resource type -// resourceName - Resource identifier -// configurationAssignmentName - Configuration assignment name -// configurationAssignment - The configurationAssignment -// options - ConfigurationAssignmentsClientCreateOrUpdateOptions contains the optional parameters for the ConfigurationAssignmentsClient.CreateOrUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - Resource group name +// - providerName - Resource provider name +// - resourceType - Resource type +// - resourceName - Resource identifier +// - configurationAssignmentName - Configuration assignment name +// - configurationAssignment - The configurationAssignment +// - options - ConfigurationAssignmentsClientCreateOrUpdateOptions contains the optional parameters for the ConfigurationAssignmentsClient.CreateOrUpdate +// method. func (client *ConfigurationAssignmentsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, providerName string, resourceType string, resourceName string, configurationAssignmentName string, configurationAssignment ConfigurationAssignment, options *ConfigurationAssignmentsClientCreateOrUpdateOptions) (ConfigurationAssignmentsClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, providerName, resourceType, resourceName, configurationAssignmentName, configurationAssignment, options) if err != nil { @@ -114,7 +115,7 @@ func (client *ConfigurationAssignmentsClient) createOrUpdateCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, configurationAssignment) @@ -131,17 +132,18 @@ func (client *ConfigurationAssignmentsClient) createOrUpdateHandleResponse(resp // CreateOrUpdateParent - Register configuration for resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview -// resourceGroupName - Resource group name -// providerName - Resource provider name -// resourceParentType - Resource parent type -// resourceParentName - Resource parent identifier -// resourceType - Resource type -// resourceName - Resource identifier -// configurationAssignmentName - Configuration assignment name -// configurationAssignment - The configurationAssignment -// options - ConfigurationAssignmentsClientCreateOrUpdateParentOptions contains the optional parameters for the ConfigurationAssignmentsClient.CreateOrUpdateParent -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - Resource group name +// - providerName - Resource provider name +// - resourceParentType - Resource parent type +// - resourceParentName - Resource parent identifier +// - resourceType - Resource type +// - resourceName - Resource identifier +// - configurationAssignmentName - Configuration assignment name +// - configurationAssignment - The configurationAssignment +// - options - ConfigurationAssignmentsClientCreateOrUpdateParentOptions contains the optional parameters for the ConfigurationAssignmentsClient.CreateOrUpdateParent +// method. func (client *ConfigurationAssignmentsClient) CreateOrUpdateParent(ctx context.Context, resourceGroupName string, providerName string, resourceParentType string, resourceParentName string, resourceType string, resourceName string, configurationAssignmentName string, configurationAssignment ConfigurationAssignment, options *ConfigurationAssignmentsClientCreateOrUpdateParentOptions) (ConfigurationAssignmentsClientCreateOrUpdateParentResponse, error) { req, err := client.createOrUpdateParentCreateRequest(ctx, resourceGroupName, providerName, resourceParentType, resourceParentName, resourceType, resourceName, configurationAssignmentName, configurationAssignment, options) if err != nil { @@ -197,7 +199,7 @@ func (client *ConfigurationAssignmentsClient) createOrUpdateParentCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, configurationAssignment) @@ -214,14 +216,15 @@ func (client *ConfigurationAssignmentsClient) createOrUpdateParentHandleResponse // Delete - Unregister configuration for resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview -// resourceGroupName - Resource group name -// providerName - Resource provider name -// resourceType - Resource type -// resourceName - Resource identifier -// configurationAssignmentName - Unique configuration assignment name -// options - ConfigurationAssignmentsClientDeleteOptions contains the optional parameters for the ConfigurationAssignmentsClient.Delete -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - Resource group name +// - providerName - Resource provider name +// - resourceType - Resource type +// - resourceName - Resource identifier +// - configurationAssignmentName - Unique configuration assignment name +// - options - ConfigurationAssignmentsClientDeleteOptions contains the optional parameters for the ConfigurationAssignmentsClient.Delete +// method. func (client *ConfigurationAssignmentsClient) Delete(ctx context.Context, resourceGroupName string, providerName string, resourceType string, resourceName string, configurationAssignmentName string, options *ConfigurationAssignmentsClientDeleteOptions) (ConfigurationAssignmentsClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, providerName, resourceType, resourceName, configurationAssignmentName, options) if err != nil { @@ -269,7 +272,7 @@ func (client *ConfigurationAssignmentsClient) deleteCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -286,16 +289,17 @@ func (client *ConfigurationAssignmentsClient) deleteHandleResponse(resp *http.Re // DeleteParent - Unregister configuration for resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview -// resourceGroupName - Resource group name -// providerName - Resource provider name -// resourceParentType - Resource parent type -// resourceParentName - Resource parent identifier -// resourceType - Resource type -// resourceName - Resource identifier -// configurationAssignmentName - Unique configuration assignment name -// options - ConfigurationAssignmentsClientDeleteParentOptions contains the optional parameters for the ConfigurationAssignmentsClient.DeleteParent -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - Resource group name +// - providerName - Resource provider name +// - resourceParentType - Resource parent type +// - resourceParentName - Resource parent identifier +// - resourceType - Resource type +// - resourceName - Resource identifier +// - configurationAssignmentName - Unique configuration assignment name +// - options - ConfigurationAssignmentsClientDeleteParentOptions contains the optional parameters for the ConfigurationAssignmentsClient.DeleteParent +// method. func (client *ConfigurationAssignmentsClient) DeleteParent(ctx context.Context, resourceGroupName string, providerName string, resourceParentType string, resourceParentName string, resourceType string, resourceName string, configurationAssignmentName string, options *ConfigurationAssignmentsClientDeleteParentOptions) (ConfigurationAssignmentsClientDeleteParentResponse, error) { req, err := client.deleteParentCreateRequest(ctx, resourceGroupName, providerName, resourceParentType, resourceParentName, resourceType, resourceName, configurationAssignmentName, options) if err != nil { @@ -351,7 +355,7 @@ func (client *ConfigurationAssignmentsClient) deleteParentCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -368,14 +372,15 @@ func (client *ConfigurationAssignmentsClient) deleteParentHandleResponse(resp *h // Get - Get configuration for resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview -// resourceGroupName - Resource group name -// providerName - Resource provider name -// resourceType - Resource type -// resourceName - Resource identifier -// configurationAssignmentName - Configuration assignment name -// options - ConfigurationAssignmentsClientGetOptions contains the optional parameters for the ConfigurationAssignmentsClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - Resource group name +// - providerName - Resource provider name +// - resourceType - Resource type +// - resourceName - Resource identifier +// - configurationAssignmentName - Configuration assignment name +// - options - ConfigurationAssignmentsClientGetOptions contains the optional parameters for the ConfigurationAssignmentsClient.Get +// method. func (client *ConfigurationAssignmentsClient) Get(ctx context.Context, resourceGroupName string, providerName string, resourceType string, resourceName string, configurationAssignmentName string, options *ConfigurationAssignmentsClientGetOptions) (ConfigurationAssignmentsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, providerName, resourceType, resourceName, configurationAssignmentName, options) if err != nil { @@ -423,7 +428,7 @@ func (client *ConfigurationAssignmentsClient) getCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -440,16 +445,17 @@ func (client *ConfigurationAssignmentsClient) getHandleResponse(resp *http.Respo // GetParent - Get configuration for resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview -// resourceGroupName - Resource group name -// providerName - Resource provider name -// resourceParentType - Resource parent type -// resourceParentName - Resource parent identifier -// resourceType - Resource type -// resourceName - Resource identifier -// configurationAssignmentName - Configuration assignment name -// options - ConfigurationAssignmentsClientGetParentOptions contains the optional parameters for the ConfigurationAssignmentsClient.GetParent -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - Resource group name +// - providerName - Resource provider name +// - resourceParentType - Resource parent type +// - resourceParentName - Resource parent identifier +// - resourceType - Resource type +// - resourceName - Resource identifier +// - configurationAssignmentName - Configuration assignment name +// - options - ConfigurationAssignmentsClientGetParentOptions contains the optional parameters for the ConfigurationAssignmentsClient.GetParent +// method. func (client *ConfigurationAssignmentsClient) GetParent(ctx context.Context, resourceGroupName string, providerName string, resourceParentType string, resourceParentName string, resourceType string, resourceName string, configurationAssignmentName string, options *ConfigurationAssignmentsClientGetParentOptions) (ConfigurationAssignmentsClientGetParentResponse, error) { req, err := client.getParentCreateRequest(ctx, resourceGroupName, providerName, resourceParentType, resourceParentName, resourceType, resourceName, configurationAssignmentName, options) if err != nil { @@ -505,7 +511,7 @@ func (client *ConfigurationAssignmentsClient) getParentCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -521,13 +527,14 @@ func (client *ConfigurationAssignmentsClient) getParentHandleResponse(resp *http } // NewListPager - List configurationAssignments for resource. -// Generated from API version 2022-07-01-preview -// resourceGroupName - Resource group name -// providerName - Resource provider name -// resourceType - Resource type -// resourceName - Resource identifier -// options - ConfigurationAssignmentsClientListOptions contains the optional parameters for the ConfigurationAssignmentsClient.List -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - Resource group name +// - providerName - Resource provider name +// - resourceType - Resource type +// - resourceName - Resource identifier +// - options - ConfigurationAssignmentsClientListOptions contains the optional parameters for the ConfigurationAssignmentsClient.NewListPager +// method. func (client *ConfigurationAssignmentsClient) NewListPager(resourceGroupName string, providerName string, resourceType string, resourceName string, options *ConfigurationAssignmentsClientListOptions) *runtime.Pager[ConfigurationAssignmentsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ConfigurationAssignmentsClientListResponse]{ More: func(page ConfigurationAssignmentsClientListResponse) bool { @@ -578,7 +585,7 @@ func (client *ConfigurationAssignmentsClient) listCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -594,15 +601,16 @@ func (client *ConfigurationAssignmentsClient) listHandleResponse(resp *http.Resp } // NewListParentPager - List configurationAssignments for resource. -// Generated from API version 2022-07-01-preview -// resourceGroupName - Resource group name -// providerName - Resource provider name -// resourceParentType - Resource parent type -// resourceParentName - Resource parent identifier -// resourceType - Resource type -// resourceName - Resource identifier -// options - ConfigurationAssignmentsClientListParentOptions contains the optional parameters for the ConfigurationAssignmentsClient.ListParent -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - Resource group name +// - providerName - Resource provider name +// - resourceParentType - Resource parent type +// - resourceParentName - Resource parent identifier +// - resourceType - Resource type +// - resourceName - Resource identifier +// - options - ConfigurationAssignmentsClientListParentOptions contains the optional parameters for the ConfigurationAssignmentsClient.NewListParentPager +// method. func (client *ConfigurationAssignmentsClient) NewListParentPager(resourceGroupName string, providerName string, resourceParentType string, resourceParentName string, resourceType string, resourceName string, options *ConfigurationAssignmentsClientListParentOptions) *runtime.Pager[ConfigurationAssignmentsClientListParentResponse] { return runtime.NewPager(runtime.PagingHandler[ConfigurationAssignmentsClientListParentResponse]{ More: func(page ConfigurationAssignmentsClientListParentResponse) bool { @@ -661,7 +669,7 @@ func (client *ConfigurationAssignmentsClient) listParentCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/maintenance/armmaintenance/configurationassignments_client_example_test.go b/sdk/resourcemanager/maintenance/armmaintenance/configurationassignments_client_example_test.go deleted file mode 100644 index e38ef5d462d6..000000000000 --- a/sdk/resourcemanager/maintenance/armmaintenance/configurationassignments_client_example_test.go +++ /dev/null @@ -1,188 +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 armmaintenance_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/maintenance/armmaintenance" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2022-07-01-preview/examples/ConfigurationAssignments_GetParent.json -func ExampleConfigurationAssignmentsClient_GetParent() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmaintenance.NewConfigurationAssignmentsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetParent(ctx, "examplerg", "Microsoft.Compute", "virtualMachineScaleSets", "smdtest1", "virtualMachines", "smdvm1", "workervmPolicy", 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/maintenance/resource-manager/Microsoft.Maintenance/preview/2022-07-01-preview/examples/ConfigurationAssignments_CreateOrUpdateParent.json -func ExampleConfigurationAssignmentsClient_CreateOrUpdateParent() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmaintenance.NewConfigurationAssignmentsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdateParent(ctx, "examplerg", "Microsoft.Compute", "virtualMachineScaleSets", "smdtest1", "virtualMachines", "smdvm1", "workervmPolicy", armmaintenance.ConfigurationAssignment{ - Properties: &armmaintenance.ConfigurationAssignmentProperties{ - MaintenanceConfigurationID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Maintenance/maintenanceConfigurations/policy1"), - }, - }, 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/maintenance/resource-manager/Microsoft.Maintenance/preview/2022-07-01-preview/examples/ConfigurationAssignments_DeleteParent.json -func ExampleConfigurationAssignmentsClient_DeleteParent() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmaintenance.NewConfigurationAssignmentsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.DeleteParent(ctx, "examplerg", "Microsoft.Compute", "virtualMachineScaleSets", "smdtest1", "virtualMachines", "smdvm1", "workervmConfiguration", 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/maintenance/resource-manager/Microsoft.Maintenance/preview/2022-07-01-preview/examples/ConfigurationAssignments_Get.json -func ExampleConfigurationAssignmentsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmaintenance.NewConfigurationAssignmentsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "examplerg", "Microsoft.Compute", "virtualMachineScaleSets", "smdtest1", "workervmConfiguration", 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/maintenance/resource-manager/Microsoft.Maintenance/preview/2022-07-01-preview/examples/ConfigurationAssignments_CreateOrUpdate.json -func ExampleConfigurationAssignmentsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmaintenance.NewConfigurationAssignmentsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, "examplerg", "Microsoft.Compute", "virtualMachineScaleSets", "smdtest1", "workervmConfiguration", armmaintenance.ConfigurationAssignment{ - Properties: &armmaintenance.ConfigurationAssignmentProperties{ - MaintenanceConfigurationID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Maintenance/maintenanceConfigurations/configuration1"), - }, - }, 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/maintenance/resource-manager/Microsoft.Maintenance/preview/2022-07-01-preview/examples/ConfigurationAssignments_Delete.json -func ExampleConfigurationAssignmentsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmaintenance.NewConfigurationAssignmentsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Delete(ctx, "examplerg", "Microsoft.Compute", "virtualMachineScaleSets", "smdtest1", "workervmConfiguration", 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/maintenance/resource-manager/Microsoft.Maintenance/preview/2022-07-01-preview/examples/ConfigurationAssignments_ListParent.json -func ExampleConfigurationAssignmentsClient_NewListParentPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmaintenance.NewConfigurationAssignmentsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListParentPager("examplerg", "Microsoft.Compute", "virtualMachineScaleSets", "smdtest1", "virtualMachines", "smdtestvm1", 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/maintenance/resource-manager/Microsoft.Maintenance/preview/2022-07-01-preview/examples/ConfigurationAssignments_List.json -func ExampleConfigurationAssignmentsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmaintenance.NewConfigurationAssignmentsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("examplerg", "Microsoft.Compute", "virtualMachineScaleSets", "smdtest1", 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/maintenance/armmaintenance/configurationassignmentswithinsubscription_client.go b/sdk/resourcemanager/maintenance/armmaintenance/configurationassignmentswithinsubscription_client.go index 5240bef01046..e093854d7fd4 100644 --- a/sdk/resourcemanager/maintenance/armmaintenance/configurationassignmentswithinsubscription_client.go +++ b/sdk/resourcemanager/maintenance/armmaintenance/configurationassignmentswithinsubscription_client.go @@ -32,10 +32,10 @@ type ConfigurationAssignmentsWithinSubscriptionClient struct { } // NewConfigurationAssignmentsWithinSubscriptionClient creates a new instance of ConfigurationAssignmentsWithinSubscriptionClient with the specified values. -// subscriptionID - Subscription credentials that uniquely identify a 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 credentials that uniquely identify a 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 NewConfigurationAssignmentsWithinSubscriptionClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ConfigurationAssignmentsWithinSubscriptionClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,9 +57,10 @@ func NewConfigurationAssignmentsWithinSubscriptionClient(subscriptionID string, } // NewListPager - Get configuration assignment within a subscription -// Generated from API version 2022-07-01-preview -// options - ConfigurationAssignmentsWithinSubscriptionClientListOptions contains the optional parameters for the ConfigurationAssignmentsWithinSubscriptionClient.List -// method. +// +// Generated from API version 2022-11-01-preview +// - options - ConfigurationAssignmentsWithinSubscriptionClientListOptions contains the optional parameters for the ConfigurationAssignmentsWithinSubscriptionClient.NewListPager +// method. func (client *ConfigurationAssignmentsWithinSubscriptionClient) NewListPager(options *ConfigurationAssignmentsWithinSubscriptionClientListOptions) *runtime.Pager[ConfigurationAssignmentsWithinSubscriptionClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ConfigurationAssignmentsWithinSubscriptionClientListResponse]{ More: func(page ConfigurationAssignmentsWithinSubscriptionClientListResponse) bool { @@ -94,7 +95,7 @@ func (client *ConfigurationAssignmentsWithinSubscriptionClient) listCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/maintenance/armmaintenance/configurationassignmentswithinsubscription_client_example_test.go b/sdk/resourcemanager/maintenance/armmaintenance/configurationassignmentswithinsubscription_client_example_test.go deleted file mode 100644 index a177c141fd37..000000000000 --- a/sdk/resourcemanager/maintenance/armmaintenance/configurationassignmentswithinsubscription_client_example_test.go +++ /dev/null @@ -1,41 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armmaintenance_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/maintenance/armmaintenance" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2022-07-01-preview/examples/ConfigurationAssignmentsResultWithinSubscription_List.json -func ExampleConfigurationAssignmentsWithinSubscriptionClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmaintenance.NewConfigurationAssignmentsWithinSubscriptionClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", 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/maintenance/armmaintenance/configurations_client.go b/sdk/resourcemanager/maintenance/armmaintenance/configurations_client.go index d343c57e0a3d..fda67d3a6e76 100644 --- a/sdk/resourcemanager/maintenance/armmaintenance/configurations_client.go +++ b/sdk/resourcemanager/maintenance/armmaintenance/configurations_client.go @@ -32,10 +32,10 @@ type ConfigurationsClient struct { } // NewConfigurationsClient creates a new instance of ConfigurationsClient with the specified values. -// subscriptionID - Subscription credentials that uniquely identify a 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 credentials that uniquely identify a 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 NewConfigurationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ConfigurationsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,12 +58,13 @@ func NewConfigurationsClient(subscriptionID string, credential azcore.TokenCrede // CreateOrUpdate - Create or Update configuration record // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview -// resourceGroupName - Resource Group Name -// resourceName - Maintenance Configuration Name -// configuration - The configuration -// options - ConfigurationsClientCreateOrUpdateOptions contains the optional parameters for the ConfigurationsClient.CreateOrUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - Resource Group Name +// - resourceName - Maintenance Configuration Name +// - configuration - The configuration +// - options - ConfigurationsClientCreateOrUpdateOptions contains the optional parameters for the ConfigurationsClient.CreateOrUpdate +// method. func (client *ConfigurationsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, configuration Configuration, options *ConfigurationsClientCreateOrUpdateOptions) (ConfigurationsClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, resourceName, configuration, options) if err != nil { @@ -99,7 +100,7 @@ func (client *ConfigurationsClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, configuration) @@ -116,10 +117,11 @@ func (client *ConfigurationsClient) createOrUpdateHandleResponse(resp *http.Resp // Delete - Delete Configuration record // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview -// resourceGroupName - Resource Group Name -// resourceName - Maintenance Configuration Name -// options - ConfigurationsClientDeleteOptions contains the optional parameters for the ConfigurationsClient.Delete method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - Resource Group Name +// - resourceName - Maintenance Configuration Name +// - options - ConfigurationsClientDeleteOptions contains the optional parameters for the ConfigurationsClient.Delete method. func (client *ConfigurationsClient) Delete(ctx context.Context, resourceGroupName string, resourceName string, options *ConfigurationsClientDeleteOptions) (ConfigurationsClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, resourceName, options) if err != nil { @@ -155,7 +157,7 @@ func (client *ConfigurationsClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -172,10 +174,11 @@ func (client *ConfigurationsClient) deleteHandleResponse(resp *http.Response) (C // Get - Get Configuration record // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview -// resourceGroupName - Resource Group Name -// resourceName - Maintenance Configuration Name -// options - ConfigurationsClientGetOptions contains the optional parameters for the ConfigurationsClient.Get method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - Resource Group Name +// - resourceName - Maintenance Configuration Name +// - options - ConfigurationsClientGetOptions contains the optional parameters for the ConfigurationsClient.Get method. func (client *ConfigurationsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, options *ConfigurationsClientGetOptions) (ConfigurationsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, resourceName, options) if err != nil { @@ -211,7 +214,7 @@ func (client *ConfigurationsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -227,8 +230,9 @@ func (client *ConfigurationsClient) getHandleResponse(resp *http.Response) (Conf } // NewListPager - Get Configuration records within a subscription -// Generated from API version 2022-07-01-preview -// options - ConfigurationsClientListOptions contains the optional parameters for the ConfigurationsClient.List method. +// +// Generated from API version 2022-11-01-preview +// - options - ConfigurationsClientListOptions contains the optional parameters for the ConfigurationsClient.NewListPager method. func (client *ConfigurationsClient) NewListPager(options *ConfigurationsClientListOptions) *runtime.Pager[ConfigurationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ConfigurationsClientListResponse]{ More: func(page ConfigurationsClientListResponse) bool { @@ -263,7 +267,7 @@ func (client *ConfigurationsClient) listCreateRequest(ctx context.Context, optio return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -280,11 +284,12 @@ func (client *ConfigurationsClient) listHandleResponse(resp *http.Response) (Con // Update - Patch configuration record // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview -// resourceGroupName - Resource Group Name -// resourceName - Maintenance Configuration Name -// configuration - The configuration -// options - ConfigurationsClientUpdateOptions contains the optional parameters for the ConfigurationsClient.Update method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - Resource Group Name +// - resourceName - Maintenance Configuration Name +// - configuration - The configuration +// - options - ConfigurationsClientUpdateOptions contains the optional parameters for the ConfigurationsClient.Update method. func (client *ConfigurationsClient) Update(ctx context.Context, resourceGroupName string, resourceName string, configuration Configuration, options *ConfigurationsClientUpdateOptions) (ConfigurationsClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, resourceName, configuration, options) if err != nil { @@ -320,7 +325,7 @@ func (client *ConfigurationsClient) updateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, configuration) diff --git a/sdk/resourcemanager/maintenance/armmaintenance/configurations_client_example_test.go b/sdk/resourcemanager/maintenance/armmaintenance/configurations_client_example_test.go deleted file mode 100644 index 985094eb5fce..000000000000 --- a/sdk/resourcemanager/maintenance/armmaintenance/configurations_client_example_test.go +++ /dev/null @@ -1,184 +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 armmaintenance_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/maintenance/armmaintenance" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2022-07-01-preview/examples/MaintenanceConfigurations_GetForResource.json -func ExampleConfigurationsClient_Get_maintenanceConfigurationsGetForResource() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmaintenance.NewConfigurationsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "examplerg", "configuration1", 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/maintenance/resource-manager/Microsoft.Maintenance/preview/2022-07-01-preview/examples/MaintenanceConfigurations_GetForResource_GuestOSPatchLinux.json -func ExampleConfigurationsClient_Get_maintenanceConfigurationsGetForResourceGuestOsPatchLinux() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmaintenance.NewConfigurationsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "examplerg", "configuration1", 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/maintenance/resource-manager/Microsoft.Maintenance/preview/2022-07-01-preview/examples/MaintenanceConfigurations_GetForResource_GuestOSPatchWindows.json -func ExampleConfigurationsClient_Get_maintenanceConfigurationsGetForResourceGuestOsPatchWindows() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmaintenance.NewConfigurationsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "examplerg", "configuration1", 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/maintenance/resource-manager/Microsoft.Maintenance/preview/2022-07-01-preview/examples/MaintenanceConfigurations_CreateOrUpdateForResource.json -func ExampleConfigurationsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmaintenance.NewConfigurationsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, "examplerg", "configuration1", armmaintenance.Configuration{ - Location: to.Ptr("westus2"), - Properties: &armmaintenance.ConfigurationProperties{ - MaintenanceScope: to.Ptr(armmaintenance.MaintenanceScopeOSImage), - MaintenanceWindow: &armmaintenance.Window{ - Duration: to.Ptr("05:00"), - ExpirationDateTime: to.Ptr("9999-12-31 00:00"), - RecurEvery: to.Ptr("Day"), - StartDateTime: to.Ptr("2020-04-30 08:00"), - TimeZone: to.Ptr("Pacific Standard Time"), - }, - Namespace: to.Ptr("Microsoft.Maintenance"), - Visibility: to.Ptr(armmaintenance.VisibilityCustom), - }, - }, 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/maintenance/resource-manager/Microsoft.Maintenance/preview/2022-07-01-preview/examples/MaintenanceConfigurations_DeleteForResource.json -func ExampleConfigurationsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmaintenance.NewConfigurationsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Delete(ctx, "examplerg", "example1", 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/maintenance/resource-manager/Microsoft.Maintenance/preview/2022-07-01-preview/examples/MaintenanceConfigurations_UpdateForResource.json -func ExampleConfigurationsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmaintenance.NewConfigurationsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, "examplerg", "configuration1", armmaintenance.Configuration{ - Location: to.Ptr("westus2"), - Properties: &armmaintenance.ConfigurationProperties{ - MaintenanceScope: to.Ptr(armmaintenance.MaintenanceScopeOSImage), - MaintenanceWindow: &armmaintenance.Window{ - Duration: to.Ptr("05:00"), - ExpirationDateTime: to.Ptr("9999-12-31 00:00"), - RecurEvery: to.Ptr("Month Third Sunday"), - StartDateTime: to.Ptr("2020-04-30 08:00"), - TimeZone: to.Ptr("Pacific Standard Time"), - }, - Namespace: to.Ptr("Microsoft.Maintenance"), - Visibility: to.Ptr(armmaintenance.VisibilityCustom), - }, - }, 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/maintenance/resource-manager/Microsoft.Maintenance/preview/2022-07-01-preview/examples/MaintenanceConfigurations_List.json -func ExampleConfigurationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmaintenance.NewConfigurationsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", 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/maintenance/armmaintenance/configurationsforresourcegroup_client.go b/sdk/resourcemanager/maintenance/armmaintenance/configurationsforresourcegroup_client.go index b3b7c8b6bec5..0a406f191277 100644 --- a/sdk/resourcemanager/maintenance/armmaintenance/configurationsforresourcegroup_client.go +++ b/sdk/resourcemanager/maintenance/armmaintenance/configurationsforresourcegroup_client.go @@ -32,10 +32,10 @@ type ConfigurationsForResourceGroupClient struct { } // NewConfigurationsForResourceGroupClient creates a new instance of ConfigurationsForResourceGroupClient with the specified values. -// subscriptionID - Subscription credentials that uniquely identify a 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 credentials that uniquely identify a 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 NewConfigurationsForResourceGroupClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ConfigurationsForResourceGroupClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,10 +57,11 @@ func NewConfigurationsForResourceGroupClient(subscriptionID string, credential a } // NewListPager - Get Configuration records within a subscription and resource group -// Generated from API version 2022-07-01-preview -// resourceGroupName - Resource Group Name -// options - ConfigurationsForResourceGroupClientListOptions contains the optional parameters for the ConfigurationsForResourceGroupClient.List -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - Resource Group Name +// - options - ConfigurationsForResourceGroupClientListOptions contains the optional parameters for the ConfigurationsForResourceGroupClient.NewListPager +// method. func (client *ConfigurationsForResourceGroupClient) NewListPager(resourceGroupName string, options *ConfigurationsForResourceGroupClientListOptions) *runtime.Pager[ConfigurationsForResourceGroupClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ConfigurationsForResourceGroupClientListResponse]{ More: func(page ConfigurationsForResourceGroupClientListResponse) bool { @@ -99,7 +100,7 @@ func (client *ConfigurationsForResourceGroupClient) listCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/maintenance/armmaintenance/configurationsforresourcegroup_client_example_test.go b/sdk/resourcemanager/maintenance/armmaintenance/configurationsforresourcegroup_client_example_test.go deleted file mode 100644 index ab6bcafc974d..000000000000 --- a/sdk/resourcemanager/maintenance/armmaintenance/configurationsforresourcegroup_client_example_test.go +++ /dev/null @@ -1,41 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armmaintenance_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/maintenance/armmaintenance" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2022-07-01-preview/examples/MaintenanceConfigurationsResourceGroup_List.json -func ExampleConfigurationsForResourceGroupClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmaintenance.NewConfigurationsForResourceGroupClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("examplerg", 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/maintenance/armmaintenance/constants.go b/sdk/resourcemanager/maintenance/armmaintenance/constants.go index b49a34505fc0..a9c0ed8fd392 100644 --- a/sdk/resourcemanager/maintenance/armmaintenance/constants.go +++ b/sdk/resourcemanager/maintenance/armmaintenance/constants.go @@ -11,7 +11,7 @@ package armmaintenance const ( moduleName = "armmaintenance" - moduleVersion = "v1.1.0-beta.2" + moduleVersion = "v1.1.0-beta.3" ) // CreatedByType - The type of identity that created the resource. @@ -93,8 +93,7 @@ func PossibleMaintenanceScopeValues() []MaintenanceScope { } // RebootOptions - Possible reboot preference as defined by the user based on which it would be decided to reboot the machine -// or not after the patch operation is completed. This property only applies to Guest -// (InGuestPatch) scope. +// or not after the patch operation is completed. type RebootOptions string const ( @@ -112,7 +111,7 @@ func PossibleRebootOptionsValues() []RebootOptions { } } -// TaskScope - [Not supported] Global Task execute once when schedule trigger. Resource task execute for each VM. +// TaskScope - Global Task execute once when schedule trigger. Resource task execute for each VM. type TaskScope string const ( diff --git a/sdk/resourcemanager/maintenance/armmaintenance/go.mod b/sdk/resourcemanager/maintenance/armmaintenance/go.mod index 210290426671..1a82daa235d1 100644 --- a/sdk/resourcemanager/maintenance/armmaintenance/go.mod +++ b/sdk/resourcemanager/maintenance/armmaintenance/go.mod @@ -2,20 +2,12 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/maintenance/armmain 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.2.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.7.0 // indirect - github.com/golang-jwt/jwt/v4 v4.4.2 // 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/maintenance/armmaintenance/go.sum b/sdk/resourcemanager/maintenance/armmaintenance/go.sum index 8c0539b73123..3afb578030a5 100644 --- a/sdk/resourcemanager/maintenance/armmaintenance/go.sum +++ b/sdk/resourcemanager/maintenance/armmaintenance/go.sum @@ -1,30 +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.2.0 h1:t/W5MYAuQy81cvM8VUNfRLzhtKpXhVUAN7Cd7KVbTyc= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.0/go.mod h1:NBanQUfSWiWn3QEpWDTCU0IjBECKOYvl2R8xdRtMtiM= 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.7.0 h1:VgSJlZH5u0k2qxSpqyghcFQKmvYckj46uymKK5XzkBM= -github.com/AzureAD/microsoft-authentication-library-for-go v0.7.0/go.mod h1:BDJ5qMFKx9DugEg3+uQSDCdbYPr5s9vBTrL9P8TpqOU= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= -github.com/golang-jwt/jwt/v4 v4.4.2 h1:rcc4lwaZgFMCZ5jxF9ABolDcIHdBytAFgqFPbSJQAYs= -github.com/golang-jwt/jwt/v4 v4.4.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= -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/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-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/maintenance/armmaintenance/models.go b/sdk/resourcemanager/maintenance/armmaintenance/models.go index 80303aaa1b1b..f57ff338eb79 100644 --- a/sdk/resourcemanager/maintenance/armmaintenance/models.go +++ b/sdk/resourcemanager/maintenance/armmaintenance/models.go @@ -29,7 +29,7 @@ type ApplyUpdate struct { Type *string `json:"type,omitempty" azure:"ro"` } -// ApplyUpdateForResourceGroupClientListOptions contains the optional parameters for the ApplyUpdateForResourceGroupClient.List +// ApplyUpdateForResourceGroupClientListOptions contains the optional parameters for the ApplyUpdateForResourceGroupClient.NewListPager // method. type ApplyUpdateForResourceGroupClientListOptions struct { // placeholder for future optional parameters @@ -68,7 +68,7 @@ type ApplyUpdatesClientGetParentOptions struct { // placeholder for future optional parameters } -// ApplyUpdatesClientListOptions contains the optional parameters for the ApplyUpdatesClient.List method. +// ApplyUpdatesClientListOptions contains the optional parameters for the ApplyUpdatesClient.NewListPager method. type ApplyUpdatesClientListOptions struct { // placeholder for future optional parameters } @@ -162,30 +162,36 @@ type ConfigurationAssignmentsClientGetParentOptions struct { // placeholder for future optional parameters } -// ConfigurationAssignmentsClientListOptions contains the optional parameters for the ConfigurationAssignmentsClient.List +// ConfigurationAssignmentsClientListOptions contains the optional parameters for the ConfigurationAssignmentsClient.NewListPager // method. type ConfigurationAssignmentsClientListOptions struct { // placeholder for future optional parameters } -// ConfigurationAssignmentsClientListParentOptions contains the optional parameters for the ConfigurationAssignmentsClient.ListParent +// ConfigurationAssignmentsClientListParentOptions contains the optional parameters for the ConfigurationAssignmentsClient.NewListParentPager // method. type ConfigurationAssignmentsClientListParentOptions struct { // placeholder for future optional parameters } -// ConfigurationAssignmentsWithinSubscriptionClientListOptions contains the optional parameters for the ConfigurationAssignmentsWithinSubscriptionClient.List +// ConfigurationAssignmentsWithinSubscriptionClientListOptions contains the optional parameters for the ConfigurationAssignmentsWithinSubscriptionClient.NewListPager // method. type ConfigurationAssignmentsWithinSubscriptionClientListOptions struct { // placeholder for future optional parameters } +// ConfigurationOverrides - List of Override Properties for the maintenance Configuration. +type ConfigurationOverrides struct { + // Override Properties for the maintenance Configuration. + Overrides []*OverrideProperties `json:"overrides,omitempty"` +} + // ConfigurationProperties - Properties for maintenance configuration type ConfigurationProperties struct { // Gets or sets extensionProperties of the maintenanceConfiguration ExtensionProperties map[string]*string `json:"extensionProperties,omitempty"` - // The input parameters to be passed to the patch run operation. This property only applies to Guest (InGuestPatch) scope. + // The input parameters to be passed to the patch run operation. InstallPatches *InputPatchConfiguration `json:"installPatches,omitempty"` // Gets or sets maintenanceScope of the configuration @@ -197,6 +203,9 @@ type ConfigurationProperties struct { // Gets or sets namespace of the resource Namespace *string `json:"namespace,omitempty"` + // Override the Maintenance Window for a specific period + Overrides *ConfigurationOverrides `json:"overrides,omitempty"` + // Gets or sets the visibility of the configuration. The default value is 'Custom' Visibility *Visibility `json:"visibility,omitempty"` } @@ -217,7 +226,7 @@ type ConfigurationsClientGetOptions struct { // placeholder for future optional parameters } -// ConfigurationsClientListOptions contains the optional parameters for the ConfigurationsClient.List method. +// ConfigurationsClientListOptions contains the optional parameters for the ConfigurationsClient.NewListPager method. type ConfigurationsClientListOptions struct { // placeholder for future optional parameters } @@ -227,7 +236,7 @@ type ConfigurationsClientUpdateOptions struct { // placeholder for future optional parameters } -// ConfigurationsForResourceGroupClientListOptions contains the optional parameters for the ConfigurationsForResourceGroupClient.List +// ConfigurationsForResourceGroupClientListOptions contains the optional parameters for the ConfigurationsForResourceGroupClient.NewListPager // method. type ConfigurationsForResourceGroupClientListOptions struct { // placeholder for future optional parameters @@ -248,8 +257,7 @@ type ErrorDetails struct { Message *string `json:"message,omitempty"` } -// InputLinuxParameters - Input properties for patching a Linux machine. This property only applies to Guest (InGuestPatch) -// scope. +// InputLinuxParameters - Input properties for patching a Linux machine. type InputLinuxParameters struct { // Classification category of patches to be patched ClassificationsToInclude []*string `json:"classificationsToInclude,omitempty"` @@ -263,25 +271,21 @@ type InputLinuxParameters struct { // InputPatchConfiguration - Input configuration for a patch run type InputPatchConfiguration struct { - // Input parameters specific to patching Linux machine. For Windows machines, do not pass this property. This property only - // applies to Guest (InGuestPatch) scope. + // Input parameters specific to patching Linux machine. For Windows machines, do not pass this property. LinuxParameters *InputLinuxParameters `json:"linuxParameters,omitempty"` // Possible reboot preference as defined by the user based on which it would be decided to reboot the machine or not after - // the patch operation is completed. This property only applies to Guest - // (InGuestPatch) scope. + // the patch operation is completed. RebootSetting *RebootOptions `json:"rebootSetting,omitempty"` - // [Not supported] Tasks information for the Software update configuration. + // Tasks information for the Software update configuration. Tasks *SoftwareUpdateConfigurationTasks `json:"tasks,omitempty"` - // Input parameters specific to patching a Windows machine. For Linux machines, do not pass this property. This property only - // applies to Guest (InGuestPatch) scope. + // Input parameters specific to patching a Windows machine. For Linux machines, do not pass this property. WindowsParameters *InputWindowsParameters `json:"windowsParameters,omitempty"` } -// InputWindowsParameters - Input properties for patching a Windows machine. This property only applies to Guest (InGuestPatch) -// scope. +// InputWindowsParameters - Input properties for patching a Windows machine. type InputWindowsParameters struct { // Classification category of patches to be patched ClassificationsToInclude []*string `json:"classificationsToInclude,omitempty"` @@ -335,7 +339,7 @@ type Operation struct { Origin *string `json:"origin,omitempty"` // Properties of the operation - Properties interface{} `json:"properties,omitempty"` + Properties any `json:"properties,omitempty"` } // OperationInfo - Information about an operation @@ -353,7 +357,7 @@ type OperationInfo struct { Resource *string `json:"resource,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 } @@ -364,13 +368,34 @@ type OperationsListResult struct { Value []*Operation `json:"value,omitempty"` } +// OverrideProperties - Definition of a MaintenanceOverrideProperties +type OverrideProperties struct { + // Effective end date of the maintenance override window in YYYY-MM-DD hh:mm format. The window will be created in the time + // zone provided and adjusted to daylight savings according to that time zone. + // Expiration date must be set to a future date. If not provided, it will be set to the maximum datetime 9999-12-31 23:59:59. + EndDateTime *time.Time `json:"endDateTime,omitempty"` + + // Gets or sets overrideProperties of the maintenanceConfiguration + OverrideProperties map[string]*string `json:"overrideProperties,omitempty"` + + // Effective start date of the maintenance override window in YYYY-MM-DD hh:mm format. The start date can be set to either + // the current date or future date. The window will be created in the time zone + // provided and adjusted to daylight savings according to that time zone. + StartDateTime *time.Time `json:"startDateTime,omitempty"` + + // Name of the timezone. List of timezones can be obtained by executing [System.TimeZoneInfo]::GetSystemTimeZones() in PowerShell. + // Example: Pacific Standard Time, UTC, W. Europe Standard Time, Korea + // Standard Time, Cen. Australia Standard Time. + TimeZone *string `json:"timeZone,omitempty"` +} + // PublicMaintenanceConfigurationsClientGetOptions contains the optional parameters for the PublicMaintenanceConfigurationsClient.Get // method. type PublicMaintenanceConfigurationsClientGetOptions struct { // placeholder for future optional parameters } -// PublicMaintenanceConfigurationsClientListOptions contains the optional parameters for the PublicMaintenanceConfigurationsClient.List +// PublicMaintenanceConfigurationsClientListOptions contains the optional parameters for the PublicMaintenanceConfigurationsClient.NewListPager // method. type PublicMaintenanceConfigurationsClientListOptions struct { // placeholder for future optional parameters @@ -391,12 +416,12 @@ type Resource struct { Type *string `json:"type,omitempty" azure:"ro"` } -// SoftwareUpdateConfigurationTasks - [Not supported] Task properties of the software update configuration. +// SoftwareUpdateConfigurationTasks - Task properties of the software update configuration. type SoftwareUpdateConfigurationTasks struct { - // [Not supported] List of post tasks. e.g. [{'source' :'runbook', 'taskScope': 'Resource', 'parameters': { 'arg1': 'value1'}}] + // List of post tasks. e.g. [{'source' :'runbook', 'taskScope': 'Resource', 'parameters': { 'arg1': 'value1'}}] PostTasks []*TaskProperties `json:"postTasks,omitempty"` - // [Not supported] List of pre tasks. e.g. [{'source' :'runbook', 'taskScope': 'Global', 'parameters': { 'arg1': 'value1'}}] + // List of pre tasks. e.g. [{'source' :'runbook', 'taskScope': 'Global', 'parameters': { 'arg1': 'value1'}}] PreTasks []*TaskProperties `json:"preTasks,omitempty"` } @@ -421,15 +446,15 @@ type SystemData struct { LastModifiedByType *CreatedByType `json:"lastModifiedByType,omitempty"` } -// TaskProperties - [Not supported] Task properties of the software update configuration. +// TaskProperties - Task properties of the software update configuration. type TaskProperties struct { - // [Not supported] Gets or sets the parameters of the task. + // Gets or sets the parameters of the task. Parameters map[string]*string `json:"parameters,omitempty"` - // [Not supported] Gets or sets the name of the runbook. + // Gets or sets the name of the runbook. Source *string `json:"source,omitempty"` - // [Not supported] Global Task execute once when schedule trigger. Resource task execute for each VM. + // Global Task execute once when schedule trigger. Resource task execute for each VM. TaskScope *TaskScope `json:"taskScope,omitempty"` } @@ -460,12 +485,12 @@ type UpdateProperties struct { ResourceID *string `json:"resourceId,omitempty"` } -// UpdatesClientListOptions contains the optional parameters for the UpdatesClient.List method. +// UpdatesClientListOptions contains the optional parameters for the UpdatesClient.NewListPager method. type UpdatesClientListOptions struct { // placeholder for future optional parameters } -// UpdatesClientListParentOptions contains the optional parameters for the UpdatesClient.ListParent method. +// UpdatesClientListParentOptions contains the optional parameters for the UpdatesClient.NewListParentPager method. type UpdatesClientListParentOptions struct { // placeholder for future optional parameters } diff --git a/sdk/resourcemanager/maintenance/armmaintenance/models_serde.go b/sdk/resourcemanager/maintenance/armmaintenance/models_serde.go index 521064c96b69..c312b50731f2 100644 --- a/sdk/resourcemanager/maintenance/armmaintenance/models_serde.go +++ b/sdk/resourcemanager/maintenance/armmaintenance/models_serde.go @@ -18,7 +18,7 @@ import ( // MarshalJSON implements the json.Marshaller interface for type ApplyUpdate. func (a ApplyUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", a.ID) populate(objectMap, "name", a.Name) populate(objectMap, "properties", a.Properties) @@ -61,7 +61,7 @@ func (a *ApplyUpdate) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ApplyUpdateProperties. func (a ApplyUpdateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populateTimeRFC3339(objectMap, "lastUpdateTime", a.LastUpdateTime) populate(objectMap, "resourceId", a.ResourceID) populate(objectMap, "status", a.Status) @@ -96,7 +96,7 @@ func (a *ApplyUpdateProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Configuration. func (c Configuration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", c.ID) populate(objectMap, "location", c.Location) populate(objectMap, "name", c.Name) @@ -147,7 +147,7 @@ func (c *Configuration) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ConfigurationAssignment. func (c ConfigurationAssignment) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", c.ID) populate(objectMap, "location", c.Location) populate(objectMap, "name", c.Name) @@ -194,7 +194,7 @@ func (c *ConfigurationAssignment) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ConfigurationAssignmentProperties. func (c ConfigurationAssignmentProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "maintenanceConfigurationId", c.MaintenanceConfigurationID) populate(objectMap, "resourceId", c.ResourceID) return json.Marshal(objectMap) @@ -223,14 +223,42 @@ func (c *ConfigurationAssignmentProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ConfigurationOverrides. +func (c ConfigurationOverrides) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "overrides", c.Overrides) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationOverrides. +func (c *ConfigurationOverrides) 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 "overrides": + err = unpopulate(val, "Overrides", &c.Overrides) + 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 ConfigurationProperties. func (c ConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "extensionProperties", c.ExtensionProperties) populate(objectMap, "installPatches", c.InstallPatches) populate(objectMap, "maintenanceScope", c.MaintenanceScope) populate(objectMap, "maintenanceWindow", c.MaintenanceWindow) populate(objectMap, "namespace", c.Namespace) + populate(objectMap, "overrides", c.Overrides) populate(objectMap, "visibility", c.Visibility) return json.Marshal(objectMap) } @@ -259,6 +287,9 @@ func (c *ConfigurationProperties) UnmarshalJSON(data []byte) error { case "namespace": err = unpopulate(val, "Namespace", &c.Namespace) delete(rawMsg, key) + case "overrides": + err = unpopulate(val, "Overrides", &c.Overrides) + delete(rawMsg, key) case "visibility": err = unpopulate(val, "Visibility", &c.Visibility) delete(rawMsg, key) @@ -272,7 +303,7 @@ func (c *ConfigurationProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Error. func (e Error) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "error", e.Error) return json.Marshal(objectMap) } @@ -299,7 +330,7 @@ func (e *Error) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ErrorDetails. func (e ErrorDetails) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "code", e.Code) populate(objectMap, "message", e.Message) return json.Marshal(objectMap) @@ -330,7 +361,7 @@ func (e *ErrorDetails) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type InputLinuxParameters. func (i InputLinuxParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "classificationsToInclude", i.ClassificationsToInclude) populate(objectMap, "packageNameMasksToExclude", i.PackageNameMasksToExclude) populate(objectMap, "packageNameMasksToInclude", i.PackageNameMasksToInclude) @@ -365,7 +396,7 @@ func (i *InputLinuxParameters) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type InputPatchConfiguration. func (i InputPatchConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "linuxParameters", i.LinuxParameters) populate(objectMap, "rebootSetting", i.RebootSetting) populate(objectMap, "tasks", i.Tasks) @@ -404,7 +435,7 @@ func (i *InputPatchConfiguration) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type InputWindowsParameters. func (i InputWindowsParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "classificationsToInclude", i.ClassificationsToInclude) populate(objectMap, "excludeKbsRequiringReboot", i.ExcludeKbsRequiringReboot) populate(objectMap, "kbNumbersToExclude", i.KbNumbersToExclude) @@ -443,7 +474,7 @@ func (i *InputWindowsParameters) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ListApplyUpdate. func (l ListApplyUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "value", l.Value) return json.Marshal(objectMap) } @@ -470,7 +501,7 @@ func (l *ListApplyUpdate) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ListConfigurationAssignmentsResult. func (l ListConfigurationAssignmentsResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "value", l.Value) return json.Marshal(objectMap) } @@ -497,7 +528,7 @@ func (l *ListConfigurationAssignmentsResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ListMaintenanceConfigurationsResult. func (l ListMaintenanceConfigurationsResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "value", l.Value) return json.Marshal(objectMap) } @@ -524,7 +555,7 @@ func (l *ListMaintenanceConfigurationsResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ListUpdatesResult. func (l ListUpdatesResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "value", l.Value) return json.Marshal(objectMap) } @@ -551,7 +582,7 @@ func (l *ListUpdatesResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Operation. func (o Operation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "display", o.Display) populate(objectMap, "isDataAction", o.IsDataAction) populate(objectMap, "name", o.Name) @@ -594,7 +625,7 @@ func (o *Operation) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type OperationInfo. func (o OperationInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "description", o.Description) populate(objectMap, "operation", o.Operation) populate(objectMap, "provider", o.Provider) @@ -633,7 +664,7 @@ func (o *OperationInfo) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type OperationsListResult. func (o OperationsListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "value", o.Value) return json.Marshal(objectMap) } @@ -658,9 +689,48 @@ func (o *OperationsListResult) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type OverrideProperties. +func (o OverrideProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "endDateTime", o.EndDateTime) + populate(objectMap, "overrideProperties", o.OverrideProperties) + populateTimeRFC3339(objectMap, "startDateTime", o.StartDateTime) + populate(objectMap, "timeZone", o.TimeZone) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OverrideProperties. +func (o *OverrideProperties) 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 "endDateTime": + err = unpopulateTimeRFC3339(val, "EndDateTime", &o.EndDateTime) + delete(rawMsg, key) + case "overrideProperties": + err = unpopulate(val, "OverrideProperties", &o.OverrideProperties) + delete(rawMsg, key) + case "startDateTime": + err = unpopulateTimeRFC3339(val, "StartDateTime", &o.StartDateTime) + delete(rawMsg, key) + case "timeZone": + err = unpopulate(val, "TimeZone", &o.TimeZone) + 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 Resource. func (r Resource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", r.ID) populate(objectMap, "name", r.Name) populate(objectMap, "systemData", r.SystemData) @@ -699,7 +769,7 @@ func (r *Resource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SoftwareUpdateConfigurationTasks. func (s SoftwareUpdateConfigurationTasks) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "postTasks", s.PostTasks) populate(objectMap, "preTasks", s.PreTasks) return json.Marshal(objectMap) @@ -730,7 +800,7 @@ func (s *SoftwareUpdateConfigurationTasks) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SystemData. func (s SystemData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) populate(objectMap, "createdBy", s.CreatedBy) populate(objectMap, "createdByType", s.CreatedByType) @@ -777,7 +847,7 @@ func (s *SystemData) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type TaskProperties. func (t TaskProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "parameters", t.Parameters) populate(objectMap, "source", t.Source) populate(objectMap, "taskScope", t.TaskScope) @@ -812,7 +882,7 @@ func (t *TaskProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Update. func (u Update) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "impactDurationInSec", u.ImpactDurationInSec) populate(objectMap, "impactType", u.ImpactType) populate(objectMap, "maintenanceScope", u.MaintenanceScope) @@ -859,7 +929,7 @@ func (u *Update) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type UpdateProperties. func (u UpdateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "resourceId", u.ResourceID) return json.Marshal(objectMap) } @@ -886,7 +956,7 @@ func (u *UpdateProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Window. func (w Window) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "duration", w.Duration) populate(objectMap, "expirationDateTime", w.ExpirationDateTime) populate(objectMap, "recurEvery", w.RecurEvery) @@ -927,7 +997,7 @@ func (w *Window) UnmarshalJSON(data []byte) error { return nil } -func populate(m map[string]interface{}, k string, v interface{}) { +func populate(m map[string]any, k string, v any) { if v == nil { return } else if azcore.IsNullValue(v) { @@ -937,7 +1007,7 @@ func populate(m map[string]interface{}, k string, v interface{}) { } } -func unpopulate(data json.RawMessage, fn string, v interface{}) error { +func unpopulate(data json.RawMessage, fn string, v any) error { if data == nil { return nil } diff --git a/sdk/resourcemanager/maintenance/armmaintenance/operations_client.go b/sdk/resourcemanager/maintenance/armmaintenance/operations_client.go index 980f0aa0f82e..116d6ed2aff1 100644 --- a/sdk/resourcemanager/maintenance/armmaintenance/operations_client.go +++ b/sdk/resourcemanager/maintenance/armmaintenance/operations_client.go @@ -28,8 +28,8 @@ type OperationsClient struct { } // NewOperationsClient creates a new instance of OperationsClient with the specified values. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -50,8 +50,9 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO } // NewListPager - List the available operations supported by the Microsoft.Maintenance resource provider -// Generated from API version 2022-07-01-preview -// options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. +// +// Generated from API version 2022-11-01-preview +// - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ More: func(page OperationsClientListResponse) bool { @@ -82,7 +83,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/maintenance/armmaintenance/operations_client_example_test.go b/sdk/resourcemanager/maintenance/armmaintenance/operations_client_example_test.go deleted file mode 100644 index 26436050955f..000000000000 --- a/sdk/resourcemanager/maintenance/armmaintenance/operations_client_example_test.go +++ /dev/null @@ -1,41 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armmaintenance_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/maintenance/armmaintenance" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2022-07-01-preview/examples/Operations_List.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmaintenance.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/maintenance/armmaintenance/publicmaintenanceconfigurations_client.go b/sdk/resourcemanager/maintenance/armmaintenance/publicmaintenanceconfigurations_client.go index d7108e787bf7..ce76cce017e9 100644 --- a/sdk/resourcemanager/maintenance/armmaintenance/publicmaintenanceconfigurations_client.go +++ b/sdk/resourcemanager/maintenance/armmaintenance/publicmaintenanceconfigurations_client.go @@ -32,10 +32,10 @@ type PublicMaintenanceConfigurationsClient struct { } // NewPublicMaintenanceConfigurationsClient creates a new instance of PublicMaintenanceConfigurationsClient with the specified values. -// subscriptionID - Subscription credentials that uniquely identify a 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 credentials that uniquely identify a 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 NewPublicMaintenanceConfigurationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PublicMaintenanceConfigurationsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,10 +58,11 @@ func NewPublicMaintenanceConfigurationsClient(subscriptionID string, credential // Get - Get Public Maintenance Configuration record // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview -// resourceName - Maintenance Configuration Name -// options - PublicMaintenanceConfigurationsClientGetOptions contains the optional parameters for the PublicMaintenanceConfigurationsClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceName - Maintenance Configuration Name +// - options - PublicMaintenanceConfigurationsClientGetOptions contains the optional parameters for the PublicMaintenanceConfigurationsClient.Get +// method. func (client *PublicMaintenanceConfigurationsClient) Get(ctx context.Context, resourceName string, options *PublicMaintenanceConfigurationsClientGetOptions) (PublicMaintenanceConfigurationsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceName, options) if err != nil { @@ -93,7 +94,7 @@ func (client *PublicMaintenanceConfigurationsClient) getCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -109,9 +110,10 @@ func (client *PublicMaintenanceConfigurationsClient) getHandleResponse(resp *htt } // NewListPager - Get Public Maintenance Configuration records -// Generated from API version 2022-07-01-preview -// options - PublicMaintenanceConfigurationsClientListOptions contains the optional parameters for the PublicMaintenanceConfigurationsClient.List -// method. +// +// Generated from API version 2022-11-01-preview +// - options - PublicMaintenanceConfigurationsClientListOptions contains the optional parameters for the PublicMaintenanceConfigurationsClient.NewListPager +// method. func (client *PublicMaintenanceConfigurationsClient) NewListPager(options *PublicMaintenanceConfigurationsClientListOptions) *runtime.Pager[PublicMaintenanceConfigurationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[PublicMaintenanceConfigurationsClientListResponse]{ More: func(page PublicMaintenanceConfigurationsClientListResponse) bool { @@ -146,7 +148,7 @@ func (client *PublicMaintenanceConfigurationsClient) listCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/maintenance/armmaintenance/publicmaintenanceconfigurations_client_example_test.go b/sdk/resourcemanager/maintenance/armmaintenance/publicmaintenanceconfigurations_client_example_test.go deleted file mode 100644 index 9477cd8fb9a4..000000000000 --- a/sdk/resourcemanager/maintenance/armmaintenance/publicmaintenanceconfigurations_client_example_test.go +++ /dev/null @@ -1,60 +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 armmaintenance_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/maintenance/armmaintenance" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2022-07-01-preview/examples/PublicMaintenanceConfigurations_List.json -func ExamplePublicMaintenanceConfigurationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmaintenance.NewPublicMaintenanceConfigurationsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", 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 - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2022-07-01-preview/examples/PublicMaintenanceConfigurations_GetForResource.json -func ExamplePublicMaintenanceConfigurationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmaintenance.NewPublicMaintenanceConfigurationsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "configuration1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/maintenance/armmaintenance/response_types.go b/sdk/resourcemanager/maintenance/armmaintenance/response_types.go index cbe5f1fc4093..96c45c9d0ce3 100644 --- a/sdk/resourcemanager/maintenance/armmaintenance/response_types.go +++ b/sdk/resourcemanager/maintenance/armmaintenance/response_types.go @@ -9,7 +9,7 @@ package armmaintenance -// ApplyUpdateForResourceGroupClientListResponse contains the response from method ApplyUpdateForResourceGroupClient.List. +// ApplyUpdateForResourceGroupClientListResponse contains the response from method ApplyUpdateForResourceGroupClient.NewListPager. type ApplyUpdateForResourceGroupClientListResponse struct { ListApplyUpdate } @@ -34,7 +34,7 @@ type ApplyUpdatesClientGetResponse struct { ApplyUpdate } -// ApplyUpdatesClientListResponse contains the response from method ApplyUpdatesClient.List. +// ApplyUpdatesClientListResponse contains the response from method ApplyUpdatesClient.NewListPager. type ApplyUpdatesClientListResponse struct { ListApplyUpdate } @@ -69,17 +69,17 @@ type ConfigurationAssignmentsClientGetResponse struct { ConfigurationAssignment } -// ConfigurationAssignmentsClientListParentResponse contains the response from method ConfigurationAssignmentsClient.ListParent. +// ConfigurationAssignmentsClientListParentResponse contains the response from method ConfigurationAssignmentsClient.NewListParentPager. type ConfigurationAssignmentsClientListParentResponse struct { ListConfigurationAssignmentsResult } -// ConfigurationAssignmentsClientListResponse contains the response from method ConfigurationAssignmentsClient.List. +// ConfigurationAssignmentsClientListResponse contains the response from method ConfigurationAssignmentsClient.NewListPager. type ConfigurationAssignmentsClientListResponse struct { ListConfigurationAssignmentsResult } -// ConfigurationAssignmentsWithinSubscriptionClientListResponse contains the response from method ConfigurationAssignmentsWithinSubscriptionClient.List. +// ConfigurationAssignmentsWithinSubscriptionClientListResponse contains the response from method ConfigurationAssignmentsWithinSubscriptionClient.NewListPager. type ConfigurationAssignmentsWithinSubscriptionClientListResponse struct { ListConfigurationAssignmentsResult } @@ -99,7 +99,7 @@ type ConfigurationsClientGetResponse struct { Configuration } -// ConfigurationsClientListResponse contains the response from method ConfigurationsClient.List. +// ConfigurationsClientListResponse contains the response from method ConfigurationsClient.NewListPager. type ConfigurationsClientListResponse struct { ListMaintenanceConfigurationsResult } @@ -109,12 +109,12 @@ type ConfigurationsClientUpdateResponse struct { Configuration } -// ConfigurationsForResourceGroupClientListResponse contains the response from method ConfigurationsForResourceGroupClient.List. +// ConfigurationsForResourceGroupClientListResponse contains the response from method ConfigurationsForResourceGroupClient.NewListPager. type ConfigurationsForResourceGroupClientListResponse struct { ListMaintenanceConfigurationsResult } -// OperationsClientListResponse contains the response from method OperationsClient.List. +// OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { OperationsListResult } @@ -124,17 +124,17 @@ type PublicMaintenanceConfigurationsClientGetResponse struct { Configuration } -// PublicMaintenanceConfigurationsClientListResponse contains the response from method PublicMaintenanceConfigurationsClient.List. +// PublicMaintenanceConfigurationsClientListResponse contains the response from method PublicMaintenanceConfigurationsClient.NewListPager. type PublicMaintenanceConfigurationsClientListResponse struct { ListMaintenanceConfigurationsResult } -// UpdatesClientListParentResponse contains the response from method UpdatesClient.ListParent. +// UpdatesClientListParentResponse contains the response from method UpdatesClient.NewListParentPager. type UpdatesClientListParentResponse struct { ListUpdatesResult } -// UpdatesClientListResponse contains the response from method UpdatesClient.List. +// UpdatesClientListResponse contains the response from method UpdatesClient.NewListPager. type UpdatesClientListResponse struct { ListUpdatesResult } diff --git a/sdk/resourcemanager/maintenance/armmaintenance/time_rfc3339.go b/sdk/resourcemanager/maintenance/armmaintenance/time_rfc3339.go index 96e90b043364..456d2d616106 100644 --- a/sdk/resourcemanager/maintenance/armmaintenance/time_rfc3339.go +++ b/sdk/resourcemanager/maintenance/armmaintenance/time_rfc3339.go @@ -62,7 +62,7 @@ func (t *timeRFC3339) Parse(layout, value string) error { return err } -func populateTimeRFC3339(m map[string]interface{}, k string, t *time.Time) { +func populateTimeRFC3339(m map[string]any, k string, t *time.Time) { if t == nil { return } else if azcore.IsNullValue(t) { diff --git a/sdk/resourcemanager/maintenance/armmaintenance/updates_client.go b/sdk/resourcemanager/maintenance/armmaintenance/updates_client.go index fdd4ccc0c371..ea29fa34b315 100644 --- a/sdk/resourcemanager/maintenance/armmaintenance/updates_client.go +++ b/sdk/resourcemanager/maintenance/armmaintenance/updates_client.go @@ -32,10 +32,10 @@ type UpdatesClient struct { } // NewUpdatesClient creates a new instance of UpdatesClient with the specified values. -// subscriptionID - Subscription credentials that uniquely identify a 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 credentials that uniquely identify a 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 NewUpdatesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*UpdatesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,12 +57,13 @@ func NewUpdatesClient(subscriptionID string, credential azcore.TokenCredential, } // NewListPager - Get updates to resources. -// Generated from API version 2022-07-01-preview -// resourceGroupName - Resource group name -// providerName - Resource provider name -// resourceType - Resource type -// resourceName - Resource identifier -// options - UpdatesClientListOptions contains the optional parameters for the UpdatesClient.List method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - Resource group name +// - providerName - Resource provider name +// - resourceType - Resource type +// - resourceName - Resource identifier +// - options - UpdatesClientListOptions contains the optional parameters for the UpdatesClient.NewListPager method. func (client *UpdatesClient) NewListPager(resourceGroupName string, providerName string, resourceType string, resourceName string, options *UpdatesClientListOptions) *runtime.Pager[UpdatesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[UpdatesClientListResponse]{ More: func(page UpdatesClientListResponse) bool { @@ -113,7 +114,7 @@ func (client *UpdatesClient) listCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -129,14 +130,15 @@ func (client *UpdatesClient) listHandleResponse(resp *http.Response) (UpdatesCli } // NewListParentPager - Get updates to resources. -// Generated from API version 2022-07-01-preview -// resourceGroupName - Resource group name -// providerName - Resource provider name -// resourceParentType - Resource parent type -// resourceParentName - Resource parent identifier -// resourceType - Resource type -// resourceName - Resource identifier -// options - UpdatesClientListParentOptions contains the optional parameters for the UpdatesClient.ListParent method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - Resource group name +// - providerName - Resource provider name +// - resourceParentType - Resource parent type +// - resourceParentName - Resource parent identifier +// - resourceType - Resource type +// - resourceName - Resource identifier +// - options - UpdatesClientListParentOptions contains the optional parameters for the UpdatesClient.NewListParentPager method. func (client *UpdatesClient) NewListParentPager(resourceGroupName string, providerName string, resourceParentType string, resourceParentName string, resourceType string, resourceName string, options *UpdatesClientListParentOptions) *runtime.Pager[UpdatesClientListParentResponse] { return runtime.NewPager(runtime.PagingHandler[UpdatesClientListParentResponse]{ More: func(page UpdatesClientListParentResponse) bool { @@ -195,7 +197,7 @@ func (client *UpdatesClient) listParentCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/maintenance/armmaintenance/updates_client_example_test.go b/sdk/resourcemanager/maintenance/armmaintenance/updates_client_example_test.go deleted file mode 100644 index db63ea5d3ffa..000000000000 --- a/sdk/resourcemanager/maintenance/armmaintenance/updates_client_example_test.go +++ /dev/null @@ -1,65 +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 armmaintenance_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/maintenance/armmaintenance" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2022-07-01-preview/examples/Updates_ListParent.json -func ExampleUpdatesClient_NewListParentPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmaintenance.NewUpdatesClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListParentPager("examplerg", "Microsoft.Compute", "virtualMachineScaleSets", "smdtest1", "virtualMachines", "1", 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/maintenance/resource-manager/Microsoft.Maintenance/preview/2022-07-01-preview/examples/Updates_List.json -func ExampleUpdatesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmaintenance.NewUpdatesClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("examplerg", "Microsoft.Compute", "virtualMachineScaleSets", "smdtest1", 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 - } - } -}