From c63c7e5e182212e19d0ed699c44bffd188ec3992 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 22 Jun 2022 22:13:21 +0000 Subject: [PATCH] CodeGen from PR 19553 in Azure/azure-rest-api-specs Merge 37072829f795ce840b8085035e8adf4721602f34 into c537f5a7853766a7946863dd9b0303773b488eff --- .../dnsresolver/armdnsresolver/CHANGELOG.md | 6 + .../dnsresolver/armdnsresolver/autorest.md | 6 +- ...zz_generated_constants.go => constants.go} | 3 +- ...ent.go => dnsforwardingrulesets_client.go} | 35 +- ...lvers_client.go => dnsresolvers_client.go} | 35 +- ...es_client.go => forwardingrules_client.go} | 21 +- .../dnsresolver/armdnsresolver/go.mod | 14 +- .../dnsresolver/armdnsresolver/go.sum | 24 +- ...s_client.go => inboundendpoints_client.go} | 27 +- .../{zz_generated_models.go => models.go} | 41 +- .../armdnsresolver/models_serde.go | 1426 +++++++++++++++++ ..._client.go => outboundendpoints_client.go} | 27 +- ...ed_response_types.go => response_types.go} | 1 + ...erated_time_rfc3339.go => time_rfc3339.go} | 1 + ...lient.go => virtualnetworklinks_client.go} | 27 +- ...ample_dnsforwardingrulesets_client_test.go | 213 --- ...erated_example_dnsresolvers_client_test.go | 209 --- ...ted_example_forwardingrules_client_test.go | 162 -- ...ed_example_inboundendpoints_client_test.go | 169 -- ...d_example_outboundendpoints_client_test.go | 164 -- ...example_virtualnetworklinks_client_test.go | 165 -- .../zz_generated_models_serde.go | 246 --- 22 files changed, 1557 insertions(+), 1465 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/{zz_generated_dnsresolvers_client.go => dnsresolvers_client.go} (96%) rename sdk/resourcemanager/dnsresolver/armdnsresolver/{zz_generated_forwardingrules_client.go => forwardingrules_client.go} (97%) rename sdk/resourcemanager/dnsresolver/armdnsresolver/{zz_generated_inboundendpoints_client.go => inboundendpoints_client.go} (96%) 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/{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%) delete mode 100644 sdk/resourcemanager/dnsresolver/armdnsresolver/ze_generated_example_dnsforwardingrulesets_client_test.go delete mode 100644 sdk/resourcemanager/dnsresolver/armdnsresolver/ze_generated_example_dnsresolvers_client_test.go delete mode 100644 sdk/resourcemanager/dnsresolver/armdnsresolver/ze_generated_example_forwardingrules_client_test.go delete mode 100644 sdk/resourcemanager/dnsresolver/armdnsresolver/ze_generated_example_inboundendpoints_client_test.go delete mode 100644 sdk/resourcemanager/dnsresolver/armdnsresolver/ze_generated_example_outboundendpoints_client_test.go delete mode 100644 sdk/resourcemanager/dnsresolver/armdnsresolver/ze_generated_example_virtualnetworklinks_client_test.go 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..a87a4ba3b36a 100644 --- a/sdk/resourcemanager/dnsresolver/armdnsresolver/CHANGELOG.md +++ b/sdk/resourcemanager/dnsresolver/armdnsresolver/CHANGELOG.md @@ -1,5 +1,11 @@ # Release History +## 0.5.0 (2022-06-22) +### 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..f9ad3134fa23 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 +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/dnsresolver/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/dnsresolver/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 0.4.0 +module-version: 0.5.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..bc4885db4937 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 = "v0.5.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/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/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/go.mod b/sdk/resourcemanager/dnsresolver/armdnsresolver/go.mod index 900c2ea3600b..dbd36137fca4 100644 --- a/sdk/resourcemanager/dnsresolver/armdnsresolver/go.mod +++ b/sdk/resourcemanager/dnsresolver/armdnsresolver/go.mod @@ -2,20 +2,12 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dnsresolver/armdnsr go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 // indirect - github.com/golang-jwt/jwt v3.2.1+incompatible // indirect - github.com/google/uuid v1.1.1 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 // indirect - golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 // indirect - golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect golang.org/x/text v0.3.7 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/sdk/resourcemanager/dnsresolver/armdnsresolver/go.sum b/sdk/resourcemanager/dnsresolver/armdnsresolver/go.sum index ed5b814680ee..3afb578030a5 100644 --- a/sdk/resourcemanager/dnsresolver/armdnsresolver/go.sum +++ b/sdk/resourcemanager/dnsresolver/armdnsresolver/go.sum @@ -1,33 +1,15 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 h1:sVPhtT2qjO86rTUaWMr4WoES4TkjGnzcioXcnHV9s5k= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0 h1:Yoicul8bnVdQrhDMTHxdEckRGX01XvwXDHUT9zYZ3k0= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0/go.mod h1:+6sju8gk8FRmSajX3Oz4G5Gm7P+mbqE9FVaXXFYTkCM= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 h1:jp0dGvZ7ZK0mgqnTSClMxa5xuRL7NZgHameVYF6BurY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 h1:WVsrXCnHlDDX8ls+tootqRE87/hL9S/g4ewig9RsD/c= -github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= -github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= -github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= -github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 h1:Qj1ukM4GlMWXNdMBuXcXfz/Kw9s1qm0CLY32QxuSImI= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 h1:Tgea0cVUD0ivh5ADBX4WwuI12DUd2to3nCYe2eayMIw= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 h1:HVyaeDAYux4pnY+D/SiwmLOR36ewZ4iGQIIrtnuCjFA= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/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/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/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_dnsforwardingrulesets_client_test.go b/sdk/resourcemanager/dnsresolver/armdnsresolver/ze_generated_example_dnsforwardingrulesets_client_test.go deleted file mode 100644 index 70878f93399b..000000000000 --- a/sdk/resourcemanager/dnsresolver/armdnsresolver/ze_generated_example_dnsforwardingrulesets_client_test.go +++ /dev/null @@ -1,213 +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_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/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 -func ExampleDNSForwardingRulesetsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdnsresolver.NewDNSForwardingRulesetsClient("abdd4249-9f34-4cc6-8e42-c2e32110603e", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "sampleResourceGroup", - "samplednsForwardingRuleset", - armdnsresolver.DNSForwardingRuleset{ - Location: to.Ptr("westus2"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, - Properties: &armdnsresolver.DNSForwardingRulesetProperties{ - DNSResolverOutboundEndpoints: []*armdnsresolver.SubResource{ - { - ID: to.Ptr("/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/dnsResolvers/sampleDnsResolver/outboundEndpoints/sampleOutboundEndpoint0"), - }, - { - ID: to.Ptr("/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/dnsResolvers/sampleDnsResolver/outboundEndpoints/sampleOutboundEndpoint1"), - }}, - }, - }, - &armdnsresolver.DNSForwardingRulesetsClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = 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 -func ExampleDNSForwardingRulesetsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdnsresolver.NewDNSForwardingRulesetsClient("abdd4249-9f34-4cc6-8e42-c2e32110603e", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "sampleResourceGroup", - "sampleDnsForwardingRuleset", - armdnsresolver.DNSForwardingRulesetPatch{ - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, - }, - &armdnsresolver.DNSForwardingRulesetsClientBeginUpdateOptions{IfMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = 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 -func ExampleDNSForwardingRulesetsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdnsresolver.NewDNSForwardingRulesetsClient("abdd4249-9f34-4cc6-8e42-c2e32110603e", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "sampleResourceGroup", - "samplednsForwardingRulesetName", - &armdnsresolver.DNSForwardingRulesetsClientBeginDeleteOptions{IfMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/DnsForwardingRuleset_Get.json -func ExampleDNSForwardingRulesetsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdnsresolver.NewDNSForwardingRulesetsClient("abdd4249-9f34-4cc6-8e42-c2e32110603e", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "sampleResourceGroup", - "sampleDnsForwardingRuleset", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/DnsForwardingRuleset_ListByResourceGroup.json -func ExampleDNSForwardingRulesetsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdnsresolver.NewDNSForwardingRulesetsClient("abdd4249-9f34-4cc6-8e42-c2e32110603e", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("sampleResourceGroup", - &armdnsresolver.DNSForwardingRulesetsClientListByResourceGroupOptions{Top: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/DnsForwardingRuleset_ListBySubscription.json -func ExampleDNSForwardingRulesetsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdnsresolver.NewDNSForwardingRulesetsClient("abdd4249-9f34-4cc6-8e42-c2e32110603e", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(&armdnsresolver.DNSForwardingRulesetsClientListOptions{Top: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/DnsForwardingRuleset_ListByVirtualNetwork.json -func ExampleDNSForwardingRulesetsClient_NewListByVirtualNetworkPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdnsresolver.NewDNSForwardingRulesetsClient("abdd4249-9f34-4cc6-8e42-c2e32110603e", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByVirtualNetworkPager("sampleResourceGroup", - "sampleVirtualNetwork", - &armdnsresolver.DNSForwardingRulesetsClientListByVirtualNetworkOptions{Top: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/dnsresolver/armdnsresolver/ze_generated_example_dnsresolvers_client_test.go b/sdk/resourcemanager/dnsresolver/armdnsresolver/ze_generated_example_dnsresolvers_client_test.go deleted file mode 100644 index 38aca6668989..000000000000 --- a/sdk/resourcemanager/dnsresolver/armdnsresolver/ze_generated_example_dnsresolvers_client_test.go +++ /dev/null @@ -1,209 +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_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/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 -func ExampleDNSResolversClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdnsresolver.NewDNSResolversClient("abdd4249-9f34-4cc6-8e42-c2e32110603e", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "sampleResourceGroup", - "sampleDnsResolver", - armdnsresolver.DNSResolver{ - Location: to.Ptr("westus2"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, - Properties: &armdnsresolver.Properties{ - VirtualNetwork: &armdnsresolver.SubResource{ - ID: to.Ptr("/subscriptions/cbb1387e-4b03-44f2-ad41-58d4677b9873/resourceGroups/virtualNetworkResourceGroup/providers/Microsoft.Network/virtualNetworks/sampleVirtualNetwork"), - }, - }, - }, - &armdnsresolver.DNSResolversClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = 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 -func ExampleDNSResolversClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdnsresolver.NewDNSResolversClient("abdd4249-9f34-4cc6-8e42-c2e32110603e", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "sampleResourceGroup", - "sampleDnsResolver", - armdnsresolver.Patch{ - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, - }, - &armdnsresolver.DNSResolversClientBeginUpdateOptions{IfMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = 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 -func ExampleDNSResolversClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdnsresolver.NewDNSResolversClient("abdd4249-9f34-4cc6-8e42-c2e32110603e", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "sampleResourceGroup", - "sampleDnsResolver", - &armdnsresolver.DNSResolversClientBeginDeleteOptions{IfMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/DnsResolver_Get.json -func ExampleDNSResolversClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdnsresolver.NewDNSResolversClient("abdd4249-9f34-4cc6-8e42-c2e32110603e", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "sampleResourceGroup", - "sampleDnsResolver", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/DnsResolver_ListByResourceGroup.json -func ExampleDNSResolversClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdnsresolver.NewDNSResolversClient("abdd4249-9f34-4cc6-8e42-c2e32110603e", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("sampleResourceGroup", - &armdnsresolver.DNSResolversClientListByResourceGroupOptions{Top: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/DnsResolver_ListBySubscription.json -func ExampleDNSResolversClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdnsresolver.NewDNSResolversClient("abdd4249-9f34-4cc6-8e42-c2e32110603e", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(&armdnsresolver.DNSResolversClientListOptions{Top: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/DnsResolver_ListByVirtualNetwork.json -func ExampleDNSResolversClient_NewListByVirtualNetworkPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdnsresolver.NewDNSResolversClient("abdd4249-9f34-4cc6-8e42-c2e32110603e", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByVirtualNetworkPager("sampleResourceGroup", - "sampleVirtualNetwork", - &armdnsresolver.DNSResolversClientListByVirtualNetworkOptions{Top: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/dnsresolver/armdnsresolver/ze_generated_example_forwardingrules_client_test.go b/sdk/resourcemanager/dnsresolver/armdnsresolver/ze_generated_example_forwardingrules_client_test.go deleted file mode 100644 index 29f4e7a4a853..000000000000 --- a/sdk/resourcemanager/dnsresolver/armdnsresolver/ze_generated_example_forwardingrules_client_test.go +++ /dev/null @@ -1,162 +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_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/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 -func ExampleForwardingRulesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdnsresolver.NewForwardingRulesClient("abdd4249-9f34-4cc6-8e42-c2e32110603e", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "sampleResourceGroup", - "sampleDnsForwardingRuleset", - "sampleForwardingRule", - armdnsresolver.ForwardingRule{ - Properties: &armdnsresolver.ForwardingRuleProperties{ - DomainName: to.Ptr("contoso.com."), - ForwardingRuleState: to.Ptr(armdnsresolver.ForwardingRuleStateEnabled), - Metadata: map[string]*string{ - "additionalProp1": to.Ptr("value1"), - }, - TargetDNSServers: []*armdnsresolver.TargetDNSServer{ - { - IPAddress: to.Ptr("10.0.0.1"), - Port: to.Ptr[int32](53), - }, - { - IPAddress: to.Ptr("10.0.0.2"), - Port: to.Ptr[int32](53), - }}, - }, - }, - &armdnsresolver.ForwardingRulesClientCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/ForwardingRule_Patch.json -func ExampleForwardingRulesClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdnsresolver.NewForwardingRulesClient("abdd4249-9f34-4cc6-8e42-c2e32110603e", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "sampleResourceGroup", - "sampleDnsForwardingRuleset", - "sampleForwardingRule", - armdnsresolver.ForwardingRulePatch{ - Properties: &armdnsresolver.ForwardingRulePatchProperties{ - ForwardingRuleState: to.Ptr(armdnsresolver.ForwardingRuleStateDisabled), - Metadata: map[string]*string{ - "additionalProp2": to.Ptr("value2"), - }, - }, - }, - &armdnsresolver.ForwardingRulesClientUpdateOptions{IfMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/ForwardingRule_Delete.json -func ExampleForwardingRulesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdnsresolver.NewForwardingRulesClient("abdd4249-9f34-4cc6-8e42-c2e32110603e", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "sampleResourceGroup", - "sampleDnsForwardingRuleset", - "sampleForwardingRule", - &armdnsresolver.ForwardingRulesClientDeleteOptions{IfMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/ForwardingRule_Get.json -func ExampleForwardingRulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdnsresolver.NewForwardingRulesClient("abdd4249-9f34-4cc6-8e42-c2e32110603e", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "sampleResourceGroup", - "sampleDnsForwardingRuleset", - "sampleForwardingRule", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/ForwardingRule_List.json -func ExampleForwardingRulesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdnsresolver.NewForwardingRulesClient("abdd4249-9f34-4cc6-8e42-c2e32110603e", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("sampleResourceGroup", - "sampleDnsForwardingRuleset", - &armdnsresolver.ForwardingRulesClientListOptions{Top: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/dnsresolver/armdnsresolver/ze_generated_example_inboundendpoints_client_test.go b/sdk/resourcemanager/dnsresolver/armdnsresolver/ze_generated_example_inboundendpoints_client_test.go deleted file mode 100644 index b59f0acdcc42..000000000000 --- a/sdk/resourcemanager/dnsresolver/armdnsresolver/ze_generated_example_inboundendpoints_client_test.go +++ /dev/null @@ -1,169 +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_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/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 -func ExampleInboundEndpointsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdnsresolver.NewInboundEndpointsClient("abdd4249-9f34-4cc6-8e42-c2e32110603e", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "sampleResourceGroup", - "sampleDnsResolver", - "sampleInboundEndpoint", - armdnsresolver.InboundEndpoint{ - Location: to.Ptr("westus2"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, - Properties: &armdnsresolver.InboundEndpointProperties{ - IPConfigurations: []*armdnsresolver.IPConfiguration{ - { - PrivateIPAddress: to.Ptr("255.255.255.255"), - PrivateIPAllocationMethod: to.Ptr(armdnsresolver.IPAllocationMethodStatic), - Subnet: &armdnsresolver.SubResource{ - ID: to.Ptr("/subscriptions/0403cfa9-9659-4f33-9f30-1f191c51d111/resourceGroups/sampleVnetResourceGroupName/providers/Microsoft.Network/virtualNetworks/sampleVirtualNetwork/subnets/sampleSubnet"), - }, - }}, - }, - }, - &armdnsresolver.InboundEndpointsClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = 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 -func ExampleInboundEndpointsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdnsresolver.NewInboundEndpointsClient("abdd4249-9f34-4cc6-8e42-c2e32110603e", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "sampleResourceGroup", - "sampleDnsResolver", - "sampleInboundEndpoint", - armdnsresolver.InboundEndpointPatch{ - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, - }, - &armdnsresolver.InboundEndpointsClientBeginUpdateOptions{IfMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = 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 -func ExampleInboundEndpointsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdnsresolver.NewInboundEndpointsClient("abdd4249-9f34-4cc6-8e42-c2e32110603e", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "sampleResourceGroup", - "sampleDnsResolver", - "sampleInboundEndpoint", - &armdnsresolver.InboundEndpointsClientBeginDeleteOptions{IfMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/InboundEndpoint_Get.json -func ExampleInboundEndpointsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdnsresolver.NewInboundEndpointsClient("abdd4249-9f34-4cc6-8e42-c2e32110603e", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "sampleResourceGroup", - "sampleDnsResolver", - "sampleInboundEndpoint", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/InboundEndpoint_List.json -func ExampleInboundEndpointsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdnsresolver.NewInboundEndpointsClient("abdd4249-9f34-4cc6-8e42-c2e32110603e", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("sampleResourceGroup", - "sampleDnsResolver", - &armdnsresolver.InboundEndpointsClientListOptions{Top: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/dnsresolver/armdnsresolver/ze_generated_example_outboundendpoints_client_test.go b/sdk/resourcemanager/dnsresolver/armdnsresolver/ze_generated_example_outboundendpoints_client_test.go deleted file mode 100644 index 5f5857f961ba..000000000000 --- a/sdk/resourcemanager/dnsresolver/armdnsresolver/ze_generated_example_outboundendpoints_client_test.go +++ /dev/null @@ -1,164 +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_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/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 -func ExampleOutboundEndpointsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdnsresolver.NewOutboundEndpointsClient("abdd4249-9f34-4cc6-8e42-c2e32110603e", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "sampleResourceGroup", - "sampleDnsResolver", - "sampleOutboundEndpoint", - armdnsresolver.OutboundEndpoint{ - Location: to.Ptr("westus2"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, - Properties: &armdnsresolver.OutboundEndpointProperties{ - Subnet: &armdnsresolver.SubResource{ - ID: to.Ptr("/subscriptions/0403cfa9-9659-4f33-9f30-1f191c51d111/resourceGroups/sampleVnetResourceGroupName/providers/Microsoft.Network/virtualNetworks/sampleVirtualNetwork/subnets/sampleSubnet"), - }, - }, - }, - &armdnsresolver.OutboundEndpointsClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = 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 -func ExampleOutboundEndpointsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdnsresolver.NewOutboundEndpointsClient("abdd4249-9f34-4cc6-8e42-c2e32110603e", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "sampleResourceGroup", - "sampleDnsResolver", - "sampleOutboundEndpoint", - armdnsresolver.OutboundEndpointPatch{ - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, - }, - &armdnsresolver.OutboundEndpointsClientBeginUpdateOptions{IfMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = 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 -func ExampleOutboundEndpointsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdnsresolver.NewOutboundEndpointsClient("abdd4249-9f34-4cc6-8e42-c2e32110603e", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "sampleResourceGroup", - "sampleDnsResolver", - "sampleOutboundEndpoint", - &armdnsresolver.OutboundEndpointsClientBeginDeleteOptions{IfMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/OutboundEndpoint_Get.json -func ExampleOutboundEndpointsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdnsresolver.NewOutboundEndpointsClient("abdd4249-9f34-4cc6-8e42-c2e32110603e", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "sampleResourceGroup", - "sampleDnsResolver", - "sampleOutboundEndpoint", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/OutboundEndpoint_List.json -func ExampleOutboundEndpointsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdnsresolver.NewOutboundEndpointsClient("abdd4249-9f34-4cc6-8e42-c2e32110603e", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("sampleResourceGroup", - "sampleDnsResolver", - &armdnsresolver.OutboundEndpointsClientListOptions{Top: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/dnsresolver/armdnsresolver/ze_generated_example_virtualnetworklinks_client_test.go b/sdk/resourcemanager/dnsresolver/armdnsresolver/ze_generated_example_virtualnetworklinks_client_test.go deleted file mode 100644 index 72db2e9a2e21..000000000000 --- a/sdk/resourcemanager/dnsresolver/armdnsresolver/ze_generated_example_virtualnetworklinks_client_test.go +++ /dev/null @@ -1,165 +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_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/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 -func ExampleVirtualNetworkLinksClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdnsresolver.NewVirtualNetworkLinksClient("abdd4249-9f34-4cc6-8e42-c2e32110603e", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "sampleResourceGroup", - "sampleDnsForwardingRuleset", - "sampleVirtualNetworkLink", - armdnsresolver.VirtualNetworkLink{ - Properties: &armdnsresolver.VirtualNetworkLinkProperties{ - Metadata: map[string]*string{ - "additionalProp1": to.Ptr("value1"), - }, - VirtualNetwork: &armdnsresolver.SubResource{ - ID: to.Ptr("/subscriptions/0403cfa9-9659-4f33-9f30-1f191c51d111/resourceGroups/sampleVnetResourceGroupName/providers/Microsoft.Network/virtualNetworks/sampleVirtualNetwork"), - }, - }, - }, - &armdnsresolver.VirtualNetworkLinksClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = 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 -func ExampleVirtualNetworkLinksClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdnsresolver.NewVirtualNetworkLinksClient("abdd4249-9f34-4cc6-8e42-c2e32110603e", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "sampleResourceGroup", - "sampleDnsForwardingRuleset", - "sampleVirtualNetworkLink", - armdnsresolver.VirtualNetworkLinkPatch{ - Properties: &armdnsresolver.VirtualNetworkLinkPatchProperties{ - Metadata: map[string]*string{ - "additionalProp1": to.Ptr("value1"), - }, - }, - }, - &armdnsresolver.VirtualNetworkLinksClientBeginUpdateOptions{IfMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = 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 -func ExampleVirtualNetworkLinksClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdnsresolver.NewVirtualNetworkLinksClient("abdd4249-9f34-4cc6-8e42-c2e32110603e", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "sampleResourceGroup", - "sampleDnsForwardingRuleset", - "sampleVirtualNetworkLink", - &armdnsresolver.VirtualNetworkLinksClientBeginDeleteOptions{IfMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/VirtualNetworkLink_Get.json -func ExampleVirtualNetworkLinksClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdnsresolver.NewVirtualNetworkLinksClient("abdd4249-9f34-4cc6-8e42-c2e32110603e", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "sampleResourceGroup", - "sampleDnsForwardingRuleset", - "sampleVirtualNetworkLink", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dnsresolver/resource-manager/Microsoft.Network/preview/2020-04-01-preview/examples/VirtualNetworkLink_List.json -func ExampleVirtualNetworkLinksClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdnsresolver.NewVirtualNetworkLinksClient("abdd4249-9f34-4cc6-8e42-c2e32110603e", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("sampleResourceGroup", - "sampleDnsForwardingRuleset", - &armdnsresolver.VirtualNetworkLinksClientListOptions{Top: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/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 -}