From 91497a11fb15152a028b4db0348820ec8024991f Mon Sep 17 00:00:00 2001 From: 804873052 <804873052@qq.com> Date: Tue, 5 Jul 2022 10:08:56 +0800 Subject: [PATCH] [Release] sdk/resourcemanager/dnsresolver/armdnsresolver/1.0.0 generation from spec commit: efb0537b7f01b4f1d8c01685b7c0e76ae9baf5c6 --- .../dnsresolver/armdnsresolver/CHANGELOG.md | 6 + .../dnsresolver/armdnsresolver/autorest.md | 6 +- ...zz_generated_constants.go => constants.go} | 3 +- ...ent.go => dnsforwardingrulesets_client.go} | 35 +- ...forwardingrulesets_client_example_test.go} | 14 +- ...lvers_client.go => dnsresolvers_client.go} | 35 +- ...go => dnsresolvers_client_example_test.go} | 14 +- ...es_client.go => forwardingrules_client.go} | 21 +- ...=> forwardingrules_client_example_test.go} | 10 +- .../dnsresolver/armdnsresolver/go.mod | 4 +- .../dnsresolver/armdnsresolver/go.sum | 8 +- ...s_client.go => inboundendpoints_client.go} | 27 +- ...> inboundendpoints_client_example_test.go} | 10 +- .../{zz_generated_models.go => models.go} | 41 +- .../armdnsresolver/models_serde.go | 1426 +++++++++++++++++ ..._client.go => outboundendpoints_client.go} | 27 +- ... outboundendpoints_client_example_test.go} | 10 +- ...ed_response_types.go => response_types.go} | 1 + ...erated_time_rfc3339.go => time_rfc3339.go} | 1 + ...lient.go => virtualnetworklinks_client.go} | 27 +- ...irtualnetworklinks_client_example_test.go} | 10 +- .../zz_generated_models_serde.go | 246 --- 22 files changed, 1591 insertions(+), 391 deletions(-) rename sdk/resourcemanager/dnsresolver/armdnsresolver/{zz_generated_constants.go => constants.go} (98%) rename sdk/resourcemanager/dnsresolver/armdnsresolver/{zz_generated_dnsforwardingrulesets_client.go => dnsforwardingrulesets_client.go} (96%) rename sdk/resourcemanager/dnsresolver/armdnsresolver/{ze_generated_example_dnsforwardingrulesets_client_test.go => dnsforwardingrulesets_client_example_test.go} (91%) rename sdk/resourcemanager/dnsresolver/armdnsresolver/{zz_generated_dnsresolvers_client.go => dnsresolvers_client.go} (96%) rename sdk/resourcemanager/dnsresolver/armdnsresolver/{ze_generated_example_dnsresolvers_client_test.go => dnsresolvers_client_example_test.go} (91%) rename sdk/resourcemanager/dnsresolver/armdnsresolver/{zz_generated_forwardingrules_client.go => forwardingrules_client.go} (97%) rename sdk/resourcemanager/dnsresolver/armdnsresolver/{ze_generated_example_forwardingrules_client_test.go => forwardingrules_client_example_test.go} (92%) rename sdk/resourcemanager/dnsresolver/armdnsresolver/{zz_generated_inboundendpoints_client.go => inboundendpoints_client.go} (96%) rename sdk/resourcemanager/dnsresolver/armdnsresolver/{ze_generated_example_inboundendpoints_client_test.go => inboundendpoints_client_example_test.go} (92%) rename sdk/resourcemanager/dnsresolver/armdnsresolver/{zz_generated_models.go => models.go} (97%) create mode 100644 sdk/resourcemanager/dnsresolver/armdnsresolver/models_serde.go rename sdk/resourcemanager/dnsresolver/armdnsresolver/{zz_generated_outboundendpoints_client.go => outboundendpoints_client.go} (96%) rename sdk/resourcemanager/dnsresolver/armdnsresolver/{ze_generated_example_outboundendpoints_client_test.go => outboundendpoints_client_example_test.go} (92%) rename sdk/resourcemanager/dnsresolver/armdnsresolver/{zz_generated_response_types.go => response_types.go} (99%) rename sdk/resourcemanager/dnsresolver/armdnsresolver/{zz_generated_time_rfc3339.go => time_rfc3339.go} (99%) rename sdk/resourcemanager/dnsresolver/armdnsresolver/{zz_generated_virtualnetworklinks_client.go => virtualnetworklinks_client.go} (97%) rename sdk/resourcemanager/dnsresolver/armdnsresolver/{ze_generated_example_virtualnetworklinks_client_test.go => virtualnetworklinks_client_example_test.go} (92%) delete mode 100644 sdk/resourcemanager/dnsresolver/armdnsresolver/zz_generated_models_serde.go diff --git a/sdk/resourcemanager/dnsresolver/armdnsresolver/CHANGELOG.md b/sdk/resourcemanager/dnsresolver/armdnsresolver/CHANGELOG.md index a66debc5a870..9bc55b53523a 100644 --- a/sdk/resourcemanager/dnsresolver/armdnsresolver/CHANGELOG.md +++ b/sdk/resourcemanager/dnsresolver/armdnsresolver/CHANGELOG.md @@ -1,5 +1,11 @@ # Release History +## 1.0.0 (2022-07-05) +### Features Added + +- New field `DNSResolverOutboundEndpoints` in struct `DNSForwardingRulesetPatch` + + ## 0.4.0 (2022-05-18) The package of `github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dnsresolver/armdnsresolver` is using our [next generation design principles](https://azure.github.io/azure-sdk/general_introduction.html) since version 0.4.0, which contains breaking changes. diff --git a/sdk/resourcemanager/dnsresolver/armdnsresolver/autorest.md b/sdk/resourcemanager/dnsresolver/armdnsresolver/autorest.md index ae262c2d199d..d4a436559bf0 100644 --- a/sdk/resourcemanager/dnsresolver/armdnsresolver/autorest.md +++ b/sdk/resourcemanager/dnsresolver/armdnsresolver/autorest.md @@ -5,9 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/dnsresolver/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/dnsresolver/resource-manager/readme.go.md +- https://github.com/Azure/azure-rest-api-specs/blob/efb0537b7f01b4f1d8c01685b7c0e76ae9baf5c6/specification/dnsresolver/resource-manager/readme.md +- https://github.com/Azure/azure-rest-api-specs/blob/efb0537b7f01b4f1d8c01685b7c0e76ae9baf5c6/specification/dnsresolver/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 0.4.0 +module-version: 1.0.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/dnsresolver/armdnsresolver/zz_generated_constants.go b/sdk/resourcemanager/dnsresolver/armdnsresolver/constants.go similarity index 98% rename from sdk/resourcemanager/dnsresolver/armdnsresolver/zz_generated_constants.go rename to sdk/resourcemanager/dnsresolver/armdnsresolver/constants.go index a3df4638d448..38c23e7913f2 100644 --- a/sdk/resourcemanager/dnsresolver/armdnsresolver/zz_generated_constants.go +++ b/sdk/resourcemanager/dnsresolver/armdnsresolver/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 armdnsresolver const ( moduleName = "armdnsresolver" - moduleVersion = "v0.4.0" + moduleVersion = "v1.0.0" ) // CreatedByType - The type of identity that created the resource. diff --git a/sdk/resourcemanager/dnsresolver/armdnsresolver/zz_generated_dnsforwardingrulesets_client.go b/sdk/resourcemanager/dnsresolver/armdnsresolver/dnsforwardingrulesets_client.go similarity index 96% rename from sdk/resourcemanager/dnsresolver/armdnsresolver/zz_generated_dnsforwardingrulesets_client.go rename to sdk/resourcemanager/dnsresolver/armdnsresolver/dnsforwardingrulesets_client.go index 7789d7426e49..c5053f29743f 100644 --- a/sdk/resourcemanager/dnsresolver/armdnsresolver/zz_generated_dnsforwardingrulesets_client.go +++ b/sdk/resourcemanager/dnsresolver/armdnsresolver/dnsforwardingrulesets_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 armdnsresolver @@ -57,7 +58,7 @@ func NewDNSForwardingRulesetsClient(subscriptionID string, credential azcore.Tok // BeginCreateOrUpdate - Creates or updates a DNS forwarding ruleset. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-04-01-preview +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // dnsForwardingRulesetName - The name of the DNS forwarding ruleset. // parameters - Parameters supplied to the CreateOrUpdate operation. @@ -77,7 +78,7 @@ func (client *DNSForwardingRulesetsClient) BeginCreateOrUpdate(ctx context.Conte // CreateOrUpdate - Creates or updates a DNS forwarding ruleset. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-04-01-preview +// Generated from API version 2022-07-01 func (client *DNSForwardingRulesetsClient) createOrUpdate(ctx context.Context, resourceGroupName string, dnsForwardingRulesetName string, parameters DNSForwardingRuleset, options *DNSForwardingRulesetsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, dnsForwardingRulesetName, parameters, options) if err != nil { @@ -113,7 +114,7 @@ func (client *DNSForwardingRulesetsClient) createOrUpdateCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-04-01-preview") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -128,7 +129,7 @@ func (client *DNSForwardingRulesetsClient) createOrUpdateCreateRequest(ctx conte // BeginDelete - Deletes a DNS forwarding ruleset. WARNING: This operation cannot be undone. All forwarding rules within the // ruleset will be deleted. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-04-01-preview +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // dnsForwardingRulesetName - The name of the DNS forwarding ruleset. // options - DNSForwardingRulesetsClientBeginDeleteOptions contains the optional parameters for the DNSForwardingRulesetsClient.BeginDelete @@ -148,7 +149,7 @@ func (client *DNSForwardingRulesetsClient) BeginDelete(ctx context.Context, reso // Delete - Deletes a DNS forwarding ruleset. WARNING: This operation cannot be undone. All forwarding rules within the ruleset // will be deleted. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-04-01-preview +// Generated from API version 2022-07-01 func (client *DNSForwardingRulesetsClient) deleteOperation(ctx context.Context, resourceGroupName string, dnsForwardingRulesetName string, options *DNSForwardingRulesetsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, dnsForwardingRulesetName, options) if err != nil { @@ -184,7 +185,7 @@ func (client *DNSForwardingRulesetsClient) deleteCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-04-01-preview") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -195,7 +196,7 @@ func (client *DNSForwardingRulesetsClient) deleteCreateRequest(ctx context.Conte // Get - Gets a DNS forwarding ruleset properties. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-04-01-preview +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // dnsForwardingRulesetName - The name of the DNS forwarding ruleset. // options - DNSForwardingRulesetsClientGetOptions contains the optional parameters for the DNSForwardingRulesetsClient.Get @@ -235,7 +236,7 @@ func (client *DNSForwardingRulesetsClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-04-01-preview") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -252,7 +253,7 @@ func (client *DNSForwardingRulesetsClient) getHandleResponse(resp *http.Response // NewListPager - Lists DNS forwarding rulesets in all resource groups of a subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-04-01-preview +// Generated from API version 2022-07-01 // options - DNSForwardingRulesetsClientListOptions contains the optional parameters for the DNSForwardingRulesetsClient.List // method. func (client *DNSForwardingRulesetsClient) NewListPager(options *DNSForwardingRulesetsClientListOptions) *runtime.Pager[DNSForwardingRulesetsClientListResponse] { @@ -295,7 +296,7 @@ func (client *DNSForwardingRulesetsClient) listCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-04-01-preview") + reqQP.Set("api-version", "2022-07-01") if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } @@ -315,7 +316,7 @@ func (client *DNSForwardingRulesetsClient) listHandleResponse(resp *http.Respons // NewListByResourceGroupPager - Lists DNS forwarding rulesets within a resource group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-04-01-preview +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // options - DNSForwardingRulesetsClientListByResourceGroupOptions contains the optional parameters for the DNSForwardingRulesetsClient.ListByResourceGroup // method. @@ -363,7 +364,7 @@ func (client *DNSForwardingRulesetsClient) listByResourceGroupCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-04-01-preview") + reqQP.Set("api-version", "2022-07-01") if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } @@ -383,7 +384,7 @@ func (client *DNSForwardingRulesetsClient) listByResourceGroupHandleResponse(res // NewListByVirtualNetworkPager - Lists DNS forwarding ruleset resource IDs attached to a virtual network. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-04-01-preview +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // virtualNetworkName - The name of the virtual network. // options - DNSForwardingRulesetsClientListByVirtualNetworkOptions contains the optional parameters for the DNSForwardingRulesetsClient.ListByVirtualNetwork @@ -436,7 +437,7 @@ func (client *DNSForwardingRulesetsClient) listByVirtualNetworkCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-04-01-preview") + reqQP.Set("api-version", "2022-07-01") if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } @@ -456,7 +457,7 @@ func (client *DNSForwardingRulesetsClient) listByVirtualNetworkHandleResponse(re // BeginUpdate - Updates a DNS forwarding ruleset. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-04-01-preview +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // dnsForwardingRulesetName - The name of the DNS forwarding ruleset. // parameters - Parameters supplied to the Update operation. @@ -476,7 +477,7 @@ func (client *DNSForwardingRulesetsClient) BeginUpdate(ctx context.Context, reso // Update - Updates a DNS forwarding ruleset. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-04-01-preview +// Generated from API version 2022-07-01 func (client *DNSForwardingRulesetsClient) update(ctx context.Context, resourceGroupName string, dnsForwardingRulesetName string, parameters DNSForwardingRulesetPatch, options *DNSForwardingRulesetsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, dnsForwardingRulesetName, parameters, options) if err != nil { @@ -512,7 +513,7 @@ func (client *DNSForwardingRulesetsClient) updateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-04-01-preview") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} diff --git a/sdk/resourcemanager/dnsresolver/armdnsresolver/ze_generated_example_dnsforwardingrulesets_client_test.go b/sdk/resourcemanager/dnsresolver/armdnsresolver/dnsforwardingrulesets_client_example_test.go similarity index 91% rename from sdk/resourcemanager/dnsresolver/armdnsresolver/ze_generated_example_dnsforwardingrulesets_client_test.go rename to sdk/resourcemanager/dnsresolver/armdnsresolver/dnsforwardingrulesets_client_example_test.go index 70878f93399b..f43d5ab828d7 100644 --- a/sdk/resourcemanager/dnsresolver/armdnsresolver/ze_generated_example_dnsforwardingrulesets_client_test.go +++ b/sdk/resourcemanager/dnsresolver/armdnsresolver/dnsforwardingrulesets_client_example_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dnsresolver/armdnsresolver" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/DnsForwardingRuleset_Put.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/DnsForwardingRuleset_Put.json func ExampleDNSForwardingRulesetsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -60,7 +60,7 @@ func ExampleDNSForwardingRulesetsClient_BeginCreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/DnsForwardingRuleset_Patch.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/DnsForwardingRuleset_Patch.json func ExampleDNSForwardingRulesetsClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -91,7 +91,7 @@ func ExampleDNSForwardingRulesetsClient_BeginUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/DnsForwardingRuleset_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/DnsForwardingRuleset_Delete.json func ExampleDNSForwardingRulesetsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -115,7 +115,7 @@ func ExampleDNSForwardingRulesetsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/DnsForwardingRuleset_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/DnsForwardingRuleset_Get.json func ExampleDNSForwardingRulesetsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -137,7 +137,7 @@ func ExampleDNSForwardingRulesetsClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/DnsForwardingRuleset_ListByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/DnsForwardingRuleset_ListByResourceGroup.json func ExampleDNSForwardingRulesetsClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -162,7 +162,7 @@ func ExampleDNSForwardingRulesetsClient_NewListByResourceGroupPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/DnsForwardingRuleset_ListBySubscription.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/DnsForwardingRuleset_ListBySubscription.json func ExampleDNSForwardingRulesetsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -186,7 +186,7 @@ func ExampleDNSForwardingRulesetsClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/DnsForwardingRuleset_ListByVirtualNetwork.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/DnsForwardingRuleset_ListByVirtualNetwork.json func ExampleDNSForwardingRulesetsClient_NewListByVirtualNetworkPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/dnsresolver/armdnsresolver/zz_generated_dnsresolvers_client.go b/sdk/resourcemanager/dnsresolver/armdnsresolver/dnsresolvers_client.go similarity index 96% rename from sdk/resourcemanager/dnsresolver/armdnsresolver/zz_generated_dnsresolvers_client.go rename to sdk/resourcemanager/dnsresolver/armdnsresolver/dnsresolvers_client.go index 1d49859b31d4..ce4dcfc9063b 100644 --- a/sdk/resourcemanager/dnsresolver/armdnsresolver/zz_generated_dnsresolvers_client.go +++ b/sdk/resourcemanager/dnsresolver/armdnsresolver/dnsresolvers_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 armdnsresolver @@ -57,7 +58,7 @@ func NewDNSResolversClient(subscriptionID string, credential azcore.TokenCredent // BeginCreateOrUpdate - Creates or updates a DNS resolver. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-04-01-preview +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // dnsResolverName - The name of the DNS resolver. // parameters - Parameters supplied to the CreateOrUpdate operation. @@ -77,7 +78,7 @@ func (client *DNSResolversClient) BeginCreateOrUpdate(ctx context.Context, resou // CreateOrUpdate - Creates or updates a DNS resolver. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-04-01-preview +// Generated from API version 2022-07-01 func (client *DNSResolversClient) createOrUpdate(ctx context.Context, resourceGroupName string, dnsResolverName string, parameters DNSResolver, options *DNSResolversClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, dnsResolverName, parameters, options) if err != nil { @@ -113,7 +114,7 @@ func (client *DNSResolversClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-04-01-preview") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -127,7 +128,7 @@ func (client *DNSResolversClient) createOrUpdateCreateRequest(ctx context.Contex // BeginDelete - Deletes a DNS resolver. WARNING: This operation cannot be undone. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-04-01-preview +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // dnsResolverName - The name of the DNS resolver. // options - DNSResolversClientBeginDeleteOptions contains the optional parameters for the DNSResolversClient.BeginDelete @@ -146,7 +147,7 @@ func (client *DNSResolversClient) BeginDelete(ctx context.Context, resourceGroup // Delete - Deletes a DNS resolver. WARNING: This operation cannot be undone. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-04-01-preview +// Generated from API version 2022-07-01 func (client *DNSResolversClient) deleteOperation(ctx context.Context, resourceGroupName string, dnsResolverName string, options *DNSResolversClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, dnsResolverName, options) if err != nil { @@ -182,7 +183,7 @@ func (client *DNSResolversClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-04-01-preview") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -193,7 +194,7 @@ func (client *DNSResolversClient) deleteCreateRequest(ctx context.Context, resou // Get - Gets properties of a DNS resolver. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-04-01-preview +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // dnsResolverName - The name of the DNS resolver. // options - DNSResolversClientGetOptions contains the optional parameters for the DNSResolversClient.Get method. @@ -232,7 +233,7 @@ func (client *DNSResolversClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-04-01-preview") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -249,7 +250,7 @@ func (client *DNSResolversClient) getHandleResponse(resp *http.Response) (DNSRes // NewListPager - Lists DNS resolvers in all resource groups of a subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-04-01-preview +// Generated from API version 2022-07-01 // options - DNSResolversClientListOptions contains the optional parameters for the DNSResolversClient.List method. func (client *DNSResolversClient) NewListPager(options *DNSResolversClientListOptions) *runtime.Pager[DNSResolversClientListResponse] { return runtime.NewPager(runtime.PagingHandler[DNSResolversClientListResponse]{ @@ -291,7 +292,7 @@ func (client *DNSResolversClient) listCreateRequest(ctx context.Context, options return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-04-01-preview") + reqQP.Set("api-version", "2022-07-01") if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } @@ -311,7 +312,7 @@ func (client *DNSResolversClient) listHandleResponse(resp *http.Response) (DNSRe // NewListByResourceGroupPager - Lists DNS resolvers within a resource group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-04-01-preview +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // options - DNSResolversClientListByResourceGroupOptions contains the optional parameters for the DNSResolversClient.ListByResourceGroup // method. @@ -359,7 +360,7 @@ func (client *DNSResolversClient) listByResourceGroupCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-04-01-preview") + reqQP.Set("api-version", "2022-07-01") if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } @@ -379,7 +380,7 @@ func (client *DNSResolversClient) listByResourceGroupHandleResponse(resp *http.R // NewListByVirtualNetworkPager - Lists DNS resolver resource IDs linked to a virtual network. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-04-01-preview +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // virtualNetworkName - The name of the virtual network. // options - DNSResolversClientListByVirtualNetworkOptions contains the optional parameters for the DNSResolversClient.ListByVirtualNetwork @@ -432,7 +433,7 @@ func (client *DNSResolversClient) listByVirtualNetworkCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-04-01-preview") + reqQP.Set("api-version", "2022-07-01") if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } @@ -452,7 +453,7 @@ func (client *DNSResolversClient) listByVirtualNetworkHandleResponse(resp *http. // BeginUpdate - Updates a DNS resolver. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-04-01-preview +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // dnsResolverName - The name of the DNS resolver. // parameters - Parameters supplied to the Update operation. @@ -472,7 +473,7 @@ func (client *DNSResolversClient) BeginUpdate(ctx context.Context, resourceGroup // Update - Updates a DNS resolver. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-04-01-preview +// Generated from API version 2022-07-01 func (client *DNSResolversClient) update(ctx context.Context, resourceGroupName string, dnsResolverName string, parameters Patch, options *DNSResolversClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, dnsResolverName, parameters, options) if err != nil { @@ -508,7 +509,7 @@ func (client *DNSResolversClient) updateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-04-01-preview") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} diff --git a/sdk/resourcemanager/dnsresolver/armdnsresolver/ze_generated_example_dnsresolvers_client_test.go b/sdk/resourcemanager/dnsresolver/armdnsresolver/dnsresolvers_client_example_test.go similarity index 91% rename from sdk/resourcemanager/dnsresolver/armdnsresolver/ze_generated_example_dnsresolvers_client_test.go rename to sdk/resourcemanager/dnsresolver/armdnsresolver/dnsresolvers_client_example_test.go index 38aca6668989..a96ba6e2e6a6 100644 --- a/sdk/resourcemanager/dnsresolver/armdnsresolver/ze_generated_example_dnsresolvers_client_test.go +++ b/sdk/resourcemanager/dnsresolver/armdnsresolver/dnsresolvers_client_example_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dnsresolver/armdnsresolver" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/DnsResolver_Put.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/DnsResolver_Put.json func ExampleDNSResolversClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -56,7 +56,7 @@ func ExampleDNSResolversClient_BeginCreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/DnsResolver_Patch.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/DnsResolver_Patch.json func ExampleDNSResolversClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -87,7 +87,7 @@ func ExampleDNSResolversClient_BeginUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/DnsResolver_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/DnsResolver_Delete.json func ExampleDNSResolversClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -111,7 +111,7 @@ func ExampleDNSResolversClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/DnsResolver_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/DnsResolver_Get.json func ExampleDNSResolversClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -133,7 +133,7 @@ func ExampleDNSResolversClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/DnsResolver_ListByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/DnsResolver_ListByResourceGroup.json func ExampleDNSResolversClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -158,7 +158,7 @@ func ExampleDNSResolversClient_NewListByResourceGroupPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/DnsResolver_ListBySubscription.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/DnsResolver_ListBySubscription.json func ExampleDNSResolversClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -182,7 +182,7 @@ func ExampleDNSResolversClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/DnsResolver_ListByVirtualNetwork.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/DnsResolver_ListByVirtualNetwork.json func ExampleDNSResolversClient_NewListByVirtualNetworkPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/dnsresolver/armdnsresolver/zz_generated_forwardingrules_client.go b/sdk/resourcemanager/dnsresolver/armdnsresolver/forwardingrules_client.go similarity index 97% rename from sdk/resourcemanager/dnsresolver/armdnsresolver/zz_generated_forwardingrules_client.go rename to sdk/resourcemanager/dnsresolver/armdnsresolver/forwardingrules_client.go index 8a3e5b00c663..014b67ba2cfa 100644 --- a/sdk/resourcemanager/dnsresolver/armdnsresolver/zz_generated_forwardingrules_client.go +++ b/sdk/resourcemanager/dnsresolver/armdnsresolver/forwardingrules_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 armdnsresolver @@ -57,7 +58,7 @@ func NewForwardingRulesClient(subscriptionID string, credential azcore.TokenCred // CreateOrUpdate - Creates or updates a forwarding rule in a DNS forwarding ruleset. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-04-01-preview +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // dnsForwardingRulesetName - The name of the DNS forwarding ruleset. // forwardingRuleName - The name of the forwarding rule. @@ -103,7 +104,7 @@ func (client *ForwardingRulesClient) createOrUpdateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-04-01-preview") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -126,7 +127,7 @@ func (client *ForwardingRulesClient) createOrUpdateHandleResponse(resp *http.Res // Delete - Deletes a forwarding rule in a DNS forwarding ruleset. WARNING: This operation cannot be undone. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-04-01-preview +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // dnsForwardingRulesetName - The name of the DNS forwarding ruleset. // forwardingRuleName - The name of the forwarding rule. @@ -170,7 +171,7 @@ func (client *ForwardingRulesClient) deleteCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-04-01-preview") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -181,7 +182,7 @@ func (client *ForwardingRulesClient) deleteCreateRequest(ctx context.Context, re // Get - Gets properties of a forwarding rule in a DNS forwarding ruleset. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-04-01-preview +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // dnsForwardingRulesetName - The name of the DNS forwarding ruleset. // forwardingRuleName - The name of the forwarding rule. @@ -225,7 +226,7 @@ func (client *ForwardingRulesClient) getCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-04-01-preview") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -242,7 +243,7 @@ func (client *ForwardingRulesClient) getHandleResponse(resp *http.Response) (For // NewListPager - Lists forwarding rules in a DNS forwarding ruleset. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-04-01-preview +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // dnsForwardingRulesetName - The name of the DNS forwarding ruleset. // options - ForwardingRulesClientListOptions contains the optional parameters for the ForwardingRulesClient.List method. @@ -294,7 +295,7 @@ func (client *ForwardingRulesClient) listCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-04-01-preview") + reqQP.Set("api-version", "2022-07-01") if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } @@ -314,7 +315,7 @@ func (client *ForwardingRulesClient) listHandleResponse(resp *http.Response) (Fo // Update - Updates a forwarding rule in a DNS forwarding ruleset. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-04-01-preview +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // dnsForwardingRulesetName - The name of the DNS forwarding ruleset. // forwardingRuleName - The name of the forwarding rule. @@ -359,7 +360,7 @@ func (client *ForwardingRulesClient) updateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-04-01-preview") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} diff --git a/sdk/resourcemanager/dnsresolver/armdnsresolver/ze_generated_example_forwardingrules_client_test.go b/sdk/resourcemanager/dnsresolver/armdnsresolver/forwardingrules_client_example_test.go similarity index 92% rename from sdk/resourcemanager/dnsresolver/armdnsresolver/ze_generated_example_forwardingrules_client_test.go rename to sdk/resourcemanager/dnsresolver/armdnsresolver/forwardingrules_client_example_test.go index 29f4e7a4a853..7b336cdb6a1b 100644 --- a/sdk/resourcemanager/dnsresolver/armdnsresolver/ze_generated_example_forwardingrules_client_test.go +++ b/sdk/resourcemanager/dnsresolver/armdnsresolver/forwardingrules_client_example_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dnsresolver/armdnsresolver" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/ForwardingRule_Put.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/ForwardingRule_Put.json func ExampleForwardingRulesClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -60,7 +60,7 @@ func ExampleForwardingRulesClient_CreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/ForwardingRule_Patch.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/ForwardingRule_Patch.json func ExampleForwardingRulesClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -91,7 +91,7 @@ func ExampleForwardingRulesClient_Update() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/ForwardingRule_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/ForwardingRule_Delete.json func ExampleForwardingRulesClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -112,7 +112,7 @@ func ExampleForwardingRulesClient_Delete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/ForwardingRule_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/ForwardingRule_Get.json func ExampleForwardingRulesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -135,7 +135,7 @@ func ExampleForwardingRulesClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/ForwardingRule_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/ForwardingRule_List.json func ExampleForwardingRulesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/dnsresolver/armdnsresolver/go.mod b/sdk/resourcemanager/dnsresolver/armdnsresolver/go.mod index 900c2ea3600b..30af7258d984 100644 --- a/sdk/resourcemanager/dnsresolver/armdnsresolver/go.mod +++ b/sdk/resourcemanager/dnsresolver/armdnsresolver/go.mod @@ -4,12 +4,12 @@ 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 + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.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/AzureAD/microsoft-authentication-library-for-go v0.5.1 // 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 diff --git a/sdk/resourcemanager/dnsresolver/armdnsresolver/go.sum b/sdk/resourcemanager/dnsresolver/armdnsresolver/go.sum index ed5b814680ee..8828b17b1853 100644 --- a/sdk/resourcemanager/dnsresolver/armdnsresolver/go.sum +++ b/sdk/resourcemanager/dnsresolver/armdnsresolver/go.sum @@ -1,11 +1,11 @@ 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/azidentity v1.1.0 h1:QkAcEIAKbNL4KoFr4SathZPhDhF4mVwpBMFlYjyAqy8= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0/go.mod h1:bhXu1AjYL+wutSL/kpSq6s7733q2Rb0yuot9Zgfqa/0= 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/AzureAD/microsoft-authentication-library-for-go v0.5.1 h1:BWe8a+f/t+7KY7zH2mqygeUD0t8hNFXe08p1Pb3/jKE= +github.com/AzureAD/microsoft-authentication-library-for-go v0.5.1/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= diff --git a/sdk/resourcemanager/dnsresolver/armdnsresolver/zz_generated_inboundendpoints_client.go b/sdk/resourcemanager/dnsresolver/armdnsresolver/inboundendpoints_client.go similarity index 96% rename from sdk/resourcemanager/dnsresolver/armdnsresolver/zz_generated_inboundendpoints_client.go rename to sdk/resourcemanager/dnsresolver/armdnsresolver/inboundendpoints_client.go index b018594a8b6b..3f806aad2a2d 100644 --- a/sdk/resourcemanager/dnsresolver/armdnsresolver/zz_generated_inboundendpoints_client.go +++ b/sdk/resourcemanager/dnsresolver/armdnsresolver/inboundendpoints_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 armdnsresolver @@ -57,7 +58,7 @@ func NewInboundEndpointsClient(subscriptionID string, credential azcore.TokenCre // BeginCreateOrUpdate - Creates or updates an inbound endpoint for a DNS resolver. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-04-01-preview +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // dnsResolverName - The name of the DNS resolver. // inboundEndpointName - The name of the inbound endpoint for the DNS resolver. @@ -78,7 +79,7 @@ func (client *InboundEndpointsClient) BeginCreateOrUpdate(ctx context.Context, r // CreateOrUpdate - Creates or updates an inbound endpoint for a DNS resolver. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-04-01-preview +// Generated from API version 2022-07-01 func (client *InboundEndpointsClient) createOrUpdate(ctx context.Context, resourceGroupName string, dnsResolverName string, inboundEndpointName string, parameters InboundEndpoint, options *InboundEndpointsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, dnsResolverName, inboundEndpointName, parameters, options) if err != nil { @@ -118,7 +119,7 @@ func (client *InboundEndpointsClient) createOrUpdateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-04-01-preview") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -132,7 +133,7 @@ func (client *InboundEndpointsClient) createOrUpdateCreateRequest(ctx context.Co // BeginDelete - Deletes an inbound endpoint for a DNS resolver. WARNING: This operation cannot be undone. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-04-01-preview +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // dnsResolverName - The name of the DNS resolver. // inboundEndpointName - The name of the inbound endpoint for the DNS resolver. @@ -152,7 +153,7 @@ func (client *InboundEndpointsClient) BeginDelete(ctx context.Context, resourceG // Delete - Deletes an inbound endpoint for a DNS resolver. WARNING: This operation cannot be undone. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-04-01-preview +// Generated from API version 2022-07-01 func (client *InboundEndpointsClient) deleteOperation(ctx context.Context, resourceGroupName string, dnsResolverName string, inboundEndpointName string, options *InboundEndpointsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, dnsResolverName, inboundEndpointName, options) if err != nil { @@ -192,7 +193,7 @@ func (client *InboundEndpointsClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-04-01-preview") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -203,7 +204,7 @@ func (client *InboundEndpointsClient) deleteCreateRequest(ctx context.Context, r // Get - Gets properties of an inbound endpoint for a DNS resolver. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-04-01-preview +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // dnsResolverName - The name of the DNS resolver. // inboundEndpointName - The name of the inbound endpoint for the DNS resolver. @@ -247,7 +248,7 @@ func (client *InboundEndpointsClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-04-01-preview") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -264,7 +265,7 @@ func (client *InboundEndpointsClient) getHandleResponse(resp *http.Response) (In // NewListPager - Lists inbound endpoints for a DNS resolver. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-04-01-preview +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // dnsResolverName - The name of the DNS resolver. // options - InboundEndpointsClientListOptions contains the optional parameters for the InboundEndpointsClient.List method. @@ -316,7 +317,7 @@ func (client *InboundEndpointsClient) listCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-04-01-preview") + reqQP.Set("api-version", "2022-07-01") if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } @@ -336,7 +337,7 @@ func (client *InboundEndpointsClient) listHandleResponse(resp *http.Response) (I // BeginUpdate - Updates an inbound endpoint for a DNS resolver. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-04-01-preview +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // dnsResolverName - The name of the DNS resolver. // inboundEndpointName - The name of the inbound endpoint for the DNS resolver. @@ -357,7 +358,7 @@ func (client *InboundEndpointsClient) BeginUpdate(ctx context.Context, resourceG // Update - Updates an inbound endpoint for a DNS resolver. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-04-01-preview +// Generated from API version 2022-07-01 func (client *InboundEndpointsClient) update(ctx context.Context, resourceGroupName string, dnsResolverName string, inboundEndpointName string, parameters InboundEndpointPatch, options *InboundEndpointsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, dnsResolverName, inboundEndpointName, parameters, options) if err != nil { @@ -397,7 +398,7 @@ func (client *InboundEndpointsClient) updateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-04-01-preview") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} diff --git a/sdk/resourcemanager/dnsresolver/armdnsresolver/ze_generated_example_inboundendpoints_client_test.go b/sdk/resourcemanager/dnsresolver/armdnsresolver/inboundendpoints_client_example_test.go similarity index 92% rename from sdk/resourcemanager/dnsresolver/armdnsresolver/ze_generated_example_inboundendpoints_client_test.go rename to sdk/resourcemanager/dnsresolver/armdnsresolver/inboundendpoints_client_example_test.go index b59f0acdcc42..f3214b9e72d9 100644 --- a/sdk/resourcemanager/dnsresolver/armdnsresolver/ze_generated_example_inboundendpoints_client_test.go +++ b/sdk/resourcemanager/dnsresolver/armdnsresolver/inboundendpoints_client_example_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dnsresolver/armdnsresolver" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/InboundEndpoint_Put.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/InboundEndpoint_Put.json func ExampleInboundEndpointsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -62,7 +62,7 @@ func ExampleInboundEndpointsClient_BeginCreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/InboundEndpoint_Patch.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/InboundEndpoint_Patch.json func ExampleInboundEndpointsClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -94,7 +94,7 @@ func ExampleInboundEndpointsClient_BeginUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/InboundEndpoint_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/InboundEndpoint_Delete.json func ExampleInboundEndpointsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -119,7 +119,7 @@ func ExampleInboundEndpointsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/InboundEndpoint_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/InboundEndpoint_Get.json func ExampleInboundEndpointsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -142,7 +142,7 @@ func ExampleInboundEndpointsClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/InboundEndpoint_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/InboundEndpoint_List.json func ExampleInboundEndpointsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/dnsresolver/armdnsresolver/zz_generated_models.go b/sdk/resourcemanager/dnsresolver/armdnsresolver/models.go similarity index 97% rename from sdk/resourcemanager/dnsresolver/armdnsresolver/zz_generated_models.go rename to sdk/resourcemanager/dnsresolver/armdnsresolver/models.go index 832c849a206d..8e635821e555 100644 --- a/sdk/resourcemanager/dnsresolver/armdnsresolver/zz_generated_models.go +++ b/sdk/resourcemanager/dnsresolver/armdnsresolver/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 armdnsresolver @@ -36,7 +37,7 @@ type DNSForwardingRuleset struct { // REQUIRED; The geo-location where the resource lives Location *string `json:"location,omitempty"` - // Properties of the DNS forwarding ruleset. + // REQUIRED; Properties of the DNS forwarding ruleset. Properties *DNSForwardingRulesetProperties `json:"properties,omitempty"` // Resource tags. @@ -69,14 +70,18 @@ type DNSForwardingRulesetListResult struct { // DNSForwardingRulesetPatch - Describes a DNS forwarding ruleset PATCH operation. type DNSForwardingRulesetPatch struct { + // The reference to the DNS resolver outbound endpoints that are used to route DNS queries matching the forwarding rules in + // the ruleset to the target DNS servers. + DNSResolverOutboundEndpoints []*SubResource `json:"dnsResolverOutboundEndpoints,omitempty"` + // Tags for DNS Resolver. Tags map[string]*string `json:"tags,omitempty"` } // DNSForwardingRulesetProperties - Represents the properties of a DNS forwarding ruleset. type DNSForwardingRulesetProperties struct { - // The reference to the DNS resolver outbound endpoints that are used to route DNS queries matching the forwarding rules in - // the ruleset to the target DNS servers. + // REQUIRED; The reference to the DNS resolver outbound endpoints that are used to route DNS queries matching the forwarding + // rules in the ruleset to the target DNS servers. DNSResolverOutboundEndpoints []*SubResource `json:"dnsResolverOutboundEndpoints,omitempty"` // READ-ONLY; The current provisioning state of the DNS forwarding ruleset. This is a read-only property and any attempt to @@ -149,7 +154,7 @@ type DNSResolver struct { // REQUIRED; The geo-location where the resource lives Location *string `json:"location,omitempty"` - // Properties of the DNS resolver. + // REQUIRED; Properties of the DNS resolver. Properties *Properties `json:"properties,omitempty"` // Resource tags. @@ -228,7 +233,7 @@ type DNSResolversClientListOptions struct { // ForwardingRule - Describes a forwarding rule within a DNS forwarding ruleset. type ForwardingRule struct { - // Properties of the forwarding rule. + // REQUIRED; Properties of the forwarding rule. Properties *ForwardingRuleProperties `json:"properties,omitempty"` // READ-ONLY; ETag of the forwarding rule. @@ -330,14 +335,14 @@ type ForwardingRulesClientUpdateOptions struct { // IPConfiguration - IP configuration. type IPConfiguration struct { + // REQUIRED; The reference to the subnet bound to the IP configuration. + Subnet *SubResource `json:"subnet,omitempty"` + // Private IP address of the IP configuration. PrivateIPAddress *string `json:"privateIpAddress,omitempty"` // Private IP address allocation method. PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIpAllocationMethod,omitempty"` - - // The reference to the subnet bound to the IP configuration. - Subnet *SubResource `json:"subnet,omitempty"` } // InboundEndpoint - Describes an inbound endpoint for a DNS resolver. @@ -345,7 +350,7 @@ type InboundEndpoint struct { // REQUIRED; The geo-location where the resource lives Location *string `json:"location,omitempty"` - // Properties of the inbound endpoint. + // REQUIRED; Properties of the inbound endpoint. Properties *InboundEndpointProperties `json:"properties,omitempty"` // Resource tags. @@ -384,7 +389,7 @@ type InboundEndpointPatch struct { // InboundEndpointProperties - Represents the properties of an inbound endpoint for a DNS resolver. type InboundEndpointProperties struct { - // IP configurations for the inbound endpoint. + // REQUIRED; IP configurations for the inbound endpoint. IPConfigurations []*IPConfiguration `json:"ipConfigurations,omitempty"` // READ-ONLY; The current provisioning state of the inbound endpoint. This is a read-only property and any attempt to set @@ -450,7 +455,7 @@ type OutboundEndpoint struct { // REQUIRED; The geo-location where the resource lives Location *string `json:"location,omitempty"` - // Properties of the outbound endpoint. + // REQUIRED; Properties of the outbound endpoint. Properties *OutboundEndpointProperties `json:"properties,omitempty"` // Resource tags. @@ -489,7 +494,7 @@ type OutboundEndpointPatch struct { // OutboundEndpointProperties - Represents the properties of an outbound endpoint for a DNS resolver. type OutboundEndpointProperties struct { - // The reference to the subnet used for the outbound endpoint. + // REQUIRED; The reference to the subnet used for the outbound endpoint. Subnet *SubResource `json:"subnet,omitempty"` // READ-ONLY; The current provisioning state of the outbound endpoint. This is a read-only property and any attempt to set @@ -593,7 +598,7 @@ type Resource struct { // SubResource - Reference to another ARM resource. type SubResource struct { - // Resource ID. + // REQUIRED; Resource ID. ID *string `json:"id,omitempty"` } @@ -629,7 +634,7 @@ type SystemData struct { // TargetDNSServer - Describes a server to forward the DNS queries to. type TargetDNSServer struct { - // DNS server IP address. + // REQUIRED; DNS server IP address. IPAddress *string `json:"ipAddress,omitempty"` // DNS server port. @@ -676,7 +681,7 @@ type VirtualNetworkDNSForwardingRulesetListResult struct { // VirtualNetworkLink - Describes a virtual network link. type VirtualNetworkLink struct { - // Properties of the virtual network link. + // REQUIRED; Properties of the virtual network link. Properties *VirtualNetworkLinkProperties `json:"properties,omitempty"` // READ-ONLY; ETag of the virtual network link. @@ -718,12 +723,12 @@ type VirtualNetworkLinkPatchProperties struct { // VirtualNetworkLinkProperties - Represents the properties of a virtual network link. type VirtualNetworkLinkProperties struct { + // REQUIRED; The reference to the virtual network. This cannot be changed after creation. + VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` + // Metadata attached to the virtual network link. Metadata map[string]*string `json:"metadata,omitempty"` - // The reference to the virtual network. This cannot be changed after creation. - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` - // READ-ONLY; The current provisioning state of the virtual network link. This is a read-only property and any attempt to // set this value will be ignored. ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` diff --git a/sdk/resourcemanager/dnsresolver/armdnsresolver/models_serde.go b/sdk/resourcemanager/dnsresolver/armdnsresolver/models_serde.go new file mode 100644 index 000000000000..89bdae640fd2 --- /dev/null +++ b/sdk/resourcemanager/dnsresolver/armdnsresolver/models_serde.go @@ -0,0 +1,1426 @@ +//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 armdnsresolver + +import ( + "encoding/json" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "reflect" +) + +// MarshalJSON implements the json.Marshaller interface for type CloudError. +func (c CloudError) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "error", c.Error) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CloudError. +func (c *CloudError) 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 "error": + err = unpopulate(val, "Error", &c.Error) + 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 CloudErrorBody. +func (c CloudErrorBody) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "code", c.Code) + populate(objectMap, "details", c.Details) + populate(objectMap, "message", c.Message) + populate(objectMap, "target", c.Target) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CloudErrorBody. +func (c *CloudErrorBody) 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 "code": + err = unpopulate(val, "Code", &c.Code) + delete(rawMsg, key) + case "details": + err = unpopulate(val, "Details", &c.Details) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &c.Message) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &c.Target) + 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 DNSForwardingRuleset. +func (d DNSForwardingRuleset) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", d.Etag) + populate(objectMap, "id", d.ID) + populate(objectMap, "location", d.Location) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "systemData", d.SystemData) + populate(objectMap, "tags", d.Tags) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DNSForwardingRuleset. +func (d *DNSForwardingRuleset) 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &d.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &d.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &d.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &d.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DNSForwardingRulesetListResult. +func (d DNSForwardingRulesetListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DNSForwardingRulesetListResult. +func (d *DNSForwardingRulesetListResult) 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &d.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &d.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DNSForwardingRulesetPatch. +func (d DNSForwardingRulesetPatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "dnsResolverOutboundEndpoints", d.DNSResolverOutboundEndpoints) + populate(objectMap, "tags", d.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DNSForwardingRulesetPatch. +func (d *DNSForwardingRulesetPatch) 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "dnsResolverOutboundEndpoints": + err = unpopulate(val, "DNSResolverOutboundEndpoints", &d.DNSResolverOutboundEndpoints) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &d.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DNSForwardingRulesetProperties. +func (d DNSForwardingRulesetProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "dnsResolverOutboundEndpoints", d.DNSResolverOutboundEndpoints) + populate(objectMap, "provisioningState", d.ProvisioningState) + populate(objectMap, "resourceGuid", d.ResourceGUID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DNSForwardingRulesetProperties. +func (d *DNSForwardingRulesetProperties) 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "dnsResolverOutboundEndpoints": + err = unpopulate(val, "DNSResolverOutboundEndpoints", &d.DNSResolverOutboundEndpoints) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) + delete(rawMsg, key) + case "resourceGuid": + err = unpopulate(val, "ResourceGUID", &d.ResourceGUID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DNSResolver. +func (d DNSResolver) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", d.Etag) + populate(objectMap, "id", d.ID) + populate(objectMap, "location", d.Location) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "systemData", d.SystemData) + populate(objectMap, "tags", d.Tags) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DNSResolver. +func (d *DNSResolver) 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &d.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &d.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &d.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &d.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ForwardingRule. +func (f ForwardingRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", f.Etag) + populate(objectMap, "id", f.ID) + populate(objectMap, "name", f.Name) + populate(objectMap, "properties", f.Properties) + populate(objectMap, "systemData", f.SystemData) + populate(objectMap, "type", f.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ForwardingRule. +func (f *ForwardingRule) 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", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &f.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &f.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &f.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &f.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &f.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &f.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ForwardingRuleListResult. +func (f ForwardingRuleListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", f.NextLink) + populate(objectMap, "value", f.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ForwardingRuleListResult. +func (f *ForwardingRuleListResult) 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", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &f.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &f.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ForwardingRulePatch. +func (f ForwardingRulePatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", f.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ForwardingRulePatch. +func (f *ForwardingRulePatch) 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", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &f.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ForwardingRulePatchProperties. +func (f ForwardingRulePatchProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "forwardingRuleState", f.ForwardingRuleState) + populate(objectMap, "metadata", f.Metadata) + populate(objectMap, "targetDnsServers", f.TargetDNSServers) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ForwardingRulePatchProperties. +func (f *ForwardingRulePatchProperties) 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", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "forwardingRuleState": + err = unpopulate(val, "ForwardingRuleState", &f.ForwardingRuleState) + delete(rawMsg, key) + case "metadata": + err = unpopulate(val, "Metadata", &f.Metadata) + delete(rawMsg, key) + case "targetDnsServers": + err = unpopulate(val, "TargetDNSServers", &f.TargetDNSServers) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ForwardingRuleProperties. +func (f ForwardingRuleProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "domainName", f.DomainName) + populate(objectMap, "forwardingRuleState", f.ForwardingRuleState) + populate(objectMap, "metadata", f.Metadata) + populate(objectMap, "provisioningState", f.ProvisioningState) + populate(objectMap, "targetDnsServers", f.TargetDNSServers) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ForwardingRuleProperties. +func (f *ForwardingRuleProperties) 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", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "domainName": + err = unpopulate(val, "DomainName", &f.DomainName) + delete(rawMsg, key) + case "forwardingRuleState": + err = unpopulate(val, "ForwardingRuleState", &f.ForwardingRuleState) + delete(rawMsg, key) + case "metadata": + err = unpopulate(val, "Metadata", &f.Metadata) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &f.ProvisioningState) + delete(rawMsg, key) + case "targetDnsServers": + err = unpopulate(val, "TargetDNSServers", &f.TargetDNSServers) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IPConfiguration. +func (i IPConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "privateIpAddress", i.PrivateIPAddress) + populate(objectMap, "privateIpAllocationMethod", i.PrivateIPAllocationMethod) + populate(objectMap, "subnet", i.Subnet) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IPConfiguration. +func (i *IPConfiguration) 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 "privateIpAddress": + err = unpopulate(val, "PrivateIPAddress", &i.PrivateIPAddress) + delete(rawMsg, key) + case "privateIpAllocationMethod": + err = unpopulate(val, "PrivateIPAllocationMethod", &i.PrivateIPAllocationMethod) + delete(rawMsg, key) + case "subnet": + err = unpopulate(val, "Subnet", &i.Subnet) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type InboundEndpoint. +func (i InboundEndpoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", i.Etag) + populate(objectMap, "id", i.ID) + populate(objectMap, "location", i.Location) + populate(objectMap, "name", i.Name) + populate(objectMap, "properties", i.Properties) + populate(objectMap, "systemData", i.SystemData) + populate(objectMap, "tags", i.Tags) + populate(objectMap, "type", i.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InboundEndpoint. +func (i *InboundEndpoint) 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 "etag": + err = unpopulate(val, "Etag", &i.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &i.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &i.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &i.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &i.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &i.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &i.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &i.Type) + 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 InboundEndpointListResult. +func (i InboundEndpointListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", i.NextLink) + populate(objectMap, "value", i.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InboundEndpointListResult. +func (i *InboundEndpointListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &i.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &i.Value) + 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 InboundEndpointPatch. +func (i InboundEndpointPatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "tags", i.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InboundEndpointPatch. +func (i *InboundEndpointPatch) 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 "tags": + err = unpopulate(val, "Tags", &i.Tags) + 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 InboundEndpointProperties. +func (i InboundEndpointProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "ipConfigurations", i.IPConfigurations) + populate(objectMap, "provisioningState", i.ProvisioningState) + populate(objectMap, "resourceGuid", i.ResourceGUID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InboundEndpointProperties. +func (i *InboundEndpointProperties) 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 "ipConfigurations": + err = unpopulate(val, "IPConfigurations", &i.IPConfigurations) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &i.ProvisioningState) + delete(rawMsg, key) + case "resourceGuid": + err = unpopulate(val, "ResourceGUID", &i.ResourceGUID) + 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 ListResult. +func (l ListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", l.NextLink) + populate(objectMap, "value", l.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ListResult. +func (l *ListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &l.NextLink) + delete(rawMsg, 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 OutboundEndpoint. +func (o OutboundEndpoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", o.Etag) + populate(objectMap, "id", o.ID) + populate(objectMap, "location", o.Location) + populate(objectMap, "name", o.Name) + populate(objectMap, "properties", o.Properties) + populate(objectMap, "systemData", o.SystemData) + populate(objectMap, "tags", o.Tags) + populate(objectMap, "type", o.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OutboundEndpoint. +func (o *OutboundEndpoint) 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 "etag": + err = unpopulate(val, "Etag", &o.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &o.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &o.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &o.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &o.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &o.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &o.Type) + 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 OutboundEndpointListResult. +func (o OutboundEndpointListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OutboundEndpointListResult. +func (o *OutboundEndpointListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &o.NextLink) + delete(rawMsg, 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 OutboundEndpointPatch. +func (o OutboundEndpointPatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "tags", o.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OutboundEndpointPatch. +func (o *OutboundEndpointPatch) 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 "tags": + err = unpopulate(val, "Tags", &o.Tags) + 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 OutboundEndpointProperties. +func (o OutboundEndpointProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "provisioningState", o.ProvisioningState) + populate(objectMap, "resourceGuid", o.ResourceGUID) + populate(objectMap, "subnet", o.Subnet) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OutboundEndpointProperties. +func (o *OutboundEndpointProperties) 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 "provisioningState": + err = unpopulate(val, "ProvisioningState", &o.ProvisioningState) + delete(rawMsg, key) + case "resourceGuid": + err = unpopulate(val, "ResourceGUID", &o.ResourceGUID) + delete(rawMsg, key) + case "subnet": + err = unpopulate(val, "Subnet", &o.Subnet) + 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 Patch. +func (p Patch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "tags", p.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Patch. +func (p *Patch) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "tags": + err = unpopulate(val, "Tags", &p.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Properties. +func (p Properties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "dnsResolverState", p.DNSResolverState) + populate(objectMap, "provisioningState", p.ProvisioningState) + populate(objectMap, "resourceGuid", p.ResourceGUID) + populate(objectMap, "virtualNetwork", p.VirtualNetwork) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Properties. +func (p *Properties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "dnsResolverState": + err = unpopulate(val, "DNSResolverState", &p.DNSResolverState) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) + delete(rawMsg, key) + case "resourceGuid": + err = unpopulate(val, "ResourceGUID", &p.ResourceGUID) + delete(rawMsg, key) + case "virtualNetwork": + err = unpopulate(val, "VirtualNetwork", &p.VirtualNetwork) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ProxyResource. +func (p ProxyResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResource. +func (p *ProxyResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Resource. +func (r *Resource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SubResource. +func (s SubResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SubResource. +func (s *SubResource) 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 "id": + err = unpopulate(val, "ID", &s.ID) + 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 SubResourceListResult. +func (s SubResourceListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SubResourceListResult. +func (s *SubResourceListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + 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 TargetDNSServer. +func (t TargetDNSServer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "ipAddress", t.IPAddress) + populate(objectMap, "port", t.Port) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TargetDNSServer. +func (t *TargetDNSServer) 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 "ipAddress": + err = unpopulate(val, "IPAddress", &t.IPAddress) + delete(rawMsg, key) + case "port": + err = unpopulate(val, "Port", &t.Port) + 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 TrackedResource. +func (t TrackedResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", t.ID) + populate(objectMap, "location", t.Location) + populate(objectMap, "name", t.Name) + populate(objectMap, "tags", t.Tags) + populate(objectMap, "type", t.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TrackedResource. +func (t *TrackedResource) 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 "id": + err = unpopulate(val, "ID", &t.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &t.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &t.Name) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &t.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &t.Type) + 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 VirtualNetworkDNSForwardingRuleset. +func (v VirtualNetworkDNSForwardingRuleset) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", v.ID) + populate(objectMap, "properties", v.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkDNSForwardingRuleset. +func (v *VirtualNetworkDNSForwardingRuleset) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &v.ID) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &v.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkDNSForwardingRulesetListResult. +func (v VirtualNetworkDNSForwardingRulesetListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", v.NextLink) + populate(objectMap, "value", v.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkDNSForwardingRulesetListResult. +func (v *VirtualNetworkDNSForwardingRulesetListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &v.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &v.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkLink. +func (v VirtualNetworkLink) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", v.Etag) + populate(objectMap, "id", v.ID) + populate(objectMap, "name", v.Name) + populate(objectMap, "properties", v.Properties) + populate(objectMap, "systemData", v.SystemData) + populate(objectMap, "type", v.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkLink. +func (v *VirtualNetworkLink) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &v.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &v.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &v.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &v.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &v.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &v.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkLinkListResult. +func (v VirtualNetworkLinkListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", v.NextLink) + populate(objectMap, "value", v.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkLinkListResult. +func (v *VirtualNetworkLinkListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &v.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &v.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkLinkPatch. +func (v VirtualNetworkLinkPatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", v.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkLinkPatch. +func (v *VirtualNetworkLinkPatch) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &v.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkLinkPatchProperties. +func (v VirtualNetworkLinkPatchProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "metadata", v.Metadata) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkLinkPatchProperties. +func (v *VirtualNetworkLinkPatchProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "metadata": + err = unpopulate(val, "Metadata", &v.Metadata) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkLinkProperties. +func (v VirtualNetworkLinkProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "metadata", v.Metadata) + populate(objectMap, "provisioningState", v.ProvisioningState) + populate(objectMap, "virtualNetwork", v.VirtualNetwork) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkLinkProperties. +func (v *VirtualNetworkLinkProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "metadata": + err = unpopulate(val, "Metadata", &v.Metadata) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) + delete(rawMsg, key) + case "virtualNetwork": + err = unpopulate(val, "VirtualNetwork", &v.VirtualNetwork) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkLinkSubResourceProperties. +func (v VirtualNetworkLinkSubResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "virtualNetworkLink", v.VirtualNetworkLink) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkLinkSubResourceProperties. +func (v *VirtualNetworkLinkSubResourceProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "virtualNetworkLink": + err = unpopulate(val, "VirtualNetworkLink", &v.VirtualNetworkLink) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +func populate(m map[string]interface{}, k string, v interface{}) { + if v == nil { + return + } else if azcore.IsNullValue(v) { + m[k] = nil + } else if !reflect.ValueOf(v).IsNil() { + m[k] = v + } +} + +func unpopulate(data json.RawMessage, fn string, v interface{}) error { + if data == nil { + return nil + } + if err := json.Unmarshal(data, v); err != nil { + return fmt.Errorf("struct field %s: %v", fn, err) + } + return nil +} diff --git a/sdk/resourcemanager/dnsresolver/armdnsresolver/zz_generated_outboundendpoints_client.go b/sdk/resourcemanager/dnsresolver/armdnsresolver/outboundendpoints_client.go similarity index 96% rename from sdk/resourcemanager/dnsresolver/armdnsresolver/zz_generated_outboundendpoints_client.go rename to sdk/resourcemanager/dnsresolver/armdnsresolver/outboundendpoints_client.go index 69b0791d9fb9..67e449ad6be9 100644 --- a/sdk/resourcemanager/dnsresolver/armdnsresolver/zz_generated_outboundendpoints_client.go +++ b/sdk/resourcemanager/dnsresolver/armdnsresolver/outboundendpoints_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 armdnsresolver @@ -57,7 +58,7 @@ func NewOutboundEndpointsClient(subscriptionID string, credential azcore.TokenCr // BeginCreateOrUpdate - Creates or updates an outbound endpoint for a DNS resolver. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-04-01-preview +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // dnsResolverName - The name of the DNS resolver. // outboundEndpointName - The name of the outbound endpoint for the DNS resolver. @@ -78,7 +79,7 @@ func (client *OutboundEndpointsClient) BeginCreateOrUpdate(ctx context.Context, // CreateOrUpdate - Creates or updates an outbound endpoint for a DNS resolver. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-04-01-preview +// Generated from API version 2022-07-01 func (client *OutboundEndpointsClient) createOrUpdate(ctx context.Context, resourceGroupName string, dnsResolverName string, outboundEndpointName string, parameters OutboundEndpoint, options *OutboundEndpointsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, dnsResolverName, outboundEndpointName, parameters, options) if err != nil { @@ -118,7 +119,7 @@ func (client *OutboundEndpointsClient) createOrUpdateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-04-01-preview") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -132,7 +133,7 @@ func (client *OutboundEndpointsClient) createOrUpdateCreateRequest(ctx context.C // BeginDelete - Deletes an outbound endpoint for a DNS resolver. WARNING: This operation cannot be undone. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-04-01-preview +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // dnsResolverName - The name of the DNS resolver. // outboundEndpointName - The name of the outbound endpoint for the DNS resolver. @@ -152,7 +153,7 @@ func (client *OutboundEndpointsClient) BeginDelete(ctx context.Context, resource // Delete - Deletes an outbound endpoint for a DNS resolver. WARNING: This operation cannot be undone. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-04-01-preview +// Generated from API version 2022-07-01 func (client *OutboundEndpointsClient) deleteOperation(ctx context.Context, resourceGroupName string, dnsResolverName string, outboundEndpointName string, options *OutboundEndpointsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, dnsResolverName, outboundEndpointName, options) if err != nil { @@ -192,7 +193,7 @@ func (client *OutboundEndpointsClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-04-01-preview") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -203,7 +204,7 @@ func (client *OutboundEndpointsClient) deleteCreateRequest(ctx context.Context, // Get - Gets properties of an outbound endpoint for a DNS resolver. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-04-01-preview +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // dnsResolverName - The name of the DNS resolver. // outboundEndpointName - The name of the outbound endpoint for the DNS resolver. @@ -247,7 +248,7 @@ func (client *OutboundEndpointsClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-04-01-preview") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -264,7 +265,7 @@ func (client *OutboundEndpointsClient) getHandleResponse(resp *http.Response) (O // NewListPager - Lists outbound endpoints for a DNS resolver. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-04-01-preview +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // dnsResolverName - The name of the DNS resolver. // options - OutboundEndpointsClientListOptions contains the optional parameters for the OutboundEndpointsClient.List method. @@ -316,7 +317,7 @@ func (client *OutboundEndpointsClient) listCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-04-01-preview") + reqQP.Set("api-version", "2022-07-01") if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } @@ -336,7 +337,7 @@ func (client *OutboundEndpointsClient) listHandleResponse(resp *http.Response) ( // BeginUpdate - Updates an outbound endpoint for a DNS resolver. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-04-01-preview +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // dnsResolverName - The name of the DNS resolver. // outboundEndpointName - The name of the outbound endpoint for the DNS resolver. @@ -357,7 +358,7 @@ func (client *OutboundEndpointsClient) BeginUpdate(ctx context.Context, resource // Update - Updates an outbound endpoint for a DNS resolver. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-04-01-preview +// Generated from API version 2022-07-01 func (client *OutboundEndpointsClient) update(ctx context.Context, resourceGroupName string, dnsResolverName string, outboundEndpointName string, parameters OutboundEndpointPatch, options *OutboundEndpointsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, dnsResolverName, outboundEndpointName, parameters, options) if err != nil { @@ -397,7 +398,7 @@ func (client *OutboundEndpointsClient) updateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-04-01-preview") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} diff --git a/sdk/resourcemanager/dnsresolver/armdnsresolver/ze_generated_example_outboundendpoints_client_test.go b/sdk/resourcemanager/dnsresolver/armdnsresolver/outboundendpoints_client_example_test.go similarity index 92% rename from sdk/resourcemanager/dnsresolver/armdnsresolver/ze_generated_example_outboundendpoints_client_test.go rename to sdk/resourcemanager/dnsresolver/armdnsresolver/outboundendpoints_client_example_test.go index 5f5857f961ba..e0bea071d2cf 100644 --- a/sdk/resourcemanager/dnsresolver/armdnsresolver/ze_generated_example_outboundendpoints_client_test.go +++ b/sdk/resourcemanager/dnsresolver/armdnsresolver/outboundendpoints_client_example_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dnsresolver/armdnsresolver" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/OutboundEndpoint_Put.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/OutboundEndpoint_Put.json func ExampleOutboundEndpointsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -57,7 +57,7 @@ func ExampleOutboundEndpointsClient_BeginCreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/OutboundEndpoint_Patch.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/OutboundEndpoint_Patch.json func ExampleOutboundEndpointsClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -89,7 +89,7 @@ func ExampleOutboundEndpointsClient_BeginUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/OutboundEndpoint_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/OutboundEndpoint_Delete.json func ExampleOutboundEndpointsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -114,7 +114,7 @@ func ExampleOutboundEndpointsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/OutboundEndpoint_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/OutboundEndpoint_Get.json func ExampleOutboundEndpointsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -137,7 +137,7 @@ func ExampleOutboundEndpointsClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/OutboundEndpoint_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/OutboundEndpoint_List.json func ExampleOutboundEndpointsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/dnsresolver/armdnsresolver/zz_generated_response_types.go b/sdk/resourcemanager/dnsresolver/armdnsresolver/response_types.go similarity index 99% rename from sdk/resourcemanager/dnsresolver/armdnsresolver/zz_generated_response_types.go rename to sdk/resourcemanager/dnsresolver/armdnsresolver/response_types.go index de82df993774..ff0d4d4ceda3 100644 --- a/sdk/resourcemanager/dnsresolver/armdnsresolver/zz_generated_response_types.go +++ b/sdk/resourcemanager/dnsresolver/armdnsresolver/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 armdnsresolver diff --git a/sdk/resourcemanager/dnsresolver/armdnsresolver/zz_generated_time_rfc3339.go b/sdk/resourcemanager/dnsresolver/armdnsresolver/time_rfc3339.go similarity index 99% rename from sdk/resourcemanager/dnsresolver/armdnsresolver/zz_generated_time_rfc3339.go rename to sdk/resourcemanager/dnsresolver/armdnsresolver/time_rfc3339.go index 515ca137cd19..c8304c552848 100644 --- a/sdk/resourcemanager/dnsresolver/armdnsresolver/zz_generated_time_rfc3339.go +++ b/sdk/resourcemanager/dnsresolver/armdnsresolver/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 armdnsresolver diff --git a/sdk/resourcemanager/dnsresolver/armdnsresolver/zz_generated_virtualnetworklinks_client.go b/sdk/resourcemanager/dnsresolver/armdnsresolver/virtualnetworklinks_client.go similarity index 97% rename from sdk/resourcemanager/dnsresolver/armdnsresolver/zz_generated_virtualnetworklinks_client.go rename to sdk/resourcemanager/dnsresolver/armdnsresolver/virtualnetworklinks_client.go index a4e5dac82c7d..19c7e77875ff 100644 --- a/sdk/resourcemanager/dnsresolver/armdnsresolver/zz_generated_virtualnetworklinks_client.go +++ b/sdk/resourcemanager/dnsresolver/armdnsresolver/virtualnetworklinks_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 armdnsresolver @@ -57,7 +58,7 @@ func NewVirtualNetworkLinksClient(subscriptionID string, credential azcore.Token // BeginCreateOrUpdate - Creates or updates a virtual network link to a DNS forwarding ruleset. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-04-01-preview +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // dnsForwardingRulesetName - The name of the DNS forwarding ruleset. // virtualNetworkLinkName - The name of the virtual network link. @@ -78,7 +79,7 @@ func (client *VirtualNetworkLinksClient) BeginCreateOrUpdate(ctx context.Context // CreateOrUpdate - Creates or updates a virtual network link to a DNS forwarding ruleset. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-04-01-preview +// Generated from API version 2022-07-01 func (client *VirtualNetworkLinksClient) createOrUpdate(ctx context.Context, resourceGroupName string, dnsForwardingRulesetName string, virtualNetworkLinkName string, parameters VirtualNetworkLink, options *VirtualNetworkLinksClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, dnsForwardingRulesetName, virtualNetworkLinkName, parameters, options) if err != nil { @@ -118,7 +119,7 @@ func (client *VirtualNetworkLinksClient) createOrUpdateCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-04-01-preview") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -132,7 +133,7 @@ func (client *VirtualNetworkLinksClient) createOrUpdateCreateRequest(ctx context // BeginDelete - Deletes a virtual network link to a DNS forwarding ruleset. WARNING: This operation cannot be undone. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-04-01-preview +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // dnsForwardingRulesetName - The name of the DNS forwarding ruleset. // virtualNetworkLinkName - The name of the virtual network link. @@ -152,7 +153,7 @@ func (client *VirtualNetworkLinksClient) BeginDelete(ctx context.Context, resour // Delete - Deletes a virtual network link to a DNS forwarding ruleset. WARNING: This operation cannot be undone. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-04-01-preview +// Generated from API version 2022-07-01 func (client *VirtualNetworkLinksClient) deleteOperation(ctx context.Context, resourceGroupName string, dnsForwardingRulesetName string, virtualNetworkLinkName string, options *VirtualNetworkLinksClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, dnsForwardingRulesetName, virtualNetworkLinkName, options) if err != nil { @@ -192,7 +193,7 @@ func (client *VirtualNetworkLinksClient) deleteCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-04-01-preview") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -203,7 +204,7 @@ func (client *VirtualNetworkLinksClient) deleteCreateRequest(ctx context.Context // Get - Gets properties of a virtual network link to a DNS forwarding ruleset. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-04-01-preview +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // dnsForwardingRulesetName - The name of the DNS forwarding ruleset. // virtualNetworkLinkName - The name of the virtual network link. @@ -247,7 +248,7 @@ func (client *VirtualNetworkLinksClient) getCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-04-01-preview") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -264,7 +265,7 @@ func (client *VirtualNetworkLinksClient) getHandleResponse(resp *http.Response) // NewListPager - Lists virtual network links to a DNS forwarding ruleset. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-04-01-preview +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // dnsForwardingRulesetName - The name of the DNS forwarding ruleset. // options - VirtualNetworkLinksClientListOptions contains the optional parameters for the VirtualNetworkLinksClient.List @@ -317,7 +318,7 @@ func (client *VirtualNetworkLinksClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-04-01-preview") + reqQP.Set("api-version", "2022-07-01") if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } @@ -337,7 +338,7 @@ func (client *VirtualNetworkLinksClient) listHandleResponse(resp *http.Response) // BeginUpdate - Updates a virtual network link to a DNS forwarding ruleset. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-04-01-preview +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // dnsForwardingRulesetName - The name of the DNS forwarding ruleset. // virtualNetworkLinkName - The name of the virtual network link. @@ -358,7 +359,7 @@ func (client *VirtualNetworkLinksClient) BeginUpdate(ctx context.Context, resour // Update - Updates a virtual network link to a DNS forwarding ruleset. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-04-01-preview +// Generated from API version 2022-07-01 func (client *VirtualNetworkLinksClient) update(ctx context.Context, resourceGroupName string, dnsForwardingRulesetName string, virtualNetworkLinkName string, parameters VirtualNetworkLinkPatch, options *VirtualNetworkLinksClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, dnsForwardingRulesetName, virtualNetworkLinkName, parameters, options) if err != nil { @@ -398,7 +399,7 @@ func (client *VirtualNetworkLinksClient) updateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-04-01-preview") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} diff --git a/sdk/resourcemanager/dnsresolver/armdnsresolver/ze_generated_example_virtualnetworklinks_client_test.go b/sdk/resourcemanager/dnsresolver/armdnsresolver/virtualnetworklinks_client_example_test.go similarity index 92% rename from sdk/resourcemanager/dnsresolver/armdnsresolver/ze_generated_example_virtualnetworklinks_client_test.go rename to sdk/resourcemanager/dnsresolver/armdnsresolver/virtualnetworklinks_client_example_test.go index 72db2e9a2e21..3fdbd1775359 100644 --- a/sdk/resourcemanager/dnsresolver/armdnsresolver/ze_generated_example_virtualnetworklinks_client_test.go +++ b/sdk/resourcemanager/dnsresolver/armdnsresolver/virtualnetworklinks_client_example_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dnsresolver/armdnsresolver" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/VirtualNetworkLink_Put.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/VirtualNetworkLink_Put.json func ExampleVirtualNetworkLinksClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -56,7 +56,7 @@ func ExampleVirtualNetworkLinksClient_BeginCreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/VirtualNetworkLink_Patch.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/VirtualNetworkLink_Patch.json func ExampleVirtualNetworkLinksClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -90,7 +90,7 @@ func ExampleVirtualNetworkLinksClient_BeginUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/VirtualNetworkLink_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/VirtualNetworkLink_Delete.json func ExampleVirtualNetworkLinksClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -115,7 +115,7 @@ func ExampleVirtualNetworkLinksClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/VirtualNetworkLink_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/VirtualNetworkLink_Get.json func ExampleVirtualNetworkLinksClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -138,7 +138,7 @@ func ExampleVirtualNetworkLinksClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/VirtualNetworkLink_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/stable/2022-07-01/examples/VirtualNetworkLink_List.json func ExampleVirtualNetworkLinksClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/dnsresolver/armdnsresolver/zz_generated_models_serde.go b/sdk/resourcemanager/dnsresolver/armdnsresolver/zz_generated_models_serde.go deleted file mode 100644 index b7fef0da7867..000000000000 --- a/sdk/resourcemanager/dnsresolver/armdnsresolver/zz_generated_models_serde.go +++ /dev/null @@ -1,246 +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 armdnsresolver - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" -) - -// MarshalJSON implements the json.Marshaller interface for type DNSForwardingRuleset. -func (d DNSForwardingRuleset) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", d.Etag) - populate(objectMap, "id", d.ID) - populate(objectMap, "location", d.Location) - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "systemData", d.SystemData) - populate(objectMap, "tags", d.Tags) - populate(objectMap, "type", d.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type DNSForwardingRulesetPatch. -func (d DNSForwardingRulesetPatch) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "tags", d.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type DNSForwardingRulesetProperties. -func (d DNSForwardingRulesetProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "dnsResolverOutboundEndpoints", d.DNSResolverOutboundEndpoints) - populate(objectMap, "provisioningState", d.ProvisioningState) - populate(objectMap, "resourceGuid", d.ResourceGUID) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type DNSResolver. -func (d DNSResolver) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", d.Etag) - populate(objectMap, "id", d.ID) - populate(objectMap, "location", d.Location) - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "systemData", d.SystemData) - populate(objectMap, "tags", d.Tags) - populate(objectMap, "type", d.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ForwardingRulePatch. -func (f ForwardingRulePatch) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", f.Properties) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ForwardingRulePatchProperties. -func (f ForwardingRulePatchProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "forwardingRuleState", f.ForwardingRuleState) - populate(objectMap, "metadata", f.Metadata) - populate(objectMap, "targetDnsServers", f.TargetDNSServers) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ForwardingRuleProperties. -func (f ForwardingRuleProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "domainName", f.DomainName) - populate(objectMap, "forwardingRuleState", f.ForwardingRuleState) - populate(objectMap, "metadata", f.Metadata) - populate(objectMap, "provisioningState", f.ProvisioningState) - populate(objectMap, "targetDnsServers", f.TargetDNSServers) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type InboundEndpoint. -func (i InboundEndpoint) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", i.Etag) - populate(objectMap, "id", i.ID) - populate(objectMap, "location", i.Location) - populate(objectMap, "name", i.Name) - populate(objectMap, "properties", i.Properties) - populate(objectMap, "systemData", i.SystemData) - populate(objectMap, "tags", i.Tags) - populate(objectMap, "type", i.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type InboundEndpointPatch. -func (i InboundEndpointPatch) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "tags", i.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type InboundEndpointProperties. -func (i InboundEndpointProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "ipConfigurations", i.IPConfigurations) - populate(objectMap, "provisioningState", i.ProvisioningState) - populate(objectMap, "resourceGuid", i.ResourceGUID) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type OutboundEndpoint. -func (o OutboundEndpoint) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", o.Etag) - populate(objectMap, "id", o.ID) - populate(objectMap, "location", o.Location) - populate(objectMap, "name", o.Name) - populate(objectMap, "properties", o.Properties) - populate(objectMap, "systemData", o.SystemData) - populate(objectMap, "tags", o.Tags) - populate(objectMap, "type", o.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type OutboundEndpointPatch. -func (o OutboundEndpointPatch) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "tags", o.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type Patch. -func (p Patch) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "tags", p.Tags) - 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 TrackedResource. -func (t TrackedResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", t.ID) - populate(objectMap, "location", t.Location) - populate(objectMap, "name", t.Name) - populate(objectMap, "tags", t.Tags) - populate(objectMap, "type", t.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkLinkPatch. -func (v VirtualNetworkLinkPatch) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", v.Properties) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkLinkPatchProperties. -func (v VirtualNetworkLinkPatchProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "metadata", v.Metadata) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkLinkProperties. -func (v VirtualNetworkLinkProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "metadata", v.Metadata) - populate(objectMap, "provisioningState", v.ProvisioningState) - populate(objectMap, "virtualNetwork", v.VirtualNetwork) - return json.Marshal(objectMap) -} - -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 -}