From cce0ab092a75e4c155febaa708de1ae58b73b532 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 7 Dec 2022 21:39:54 +0000 Subject: [PATCH] CodeGen from PR 21806 in Azure/azure-rest-api-specs Merge 097f1987e9f8e25d08dbafb6b4a7cf7b073c006b into 1be09531e4c6edeafde41d6562371566d39669e8 --- .../maintenance/armmaintenance/CHANGELOG.md | 9 + ... => applyupdateforresourcegroup_client.go} | 6 +- ...dates_client.go => applyupdates_client.go} | 22 +- .../maintenance/armmaintenance/autorest.md | 6 +- ....go => configurationassignments_client.go} | 35 +- ...onassignmentswithinsubscription_client.go} | 6 +- ...ons_client.go => configurations_client.go} | 22 +- ... configurationsforresourcegroup_client.go} | 6 +- ...zz_generated_constants.go => constants.go} | 6 +- .../maintenance/armmaintenance/go.mod | 14 +- .../maintenance/armmaintenance/go.sum | 24 +- .../{zz_generated_models.go => models.go} | 31 + .../armmaintenance/models_serde.go | 1018 +++++++++++++++++ ...rations_client.go => operations_client.go} | 6 +- ...publicmaintenanceconfigurations_client.go} | 10 +- ...ed_response_types.go => response_types.go} | 1 + ...erated_time_rfc3339.go => time_rfc3339.go} | 1 + ...ed_updates_client.go => updates_client.go} | 11 +- ...applyupdateforresourcegroup_client_test.go | 42 - ...erated_example_applyupdates_client_test.go | 143 --- ...le_configurationassignments_client_test.go | 242 ---- ...signmentswithinsubscription_client_test.go | 41 - ...e_maintenanceconfigurations_client_test.go | 160 --- ...figurationsforresourcegroup_client_test.go | 42 - ...enerated_example_operations_client_test.go | 41 - ...icmaintenanceconfigurations_client_test.go | 62 - ...e_generated_example_updates_client_test.go | 75 -- .../zz_generated_models_serde.go | 214 ---- 28 files changed, 1135 insertions(+), 1161 deletions(-) rename sdk/resourcemanager/maintenance/armmaintenance/{zz_generated_applyupdateforresourcegroup_client.go => applyupdateforresourcegroup_client.go} (96%) rename sdk/resourcemanager/maintenance/armmaintenance/{zz_generated_applyupdates_client.go => applyupdates_client.go} (97%) rename sdk/resourcemanager/maintenance/armmaintenance/{zz_generated_configurationassignments_client.go => configurationassignments_client.go} (97%) rename sdk/resourcemanager/maintenance/armmaintenance/{zz_generated_configurationassignmentswithinsubscription_client.go => configurationassignmentswithinsubscription_client.go} (96%) rename sdk/resourcemanager/maintenance/armmaintenance/{zz_generated_configurations_client.go => configurations_client.go} (96%) rename sdk/resourcemanager/maintenance/armmaintenance/{zz_generated_configurationsforresourcegroup_client.go => configurationsforresourcegroup_client.go} (96%) rename sdk/resourcemanager/maintenance/armmaintenance/{zz_generated_constants.go => constants.go} (95%) rename sdk/resourcemanager/maintenance/armmaintenance/{zz_generated_models.go => models.go} (92%) create mode 100644 sdk/resourcemanager/maintenance/armmaintenance/models_serde.go rename sdk/resourcemanager/maintenance/armmaintenance/{zz_generated_operations_client.go => operations_client.go} (95%) rename sdk/resourcemanager/maintenance/armmaintenance/{zz_generated_publicmaintenanceconfigurations_client.go => publicmaintenanceconfigurations_client.go} (96%) rename sdk/resourcemanager/maintenance/armmaintenance/{zz_generated_response_types.go => response_types.go} (99%) rename sdk/resourcemanager/maintenance/armmaintenance/{zz_generated_time_rfc3339.go => time_rfc3339.go} (99%) rename sdk/resourcemanager/maintenance/armmaintenance/{zz_generated_updates_client.go => updates_client.go} (96%) delete mode 100644 sdk/resourcemanager/maintenance/armmaintenance/ze_generated_example_applyupdateforresourcegroup_client_test.go delete mode 100644 sdk/resourcemanager/maintenance/armmaintenance/ze_generated_example_applyupdates_client_test.go delete mode 100644 sdk/resourcemanager/maintenance/armmaintenance/ze_generated_example_configurationassignments_client_test.go delete mode 100644 sdk/resourcemanager/maintenance/armmaintenance/ze_generated_example_configurationassignmentswithinsubscription_client_test.go delete mode 100644 sdk/resourcemanager/maintenance/armmaintenance/ze_generated_example_maintenanceconfigurations_client_test.go delete mode 100644 sdk/resourcemanager/maintenance/armmaintenance/ze_generated_example_maintenanceconfigurationsforresourcegroup_client_test.go delete mode 100644 sdk/resourcemanager/maintenance/armmaintenance/ze_generated_example_operations_client_test.go delete mode 100644 sdk/resourcemanager/maintenance/armmaintenance/ze_generated_example_publicmaintenanceconfigurations_client_test.go delete mode 100644 sdk/resourcemanager/maintenance/armmaintenance/ze_generated_example_updates_client_test.go delete mode 100644 sdk/resourcemanager/maintenance/armmaintenance/zz_generated_models_serde.go diff --git a/sdk/resourcemanager/maintenance/armmaintenance/CHANGELOG.md b/sdk/resourcemanager/maintenance/armmaintenance/CHANGELOG.md index b4edb2eef32b..a1c95e852dce 100644 --- a/sdk/resourcemanager/maintenance/armmaintenance/CHANGELOG.md +++ b/sdk/resourcemanager/maintenance/armmaintenance/CHANGELOG.md @@ -1,5 +1,14 @@ # Release History +## 1.1.0-beta.2 (2022-12-07) +### Features Added + +- New value `MaintenanceScopeResource` added to type alias `MaintenanceScope` +- New struct `ConfigurationOverrides` +- New struct `OverrideProperties` +- New field `Overrides` in struct `ConfigurationProperties` + + ## 1.1.0-beta.1 (2022-05-19) ### Features Added diff --git a/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_applyupdateforresourcegroup_client.go b/sdk/resourcemanager/maintenance/armmaintenance/applyupdateforresourcegroup_client.go similarity index 96% rename from sdk/resourcemanager/maintenance/armmaintenance/zz_generated_applyupdateforresourcegroup_client.go rename to sdk/resourcemanager/maintenance/armmaintenance/applyupdateforresourcegroup_client.go index 2434e0434b26..1b3701756dde 100644 --- a/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_applyupdateforresourcegroup_client.go +++ b/sdk/resourcemanager/maintenance/armmaintenance/applyupdateforresourcegroup_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armmaintenance @@ -56,8 +57,7 @@ func NewApplyUpdateForResourceGroupClient(subscriptionID string, credential azco } // NewListPager - Get Configuration records within a subscription and resource group -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01-preview +// Generated from API version 2022-11-01-preview // resourceGroupName - Resource Group Name // options - ApplyUpdateForResourceGroupClientListOptions contains the optional parameters for the ApplyUpdateForResourceGroupClient.List // method. @@ -99,7 +99,7 @@ func (client *ApplyUpdateForResourceGroupClient) listCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-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/zz_generated_applyupdates_client.go b/sdk/resourcemanager/maintenance/armmaintenance/applyupdates_client.go similarity index 97% rename from sdk/resourcemanager/maintenance/armmaintenance/zz_generated_applyupdates_client.go rename to sdk/resourcemanager/maintenance/armmaintenance/applyupdates_client.go index 94a4546932c8..8d937fe17139 100644 --- a/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_applyupdates_client.go +++ b/sdk/resourcemanager/maintenance/armmaintenance/applyupdates_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armmaintenance @@ -57,7 +58,7 @@ 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 2021-09-01-preview +// Generated from API version 2022-11-01-preview // resourceGroupName - Resource group name // providerName - Resource provider name // resourceType - Resource type @@ -107,7 +108,7 @@ func (client *ApplyUpdatesClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-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 @@ -124,7 +125,7 @@ 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 2021-09-01-preview +// Generated from API version 2022-11-01-preview // resourceGroupName - Resource group name // providerName - Resource provider name // resourceParentType - Resource parent type @@ -184,7 +185,7 @@ func (client *ApplyUpdatesClient) createOrUpdateParentCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-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 @@ -201,7 +202,7 @@ 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 2021-09-01-preview +// Generated from API version 2022-11-01-preview // resourceGroupName - Resource group name // providerName - Resource provider name // resourceType - Resource type @@ -255,7 +256,7 @@ func (client *ApplyUpdatesClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-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 @@ -272,7 +273,7 @@ func (client *ApplyUpdatesClient) getHandleResponse(resp *http.Response) (ApplyU // GetParent - Track maintenance updates to resource with parent // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01-preview +// Generated from API version 2022-11-01-preview // resourceGroupName - Resource group name // resourceParentType - Resource parent type // resourceParentName - Resource parent identifier @@ -336,7 +337,7 @@ func (client *ApplyUpdatesClient) getParentCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-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 @@ -352,8 +353,7 @@ func (client *ApplyUpdatesClient) getParentHandleResponse(resp *http.Response) ( } // NewListPager - Get Configuration records within a subscription -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01-preview +// Generated from API version 2022-11-01-preview // options - ApplyUpdatesClientListOptions contains the optional parameters for the ApplyUpdatesClient.List method. func (client *ApplyUpdatesClient) NewListPager(options *ApplyUpdatesClientListOptions) *runtime.Pager[ApplyUpdatesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ApplyUpdatesClientListResponse]{ @@ -389,7 +389,7 @@ func (client *ApplyUpdatesClient) listCreateRequest(ctx context.Context, options return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-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/autorest.md b/sdk/resourcemanager/maintenance/armmaintenance/autorest.md index 5c75f1261d9c..620a4a24fe21 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/2f2b633d940230cbbd5bcf1339a2e1c48674e4a2/specification/maintenance/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/2f2b633d940230cbbd5bcf1339a2e1c48674e4a2/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.1 +module-version: 1.1.0-beta.2 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_configurationassignments_client.go b/sdk/resourcemanager/maintenance/armmaintenance/configurationassignments_client.go similarity index 97% rename from sdk/resourcemanager/maintenance/armmaintenance/zz_generated_configurationassignments_client.go rename to sdk/resourcemanager/maintenance/armmaintenance/configurationassignments_client.go index 96f3770256ab..0fa9ece931f1 100644 --- a/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_configurationassignments_client.go +++ b/sdk/resourcemanager/maintenance/armmaintenance/configurationassignments_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armmaintenance @@ -57,7 +58,7 @@ 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 2021-09-01-preview +// Generated from API version 2022-11-01-preview // resourceGroupName - Resource group name // providerName - Resource provider name // resourceType - Resource type @@ -113,7 +114,7 @@ func (client *ConfigurationAssignmentsClient) createOrUpdateCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-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) @@ -130,7 +131,7 @@ func (client *ConfigurationAssignmentsClient) createOrUpdateHandleResponse(resp // CreateOrUpdateParent - Register configuration for resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01-preview +// Generated from API version 2022-11-01-preview // resourceGroupName - Resource group name // providerName - Resource provider name // resourceParentType - Resource parent type @@ -196,7 +197,7 @@ func (client *ConfigurationAssignmentsClient) createOrUpdateParentCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-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) @@ -213,7 +214,7 @@ func (client *ConfigurationAssignmentsClient) createOrUpdateParentHandleResponse // Delete - Unregister configuration for resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01-preview +// Generated from API version 2022-11-01-preview // resourceGroupName - Resource group name // providerName - Resource provider name // resourceType - Resource type @@ -268,7 +269,7 @@ func (client *ConfigurationAssignmentsClient) deleteCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-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 @@ -285,7 +286,7 @@ 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 2021-09-01-preview +// Generated from API version 2022-11-01-preview // resourceGroupName - Resource group name // providerName - Resource provider name // resourceParentType - Resource parent type @@ -350,7 +351,7 @@ func (client *ConfigurationAssignmentsClient) deleteParentCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-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 @@ -367,7 +368,7 @@ 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 2021-09-01-preview +// Generated from API version 2022-11-01-preview // resourceGroupName - Resource group name // providerName - Resource provider name // resourceType - Resource type @@ -422,7 +423,7 @@ func (client *ConfigurationAssignmentsClient) getCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-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 @@ -439,7 +440,7 @@ 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 2021-09-01-preview +// Generated from API version 2022-11-01-preview // resourceGroupName - Resource group name // providerName - Resource provider name // resourceParentType - Resource parent type @@ -504,7 +505,7 @@ func (client *ConfigurationAssignmentsClient) getParentCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-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 @@ -520,8 +521,7 @@ func (client *ConfigurationAssignmentsClient) getParentHandleResponse(resp *http } // NewListPager - List configurationAssignments for resource. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01-preview +// Generated from API version 2022-11-01-preview // resourceGroupName - Resource group name // providerName - Resource provider name // resourceType - Resource type @@ -578,7 +578,7 @@ func (client *ConfigurationAssignmentsClient) listCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-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,8 +594,7 @@ func (client *ConfigurationAssignmentsClient) listHandleResponse(resp *http.Resp } // NewListParentPager - List configurationAssignments for resource. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01-preview +// Generated from API version 2022-11-01-preview // resourceGroupName - Resource group name // providerName - Resource provider name // resourceParentType - Resource parent type @@ -662,7 +661,7 @@ func (client *ConfigurationAssignmentsClient) listParentCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-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/zz_generated_configurationassignmentswithinsubscription_client.go b/sdk/resourcemanager/maintenance/armmaintenance/configurationassignmentswithinsubscription_client.go similarity index 96% rename from sdk/resourcemanager/maintenance/armmaintenance/zz_generated_configurationassignmentswithinsubscription_client.go rename to sdk/resourcemanager/maintenance/armmaintenance/configurationassignmentswithinsubscription_client.go index 3db900163942..75db9bf23a55 100644 --- a/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_configurationassignmentswithinsubscription_client.go +++ b/sdk/resourcemanager/maintenance/armmaintenance/configurationassignmentswithinsubscription_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armmaintenance @@ -56,8 +57,7 @@ func NewConfigurationAssignmentsWithinSubscriptionClient(subscriptionID string, } // NewListPager - Get configuration assignment within a subscription -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01-preview +// Generated from API version 2022-11-01-preview // options - ConfigurationAssignmentsWithinSubscriptionClientListOptions contains the optional parameters for the ConfigurationAssignmentsWithinSubscriptionClient.List // method. func (client *ConfigurationAssignmentsWithinSubscriptionClient) NewListPager(options *ConfigurationAssignmentsWithinSubscriptionClientListOptions) *runtime.Pager[ConfigurationAssignmentsWithinSubscriptionClientListResponse] { @@ -94,7 +94,7 @@ func (client *ConfigurationAssignmentsWithinSubscriptionClient) listCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-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/zz_generated_configurations_client.go b/sdk/resourcemanager/maintenance/armmaintenance/configurations_client.go similarity index 96% rename from sdk/resourcemanager/maintenance/armmaintenance/zz_generated_configurations_client.go rename to sdk/resourcemanager/maintenance/armmaintenance/configurations_client.go index 3e9d401bb4a7..dd0dafcffe49 100644 --- a/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_configurations_client.go +++ b/sdk/resourcemanager/maintenance/armmaintenance/configurations_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armmaintenance @@ -57,7 +58,7 @@ 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 2021-09-01-preview +// Generated from API version 2022-11-01-preview // resourceGroupName - Resource Group Name // resourceName - Maintenance Configuration Name // configuration - The configuration @@ -98,7 +99,7 @@ func (client *ConfigurationsClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-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) @@ -115,7 +116,7 @@ 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 2021-09-01-preview +// 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. @@ -154,7 +155,7 @@ func (client *ConfigurationsClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-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 @@ -171,7 +172,7 @@ 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 2021-09-01-preview +// 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. @@ -210,7 +211,7 @@ func (client *ConfigurationsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-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 @@ -226,8 +227,7 @@ func (client *ConfigurationsClient) getHandleResponse(resp *http.Response) (Conf } // NewListPager - Get Configuration records within a subscription -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01-preview +// Generated from API version 2022-11-01-preview // options - ConfigurationsClientListOptions contains the optional parameters for the ConfigurationsClient.List method. func (client *ConfigurationsClient) NewListPager(options *ConfigurationsClientListOptions) *runtime.Pager[ConfigurationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ConfigurationsClientListResponse]{ @@ -263,7 +263,7 @@ func (client *ConfigurationsClient) listCreateRequest(ctx context.Context, optio return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-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,7 +280,7 @@ 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 2021-09-01-preview +// Generated from API version 2022-11-01-preview // resourceGroupName - Resource Group Name // resourceName - Maintenance Configuration Name // configuration - The configuration @@ -320,7 +320,7 @@ func (client *ConfigurationsClient) updateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-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/zz_generated_configurationsforresourcegroup_client.go b/sdk/resourcemanager/maintenance/armmaintenance/configurationsforresourcegroup_client.go similarity index 96% rename from sdk/resourcemanager/maintenance/armmaintenance/zz_generated_configurationsforresourcegroup_client.go rename to sdk/resourcemanager/maintenance/armmaintenance/configurationsforresourcegroup_client.go index e1e876918dfc..835c5c310dbf 100644 --- a/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_configurationsforresourcegroup_client.go +++ b/sdk/resourcemanager/maintenance/armmaintenance/configurationsforresourcegroup_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armmaintenance @@ -56,8 +57,7 @@ func NewConfigurationsForResourceGroupClient(subscriptionID string, credential a } // NewListPager - Get Configuration records within a subscription and resource group -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01-preview +// Generated from API version 2022-11-01-preview // resourceGroupName - Resource Group Name // options - ConfigurationsForResourceGroupClientListOptions contains the optional parameters for the ConfigurationsForResourceGroupClient.List // method. @@ -99,7 +99,7 @@ func (client *ConfigurationsForResourceGroupClient) listCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-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/zz_generated_constants.go b/sdk/resourcemanager/maintenance/armmaintenance/constants.go similarity index 95% rename from sdk/resourcemanager/maintenance/armmaintenance/zz_generated_constants.go rename to sdk/resourcemanager/maintenance/armmaintenance/constants.go index 501ba2ba9962..7933e7a64af3 100644 --- a/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_constants.go +++ b/sdk/resourcemanager/maintenance/armmaintenance/constants.go @@ -5,12 +5,13 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armmaintenance const ( moduleName = "armmaintenance" - moduleVersion = "v1.1.0-beta.1" + moduleVersion = "v1.1.0-beta.2" ) // CreatedByType - The type of identity that created the resource. @@ -70,6 +71,8 @@ const ( MaintenanceScopeInGuestPatch MaintenanceScope = "InGuestPatch" // MaintenanceScopeOSImage - This maintenance scope controls os image installation on VM/VMSS MaintenanceScopeOSImage MaintenanceScope = "OSImage" + // MaintenanceScopeResource - This maintenance scope controls the default update maintenance of the Azure Resource + MaintenanceScopeResource MaintenanceScope = "Resource" // MaintenanceScopeSQLDB - This maintenance scope controls installation of SQL server platform updates. MaintenanceScopeSQLDB MaintenanceScope = "SQLDB" // MaintenanceScopeSQLManagedInstance - This maintenance scope controls installation of SQL managed instance platform update. @@ -83,6 +86,7 @@ func PossibleMaintenanceScopeValues() []MaintenanceScope { MaintenanceScopeHost, MaintenanceScopeInGuestPatch, MaintenanceScopeOSImage, + MaintenanceScopeResource, MaintenanceScopeSQLDB, MaintenanceScopeSQLManagedInstance, } diff --git a/sdk/resourcemanager/maintenance/armmaintenance/go.mod b/sdk/resourcemanager/maintenance/armmaintenance/go.mod index c79d65f6ea6b..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.0.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 // indirect - github.com/golang-jwt/jwt v3.2.1+incompatible // indirect - github.com/google/uuid v1.1.1 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 // indirect - golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 // indirect - golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect golang.org/x/text v0.3.7 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/sdk/resourcemanager/maintenance/armmaintenance/go.sum b/sdk/resourcemanager/maintenance/armmaintenance/go.sum index ed5b814680ee..3afb578030a5 100644 --- a/sdk/resourcemanager/maintenance/armmaintenance/go.sum +++ b/sdk/resourcemanager/maintenance/armmaintenance/go.sum @@ -1,33 +1,15 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 h1:sVPhtT2qjO86rTUaWMr4WoES4TkjGnzcioXcnHV9s5k= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0 h1:Yoicul8bnVdQrhDMTHxdEckRGX01XvwXDHUT9zYZ3k0= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0/go.mod h1:+6sju8gk8FRmSajX3Oz4G5Gm7P+mbqE9FVaXXFYTkCM= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 h1:jp0dGvZ7ZK0mgqnTSClMxa5xuRL7NZgHameVYF6BurY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 h1:WVsrXCnHlDDX8ls+tootqRE87/hL9S/g4ewig9RsD/c= -github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= -github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= -github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= -github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 h1:Qj1ukM4GlMWXNdMBuXcXfz/Kw9s1qm0CLY32QxuSImI= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 h1:Tgea0cVUD0ivh5ADBX4WwuI12DUd2to3nCYe2eayMIw= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 h1:HVyaeDAYux4pnY+D/SiwmLOR36ewZ4iGQIIrtnuCjFA= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_models.go b/sdk/resourcemanager/maintenance/armmaintenance/models.go similarity index 92% rename from sdk/resourcemanager/maintenance/armmaintenance/zz_generated_models.go rename to sdk/resourcemanager/maintenance/armmaintenance/models.go index 8a1b68df1132..ab6be2b1ae43 100644 --- a/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_models.go +++ b/sdk/resourcemanager/maintenance/armmaintenance/models.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armmaintenance @@ -179,6 +180,12 @@ 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 @@ -196,6 +203,9 @@ type ConfigurationProperties struct { // Gets or sets namespace of the resource Namespace *string `json:"namespace,omitempty"` + // Definition of a MaintenanceConfigurationOverrides + Overrides *ConfigurationOverrides `json:"overrides,omitempty"` + // Gets or sets the visibility of the configuration. The default value is 'Custom' Visibility *Visibility `json:"visibility,omitempty"` } @@ -358,6 +368,27 @@ 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 *string `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 *string `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 { diff --git a/sdk/resourcemanager/maintenance/armmaintenance/models_serde.go b/sdk/resourcemanager/maintenance/armmaintenance/models_serde.go new file mode 100644 index 000000000000..09b038d81c76 --- /dev/null +++ b/sdk/resourcemanager/maintenance/armmaintenance/models_serde.go @@ -0,0 +1,1018 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armmaintenance + +import ( + "encoding/json" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "reflect" +) + +// MarshalJSON implements the json.Marshaller interface for type ApplyUpdate. +func (a ApplyUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", a.ID) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "systemData", a.SystemData) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplyUpdate. +func (a *ApplyUpdate) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &a.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ApplyUpdateProperties. +func (a ApplyUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "lastUpdateTime", a.LastUpdateTime) + populate(objectMap, "resourceId", a.ResourceID) + populate(objectMap, "status", a.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplyUpdateProperties. +func (a *ApplyUpdateProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "lastUpdateTime": + err = unpopulateTimeRFC3339(val, "LastUpdateTime", &a.LastUpdateTime) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &a.ResourceID) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &a.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Configuration. +func (c Configuration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", c.ID) + populate(objectMap, "location", c.Location) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "systemData", c.SystemData) + populate(objectMap, "tags", c.Tags) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Configuration. +func (c *Configuration) 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 "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &c.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &c.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &c.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + 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 ConfigurationAssignment. +func (c ConfigurationAssignment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", c.ID) + populate(objectMap, "location", c.Location) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "systemData", c.SystemData) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationAssignment. +func (c *ConfigurationAssignment) 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 "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &c.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &c.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + 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 ConfigurationAssignmentProperties. +func (c ConfigurationAssignmentProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "maintenanceConfigurationId", c.MaintenanceConfigurationID) + populate(objectMap, "resourceId", c.ResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationAssignmentProperties. +func (c *ConfigurationAssignmentProperties) 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 "maintenanceConfigurationId": + err = unpopulate(val, "MaintenanceConfigurationID", &c.MaintenanceConfigurationID) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &c.ResourceID) + 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 ConfigurationOverrides. +func (c ConfigurationOverrides) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + 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{}) + 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) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationProperties. +func (c *ConfigurationProperties) 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 "extensionProperties": + err = unpopulate(val, "ExtensionProperties", &c.ExtensionProperties) + delete(rawMsg, key) + case "installPatches": + err = unpopulate(val, "InstallPatches", &c.InstallPatches) + delete(rawMsg, key) + case "maintenanceScope": + err = unpopulate(val, "MaintenanceScope", &c.MaintenanceScope) + delete(rawMsg, key) + case "maintenanceWindow": + err = unpopulate(val, "MaintenanceWindow", &c.MaintenanceWindow) + delete(rawMsg, key) + 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) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Error. +func (e Error) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "error", e.Error) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Error. +func (e *Error) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "error": + err = unpopulate(val, "Error", &e.Error) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ErrorDetails. +func (e ErrorDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "code", e.Code) + populate(objectMap, "message", e.Message) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetails. +func (e *ErrorDetails) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "code": + err = unpopulate(val, "Code", &e.Code) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &e.Message) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type InputLinuxParameters. +func (i InputLinuxParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "classificationsToInclude", i.ClassificationsToInclude) + populate(objectMap, "packageNameMasksToExclude", i.PackageNameMasksToExclude) + populate(objectMap, "packageNameMasksToInclude", i.PackageNameMasksToInclude) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InputLinuxParameters. +func (i *InputLinuxParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "classificationsToInclude": + err = unpopulate(val, "ClassificationsToInclude", &i.ClassificationsToInclude) + delete(rawMsg, key) + case "packageNameMasksToExclude": + err = unpopulate(val, "PackageNameMasksToExclude", &i.PackageNameMasksToExclude) + delete(rawMsg, key) + case "packageNameMasksToInclude": + err = unpopulate(val, "PackageNameMasksToInclude", &i.PackageNameMasksToInclude) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type InputPatchConfiguration. +func (i InputPatchConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "linuxParameters", i.LinuxParameters) + populate(objectMap, "rebootSetting", i.RebootSetting) + populate(objectMap, "tasks", i.Tasks) + populate(objectMap, "windowsParameters", i.WindowsParameters) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InputPatchConfiguration. +func (i *InputPatchConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "linuxParameters": + err = unpopulate(val, "LinuxParameters", &i.LinuxParameters) + delete(rawMsg, key) + case "rebootSetting": + err = unpopulate(val, "RebootSetting", &i.RebootSetting) + delete(rawMsg, key) + case "tasks": + err = unpopulate(val, "Tasks", &i.Tasks) + delete(rawMsg, key) + case "windowsParameters": + err = unpopulate(val, "WindowsParameters", &i.WindowsParameters) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type InputWindowsParameters. +func (i InputWindowsParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "classificationsToInclude", i.ClassificationsToInclude) + populate(objectMap, "excludeKbsRequiringReboot", i.ExcludeKbsRequiringReboot) + populate(objectMap, "kbNumbersToExclude", i.KbNumbersToExclude) + populate(objectMap, "kbNumbersToInclude", i.KbNumbersToInclude) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InputWindowsParameters. +func (i *InputWindowsParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "classificationsToInclude": + err = unpopulate(val, "ClassificationsToInclude", &i.ClassificationsToInclude) + delete(rawMsg, key) + case "excludeKbsRequiringReboot": + err = unpopulate(val, "ExcludeKbsRequiringReboot", &i.ExcludeKbsRequiringReboot) + delete(rawMsg, key) + case "kbNumbersToExclude": + err = unpopulate(val, "KbNumbersToExclude", &i.KbNumbersToExclude) + delete(rawMsg, key) + case "kbNumbersToInclude": + err = unpopulate(val, "KbNumbersToInclude", &i.KbNumbersToInclude) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ListApplyUpdate. +func (l ListApplyUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", l.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ListApplyUpdate. +func (l *ListApplyUpdate) 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", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &l.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ListConfigurationAssignmentsResult. +func (l ListConfigurationAssignmentsResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", l.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ListConfigurationAssignmentsResult. +func (l *ListConfigurationAssignmentsResult) 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", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &l.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ListMaintenanceConfigurationsResult. +func (l ListMaintenanceConfigurationsResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", l.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ListMaintenanceConfigurationsResult. +func (l *ListMaintenanceConfigurationsResult) 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", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &l.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ListUpdatesResult. +func (l ListUpdatesResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", l.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ListUpdatesResult. +func (l *ListUpdatesResult) 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", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &l.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Operation. +func (o Operation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "display", o.Display) + populate(objectMap, "isDataAction", o.IsDataAction) + populate(objectMap, "name", o.Name) + populate(objectMap, "origin", o.Origin) + populate(objectMap, "properties", &o.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Operation. +func (o *Operation) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "display": + err = unpopulate(val, "Display", &o.Display) + delete(rawMsg, key) + case "isDataAction": + err = unpopulate(val, "IsDataAction", &o.IsDataAction) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "origin": + err = unpopulate(val, "Origin", &o.Origin) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &o.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationInfo. +func (o OperationInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", o.Description) + populate(objectMap, "operation", o.Operation) + populate(objectMap, "provider", o.Provider) + populate(objectMap, "resource", o.Resource) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationInfo. +func (o *OperationInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &o.Description) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &o.Operation) + delete(rawMsg, key) + case "provider": + err = unpopulate(val, "Provider", &o.Provider) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &o.Resource) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationsListResult. +func (o OperationsListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", o.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationsListResult. +func (o *OperationsListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &o.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OverrideProperties. +func (o OverrideProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "endDateTime", o.EndDateTime) + populate(objectMap, "overrideProperties", o.OverrideProperties) + populate(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 = unpopulate(val, "EndDateTime", &o.EndDateTime) + delete(rawMsg, key) + case "overrideProperties": + err = unpopulate(val, "OverrideProperties", &o.OverrideProperties) + delete(rawMsg, key) + case "startDateTime": + err = unpopulate(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{}) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + populate(objectMap, "systemData", r.SystemData) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Resource. +func (r *Resource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &r.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SoftwareUpdateConfigurationTasks. +func (s SoftwareUpdateConfigurationTasks) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "postTasks", s.PostTasks) + populate(objectMap, "preTasks", s.PreTasks) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SoftwareUpdateConfigurationTasks. +func (s *SoftwareUpdateConfigurationTasks) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "postTasks": + err = unpopulate(val, "PostTasks", &s.PostTasks) + delete(rawMsg, key) + case "preTasks": + err = unpopulate(val, "PreTasks", &s.PreTasks) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SystemData. +func (s SystemData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) + populate(objectMap, "createdBy", s.CreatedBy) + populate(objectMap, "createdByType", s.CreatedByType) + populateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) + populate(objectMap, "lastModifiedBy", s.LastModifiedBy) + populate(objectMap, "lastModifiedByType", s.LastModifiedByType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. +func (s *SystemData) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "createdAt": + err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) + delete(rawMsg, key) + case "createdBy": + err = unpopulate(val, "CreatedBy", &s.CreatedBy) + delete(rawMsg, key) + case "createdByType": + err = unpopulate(val, "CreatedByType", &s.CreatedByType) + delete(rawMsg, key) + case "lastModifiedAt": + err = unpopulateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) + delete(rawMsg, key) + case "lastModifiedBy": + err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) + delete(rawMsg, key) + case "lastModifiedByType": + err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TaskProperties. +func (t TaskProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "parameters", t.Parameters) + populate(objectMap, "source", t.Source) + populate(objectMap, "taskScope", t.TaskScope) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TaskProperties. +func (t *TaskProperties) 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", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "parameters": + err = unpopulate(val, "Parameters", &t.Parameters) + delete(rawMsg, key) + case "source": + err = unpopulate(val, "Source", &t.Source) + delete(rawMsg, key) + case "taskScope": + err = unpopulate(val, "TaskScope", &t.TaskScope) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Update. +func (u Update) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "impactDurationInSec", u.ImpactDurationInSec) + populate(objectMap, "impactType", u.ImpactType) + populate(objectMap, "maintenanceScope", u.MaintenanceScope) + populateTimeRFC3339(objectMap, "notBefore", u.NotBefore) + populate(objectMap, "properties", u.Properties) + populate(objectMap, "status", u.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Update. +func (u *Update) 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", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "impactDurationInSec": + err = unpopulate(val, "ImpactDurationInSec", &u.ImpactDurationInSec) + delete(rawMsg, key) + case "impactType": + err = unpopulate(val, "ImpactType", &u.ImpactType) + delete(rawMsg, key) + case "maintenanceScope": + err = unpopulate(val, "MaintenanceScope", &u.MaintenanceScope) + delete(rawMsg, key) + case "notBefore": + err = unpopulateTimeRFC3339(val, "NotBefore", &u.NotBefore) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &u.Properties) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &u.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UpdateProperties. +func (u UpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "resourceId", u.ResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UpdateProperties. +func (u *UpdateProperties) 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", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "resourceId": + err = unpopulate(val, "ResourceID", &u.ResourceID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Window. +func (w Window) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "duration", w.Duration) + populate(objectMap, "expirationDateTime", w.ExpirationDateTime) + populate(objectMap, "recurEvery", w.RecurEvery) + populate(objectMap, "startDateTime", w.StartDateTime) + populate(objectMap, "timeZone", w.TimeZone) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Window. +func (w *Window) 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", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "duration": + err = unpopulate(val, "Duration", &w.Duration) + delete(rawMsg, key) + case "expirationDateTime": + err = unpopulate(val, "ExpirationDateTime", &w.ExpirationDateTime) + delete(rawMsg, key) + case "recurEvery": + err = unpopulate(val, "RecurEvery", &w.RecurEvery) + delete(rawMsg, key) + case "startDateTime": + err = unpopulate(val, "StartDateTime", &w.StartDateTime) + delete(rawMsg, key) + case "timeZone": + err = unpopulate(val, "TimeZone", &w.TimeZone) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +func populate(m map[string]interface{}, k string, v interface{}) { + if v == nil { + return + } else if azcore.IsNullValue(v) { + m[k] = nil + } else if !reflect.ValueOf(v).IsNil() { + m[k] = v + } +} + +func unpopulate(data json.RawMessage, fn string, v interface{}) error { + if data == nil { + return nil + } + if err := json.Unmarshal(data, v); err != nil { + return fmt.Errorf("struct field %s: %v", fn, err) + } + return nil +} diff --git a/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_operations_client.go b/sdk/resourcemanager/maintenance/armmaintenance/operations_client.go similarity index 95% rename from sdk/resourcemanager/maintenance/armmaintenance/zz_generated_operations_client.go rename to sdk/resourcemanager/maintenance/armmaintenance/operations_client.go index 39cef8952f87..4f05bd99f387 100644 --- a/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_operations_client.go +++ b/sdk/resourcemanager/maintenance/armmaintenance/operations_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armmaintenance @@ -49,8 +50,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO } // NewListPager - List the available operations supported by the Microsoft.Maintenance resource provider -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01-preview +// Generated from API version 2022-11-01-preview // options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -82,7 +82,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-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/zz_generated_publicmaintenanceconfigurations_client.go b/sdk/resourcemanager/maintenance/armmaintenance/publicmaintenanceconfigurations_client.go similarity index 96% rename from sdk/resourcemanager/maintenance/armmaintenance/zz_generated_publicmaintenanceconfigurations_client.go rename to sdk/resourcemanager/maintenance/armmaintenance/publicmaintenanceconfigurations_client.go index f4582ed23c92..fb962ad8e578 100644 --- a/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_publicmaintenanceconfigurations_client.go +++ b/sdk/resourcemanager/maintenance/armmaintenance/publicmaintenanceconfigurations_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armmaintenance @@ -57,7 +58,7 @@ 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 2021-09-01-preview +// Generated from API version 2022-11-01-preview // resourceName - Maintenance Configuration Name // options - PublicMaintenanceConfigurationsClientGetOptions contains the optional parameters for the PublicMaintenanceConfigurationsClient.Get // method. @@ -92,7 +93,7 @@ func (client *PublicMaintenanceConfigurationsClient) getCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-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 @@ -108,8 +109,7 @@ func (client *PublicMaintenanceConfigurationsClient) getHandleResponse(resp *htt } // NewListPager - Get Public Maintenance Configuration records -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01-preview +// Generated from API version 2022-11-01-preview // options - PublicMaintenanceConfigurationsClientListOptions contains the optional parameters for the PublicMaintenanceConfigurationsClient.List // method. func (client *PublicMaintenanceConfigurationsClient) NewListPager(options *PublicMaintenanceConfigurationsClientListOptions) *runtime.Pager[PublicMaintenanceConfigurationsClientListResponse] { @@ -146,7 +146,7 @@ func (client *PublicMaintenanceConfigurationsClient) listCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-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/zz_generated_response_types.go b/sdk/resourcemanager/maintenance/armmaintenance/response_types.go similarity index 99% rename from sdk/resourcemanager/maintenance/armmaintenance/zz_generated_response_types.go rename to sdk/resourcemanager/maintenance/armmaintenance/response_types.go index 6155a74c18be..cbe5f1fc4093 100644 --- a/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_response_types.go +++ b/sdk/resourcemanager/maintenance/armmaintenance/response_types.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armmaintenance diff --git a/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_time_rfc3339.go b/sdk/resourcemanager/maintenance/armmaintenance/time_rfc3339.go similarity index 99% rename from sdk/resourcemanager/maintenance/armmaintenance/zz_generated_time_rfc3339.go rename to sdk/resourcemanager/maintenance/armmaintenance/time_rfc3339.go index 8204e5275b6f..96e90b043364 100644 --- a/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_time_rfc3339.go +++ b/sdk/resourcemanager/maintenance/armmaintenance/time_rfc3339.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armmaintenance diff --git a/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_updates_client.go b/sdk/resourcemanager/maintenance/armmaintenance/updates_client.go similarity index 96% rename from sdk/resourcemanager/maintenance/armmaintenance/zz_generated_updates_client.go rename to sdk/resourcemanager/maintenance/armmaintenance/updates_client.go index be469bb61765..cf588654d8a7 100644 --- a/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_updates_client.go +++ b/sdk/resourcemanager/maintenance/armmaintenance/updates_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armmaintenance @@ -56,8 +57,7 @@ func NewUpdatesClient(subscriptionID string, credential azcore.TokenCredential, } // NewListPager - Get updates to resources. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01-preview +// Generated from API version 2022-11-01-preview // resourceGroupName - Resource group name // providerName - Resource provider name // resourceType - Resource type @@ -113,7 +113,7 @@ func (client *UpdatesClient) listCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-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,8 +129,7 @@ func (client *UpdatesClient) listHandleResponse(resp *http.Response) (UpdatesCli } // NewListParentPager - Get updates to resources. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01-preview +// Generated from API version 2022-11-01-preview // resourceGroupName - Resource group name // providerName - Resource provider name // resourceParentType - Resource parent type @@ -196,7 +195,7 @@ func (client *UpdatesClient) listParentCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-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/ze_generated_example_applyupdateforresourcegroup_client_test.go b/sdk/resourcemanager/maintenance/armmaintenance/ze_generated_example_applyupdateforresourcegroup_client_test.go deleted file mode 100644 index c6b0b82a4cb3..000000000000 --- a/sdk/resourcemanager/maintenance/armmaintenance/ze_generated_example_applyupdateforresourcegroup_client_test.go +++ /dev/null @@ -1,42 +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/2021-09-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/ze_generated_example_applyupdates_client_test.go b/sdk/resourcemanager/maintenance/armmaintenance/ze_generated_example_applyupdates_client_test.go deleted file mode 100644 index 89cd8b21d56d..000000000000 --- a/sdk/resourcemanager/maintenance/armmaintenance/ze_generated_example_applyupdates_client_test.go +++ /dev/null @@ -1,143 +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/2021-09-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/2021-09-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/2021-09-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/2021-09-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/2021-09-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/ze_generated_example_configurationassignments_client_test.go b/sdk/resourcemanager/maintenance/armmaintenance/ze_generated_example_configurationassignments_client_test.go deleted file mode 100644 index 1c7603b624b2..000000000000 --- a/sdk/resourcemanager/maintenance/armmaintenance/ze_generated_example_configurationassignments_client_test.go +++ /dev/null @@ -1,242 +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/2021-09-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/2021-09-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/2021-09-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/2021-09-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/2021-09-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/2021-09-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/2021-09-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/2021-09-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/ze_generated_example_configurationassignmentswithinsubscription_client_test.go b/sdk/resourcemanager/maintenance/armmaintenance/ze_generated_example_configurationassignmentswithinsubscription_client_test.go deleted file mode 100644 index ddf70cbfcab6..000000000000 --- a/sdk/resourcemanager/maintenance/armmaintenance/ze_generated_example_configurationassignmentswithinsubscription_client_test.go +++ /dev/null @@ -1,41 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package 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/2021-09-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/ze_generated_example_maintenanceconfigurations_client_test.go b/sdk/resourcemanager/maintenance/armmaintenance/ze_generated_example_maintenanceconfigurations_client_test.go deleted file mode 100644 index 85cb67561311..000000000000 --- a/sdk/resourcemanager/maintenance/armmaintenance/ze_generated_example_maintenanceconfigurations_client_test.go +++ /dev/null @@ -1,160 +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/2021-09-01-preview/examples/MaintenanceConfigurations_GetForResource.json -func ExampleConfigurationsClient_Get() { - 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/2021-09-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/2021-09-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/2021-09-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/2021-09-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/ze_generated_example_maintenanceconfigurationsforresourcegroup_client_test.go b/sdk/resourcemanager/maintenance/armmaintenance/ze_generated_example_maintenanceconfigurationsforresourcegroup_client_test.go deleted file mode 100644 index 9c2069d32fd4..000000000000 --- a/sdk/resourcemanager/maintenance/armmaintenance/ze_generated_example_maintenanceconfigurationsforresourcegroup_client_test.go +++ /dev/null @@ -1,42 +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/2021-09-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/ze_generated_example_operations_client_test.go b/sdk/resourcemanager/maintenance/armmaintenance/ze_generated_example_operations_client_test.go deleted file mode 100644 index efcbc7bc83d8..000000000000 --- a/sdk/resourcemanager/maintenance/armmaintenance/ze_generated_example_operations_client_test.go +++ /dev/null @@ -1,41 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package 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/2021-09-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/ze_generated_example_publicmaintenanceconfigurations_client_test.go b/sdk/resourcemanager/maintenance/armmaintenance/ze_generated_example_publicmaintenanceconfigurations_client_test.go deleted file mode 100644 index 02fe2c5fbbfe..000000000000 --- a/sdk/resourcemanager/maintenance/armmaintenance/ze_generated_example_publicmaintenanceconfigurations_client_test.go +++ /dev/null @@ -1,62 +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/2021-09-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/2021-09-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/ze_generated_example_updates_client_test.go b/sdk/resourcemanager/maintenance/armmaintenance/ze_generated_example_updates_client_test.go deleted file mode 100644 index 975c2a285bef..000000000000 --- a/sdk/resourcemanager/maintenance/armmaintenance/ze_generated_example_updates_client_test.go +++ /dev/null @@ -1,75 +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/2021-09-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/2021-09-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 - } - } -} diff --git a/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_models_serde.go b/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_models_serde.go deleted file mode 100644 index 61b98d0f3511..000000000000 --- a/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_models_serde.go +++ /dev/null @@ -1,214 +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 - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" -) - -// MarshalJSON implements the json.Marshaller interface for type ApplyUpdateProperties. -func (a ApplyUpdateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "lastUpdateTime", a.LastUpdateTime) - populate(objectMap, "resourceId", a.ResourceID) - populate(objectMap, "status", a.Status) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplyUpdateProperties. -func (a *ApplyUpdateProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "lastUpdateTime": - err = unpopulateTimeRFC3339(val, "LastUpdateTime", &a.LastUpdateTime) - delete(rawMsg, key) - case "resourceId": - err = unpopulate(val, "ResourceID", &a.ResourceID) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &a.Status) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Configuration. -func (c Configuration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", c.ID) - populate(objectMap, "location", c.Location) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "systemData", c.SystemData) - populate(objectMap, "tags", c.Tags) - populate(objectMap, "type", c.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ConfigurationProperties. -func (c ConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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, "visibility", c.Visibility) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type InputLinuxParameters. -func (i InputLinuxParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "classificationsToInclude", i.ClassificationsToInclude) - populate(objectMap, "packageNameMasksToExclude", i.PackageNameMasksToExclude) - populate(objectMap, "packageNameMasksToInclude", i.PackageNameMasksToInclude) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type InputWindowsParameters. -func (i InputWindowsParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "classificationsToInclude", i.ClassificationsToInclude) - populate(objectMap, "excludeKbsRequiringReboot", i.ExcludeKbsRequiringReboot) - populate(objectMap, "kbNumbersToExclude", i.KbNumbersToExclude) - populate(objectMap, "kbNumbersToInclude", i.KbNumbersToInclude) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type SoftwareUpdateConfigurationTasks. -func (s SoftwareUpdateConfigurationTasks) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "postTasks", s.PostTasks) - populate(objectMap, "preTasks", s.PreTasks) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type SystemData. -func (s SystemData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) - populate(objectMap, "createdBy", s.CreatedBy) - populate(objectMap, "createdByType", s.CreatedByType) - populateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) - populate(objectMap, "lastModifiedBy", s.LastModifiedBy) - populate(objectMap, "lastModifiedByType", s.LastModifiedByType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. -func (s *SystemData) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "createdAt": - err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) - delete(rawMsg, key) - case "createdBy": - err = unpopulate(val, "CreatedBy", &s.CreatedBy) - delete(rawMsg, key) - case "createdByType": - err = unpopulate(val, "CreatedByType", &s.CreatedByType) - delete(rawMsg, key) - case "lastModifiedAt": - err = unpopulateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) - delete(rawMsg, key) - case "lastModifiedBy": - err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) - delete(rawMsg, key) - case "lastModifiedByType": - err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type TaskProperties. -func (t TaskProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "parameters", t.Parameters) - populate(objectMap, "source", t.Source) - populate(objectMap, "taskScope", t.TaskScope) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Update. -func (u *Update) 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", u, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "impactDurationInSec": - err = unpopulate(val, "ImpactDurationInSec", &u.ImpactDurationInSec) - delete(rawMsg, key) - case "impactType": - err = unpopulate(val, "ImpactType", &u.ImpactType) - delete(rawMsg, key) - case "maintenanceScope": - err = unpopulate(val, "MaintenanceScope", &u.MaintenanceScope) - delete(rawMsg, key) - case "notBefore": - err = unpopulateTimeRFC3339(val, "NotBefore", &u.NotBefore) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &u.Properties) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &u.Status) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - } - return nil -} - -func populate(m map[string]interface{}, k string, v interface{}) { - if v == nil { - return - } else if azcore.IsNullValue(v) { - m[k] = nil - } else if !reflect.ValueOf(v).IsNil() { - m[k] = v - } -} - -func unpopulate(data json.RawMessage, fn string, v interface{}) error { - if data == nil { - return nil - } - if err := json.Unmarshal(data, v); err != nil { - return fmt.Errorf("struct field %s: %v", fn, err) - } - return nil -}