diff --git a/sdk/resourcemanager/dns/armdns/CHANGELOG.md b/sdk/resourcemanager/dns/armdns/CHANGELOG.md index e90709462345..deb26b101c1d 100644 --- a/sdk/resourcemanager/dns/armdns/CHANGELOG.md +++ b/sdk/resourcemanager/dns/armdns/CHANGELOG.md @@ -1,5 +1,31 @@ # Release History +## 1.3.0-beta.1 (2024-10-25) +### Features Added + +- New value `RecordTypeDS`, `RecordTypeNAPTR`, `RecordTypeTLSA` added to enum type `RecordType` +- New enum type `CreatedByType` with values `CreatedByTypeApplication`, `CreatedByTypeKey`, `CreatedByTypeManagedIdentity`, `CreatedByTypeUser` +- New function `*ClientFactory.NewDnssecConfigsClient() *DnssecConfigsClient` +- New function `NewDnssecConfigsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*DnssecConfigsClient, error)` +- New function `*DnssecConfigsClient.BeginCreateOrUpdate(context.Context, string, string, *DnssecConfigsClientBeginCreateOrUpdateOptions) (*runtime.Poller[DnssecConfigsClientCreateOrUpdateResponse], error)` +- New function `*DnssecConfigsClient.BeginDelete(context.Context, string, string, *DnssecConfigsClientBeginDeleteOptions) (*runtime.Poller[DnssecConfigsClientDeleteResponse], error)` +- New function `*DnssecConfigsClient.Get(context.Context, string, string, *DnssecConfigsClientGetOptions) (DnssecConfigsClientGetResponse, error)` +- New function `*DnssecConfigsClient.NewListByDNSZonePager(string, string, *DnssecConfigsClientListByDNSZoneOptions) *runtime.Pager[DnssecConfigsClientListByDNSZoneResponse]` +- New struct `DelegationSignerInfo` +- New struct `Digest` +- New struct `DnssecConfig` +- New struct `DnssecConfigListResult` +- New struct `DnssecProperties` +- New struct `DsRecord` +- New struct `NaptrRecord` +- New struct `SigningKey` +- New struct `SystemData` +- New struct `TlsaRecord` +- New field `DsRecords`, `NaptrRecords`, `TlsaRecords`, `TrafficManagementProfile` in struct `RecordSetProperties` +- New field `SystemData` in struct `Zone` +- New field `SigningKeys` in struct `ZoneProperties` + + ## 1.2.0 (2023-11-24) ### Features Added diff --git a/sdk/resourcemanager/dns/armdns/README.md b/sdk/resourcemanager/dns/armdns/README.md index 00c981fabadd..a710fac6a03c 100644 --- a/sdk/resourcemanager/dns/armdns/README.md +++ b/sdk/resourcemanager/dns/armdns/README.md @@ -57,7 +57,7 @@ clientFactory, err := armdns.NewClientFactory(, cred, &options) A client groups a set of related APIs, providing access to its functionality. Create one or more clients to access the APIs you require using client factory. ```go -client := clientFactory.NewRecordSetsClient() +client := clientFactory.NewDnssecConfigsClient() ``` ## Fakes diff --git a/sdk/resourcemanager/dns/armdns/assets.json b/sdk/resourcemanager/dns/armdns/assets.json index 0adc9cbdb7a3..84cd5d2a4280 100644 --- a/sdk/resourcemanager/dns/armdns/assets.json +++ b/sdk/resourcemanager/dns/armdns/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "go", "TagPrefix": "go/resourcemanager/dns/armdns", - "Tag": "go/resourcemanager/dns/armdns_b3feaf35b5" + "Tag": "go/resourcemanager/dns/armdns_5a664bd542" } diff --git a/sdk/resourcemanager/dns/armdns/autorest.md b/sdk/resourcemanager/dns/armdns/autorest.md index e8c4371fad93..765c69a3c624 100644 --- a/sdk/resourcemanager/dns/armdns/autorest.md +++ b/sdk/resourcemanager/dns/armdns/autorest.md @@ -5,9 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/readme.go.md +- https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/readme.md +- https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.2.0 - +module-version: 1.3.0-beta.1 +tag: package-2023-07-preview ``` \ No newline at end of file diff --git a/sdk/resourcemanager/dns/armdns/client_factory.go b/sdk/resourcemanager/dns/armdns/client_factory.go index a844cbb964b6..03c62eeaf71f 100644 --- a/sdk/resourcemanager/dns/armdns/client_factory.go +++ b/sdk/resourcemanager/dns/armdns/client_factory.go @@ -17,40 +17,53 @@ import ( // Don't use this type directly, use NewClientFactory instead. type ClientFactory struct { subscriptionID string - credential azcore.TokenCredential - options *arm.ClientOptions + internal *arm.Client } // NewClientFactory creates a new instance of ClientFactory with the specified values. // The parameter values will be propagated to any client created from this factory. -// - subscriptionID - Specifies the Azure subscription ID, which uniquely identifies the Microsoft Azure subscription. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error) { - _, err := arm.NewClient(moduleName, moduleVersion, credential, options) + internal, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } return &ClientFactory{ - subscriptionID: subscriptionID, credential: credential, - options: options.Clone(), + subscriptionID: subscriptionID, + internal: internal, }, nil } +// NewDnssecConfigsClient creates a new instance of DnssecConfigsClient. +func (c *ClientFactory) NewDnssecConfigsClient() *DnssecConfigsClient { + return &DnssecConfigsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + // NewRecordSetsClient creates a new instance of RecordSetsClient. func (c *ClientFactory) NewRecordSetsClient() *RecordSetsClient { - subClient, _ := NewRecordSetsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &RecordSetsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewResourceReferenceClient creates a new instance of ResourceReferenceClient. func (c *ClientFactory) NewResourceReferenceClient() *ResourceReferenceClient { - subClient, _ := NewResourceReferenceClient(c.subscriptionID, c.credential, c.options) - return subClient + return &ResourceReferenceClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewZonesClient creates a new instance of ZonesClient. func (c *ClientFactory) NewZonesClient() *ZonesClient { - subClient, _ := NewZonesClient(c.subscriptionID, c.credential, c.options) - return subClient + return &ZonesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } diff --git a/sdk/resourcemanager/dns/armdns/constants.go b/sdk/resourcemanager/dns/armdns/constants.go index 1dbee716be33..ae3c6845525b 100644 --- a/sdk/resourcemanager/dns/armdns/constants.go +++ b/sdk/resourcemanager/dns/armdns/constants.go @@ -10,9 +10,29 @@ package armdns const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns" - moduleVersion = "v1.2.0" + moduleVersion = "v1.3.0-beta.1" ) +// CreatedByType - The type of identity that created the resource. +type CreatedByType string + +const ( + CreatedByTypeApplication CreatedByType = "Application" + CreatedByTypeKey CreatedByType = "Key" + CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity" + CreatedByTypeUser CreatedByType = "User" +) + +// PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type. +func PossibleCreatedByTypeValues() []CreatedByType { + return []CreatedByType{ + CreatedByTypeApplication, + CreatedByTypeKey, + CreatedByTypeManagedIdentity, + CreatedByTypeUser, + } +} + type RecordType string const ( @@ -20,11 +40,14 @@ const ( RecordTypeAAAA RecordType = "AAAA" RecordTypeCAA RecordType = "CAA" RecordTypeCNAME RecordType = "CNAME" + RecordTypeDS RecordType = "DS" RecordTypeMX RecordType = "MX" + RecordTypeNAPTR RecordType = "NAPTR" RecordTypeNS RecordType = "NS" RecordTypePTR RecordType = "PTR" RecordTypeSOA RecordType = "SOA" RecordTypeSRV RecordType = "SRV" + RecordTypeTLSA RecordType = "TLSA" RecordTypeTXT RecordType = "TXT" ) @@ -35,11 +58,14 @@ func PossibleRecordTypeValues() []RecordType { RecordTypeAAAA, RecordTypeCAA, RecordTypeCNAME, + RecordTypeDS, RecordTypeMX, + RecordTypeNAPTR, RecordTypeNS, RecordTypePTR, RecordTypeSOA, RecordTypeSRV, + RecordTypeTLSA, RecordTypeTXT, } } diff --git a/sdk/resourcemanager/dns/armdns/dnssecconfigs_client.go b/sdk/resourcemanager/dns/armdns/dnssecconfigs_client.go new file mode 100644 index 000000000000..9b495d11e686 --- /dev/null +++ b/sdk/resourcemanager/dns/armdns/dnssecconfigs_client.go @@ -0,0 +1,334 @@ +//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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armdns + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// DnssecConfigsClient contains the methods for the DnssecConfigs group. +// Don't use this type directly, use NewDnssecConfigsClient() instead. +type DnssecConfigsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewDnssecConfigsClient creates a new instance of DnssecConfigsClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewDnssecConfigsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DnssecConfigsClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &DnssecConfigsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates the DNSSEC configuration on a DNS zone. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-07-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - zoneName - The name of the DNS zone (without a terminating dot). +// - options - DnssecConfigsClientBeginCreateOrUpdateOptions contains the optional parameters for the DnssecConfigsClient.BeginCreateOrUpdate +// method. +func (client *DnssecConfigsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, zoneName string, options *DnssecConfigsClientBeginCreateOrUpdateOptions) (*runtime.Poller[DnssecConfigsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, zoneName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DnssecConfigsClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DnssecConfigsClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// CreateOrUpdate - Creates or updates the DNSSEC configuration on a DNS zone. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-07-01-preview +func (client *DnssecConfigsClient) createOrUpdate(ctx context.Context, resourceGroupName string, zoneName string, options *DnssecConfigsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + const operationName = "DnssecConfigsClient.BeginCreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, zoneName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *DnssecConfigsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, zoneName string, options *DnssecConfigsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/dnssecConfigs/default" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if zoneName == "" { + return nil, errors.New("parameter zoneName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{zoneName}", url.PathEscape(zoneName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-07-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if options != nil && options.IfMatch != nil { + req.Raw().Header["If-Match"] = []string{*options.IfMatch} + } + if options != nil && options.IfNoneMatch != nil { + req.Raw().Header["If-None-Match"] = []string{*options.IfNoneMatch} + } + return req, nil +} + +// BeginDelete - Deletes the DNSSEC configuration on a DNS zone. This operation cannot be undone. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-07-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - zoneName - The name of the DNS zone (without a terminating dot). +// - options - DnssecConfigsClientBeginDeleteOptions contains the optional parameters for the DnssecConfigsClient.BeginDelete +// method. +func (client *DnssecConfigsClient) BeginDelete(ctx context.Context, resourceGroupName string, zoneName string, options *DnssecConfigsClientBeginDeleteOptions) (*runtime.Poller[DnssecConfigsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, zoneName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DnssecConfigsClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DnssecConfigsClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Delete - Deletes the DNSSEC configuration on a DNS zone. This operation cannot be undone. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-07-01-preview +func (client *DnssecConfigsClient) deleteOperation(ctx context.Context, resourceGroupName string, zoneName string, options *DnssecConfigsClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "DnssecConfigsClient.BeginDelete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deleteCreateRequest(ctx, resourceGroupName, zoneName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *DnssecConfigsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, zoneName string, options *DnssecConfigsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/dnssecConfigs/default" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if zoneName == "" { + return nil, errors.New("parameter zoneName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{zoneName}", url.PathEscape(zoneName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-07-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if options != nil && options.IfMatch != nil { + req.Raw().Header["If-Match"] = []string{*options.IfMatch} + } + return req, nil +} + +// Get - Gets the DNSSEC configuration. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-07-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - zoneName - The name of the DNS zone (without a terminating dot). +// - options - DnssecConfigsClientGetOptions contains the optional parameters for the DnssecConfigsClient.Get method. +func (client *DnssecConfigsClient) Get(ctx context.Context, resourceGroupName string, zoneName string, options *DnssecConfigsClientGetOptions) (DnssecConfigsClientGetResponse, error) { + var err error + const operationName = "DnssecConfigsClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, zoneName, options) + if err != nil { + return DnssecConfigsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return DnssecConfigsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DnssecConfigsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *DnssecConfigsClient) getCreateRequest(ctx context.Context, resourceGroupName string, zoneName string, options *DnssecConfigsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/dnssecConfigs/default" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if zoneName == "" { + return nil, errors.New("parameter zoneName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{zoneName}", url.PathEscape(zoneName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-07-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *DnssecConfigsClient) getHandleResponse(resp *http.Response) (DnssecConfigsClientGetResponse, error) { + result := DnssecConfigsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DnssecConfig); err != nil { + return DnssecConfigsClientGetResponse{}, err + } + return result, nil +} + +// NewListByDNSZonePager - Lists the DNSSEC configurations in a DNS zone. +// +// Generated from API version 2023-07-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - zoneName - The name of the DNS zone (without a terminating dot). +// - options - DnssecConfigsClientListByDNSZoneOptions contains the optional parameters for the DnssecConfigsClient.NewListByDNSZonePager +// method. +func (client *DnssecConfigsClient) NewListByDNSZonePager(resourceGroupName string, zoneName string, options *DnssecConfigsClientListByDNSZoneOptions) *runtime.Pager[DnssecConfigsClientListByDNSZoneResponse] { + return runtime.NewPager(runtime.PagingHandler[DnssecConfigsClientListByDNSZoneResponse]{ + More: func(page DnssecConfigsClientListByDNSZoneResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *DnssecConfigsClientListByDNSZoneResponse) (DnssecConfigsClientListByDNSZoneResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DnssecConfigsClient.NewListByDNSZonePager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listByDNSZoneCreateRequest(ctx, resourceGroupName, zoneName, options) + }, nil) + if err != nil { + return DnssecConfigsClientListByDNSZoneResponse{}, err + } + return client.listByDNSZoneHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listByDNSZoneCreateRequest creates the ListByDNSZone request. +func (client *DnssecConfigsClient) listByDNSZoneCreateRequest(ctx context.Context, resourceGroupName string, zoneName string, options *DnssecConfigsClientListByDNSZoneOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/dnssecConfigs" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if zoneName == "" { + return nil, errors.New("parameter zoneName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{zoneName}", url.PathEscape(zoneName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-07-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByDNSZoneHandleResponse handles the ListByDNSZone response. +func (client *DnssecConfigsClient) listByDNSZoneHandleResponse(resp *http.Response) (DnssecConfigsClientListByDNSZoneResponse, error) { + result := DnssecConfigsClientListByDNSZoneResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DnssecConfigListResult); err != nil { + return DnssecConfigsClientListByDNSZoneResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/dns/armdns/dnssecconfigs_client_example_test.go b/sdk/resourcemanager/dns/armdns/dnssecconfigs_client_example_test.go new file mode 100644 index 000000000000..a3b41545c3ae --- /dev/null +++ b/sdk/resourcemanager/dns/armdns/dnssecconfigs_client_example_test.go @@ -0,0 +1,188 @@ +//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 armdns_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateDnssecConfig.json +func ExampleDnssecConfigsClient_BeginCreateOrUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armdns.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewDnssecConfigsClient().BeginCreateOrUpdate(ctx, "rg1", "zone1", &armdns.DnssecConfigsClientBeginCreateOrUpdateOptions{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) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.DnssecConfig = armdns.DnssecConfig{ + // Name: to.Ptr("default"), + // Type: to.Ptr("Microsoft.Network/dnszones/dnssecConfigs"), + // Etag: to.Ptr("00000000-0000-0000-0000-000000000000"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnszones/zone1/dnssecConfigs/default"), + // Properties: &armdns.DnssecProperties{ + // ProvisioningState: to.Ptr("Succeeded"), + // SigningKeys: []*armdns.SigningKey{ + // }, + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteDnssecConfig.json +func ExampleDnssecConfigsClient_BeginDelete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armdns.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewDnssecConfigsClient().BeginDelete(ctx, "rg1", "zone1", &armdns.DnssecConfigsClientBeginDeleteOptions{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/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetDnssecConfig.json +func ExampleDnssecConfigsClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armdns.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewDnssecConfigsClient().Get(ctx, "rg1", "zone1", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.DnssecConfig = armdns.DnssecConfig{ + // Name: to.Ptr("default"), + // Type: to.Ptr("Microsoft.Network/dnszones/dnssecConfigs"), + // Etag: to.Ptr("00000000-0000-0000-0000-000000000000"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnszones/zone1/dnssecConfigs/default"), + // Properties: &armdns.DnssecProperties{ + // ProvisioningState: to.Ptr("Succeeded"), + // SigningKeys: []*armdns.SigningKey{ + // { + // DelegationSignerInfo: []*armdns.DelegationSignerInfo{ + // }, + // Flags: to.Ptr[int32](256), + // KeyTag: to.Ptr[int32](37721), + // PublicKey: to.Ptr("publicKey1"), + // SecurityAlgorithmType: to.Ptr[int32](13), + // Protocol: to.Ptr[int32](3), + // }, + // { + // DelegationSignerInfo: []*armdns.DelegationSignerInfo{ + // { + // DigestAlgorithmType: to.Ptr[int32](2), + // DigestValue: to.Ptr("digestValue1"), + // Record: to.Ptr("11920 13 2 digestValue1"), + // }}, + // Flags: to.Ptr[int32](257), + // KeyTag: to.Ptr[int32](11920), + // PublicKey: to.Ptr("publicKey2"), + // SecurityAlgorithmType: to.Ptr[int32](13), + // Protocol: to.Ptr[int32](3), + // }}, + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListDnssecConfigsByZone.json +func ExampleDnssecConfigsClient_NewListByDNSZonePager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armdns.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewDnssecConfigsClient().NewListByDNSZonePager("rg1", "zone1", nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.DnssecConfigListResult = armdns.DnssecConfigListResult{ + // Value: []*armdns.DnssecConfig{ + // { + // Name: to.Ptr("default"), + // Type: to.Ptr("Microsoft.Network/dnszones/dnssecConfigs"), + // Etag: to.Ptr("00000000-0000-0000-0000-000000000000"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnszones/zone1/dnssecConfigs/default"), + // Properties: &armdns.DnssecProperties{ + // ProvisioningState: to.Ptr("Succeeded"), + // SigningKeys: []*armdns.SigningKey{ + // { + // DelegationSignerInfo: []*armdns.DelegationSignerInfo{ + // }, + // Flags: to.Ptr[int32](256), + // KeyTag: to.Ptr[int32](37721), + // PublicKey: to.Ptr("publicKey1"), + // SecurityAlgorithmType: to.Ptr[int32](13), + // Protocol: to.Ptr[int32](3), + // }, + // { + // DelegationSignerInfo: []*armdns.DelegationSignerInfo{ + // { + // DigestAlgorithmType: to.Ptr[int32](2), + // DigestValue: to.Ptr("digestValue1"), + // Record: to.Ptr("11920 13 2 digestValue1"), + // }}, + // Flags: to.Ptr[int32](257), + // KeyTag: to.Ptr[int32](11920), + // PublicKey: to.Ptr("publicKey2"), + // SecurityAlgorithmType: to.Ptr[int32](13), + // Protocol: to.Ptr[int32](3), + // }}, + // }, + // }}, + // } + } +} diff --git a/sdk/resourcemanager/dns/armdns/fake/dnssecconfigs_server.go b/sdk/resourcemanager/dns/armdns/fake/dnssecconfigs_server.go new file mode 100644 index 000000000000..e0f4119e031a --- /dev/null +++ b/sdk/resourcemanager/dns/armdns/fake/dnssecconfigs_server.go @@ -0,0 +1,272 @@ +//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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns" + "net/http" + "net/url" + "regexp" +) + +// DnssecConfigsServer is a fake server for instances of the armdns.DnssecConfigsClient type. +type DnssecConfigsServer struct { + // BeginCreateOrUpdate is the fake for method DnssecConfigsClient.BeginCreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, zoneName string, options *armdns.DnssecConfigsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armdns.DnssecConfigsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // BeginDelete is the fake for method DnssecConfigsClient.BeginDelete + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, resourceGroupName string, zoneName string, options *armdns.DnssecConfigsClientBeginDeleteOptions) (resp azfake.PollerResponder[armdns.DnssecConfigsClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method DnssecConfigsClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, zoneName string, options *armdns.DnssecConfigsClientGetOptions) (resp azfake.Responder[armdns.DnssecConfigsClientGetResponse], errResp azfake.ErrorResponder) + + // NewListByDNSZonePager is the fake for method DnssecConfigsClient.NewListByDNSZonePager + // HTTP status codes to indicate success: http.StatusOK + NewListByDNSZonePager func(resourceGroupName string, zoneName string, options *armdns.DnssecConfigsClientListByDNSZoneOptions) (resp azfake.PagerResponder[armdns.DnssecConfigsClientListByDNSZoneResponse]) +} + +// NewDnssecConfigsServerTransport creates a new instance of DnssecConfigsServerTransport with the provided implementation. +// The returned DnssecConfigsServerTransport instance is connected to an instance of armdns.DnssecConfigsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewDnssecConfigsServerTransport(srv *DnssecConfigsServer) *DnssecConfigsServerTransport { + return &DnssecConfigsServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armdns.DnssecConfigsClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armdns.DnssecConfigsClientDeleteResponse]](), + newListByDNSZonePager: newTracker[azfake.PagerResponder[armdns.DnssecConfigsClientListByDNSZoneResponse]](), + } +} + +// DnssecConfigsServerTransport connects instances of armdns.DnssecConfigsClient to instances of DnssecConfigsServer. +// Don't use this type directly, use NewDnssecConfigsServerTransport instead. +type DnssecConfigsServerTransport struct { + srv *DnssecConfigsServer + beginCreateOrUpdate *tracker[azfake.PollerResponder[armdns.DnssecConfigsClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armdns.DnssecConfigsClientDeleteResponse]] + newListByDNSZonePager *tracker[azfake.PagerResponder[armdns.DnssecConfigsClientListByDNSZoneResponse]] +} + +// Do implements the policy.Transporter interface for DnssecConfigsServerTransport. +func (d *DnssecConfigsServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "DnssecConfigsClient.BeginCreateOrUpdate": + resp, err = d.dispatchBeginCreateOrUpdate(req) + case "DnssecConfigsClient.BeginDelete": + resp, err = d.dispatchBeginDelete(req) + case "DnssecConfigsClient.Get": + resp, err = d.dispatchGet(req) + case "DnssecConfigsClient.NewListByDNSZonePager": + resp, err = d.dispatchNewListByDNSZonePager(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (d *DnssecConfigsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { + if d.srv.BeginCreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} + } + beginCreateOrUpdate := d.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/dnsZones/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/dnssecConfigs/default` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + zoneNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("zoneName")]) + if err != nil { + return nil, err + } + ifMatchParam := getOptional(getHeaderValue(req.Header, "If-Match")) + ifNoneMatchParam := getOptional(getHeaderValue(req.Header, "If-None-Match")) + var options *armdns.DnssecConfigsClientBeginCreateOrUpdateOptions + if ifMatchParam != nil || ifNoneMatchParam != nil { + options = &armdns.DnssecConfigsClientBeginCreateOrUpdateOptions{ + IfMatch: ifMatchParam, + IfNoneMatch: ifNoneMatchParam, + } + } + respr, errRespr := d.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, zoneNameParam, options) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreateOrUpdate = &respr + d.beginCreateOrUpdate.add(req, beginCreateOrUpdate) + } + + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + d.beginCreateOrUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCreateOrUpdate) { + d.beginCreateOrUpdate.remove(req) + } + + return resp, nil +} + +func (d *DnssecConfigsServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { + if d.srv.BeginDelete == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} + } + beginDelete := d.beginDelete.get(req) + if beginDelete == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/dnsZones/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/dnssecConfigs/default` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + zoneNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("zoneName")]) + if err != nil { + return nil, err + } + ifMatchParam := getOptional(getHeaderValue(req.Header, "If-Match")) + var options *armdns.DnssecConfigsClientBeginDeleteOptions + if ifMatchParam != nil { + options = &armdns.DnssecConfigsClientBeginDeleteOptions{ + IfMatch: ifMatchParam, + } + } + respr, errRespr := d.srv.BeginDelete(req.Context(), resourceGroupNameParam, zoneNameParam, options) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDelete = &respr + d.beginDelete.add(req, beginDelete) + } + + resp, err := server.PollerResponderNext(beginDelete, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + d.beginDelete.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginDelete) { + d.beginDelete.remove(req) + } + + return resp, nil +} + +func (d *DnssecConfigsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if d.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/dnsZones/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/dnssecConfigs/default` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + zoneNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("zoneName")]) + if err != nil { + return nil, err + } + respr, errRespr := d.srv.Get(req.Context(), resourceGroupNameParam, zoneNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).DnssecConfig, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (d *DnssecConfigsServerTransport) dispatchNewListByDNSZonePager(req *http.Request) (*http.Response, error) { + if d.srv.NewListByDNSZonePager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListByDNSZonePager not implemented")} + } + newListByDNSZonePager := d.newListByDNSZonePager.get(req) + if newListByDNSZonePager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/dnsZones/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/dnssecConfigs` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + zoneNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("zoneName")]) + if err != nil { + return nil, err + } + resp := d.srv.NewListByDNSZonePager(resourceGroupNameParam, zoneNameParam, nil) + newListByDNSZonePager = &resp + d.newListByDNSZonePager.add(req, newListByDNSZonePager) + server.PagerResponderInjectNextLinks(newListByDNSZonePager, req, func(page *armdns.DnssecConfigsClientListByDNSZoneResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListByDNSZonePager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + d.newListByDNSZonePager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListByDNSZonePager) { + d.newListByDNSZonePager.remove(req) + } + return resp, nil +} diff --git a/sdk/resourcemanager/dns/armdns/fake/server_factory.go b/sdk/resourcemanager/dns/armdns/fake/server_factory.go index 3cadd8b12496..1556bb0c1175 100644 --- a/sdk/resourcemanager/dns/armdns/fake/server_factory.go +++ b/sdk/resourcemanager/dns/armdns/fake/server_factory.go @@ -19,6 +19,7 @@ import ( // ServerFactory is a fake server for instances of the armdns.ClientFactory type. type ServerFactory struct { + DnssecConfigsServer DnssecConfigsServer RecordSetsServer RecordSetsServer ResourceReferenceServer ResourceReferenceServer ZonesServer ZonesServer @@ -38,6 +39,7 @@ func NewServerFactoryTransport(srv *ServerFactory) *ServerFactoryTransport { type ServerFactoryTransport struct { srv *ServerFactory trMu sync.Mutex + trDnssecConfigsServer *DnssecConfigsServerTransport trRecordSetsServer *RecordSetsServerTransport trResourceReferenceServer *ResourceReferenceServerTransport trZonesServer *ZonesServerTransport @@ -56,6 +58,11 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { var err error switch client { + case "DnssecConfigsClient": + initServer(s, &s.trDnssecConfigsServer, func() *DnssecConfigsServerTransport { + return NewDnssecConfigsServerTransport(&s.srv.DnssecConfigsServer) + }) + resp, err = s.trDnssecConfigsServer.Do(req) case "RecordSetsClient": initServer(s, &s.trRecordSetsServer, func() *RecordSetsServerTransport { return NewRecordSetsServerTransport(&s.srv.RecordSetsServer) }) resp, err = s.trRecordSetsServer.Do(req) diff --git a/sdk/resourcemanager/dns/armdns/fake/time_rfc3339.go b/sdk/resourcemanager/dns/armdns/fake/time_rfc3339.go new file mode 100644 index 000000000000..81f308b0d343 --- /dev/null +++ b/sdk/resourcemanager/dns/armdns/fake/time_rfc3339.go @@ -0,0 +1,110 @@ +//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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "encoding/json" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "reflect" + "regexp" + "strings" + "time" +) + +// Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. +var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`) + +const ( + utcDateTime = "2006-01-02T15:04:05.999999999" + utcDateTimeJSON = `"` + utcDateTime + `"` + utcDateTimeNoT = "2006-01-02 15:04:05.999999999" + utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"` + dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00` + dateTimeJSON = `"` + time.RFC3339Nano + `"` + dateTimeJSONNoT = `"` + dateTimeNoT + `"` +) + +type dateTimeRFC3339 time.Time + +func (t dateTimeRFC3339) MarshalJSON() ([]byte, error) { + tt := time.Time(t) + return tt.MarshalJSON() +} + +func (t dateTimeRFC3339) MarshalText() ([]byte, error) { + tt := time.Time(t) + return tt.MarshalText() +} + +func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { + layout = dateTimeJSON + } else if tzOffset { + layout = dateTimeJSONNoT + } else if hasT { + layout = utcDateTimeJSON + } else { + layout = utcDateTimeJSONNoT + } + return t.Parse(layout, string(data)) +} + +func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { + layout = time.RFC3339Nano + } else if tzOffset { + layout = dateTimeNoT + } else if hasT { + layout = utcDateTime + } else { + layout = utcDateTimeNoT + } + return t.Parse(layout, string(data)) +} + +func (t *dateTimeRFC3339) Parse(layout, value string) error { + p, err := time.Parse(layout, strings.ToUpper(value)) + *t = dateTimeRFC3339(p) + return err +} + +func (t dateTimeRFC3339) String() string { + return time.Time(t).Format(time.RFC3339Nano) +} + +func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { + if t == nil { + return + } else if azcore.IsNullValue(t) { + m[k] = nil + return + } else if reflect.ValueOf(t).IsNil() { + return + } + m[k] = (*dateTimeRFC3339)(t) +} + +func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { + if data == nil || string(data) == "null" { + return nil + } + var aux dateTimeRFC3339 + if err := json.Unmarshal(data, &aux); err != nil { + return fmt.Errorf("struct field %s: %v", fn, err) + } + *t = (*time.Time)(&aux) + return nil +} diff --git a/sdk/resourcemanager/dns/armdns/models.go b/sdk/resourcemanager/dns/armdns/models.go index 7b451eb222a3..42417fd199ac 100644 --- a/sdk/resourcemanager/dns/armdns/models.go +++ b/sdk/resourcemanager/dns/armdns/models.go @@ -8,6 +8,8 @@ package armdns +import "time" + // ARecord - An A record. type ARecord struct { // The IPv4 address of this A record. @@ -38,6 +40,79 @@ type CnameRecord struct { Cname *string } +// DelegationSignerInfo - The delegation signer information. +type DelegationSignerInfo struct { + // READ-ONLY; The digest algorithm type represents the standard digest algorithm number used to construct the digest. See: + // https://www.iana.org/assignments/ds-rr-types/ds-rr-types.xhtml + DigestAlgorithmType *int32 + + // READ-ONLY; The digest value is a cryptographic hash value of the referenced DNSKEY Resource Record. + DigestValue *string + + // READ-ONLY; The record represents a delegation signer (DS) record. + Record *string +} + +// Digest - A digest. +type Digest struct { + // The digest algorithm type represents the standard digest algorithm number used to construct the digest. See: https://www.iana.org/assignments/ds-rr-types/ds-rr-types.xhtml + AlgorithmType *int32 + + // The digest value is a cryptographic hash value of the referenced DNSKEY Resource Record. + Value *string +} + +// DnssecConfig - Represents the DNSSEC configuration. +type DnssecConfig struct { + // The etag of the DNSSEC configuration. + Etag *string + + // READ-ONLY; The ID of the DNSSEC configuration. + ID *string + + // READ-ONLY; The name of the DNSSEC configuration. + Name *string + + // READ-ONLY; The DNSSEC properties. + Properties *DnssecProperties + + // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData + + // READ-ONLY; The type of the DNSSEC configuration. + Type *string +} + +// DnssecConfigListResult - The response to a List DNSSEC configurations operation. +type DnssecConfigListResult struct { + // Information about the DNSSEC configurations in the response. + Value []*DnssecConfig + + // READ-ONLY; The continuation token for the next page of results. + NextLink *string +} + +// DnssecProperties - Represents the DNSSEC properties. +type DnssecProperties struct { + // READ-ONLY; Provisioning State of the DNSSEC configuration. + ProvisioningState *string + + // READ-ONLY; The list of signing keys. + SigningKeys []*SigningKey +} + +// DsRecord - A DS record. For more information about the DS record format, see RFC 4034: https://www.rfc-editor.org/rfc/rfc4034 +type DsRecord struct { + // The security algorithm type represents the standard security algorithm number of the DNSKEY Resource Record. See: https://www.iana.org/assignments/dns-sec-alg-numbers/dns-sec-alg-numbers.xhtml + Algorithm *int32 + + // The digest entity. + Digest *Digest + + // The key tag value is used to determine which DNSKEY Resource Record is used for signature verification. + KeyTag *int32 +} + // MxRecord - An MX record. type MxRecord struct { // The domain name of the mail host for this MX record. @@ -47,6 +122,36 @@ type MxRecord struct { Preference *int32 } +// NaptrRecord - A NAPTR record. For more information about the NAPTR record format, see RFC 3403: https://www.rfc-editor.org/rfc/rfc3403 +type NaptrRecord struct { + // The flags specific to DDDS applications. Values currently defined in RFC 3404 are uppercase and lowercase letters "A", + // "P", "S", and "U", and the empty string, "". Enclose Flags in quotation marks. + Flags *string + + // The order in which the NAPTR records MUST be processed in order to accurately represent the ordered list of rules. The + // ordering is from lowest to highest. Valid values: 0-65535. + Order *int32 + + // The preference specifies the order in which NAPTR records with equal 'order' values should be processed, low numbers being + // processed before high numbers. Valid values: 0-65535. + Preference *int32 + + // The regular expression that the DDDS application uses to convert an input value into an output value. For example: an IP + // phone system might use a regular expression to convert a phone number that is + // entered by a user into a SIP URI. Enclose the regular expression in quotation marks. Specify either a value for 'regexp' + // or a value for 'replacement'. + Regexp *string + + // The replacement is a fully qualified domain name (FQDN) of the next domain name that you want the DDDS application to submit + // a DNS query for. The DDDS application replaces the input value with the + // value specified for replacement. Specify either a value for 'regexp' or a value for 'replacement'. If you specify a value + // for 'regexp', specify a dot (.) for 'replacement'. + Replacement *string + + // The services specific to DDDS applications. Enclose Services in quotation marks. + Services *string +} + // NsRecord - An NS record. type NsRecord struct { // The name server name for this NS record. @@ -100,12 +205,18 @@ type RecordSetProperties struct { // The CNAME record in the record set. CnameRecord *CnameRecord + // The list of DS records in the record set. + DsRecords []*DsRecord + // The metadata attached to the record set. Metadata map[string]*string // The list of MX records in the record set. MxRecords []*MxRecord + // The list of NAPTR records in the record set. + NaptrRecords []*NaptrRecord + // The list of NS records in the record set. NsRecords []*NsRecord @@ -124,6 +235,12 @@ type RecordSetProperties struct { // A reference to an azure resource from where the dns resource value is taken. TargetResource *SubResource + // The list of TLSA records in the record set. + TlsaRecords []*TlsaRecord + + // A reference to an azure traffic manager profile resource from where the dns resource value is taken. + TrafficManagementProfile *SubResource + // The list of TXT records in the record set. TxtRecords []*TxtRecord @@ -193,6 +310,28 @@ type ResourceReferenceResultProperties struct { DNSResourceReferences []*ResourceReference } +// SigningKey - Represents the signing key. +type SigningKey struct { + // READ-ONLY; The delegation signer information. + DelegationSignerInfo []*DelegationSignerInfo + + // READ-ONLY; The flags specifies how the key is used. + Flags *int32 + + // READ-ONLY; The key tag value of the DNSKEY Resource Record. + KeyTag *int32 + + // READ-ONLY; The protocol value. The value is always 3. + Protocol *int32 + + // READ-ONLY; The public key, represented as a Base64 encoding. + PublicKey *string + + // READ-ONLY; The security algorithm type represents the standard security algorithm number of the DNSKEY Resource Record. + // See: https://www.iana.org/assignments/dns-sec-alg-numbers/dns-sec-alg-numbers.xhtml + SecurityAlgorithmType *int32 +} + // SoaRecord - An SOA record. type SoaRecord struct { // The email contact for this SOA record. @@ -238,6 +377,43 @@ type SubResource struct { ID *string } +// SystemData - Metadata pertaining to creation and last modification of the resource. +type SystemData struct { + // The timestamp of resource creation (UTC). + CreatedAt *time.Time + + // The identity that created the resource. + CreatedBy *string + + // The type of identity that created the resource. + CreatedByType *CreatedByType + + // The timestamp of resource last modification (UTC) + LastModifiedAt *time.Time + + // The identity that last modified the resource. + LastModifiedBy *string + + // The type of identity that last modified the resource. + LastModifiedByType *CreatedByType +} + +// TlsaRecord - A TLSA record. For more information about the TLSA record format, see RFC 6698: https://www.rfc-editor.org/rfc/rfc6698 +type TlsaRecord struct { + // This specifies the certificate association data to be matched. + CertAssociationData *string + + // The matching type specifies how the certificate association is presented. + MatchingType *int32 + + // The selector specifies which part of the TLS certificate presented by the server will be matched against the association + // data. + Selector *int32 + + // The usage specifies the provided association that will be used to match the certificate presented in the TLS handshake. + Usage *int32 +} + // TxtRecord - A TXT record. type TxtRecord struct { // The text value of this TXT record. @@ -264,6 +440,9 @@ type Zone struct { // READ-ONLY; Resource name. Name *string + // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData + // READ-ONLY; Resource type. Type *string } @@ -302,6 +481,9 @@ type ZoneProperties struct { // READ-ONLY; The current number of record sets in this DNS zone. This is a read-only property and any attempt to set this // value will be ignored. NumberOfRecordSets *int64 + + // READ-ONLY; The list of signing keys. + SigningKeys []*SigningKey } // ZoneUpdate - Describes a request to update a DNS zone. diff --git a/sdk/resourcemanager/dns/armdns/models_serde.go b/sdk/resourcemanager/dns/armdns/models_serde.go index b75889c40dd6..6ae11b96ae75 100644 --- a/sdk/resourcemanager/dns/armdns/models_serde.go +++ b/sdk/resourcemanager/dns/armdns/models_serde.go @@ -131,6 +131,216 @@ func (c *CnameRecord) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type DelegationSignerInfo. +func (d DelegationSignerInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "digestAlgorithmType", d.DigestAlgorithmType) + populate(objectMap, "digestValue", d.DigestValue) + populate(objectMap, "record", d.Record) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DelegationSignerInfo. +func (d *DelegationSignerInfo) 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 "digestAlgorithmType": + err = unpopulate(val, "DigestAlgorithmType", &d.DigestAlgorithmType) + delete(rawMsg, key) + case "digestValue": + err = unpopulate(val, "DigestValue", &d.DigestValue) + delete(rawMsg, key) + case "record": + err = unpopulate(val, "Record", &d.Record) + 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 Digest. +func (d Digest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "algorithmType", d.AlgorithmType) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Digest. +func (d *Digest) 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 "algorithmType": + err = unpopulate(val, "AlgorithmType", &d.AlgorithmType) + 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 DnssecConfig. +func (d DnssecConfig) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", d.Etag) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "systemData", d.SystemData) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DnssecConfig. +func (d *DnssecConfig) 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 "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 "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 DnssecConfigListResult. +func (d DnssecConfigListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DnssecConfigListResult. +func (d *DnssecConfigListResult) 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 DnssecProperties. +func (d DnssecProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "provisioningState", d.ProvisioningState) + populate(objectMap, "signingKeys", d.SigningKeys) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DnssecProperties. +func (d *DnssecProperties) 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 "provisioningState": + err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) + delete(rawMsg, key) + case "signingKeys": + err = unpopulate(val, "SigningKeys", &d.SigningKeys) + 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 DsRecord. +func (d DsRecord) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "algorithm", d.Algorithm) + populate(objectMap, "digest", d.Digest) + populate(objectMap, "keyTag", d.KeyTag) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DsRecord. +func (d *DsRecord) 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 "algorithm": + err = unpopulate(val, "Algorithm", &d.Algorithm) + delete(rawMsg, key) + case "digest": + err = unpopulate(val, "Digest", &d.Digest) + delete(rawMsg, key) + case "keyTag": + err = unpopulate(val, "KeyTag", &d.KeyTag) + 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 MxRecord. func (m MxRecord) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -162,6 +372,53 @@ func (m *MxRecord) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type NaptrRecord. +func (n NaptrRecord) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "flags", n.Flags) + populate(objectMap, "order", n.Order) + populate(objectMap, "preference", n.Preference) + populate(objectMap, "regexp", n.Regexp) + populate(objectMap, "replacement", n.Replacement) + populate(objectMap, "services", n.Services) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NaptrRecord. +func (n *NaptrRecord) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "flags": + err = unpopulate(val, "Flags", &n.Flags) + delete(rawMsg, key) + case "order": + err = unpopulate(val, "Order", &n.Order) + delete(rawMsg, key) + case "preference": + err = unpopulate(val, "Preference", &n.Preference) + delete(rawMsg, key) + case "regexp": + err = unpopulate(val, "Regexp", &n.Regexp) + delete(rawMsg, key) + case "replacement": + err = unpopulate(val, "Replacement", &n.Replacement) + delete(rawMsg, key) + case "services": + err = unpopulate(val, "Services", &n.Services) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type NsRecord. func (n NsRecord) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -297,9 +554,11 @@ func (r RecordSetProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "AAAARecords", r.AaaaRecords) populate(objectMap, "caaRecords", r.CaaRecords) populate(objectMap, "CNAMERecord", r.CnameRecord) + populate(objectMap, "DSRecords", r.DsRecords) populate(objectMap, "fqdn", r.Fqdn) populate(objectMap, "metadata", r.Metadata) populate(objectMap, "MXRecords", r.MxRecords) + populate(objectMap, "NAPTRRecords", r.NaptrRecords) populate(objectMap, "NSRecords", r.NsRecords) populate(objectMap, "provisioningState", r.ProvisioningState) populate(objectMap, "PTRRecords", r.PtrRecords) @@ -307,6 +566,8 @@ func (r RecordSetProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "SRVRecords", r.SrvRecords) populate(objectMap, "TTL", r.TTL) populate(objectMap, "targetResource", r.TargetResource) + populate(objectMap, "TLSARecords", r.TlsaRecords) + populate(objectMap, "trafficManagementProfile", r.TrafficManagementProfile) populate(objectMap, "TXTRecords", r.TxtRecords) return json.Marshal(objectMap) } @@ -332,6 +593,9 @@ func (r *RecordSetProperties) UnmarshalJSON(data []byte) error { case "CNAMERecord": err = unpopulate(val, "CnameRecord", &r.CnameRecord) delete(rawMsg, key) + case "DSRecords": + err = unpopulate(val, "DsRecords", &r.DsRecords) + delete(rawMsg, key) case "fqdn": err = unpopulate(val, "Fqdn", &r.Fqdn) delete(rawMsg, key) @@ -341,6 +605,9 @@ func (r *RecordSetProperties) UnmarshalJSON(data []byte) error { case "MXRecords": err = unpopulate(val, "MxRecords", &r.MxRecords) delete(rawMsg, key) + case "NAPTRRecords": + err = unpopulate(val, "NaptrRecords", &r.NaptrRecords) + delete(rawMsg, key) case "NSRecords": err = unpopulate(val, "NsRecords", &r.NsRecords) delete(rawMsg, key) @@ -362,6 +629,12 @@ func (r *RecordSetProperties) UnmarshalJSON(data []byte) error { case "targetResource": err = unpopulate(val, "TargetResource", &r.TargetResource) delete(rawMsg, key) + case "TLSARecords": + err = unpopulate(val, "TlsaRecords", &r.TlsaRecords) + delete(rawMsg, key) + case "trafficManagementProfile": + err = unpopulate(val, "TrafficManagementProfile", &r.TrafficManagementProfile) + delete(rawMsg, key) case "TXTRecords": err = unpopulate(val, "TxtRecords", &r.TxtRecords) delete(rawMsg, key) @@ -582,6 +855,53 @@ func (r *ResourceReferenceResultProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type SigningKey. +func (s SigningKey) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "delegationSignerInfo", s.DelegationSignerInfo) + populate(objectMap, "flags", s.Flags) + populate(objectMap, "keyTag", s.KeyTag) + populate(objectMap, "protocol", s.Protocol) + populate(objectMap, "publicKey", s.PublicKey) + populate(objectMap, "securityAlgorithmType", s.SecurityAlgorithmType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SigningKey. +func (s *SigningKey) 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 "delegationSignerInfo": + err = unpopulate(val, "DelegationSignerInfo", &s.DelegationSignerInfo) + delete(rawMsg, key) + case "flags": + err = unpopulate(val, "Flags", &s.Flags) + delete(rawMsg, key) + case "keyTag": + err = unpopulate(val, "KeyTag", &s.KeyTag) + delete(rawMsg, key) + case "protocol": + err = unpopulate(val, "Protocol", &s.Protocol) + delete(rawMsg, key) + case "publicKey": + err = unpopulate(val, "PublicKey", &s.PublicKey) + delete(rawMsg, key) + case "securityAlgorithmType": + err = unpopulate(val, "SecurityAlgorithmType", &s.SecurityAlgorithmType) + 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 SoaRecord. func (s SoaRecord) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -699,6 +1019,92 @@ func (s *SubResource) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type SystemData. +func (s SystemData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateDateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) + populate(objectMap, "createdBy", s.CreatedBy) + populate(objectMap, "createdByType", s.CreatedByType) + populateDateTimeRFC3339(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 = unpopulateDateTimeRFC3339(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 = unpopulateDateTimeRFC3339(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 TlsaRecord. +func (t TlsaRecord) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "certAssociationData", t.CertAssociationData) + populate(objectMap, "matchingType", t.MatchingType) + populate(objectMap, "selector", t.Selector) + populate(objectMap, "usage", t.Usage) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TlsaRecord. +func (t *TlsaRecord) 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 "certAssociationData": + err = unpopulate(val, "CertAssociationData", &t.CertAssociationData) + delete(rawMsg, key) + case "matchingType": + err = unpopulate(val, "MatchingType", &t.MatchingType) + delete(rawMsg, key) + case "selector": + err = unpopulate(val, "Selector", &t.Selector) + delete(rawMsg, key) + case "usage": + err = unpopulate(val, "Usage", &t.Usage) + 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 TxtRecord. func (t TxtRecord) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -734,6 +1140,7 @@ func (z Zone) MarshalJSON() ([]byte, error) { populate(objectMap, "location", z.Location) populate(objectMap, "name", z.Name) populate(objectMap, "properties", z.Properties) + populate(objectMap, "systemData", z.SystemData) populate(objectMap, "tags", z.Tags) populate(objectMap, "type", z.Type) return json.Marshal(objectMap) @@ -763,6 +1170,9 @@ func (z *Zone) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &z.Properties) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &z.SystemData) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &z.Tags) delete(rawMsg, key) @@ -817,6 +1227,7 @@ func (z ZoneProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "numberOfRecordSets", z.NumberOfRecordSets) populate(objectMap, "registrationVirtualNetworks", z.RegistrationVirtualNetworks) populate(objectMap, "resolutionVirtualNetworks", z.ResolutionVirtualNetworks) + populate(objectMap, "signingKeys", z.SigningKeys) populate(objectMap, "zoneType", z.ZoneType) return json.Marshal(objectMap) } @@ -848,6 +1259,9 @@ func (z *ZoneProperties) UnmarshalJSON(data []byte) error { case "resolutionVirtualNetworks": err = unpopulate(val, "ResolutionVirtualNetworks", &z.ResolutionVirtualNetworks) delete(rawMsg, key) + case "signingKeys": + err = unpopulate(val, "SigningKeys", &z.SigningKeys) + delete(rawMsg, key) case "zoneType": err = unpopulate(val, "ZoneType", &z.ZoneType) delete(rawMsg, key) @@ -897,7 +1311,7 @@ func populate(m map[string]any, k string, v any) { } func unpopulate(data json.RawMessage, fn string, v any) error { - if data == nil { + if data == nil || string(data) == "null" { return nil } if err := json.Unmarshal(data, v); err != nil { diff --git a/sdk/resourcemanager/dns/armdns/options.go b/sdk/resourcemanager/dns/armdns/options.go index 9275d5d7d7b9..fbf3c90437fa 100644 --- a/sdk/resourcemanager/dns/armdns/options.go +++ b/sdk/resourcemanager/dns/armdns/options.go @@ -8,6 +8,42 @@ package armdns +// DnssecConfigsClientBeginCreateOrUpdateOptions contains the optional parameters for the DnssecConfigsClient.BeginCreateOrUpdate +// method. +type DnssecConfigsClientBeginCreateOrUpdateOptions struct { + // The etag of the DNSSEC configuration. Omit this value to always overwrite the DNSSEC configuration. Specify the last-seen + // etag value to prevent accidentally overwriting any concurrent changes. + IfMatch *string + + // Set to '*' to allow this DNSSEC configuration to be created, but to prevent updating existing DNSSEC configuration. Other + // values will be ignored. + IfNoneMatch *string + + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DnssecConfigsClientBeginDeleteOptions contains the optional parameters for the DnssecConfigsClient.BeginDelete method. +type DnssecConfigsClientBeginDeleteOptions struct { + // The etag of this DNSSEC configuration. Omit this value to always delete the DNSSEC configuration. Specify the last-seen + // etag value to prevent accidentally deleting any concurrent changes. + IfMatch *string + + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DnssecConfigsClientGetOptions contains the optional parameters for the DnssecConfigsClient.Get method. +type DnssecConfigsClientGetOptions struct { + // placeholder for future optional parameters +} + +// DnssecConfigsClientListByDNSZoneOptions contains the optional parameters for the DnssecConfigsClient.NewListByDNSZonePager +// method. +type DnssecConfigsClientListByDNSZoneOptions struct { + // placeholder for future optional parameters +} + // RecordSetsClientCreateOrUpdateOptions contains the optional parameters for the RecordSetsClient.CreateOrUpdate method. type RecordSetsClientCreateOrUpdateOptions struct { // The etag of the record set. Omit this value to always overwrite the current record set. Specify the last-seen etag value diff --git a/sdk/resourcemanager/dns/armdns/recordsets_client.go b/sdk/resourcemanager/dns/armdns/recordsets_client.go index b1da1158b264..452f69941306 100644 --- a/sdk/resourcemanager/dns/armdns/recordsets_client.go +++ b/sdk/resourcemanager/dns/armdns/recordsets_client.go @@ -29,7 +29,7 @@ type RecordSetsClient struct { } // NewRecordSetsClient creates a new instance of RecordSetsClient with the specified values. -// - subscriptionID - Specifies the Azure subscription ID, which uniquely identifies the Microsoft Azure subscription. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewRecordSetsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RecordSetsClient, error) { @@ -44,15 +44,15 @@ func NewRecordSetsClient(subscriptionID string, credential azcore.TokenCredentia return client, nil } -// CreateOrUpdate - Creates or updates a record set within a DNS zone. +// CreateOrUpdate - Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created +// (they are created when the DNS zone is created). // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2018-05-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2023-07-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - zoneName - The name of the DNS zone (without a terminating dot). // - relativeRecordSetName - The name of the record set, relative to the name of the zone. -// - recordType - The type of DNS record in this record set. Record sets of type SOA can be updated but not created (they are -// created when the DNS zone is created). +// - recordType - The type of DNS record in this record set. // - parameters - Parameters supplied to the CreateOrUpdate operation. // - options - RecordSetsClientCreateOrUpdateOptions contains the optional parameters for the RecordSetsClient.CreateOrUpdate // method. @@ -103,15 +103,15 @@ func (client *RecordSetsClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-05-01") + reqQP.Set("api-version", "2023-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } if options != nil && options.IfNoneMatch != nil { req.Raw().Header["If-None-Match"] = []string{*options.IfNoneMatch} } - req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -127,15 +127,15 @@ func (client *RecordSetsClient) createOrUpdateHandleResponse(resp *http.Response return result, nil } -// Delete - Deletes a record set from a DNS zone. This operation cannot be undone. +// Delete - Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted +// (they are deleted when the DNS zone is deleted). // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2018-05-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2023-07-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - zoneName - The name of the DNS zone (without a terminating dot). // - relativeRecordSetName - The name of the record set, relative to the name of the zone. -// - recordType - The type of DNS record in this record set. Record sets of type SOA cannot be deleted (they are deleted when -// the DNS zone is deleted). +// - recordType - The type of DNS record in this record set. // - options - RecordSetsClientDeleteOptions contains the optional parameters for the RecordSetsClient.Delete method. func (client *RecordSetsClient) Delete(ctx context.Context, resourceGroupName string, zoneName string, relativeRecordSetName string, recordType RecordType, options *RecordSetsClientDeleteOptions) (RecordSetsClientDeleteResponse, error) { var err error @@ -183,20 +183,20 @@ func (client *RecordSetsClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-05-01") + reqQP.Set("api-version", "2023-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // Get - Gets a record set. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2018-05-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2023-07-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - zoneName - The name of the DNS zone (without a terminating dot). // - relativeRecordSetName - The name of the record set, relative to the name of the zone. // - recordType - The type of DNS record in this record set. @@ -248,7 +248,7 @@ func (client *RecordSetsClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-05-01") + reqQP.Set("api-version", "2023-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -265,8 +265,8 @@ func (client *RecordSetsClient) getHandleResponse(resp *http.Response) (RecordSe // NewListAllByDNSZonePager - Lists all record sets in a DNS zone. // -// Generated from API version 2018-05-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2023-07-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - zoneName - The name of the DNS zone (without a terminating dot). // - options - RecordSetsClientListAllByDNSZoneOptions contains the optional parameters for the RecordSetsClient.NewListAllByDNSZonePager // method. @@ -313,13 +313,13 @@ func (client *RecordSetsClient) listAllByDNSZoneCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - if options != nil && options.Top != nil { - reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) - } if options != nil && options.RecordSetNameSuffix != nil { reqQP.Set("$recordsetnamesuffix", *options.RecordSetNameSuffix) } - reqQP.Set("api-version", "2018-05-01") + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + reqQP.Set("api-version", "2023-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -336,8 +336,8 @@ func (client *RecordSetsClient) listAllByDNSZoneHandleResponse(resp *http.Respon // NewListByDNSZonePager - Lists all record sets in a DNS zone. // -// Generated from API version 2018-05-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2023-07-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - zoneName - The name of the DNS zone (without a terminating dot). // - options - RecordSetsClientListByDNSZoneOptions contains the optional parameters for the RecordSetsClient.NewListByDNSZonePager // method. @@ -384,13 +384,13 @@ func (client *RecordSetsClient) listByDNSZoneCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - if options != nil && options.Top != nil { - reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) - } if options != nil && options.Recordsetnamesuffix != nil { reqQP.Set("$recordsetnamesuffix", *options.Recordsetnamesuffix) } - reqQP.Set("api-version", "2018-05-01") + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + reqQP.Set("api-version", "2023-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -407,10 +407,10 @@ func (client *RecordSetsClient) listByDNSZoneHandleResponse(resp *http.Response) // NewListByTypePager - Lists the record sets of a specified type in a DNS zone. // -// Generated from API version 2018-05-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2023-07-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - zoneName - The name of the DNS zone (without a terminating dot). -// - recordType - The type of record sets to enumerate. +// - recordType - The type of DNS record in this record set. // - options - RecordSetsClientListByTypeOptions contains the optional parameters for the RecordSetsClient.NewListByTypePager // method. func (client *RecordSetsClient) NewListByTypePager(resourceGroupName string, zoneName string, recordType RecordType, options *RecordSetsClientListByTypeOptions) *runtime.Pager[RecordSetsClientListByTypeResponse] { @@ -460,13 +460,13 @@ func (client *RecordSetsClient) listByTypeCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - if options != nil && options.Top != nil { - reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) - } if options != nil && options.Recordsetnamesuffix != nil { reqQP.Set("$recordsetnamesuffix", *options.Recordsetnamesuffix) } - reqQP.Set("api-version", "2018-05-01") + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + reqQP.Set("api-version", "2023-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -484,8 +484,8 @@ func (client *RecordSetsClient) listByTypeHandleResponse(resp *http.Response) (R // Update - Updates a record set within a DNS zone. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2018-05-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2023-07-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - zoneName - The name of the DNS zone (without a terminating dot). // - relativeRecordSetName - The name of the record set, relative to the name of the zone. // - recordType - The type of DNS record in this record set. @@ -538,12 +538,12 @@ func (client *RecordSetsClient) updateCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-05-01") + reqQP.Set("api-version", "2023-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } - req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/dns/armdns/recordsets_client_example_test.go b/sdk/resourcemanager/dns/armdns/recordsets_client_example_test.go index 7ad27cf5cad5..041185b6e885 100644 --- a/sdk/resourcemanager/dns/armdns/recordsets_client_example_test.go +++ b/sdk/resourcemanager/dns/armdns/recordsets_client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/PatchARecordset.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchARecordset.json func ExampleRecordSetsClient_Update_patchARecordset() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -61,7 +61,7 @@ func ExampleRecordSetsClient_Update_patchARecordset() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/PatchAAAARecordset.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchAAAARecordset.json func ExampleRecordSetsClient_Update_patchAaaaRecordset() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -104,7 +104,7 @@ func ExampleRecordSetsClient_Update_patchAaaaRecordset() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/PatchCaaRecordset.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchCaaRecordset.json func ExampleRecordSetsClient_Update_patchCaaRecordset() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -149,7 +149,7 @@ func ExampleRecordSetsClient_Update_patchCaaRecordset() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/PatchCNAMERecordset.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchCNAMERecordset.json func ExampleRecordSetsClient_Update_patchCnameRecordset() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -191,7 +191,55 @@ func ExampleRecordSetsClient_Update_patchCnameRecordset() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/PatchMXRecordset.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchDSRecordset.json +func ExampleRecordSetsClient_Update_patchDsRecordset() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armdns.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewRecordSetsClient().Update(ctx, "rg1", "zone1", "record1", armdns.RecordTypeDS, armdns.RecordSet{ + Properties: &armdns.RecordSetProperties{ + Metadata: map[string]*string{ + "key2": to.Ptr("value2"), + }, + }, + }, &armdns.RecordSetsClientUpdateOptions{IfMatch: nil}) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.RecordSet = armdns.RecordSet{ + // Name: to.Ptr("record1"), + // Type: to.Ptr("Microsoft.Network/dnsZones/DS"), + // Etag: to.Ptr("00000000-0000-0000-0000-000000000000"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/DS/record1"), + // Properties: &armdns.RecordSetProperties{ + // DsRecords: []*armdns.DsRecord{ + // { + // Algorithm: to.Ptr[int32](5), + // Digest: &armdns.Digest{ + // AlgorithmType: to.Ptr[int32](1), + // Value: to.Ptr("2BB183AF5F22588179A53B0A98631FAD1A292118"), + // }, + // KeyTag: to.Ptr[int32](60485), + // }}, + // TTL: to.Ptr[int64](3600), + // Fqdn: to.Ptr("record1.zone1"), + // Metadata: map[string]*string{ + // "key2": to.Ptr("value2"), + // }, + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchMXRecordset.json func ExampleRecordSetsClient_Update_patchMxRecordset() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -235,7 +283,55 @@ func ExampleRecordSetsClient_Update_patchMxRecordset() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/PatchNSRecordset.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchNAPTRRecordset.json +func ExampleRecordSetsClient_Update_patchNaptrRecordset() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armdns.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewRecordSetsClient().Update(ctx, "rg1", "zone1", "record1", armdns.RecordTypeNAPTR, armdns.RecordSet{ + Properties: &armdns.RecordSetProperties{ + Metadata: map[string]*string{ + "key2": to.Ptr("value2"), + }, + }, + }, &armdns.RecordSetsClientUpdateOptions{IfMatch: nil}) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.RecordSet = armdns.RecordSet{ + // Name: to.Ptr("record1"), + // Type: to.Ptr("Microsoft.Network/dnsZones/NAPTR"), + // Etag: to.Ptr("00000000-0000-0000-0000-000000000000"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/NAPTR/record1"), + // Properties: &armdns.RecordSetProperties{ + // NaptrRecords: []*armdns.NaptrRecord{ + // { + // Flags: to.Ptr("U"), + // Order: to.Ptr[int32](100), + // Preference: to.Ptr[int32](10), + // Regexp: to.Ptr("!^.*$!sip:user@example.com!"), + // Replacement: to.Ptr(""), + // Services: to.Ptr("E2U+sip"), + // }}, + // TTL: to.Ptr[int64](3600), + // Fqdn: to.Ptr("record1.zone1"), + // Metadata: map[string]*string{ + // "key2": to.Ptr("value2"), + // }, + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchNSRecordset.json func ExampleRecordSetsClient_Update_patchNsRecordset() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -278,7 +374,7 @@ func ExampleRecordSetsClient_Update_patchNsRecordset() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/PatchPTRRecordset.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchPTRRecordset.json func ExampleRecordSetsClient_Update_patchPtrRecordset() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -321,7 +417,7 @@ func ExampleRecordSetsClient_Update_patchPtrRecordset() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/PatchSOARecordset.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchSOARecordset.json func ExampleRecordSetsClient_Update_patchSoaRecordset() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -369,7 +465,7 @@ func ExampleRecordSetsClient_Update_patchSoaRecordset() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/PatchSRVRecordset.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchSRVRecordset.json func ExampleRecordSetsClient_Update_patchSrvRecordset() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -415,7 +511,53 @@ func ExampleRecordSetsClient_Update_patchSrvRecordset() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/PatchTXTRecordset.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchTLSARecordset.json +func ExampleRecordSetsClient_Update_patchTlsaRecordset() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armdns.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewRecordSetsClient().Update(ctx, "rg1", "zone1", "record1", armdns.RecordTypeTLSA, armdns.RecordSet{ + Properties: &armdns.RecordSetProperties{ + Metadata: map[string]*string{ + "key2": to.Ptr("value2"), + }, + }, + }, &armdns.RecordSetsClientUpdateOptions{IfMatch: nil}) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.RecordSet = armdns.RecordSet{ + // Name: to.Ptr("record1"), + // Type: to.Ptr("Microsoft.Network/dnsZones/TLSA"), + // Etag: to.Ptr("00000000-0000-0000-0000-000000000000"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/TLSA/record1"), + // Properties: &armdns.RecordSetProperties{ + // TlsaRecords: []*armdns.TlsaRecord{ + // { + // CertAssociationData: to.Ptr("6EC8A4B7F511454D84DCC055213B8D195E8ADA751FE14300AFE32D54B162438B"), + // MatchingType: to.Ptr[int32](1), + // Selector: to.Ptr[int32](1), + // Usage: to.Ptr[int32](3), + // }}, + // TTL: to.Ptr[int64](3600), + // Fqdn: to.Ptr("record1.zone1"), + // Metadata: map[string]*string{ + // "key2": to.Ptr("value2"), + // }, + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchTXTRecordset.json func ExampleRecordSetsClient_Update_patchTxtRecordset() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -460,7 +602,7 @@ func ExampleRecordSetsClient_Update_patchTxtRecordset() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateARecordset.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateARecordset.json func ExampleRecordSetsClient_CreateOrUpdate_createARecordset() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -510,7 +652,7 @@ func ExampleRecordSetsClient_CreateOrUpdate_createARecordset() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateARecordsetAlias.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateARecordsetAlias.json func ExampleRecordSetsClient_CreateOrUpdate_createARecordsetWithAliasTargetResource() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -559,7 +701,56 @@ func ExampleRecordSetsClient_CreateOrUpdate_createARecordsetWithAliasTargetResou // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateAAAARecordset.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateARecordSetTrafficManagementProfile.json +func ExampleRecordSetsClient_CreateOrUpdate_createARecordsetWithTrafficManagementProfile() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armdns.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewRecordSetsClient().CreateOrUpdate(ctx, "rg1", "zone1", "record1", armdns.RecordTypeA, armdns.RecordSet{ + Properties: &armdns.RecordSetProperties{ + TTL: to.Ptr[int64](3600), + Metadata: map[string]*string{ + "key1": to.Ptr("value1"), + }, + TrafficManagementProfile: &armdns.SubResource{ + ID: to.Ptr("/subscriptions/726f8cd6-6459-4db4-8e6d-2cd2716904e2/resourceGroups/test/providers/Microsoft.Network/trafficManagerProfiles/testpp2"), + }, + }, + }, &armdns.RecordSetsClientCreateOrUpdateOptions{IfMatch: nil, + IfNoneMatch: nil, + }) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.RecordSet = armdns.RecordSet{ + // Name: to.Ptr("record1"), + // Type: to.Ptr("Microsoft.Network/dnsZones/A"), + // Etag: to.Ptr("00000000-0000-0000-0000-000000000000"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/A/record1"), + // Properties: &armdns.RecordSetProperties{ + // TTL: to.Ptr[int64](3600), + // Fqdn: to.Ptr("record1.zone1"), + // Metadata: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, + // ProvisioningState: to.Ptr("Succeeded"), + // TrafficManagementProfile: &armdns.SubResource{ + // ID: to.Ptr("/subscriptions/726f8cd6-6459-4db4-8e6d-2cd2716904e2/resourceGroups/test/providers/Microsoft.Network/trafficManagerProfiles/testpp2"), + // }, + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateAAAARecordset.json func ExampleRecordSetsClient_CreateOrUpdate_createAaaaRecordset() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -609,7 +800,7 @@ func ExampleRecordSetsClient_CreateOrUpdate_createAaaaRecordset() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateCaaRecordset.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateCaaRecordset.json func ExampleRecordSetsClient_CreateOrUpdate_createCaaRecordset() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -663,7 +854,7 @@ func ExampleRecordSetsClient_CreateOrUpdate_createCaaRecordset() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateCNAMERecordset.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateCNAMERecordset.json func ExampleRecordSetsClient_CreateOrUpdate_createCnameRecordset() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -711,7 +902,67 @@ func ExampleRecordSetsClient_CreateOrUpdate_createCnameRecordset() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateMXRecordset.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateDSRecordset.json +func ExampleRecordSetsClient_CreateOrUpdate_createDsRecordset() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armdns.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewRecordSetsClient().CreateOrUpdate(ctx, "rg1", "zone1", "record1", armdns.RecordTypeDS, armdns.RecordSet{ + Properties: &armdns.RecordSetProperties{ + DsRecords: []*armdns.DsRecord{ + { + Algorithm: to.Ptr[int32](5), + Digest: &armdns.Digest{ + AlgorithmType: to.Ptr[int32](1), + Value: to.Ptr("2BB183AF5F22588179A53B0A98631FAD1A292118"), + }, + KeyTag: to.Ptr[int32](60485), + }}, + TTL: to.Ptr[int64](3600), + Metadata: map[string]*string{ + "key1": to.Ptr("value1"), + }, + }, + }, &armdns.RecordSetsClientCreateOrUpdateOptions{IfMatch: nil, + IfNoneMatch: nil, + }) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.RecordSet = armdns.RecordSet{ + // Name: to.Ptr("record1"), + // Type: to.Ptr("Microsoft.Network/dnszones/DS"), + // Etag: to.Ptr("00000000-0000-0000-0000-000000000000"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/DS/record1"), + // Properties: &armdns.RecordSetProperties{ + // DsRecords: []*armdns.DsRecord{ + // { + // Algorithm: to.Ptr[int32](5), + // Digest: &armdns.Digest{ + // AlgorithmType: to.Ptr[int32](1), + // Value: to.Ptr("2BB183AF5F22588179A53B0A98631FAD1A292118"), + // }, + // KeyTag: to.Ptr[int32](60485), + // }}, + // TTL: to.Ptr[int64](3600), + // Fqdn: to.Ptr("record1.zone1"), + // Metadata: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateMXRecordset.json func ExampleRecordSetsClient_CreateOrUpdate_createMxRecordset() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -763,7 +1014,67 @@ func ExampleRecordSetsClient_CreateOrUpdate_createMxRecordset() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateNSRecordset.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateNAPTRRecordset.json +func ExampleRecordSetsClient_CreateOrUpdate_createNaptrRecordset() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armdns.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewRecordSetsClient().CreateOrUpdate(ctx, "rg1", "zone1", "record1", armdns.RecordTypeNAPTR, armdns.RecordSet{ + Properties: &armdns.RecordSetProperties{ + NaptrRecords: []*armdns.NaptrRecord{ + { + Flags: to.Ptr("U"), + Order: to.Ptr[int32](100), + Preference: to.Ptr[int32](10), + Regexp: to.Ptr("!^.*$!sip:user@example.com!"), + Replacement: to.Ptr(""), + Services: to.Ptr("E2U+sip"), + }}, + TTL: to.Ptr[int64](3600), + Metadata: map[string]*string{ + "key1": to.Ptr("value1"), + }, + }, + }, &armdns.RecordSetsClientCreateOrUpdateOptions{IfMatch: nil, + IfNoneMatch: nil, + }) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.RecordSet = armdns.RecordSet{ + // Name: to.Ptr("record1"), + // Type: to.Ptr("Microsoft.Network/dnsZones/NAPTR"), + // Etag: to.Ptr("00000000-0000-0000-0000-000000000000"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/NAPTR/record1"), + // Properties: &armdns.RecordSetProperties{ + // NaptrRecords: []*armdns.NaptrRecord{ + // { + // Flags: to.Ptr("U"), + // Order: to.Ptr[int32](100), + // Preference: to.Ptr[int32](10), + // Regexp: to.Ptr("!^.*$!sip:user@example.com!"), + // Replacement: to.Ptr(""), + // Services: to.Ptr("E2U+sip"), + // }}, + // TTL: to.Ptr[int64](3600), + // Fqdn: to.Ptr("record1.zone1"), + // Metadata: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateNSRecordset.json func ExampleRecordSetsClient_CreateOrUpdate_createNsRecordset() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -813,7 +1124,7 @@ func ExampleRecordSetsClient_CreateOrUpdate_createNsRecordset() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdatePTRRecordset.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdatePTRRecordset.json func ExampleRecordSetsClient_CreateOrUpdate_createPtrRecordset() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -863,7 +1174,7 @@ func ExampleRecordSetsClient_CreateOrUpdate_createPtrRecordset() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateSOARecordset.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateSOARecordset.json func ExampleRecordSetsClient_CreateOrUpdate_createSoaRecordset() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -923,7 +1234,7 @@ func ExampleRecordSetsClient_CreateOrUpdate_createSoaRecordset() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateSRVRecordset.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateSRVRecordset.json func ExampleRecordSetsClient_CreateOrUpdate_createSrvRecordset() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -979,7 +1290,63 @@ func ExampleRecordSetsClient_CreateOrUpdate_createSrvRecordset() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateTXTRecordset.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateTLSARecordset.json +func ExampleRecordSetsClient_CreateOrUpdate_createTlsaRecordset() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armdns.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewRecordSetsClient().CreateOrUpdate(ctx, "rg1", "zone1", "record1", armdns.RecordTypeTLSA, armdns.RecordSet{ + Properties: &armdns.RecordSetProperties{ + TlsaRecords: []*armdns.TlsaRecord{ + { + CertAssociationData: to.Ptr("6EC8A4B7F511454D84DCC055213B8D195E8ADA751FE14300AFE32D54B162438B"), + MatchingType: to.Ptr[int32](1), + Selector: to.Ptr[int32](1), + Usage: to.Ptr[int32](3), + }}, + TTL: to.Ptr[int64](3600), + Metadata: map[string]*string{ + "key1": to.Ptr("value1"), + }, + }, + }, &armdns.RecordSetsClientCreateOrUpdateOptions{IfMatch: nil, + IfNoneMatch: nil, + }) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.RecordSet = armdns.RecordSet{ + // Name: to.Ptr("record1"), + // Type: to.Ptr("Microsoft.Network/dnsZones/TLSA"), + // Etag: to.Ptr("00000000-0000-0000-0000-000000000000"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/TLSA/record1"), + // Properties: &armdns.RecordSetProperties{ + // TlsaRecords: []*armdns.TlsaRecord{ + // { + // CertAssociationData: to.Ptr("6EC8A4B7F511454D84DCC055213B8D195E8ADA751FE14300AFE32D54B162438B"), + // MatchingType: to.Ptr[int32](1), + // Selector: to.Ptr[int32](1), + // Usage: to.Ptr[int32](3), + // }}, + // TTL: to.Ptr[int64](3600), + // Fqdn: to.Ptr("record1.zone1"), + // Metadata: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateTXTRecordset.json func ExampleRecordSetsClient_CreateOrUpdate_createTxtRecordset() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1009,32 +1376,117 @@ func ExampleRecordSetsClient_CreateOrUpdate_createTxtRecordset() { if err != nil { log.Fatalf("failed to finish the request: %v", err) } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RecordSet = armdns.RecordSet{ - // Name: to.Ptr("record1"), - // Type: to.Ptr("Microsoft.Network/dnsZones/TXT"), - // Etag: to.Ptr("00000000-0000-0000-0000-000000000000"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/TXT/record1"), - // Properties: &armdns.RecordSetProperties{ - // TTL: to.Ptr[int64](3600), - // TxtRecords: []*armdns.TxtRecord{ - // { - // Value: []*string{ - // to.Ptr("string1"), - // to.Ptr("string2")}, - // }}, - // Fqdn: to.Ptr("record1.zone1"), - // Metadata: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // }, - // } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.RecordSet = armdns.RecordSet{ + // Name: to.Ptr("record1"), + // Type: to.Ptr("Microsoft.Network/dnsZones/TXT"), + // Etag: to.Ptr("00000000-0000-0000-0000-000000000000"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/TXT/record1"), + // Properties: &armdns.RecordSetProperties{ + // TTL: to.Ptr[int64](3600), + // TxtRecords: []*armdns.TxtRecord{ + // { + // Value: []*string{ + // to.Ptr("string1"), + // to.Ptr("string2")}, + // }}, + // Fqdn: to.Ptr("record1.zone1"), + // Metadata: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteARecordset.json +func ExampleRecordSetsClient_Delete_deleteARecordset() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armdns.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + _, err = clientFactory.NewRecordSetsClient().Delete(ctx, "rg1", "zone1", "record1", armdns.RecordTypeA, &armdns.RecordSetsClientDeleteOptions{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/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteAAAARecordset.json +func ExampleRecordSetsClient_Delete_deleteAaaaRecordset() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armdns.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + _, err = clientFactory.NewRecordSetsClient().Delete(ctx, "rg1", "zone1", "record1", armdns.RecordTypeAAAA, &armdns.RecordSetsClientDeleteOptions{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/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteCaaRecordset.json +func ExampleRecordSetsClient_Delete_deleteCaaRecordset() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armdns.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + _, err = clientFactory.NewRecordSetsClient().Delete(ctx, "rg1", "zone1", "record1", armdns.RecordTypeCAA, &armdns.RecordSetsClientDeleteOptions{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/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteCNAMERecordset.json +func ExampleRecordSetsClient_Delete_deleteCnameRecordset() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armdns.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + _, err = clientFactory.NewRecordSetsClient().Delete(ctx, "rg1", "zone1", "record1", armdns.RecordTypeCNAME, &armdns.RecordSetsClientDeleteOptions{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/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteDSRecordset.json +func ExampleRecordSetsClient_Delete_deleteDsRecordset() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armdns.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + _, err = clientFactory.NewRecordSetsClient().Delete(ctx, "rg1", "zone1", "record1", armdns.RecordTypeDS, &armdns.RecordSetsClientDeleteOptions{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/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/DeleteARecordset.json -func ExampleRecordSetsClient_Delete_deleteARecordset() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteMXRecordset.json +func ExampleRecordSetsClient_Delete_deleteMxRecordset() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -1044,14 +1496,14 @@ func ExampleRecordSetsClient_Delete_deleteARecordset() { if err != nil { log.Fatalf("failed to create client: %v", err) } - _, err = clientFactory.NewRecordSetsClient().Delete(ctx, "rg1", "zone1", "record1", armdns.RecordTypeA, &armdns.RecordSetsClientDeleteOptions{IfMatch: nil}) + _, err = clientFactory.NewRecordSetsClient().Delete(ctx, "rg1", "zone1", "record1", armdns.RecordTypeMX, &armdns.RecordSetsClientDeleteOptions{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/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/DeleteAAAARecordset.json -func ExampleRecordSetsClient_Delete_deleteAaaaRecordset() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteNAPTRRecordset.json +func ExampleRecordSetsClient_Delete_deleteNaptrRecordset() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -1061,14 +1513,14 @@ func ExampleRecordSetsClient_Delete_deleteAaaaRecordset() { if err != nil { log.Fatalf("failed to create client: %v", err) } - _, err = clientFactory.NewRecordSetsClient().Delete(ctx, "rg1", "zone1", "record1", armdns.RecordTypeAAAA, &armdns.RecordSetsClientDeleteOptions{IfMatch: nil}) + _, err = clientFactory.NewRecordSetsClient().Delete(ctx, "rg1", "zone1", "record1", armdns.RecordTypeNAPTR, &armdns.RecordSetsClientDeleteOptions{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/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/DeleteCaaRecordset.json -func ExampleRecordSetsClient_Delete_deleteCaaRecordset() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteNSRecordset.json +func ExampleRecordSetsClient_Delete_deleteNsRecordset() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -1078,13 +1530,13 @@ func ExampleRecordSetsClient_Delete_deleteCaaRecordset() { if err != nil { log.Fatalf("failed to create client: %v", err) } - _, err = clientFactory.NewRecordSetsClient().Delete(ctx, "rg1", "zone1", "record1", armdns.RecordTypeCAA, &armdns.RecordSetsClientDeleteOptions{IfMatch: nil}) + _, err = clientFactory.NewRecordSetsClient().Delete(ctx, "rg1", "zone1", "record1", armdns.RecordTypeNS, &armdns.RecordSetsClientDeleteOptions{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/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/DeletePTRRecordset.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeletePTRRecordset.json func ExampleRecordSetsClient_Delete_deletePtrRecordset() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1101,7 +1553,7 @@ func ExampleRecordSetsClient_Delete_deletePtrRecordset() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/DeleteSRVRecordset.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteSRVRecordset.json func ExampleRecordSetsClient_Delete_deleteSrvRecordset() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1118,7 +1570,24 @@ func ExampleRecordSetsClient_Delete_deleteSrvRecordset() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/DeleteTXTRecordset.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteTLSARecordset.json +func ExampleRecordSetsClient_Delete_deleteTlsaRecordset() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armdns.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + _, err = clientFactory.NewRecordSetsClient().Delete(ctx, "rg1", "zone1", "record1", armdns.RecordTypeTLSA, &armdns.RecordSetsClientDeleteOptions{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/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteTXTRecordset.json func ExampleRecordSetsClient_Delete_deleteTxtRecordset() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1135,7 +1604,7 @@ func ExampleRecordSetsClient_Delete_deleteTxtRecordset() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/GetARecordset.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetARecordset.json func ExampleRecordSetsClient_Get_getARecordset() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1172,7 +1641,7 @@ func ExampleRecordSetsClient_Get_getARecordset() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/GetAAAARecordset.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetAAAARecordset.json func ExampleRecordSetsClient_Get_getAaaaRecordset() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1209,7 +1678,7 @@ func ExampleRecordSetsClient_Get_getAaaaRecordset() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/GetCaaRecordset.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetCaaRecordset.json func ExampleRecordSetsClient_Get_getCaaRecordset() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1248,7 +1717,7 @@ func ExampleRecordSetsClient_Get_getCaaRecordset() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/GetCNAMERecordset.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetCNAMERecordset.json func ExampleRecordSetsClient_Get_getCnameRecordset() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1284,7 +1753,49 @@ func ExampleRecordSetsClient_Get_getCnameRecordset() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/GetMXRecordset.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetDSRecordset.json +func ExampleRecordSetsClient_Get_getDsRecordset() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armdns.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewRecordSetsClient().Get(ctx, "rg1", "zone1", "record1", armdns.RecordTypeDS, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.RecordSet = armdns.RecordSet{ + // Name: to.Ptr("record1"), + // Type: to.Ptr("Microsoft.Network/dnsZones/DS"), + // Etag: to.Ptr("00000000-0000-0000-0000-000000000000"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/DS/record1"), + // Properties: &armdns.RecordSetProperties{ + // DsRecords: []*armdns.DsRecord{ + // { + // Algorithm: to.Ptr[int32](5), + // Digest: &armdns.Digest{ + // AlgorithmType: to.Ptr[int32](1), + // Value: to.Ptr("2BB183AF5F22588179A53B0A98631FAD1A292118"), + // }, + // KeyTag: to.Ptr[int32](60485), + // }}, + // TTL: to.Ptr[int64](3600), + // Fqdn: to.Ptr("record1.zone1"), + // Metadata: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetMXRecordset.json func ExampleRecordSetsClient_Get_getMxRecordset() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1322,7 +1833,49 @@ func ExampleRecordSetsClient_Get_getMxRecordset() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/GetNSRecordset.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetNAPTRRecordset.json +func ExampleRecordSetsClient_Get_getNaptrRecordset() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armdns.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewRecordSetsClient().Get(ctx, "rg1", "zone1", "record1", armdns.RecordTypeNAPTR, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.RecordSet = armdns.RecordSet{ + // Name: to.Ptr("record1"), + // Type: to.Ptr("Microsoft.Network/dnsZones/NAPTR"), + // Etag: to.Ptr("00000000-0000-0000-0000-000000000000"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/NAPTR/record1"), + // Properties: &armdns.RecordSetProperties{ + // NaptrRecords: []*armdns.NaptrRecord{ + // { + // Flags: to.Ptr("U"), + // Order: to.Ptr[int32](100), + // Preference: to.Ptr[int32](10), + // Regexp: to.Ptr("!^.*$!sip:user@example.com!"), + // Replacement: to.Ptr(""), + // Services: to.Ptr("E2U+sip"), + // }}, + // TTL: to.Ptr[int64](3600), + // Fqdn: to.Ptr("record1.zone1"), + // Metadata: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetNSRecordset.json func ExampleRecordSetsClient_Get_getNsRecordset() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1359,7 +1912,7 @@ func ExampleRecordSetsClient_Get_getNsRecordset() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/GetPTRRecordset.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetPTRRecordset.json func ExampleRecordSetsClient_Get_getPtrRecordset() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1396,7 +1949,7 @@ func ExampleRecordSetsClient_Get_getPtrRecordset() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/GetSOARecordset.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetSOARecordset.json func ExampleRecordSetsClient_Get_getSoaRecordset() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1438,7 +1991,7 @@ func ExampleRecordSetsClient_Get_getSoaRecordset() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/GetSRVRecordset.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetSRVRecordset.json func ExampleRecordSetsClient_Get_getSrvRecordset() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1478,7 +2031,47 @@ func ExampleRecordSetsClient_Get_getSrvRecordset() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/GetTXTRecordset.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetTLSARecordset.json +func ExampleRecordSetsClient_Get_getTlsaRecordset() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armdns.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewRecordSetsClient().Get(ctx, "rg1", "zone1", "record1", armdns.RecordTypeTLSA, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.RecordSet = armdns.RecordSet{ + // Name: to.Ptr("record1"), + // Type: to.Ptr("Microsoft.Network/dnsZones/TLSA"), + // Etag: to.Ptr("00000000-0000-0000-0000-000000000000"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/TLSA/record1"), + // Properties: &armdns.RecordSetProperties{ + // TlsaRecords: []*armdns.TlsaRecord{ + // { + // CertAssociationData: to.Ptr("6EC8A4B7F511454D84DCC055213B8D195E8ADA751FE14300AFE32D54B162438B"), + // MatchingType: to.Ptr[int32](1), + // Selector: to.Ptr[int32](1), + // Usage: to.Ptr[int32](3), + // }}, + // TTL: to.Ptr[int64](3600), + // Fqdn: to.Ptr("record1.zone1"), + // Metadata: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetTXTRecordset.json func ExampleRecordSetsClient_Get_getTxtRecordset() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1517,7 +2110,7 @@ func ExampleRecordSetsClient_Get_getTxtRecordset() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListARecordset.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListARecordset.json func ExampleRecordSetsClient_NewListByTypePager_listARecordsets() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1564,7 +2157,7 @@ func ExampleRecordSetsClient_NewListByTypePager_listARecordsets() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListAAAARecordset.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListAAAARecordset.json func ExampleRecordSetsClient_NewListByTypePager_listAaaaRecordsets() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1611,7 +2204,7 @@ func ExampleRecordSetsClient_NewListByTypePager_listAaaaRecordsets() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListCaaRecordset.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListCaaRecordset.json func ExampleRecordSetsClient_NewListByTypePager_listCaaRecordsets() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1660,7 +2253,7 @@ func ExampleRecordSetsClient_NewListByTypePager_listCaaRecordsets() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListCNAMERecordset.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListCNAMERecordset.json func ExampleRecordSetsClient_NewListByTypePager_listCnameRecordsets() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1706,7 +2299,59 @@ func ExampleRecordSetsClient_NewListByTypePager_listCnameRecordsets() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListMXRecordset.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListDSRecordset.json +func ExampleRecordSetsClient_NewListByTypePager_listDsRecordsets() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armdns.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewRecordSetsClient().NewListByTypePager("rg1", "zone1", armdns.RecordTypeDS, &armdns.RecordSetsClientListByTypeOptions{Top: nil, + Recordsetnamesuffix: nil, + }) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.RecordSetListResult = armdns.RecordSetListResult{ + // Value: []*armdns.RecordSet{ + // { + // Name: to.Ptr("record1"), + // Type: to.Ptr("Microsoft.Network/dnsZones/DS"), + // Etag: to.Ptr("00000000-0000-0000-0000-000000000000"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/DS/record1"), + // Properties: &armdns.RecordSetProperties{ + // DsRecords: []*armdns.DsRecord{ + // { + // Algorithm: to.Ptr[int32](5), + // Digest: &armdns.Digest{ + // AlgorithmType: to.Ptr[int32](1), + // Value: to.Ptr("2BB183AF5F22588179A53B0A98631FAD1A292118"), + // }, + // KeyTag: to.Ptr[int32](60485), + // }}, + // TTL: to.Ptr[int64](3600), + // Fqdn: to.Ptr("record1.zone1"), + // Metadata: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListMXRecordset.json func ExampleRecordSetsClient_NewListByTypePager_listMxRecordsets() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1754,7 +2399,59 @@ func ExampleRecordSetsClient_NewListByTypePager_listMxRecordsets() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListNSRecordset.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListNAPTRRecordset.json +func ExampleRecordSetsClient_NewListByTypePager_listNaptrRecordsets() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armdns.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewRecordSetsClient().NewListByTypePager("rg1", "zone1", armdns.RecordTypeNAPTR, &armdns.RecordSetsClientListByTypeOptions{Top: nil, + Recordsetnamesuffix: nil, + }) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.RecordSetListResult = armdns.RecordSetListResult{ + // Value: []*armdns.RecordSet{ + // { + // Name: to.Ptr("record1"), + // Type: to.Ptr("Microsoft.Network/dnsZones/NAPTR"), + // Etag: to.Ptr("00000000-0000-0000-0000-000000000000"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/NAPTR/record1"), + // Properties: &armdns.RecordSetProperties{ + // NaptrRecords: []*armdns.NaptrRecord{ + // { + // Flags: to.Ptr("u"), + // Order: to.Ptr[int32](100), + // Preference: to.Ptr[int32](10), + // Regexp: to.Ptr("!^.*$!sip:user@example.com!"), + // Replacement: to.Ptr(""), + // Services: to.Ptr("E2U+sip"), + // }}, + // TTL: to.Ptr[int64](3600), + // Fqdn: to.Ptr("record1.zone1"), + // Metadata: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListNSRecordset.json func ExampleRecordSetsClient_NewListByTypePager_listNsRecordsets() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1801,7 +2498,7 @@ func ExampleRecordSetsClient_NewListByTypePager_listNsRecordsets() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListPTRRecordset.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListPTRRecordset.json func ExampleRecordSetsClient_NewListByTypePager_listPtrRecordsets() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1848,7 +2545,7 @@ func ExampleRecordSetsClient_NewListByTypePager_listPtrRecordsets() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListSOARecordset.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListSOARecordset.json func ExampleRecordSetsClient_NewListByTypePager_listSoaRecordsets() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1900,7 +2597,7 @@ func ExampleRecordSetsClient_NewListByTypePager_listSoaRecordsets() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListSRVRecordset.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListSRVRecordset.json func ExampleRecordSetsClient_NewListByTypePager_listSrvRecordsets() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1950,7 +2647,57 @@ func ExampleRecordSetsClient_NewListByTypePager_listSrvRecordsets() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListTXTRecordset.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListTLSARecordset.json +func ExampleRecordSetsClient_NewListByTypePager_listTlsaRecordsets() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armdns.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewRecordSetsClient().NewListByTypePager("rg1", "zone1", armdns.RecordTypeTLSA, &armdns.RecordSetsClientListByTypeOptions{Top: nil, + Recordsetnamesuffix: nil, + }) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.RecordSetListResult = armdns.RecordSetListResult{ + // Value: []*armdns.RecordSet{ + // { + // Name: to.Ptr("record1"), + // Type: to.Ptr("Microsoft.Network/dnsZones/TLSA"), + // Etag: to.Ptr("00000000-0000-0000-0000-000000000000"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/TLSA/record1"), + // Properties: &armdns.RecordSetProperties{ + // TlsaRecords: []*armdns.TlsaRecord{ + // { + // CertAssociationData: to.Ptr("6EC8A4B7F511454D84DCC055213B8D195E8ADA751FE14300AFE32D54B162438B"), + // MatchingType: to.Ptr[int32](1), + // Selector: to.Ptr[int32](1), + // Usage: to.Ptr[int32](3), + // }}, + // TTL: to.Ptr[int64](3600), + // Fqdn: to.Ptr("record1.zone1"), + // Metadata: map[string]*string{ + // "key1": to.Ptr("value1"), + // }, + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListTXTRecordset.json func ExampleRecordSetsClient_NewListByTypePager_listTxtRecordsets() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1999,7 +2746,7 @@ func ExampleRecordSetsClient_NewListByTypePager_listTxtRecordsets() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListRecordSetsByZone.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListRecordSetsByZone.json func ExampleRecordSetsClient_NewListByDNSZonePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/dns/armdns/resourcereference_client.go b/sdk/resourcemanager/dns/armdns/resourcereference_client.go index 215f43b1641b..99b1e6cc04ae 100644 --- a/sdk/resourcemanager/dns/armdns/resourcereference_client.go +++ b/sdk/resourcemanager/dns/armdns/resourcereference_client.go @@ -28,7 +28,7 @@ type ResourceReferenceClient struct { } // NewResourceReferenceClient creates a new instance of ResourceReferenceClient with the specified values. -// - subscriptionID - Specifies the Azure subscription ID, which uniquely identifies the Microsoft Azure subscription. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewResourceReferenceClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ResourceReferenceClient, error) { @@ -46,7 +46,7 @@ func NewResourceReferenceClient(subscriptionID string, credential azcore.TokenCr // GetByTargetResources - Returns the DNS records specified by the referencing targetResourceIds. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2018-05-01 +// Generated from API version 2023-07-01-preview // - parameters - Properties for dns resource reference request. // - options - ResourceReferenceClientGetByTargetResourcesOptions contains the optional parameters for the ResourceReferenceClient.GetByTargetResources // method. @@ -84,7 +84,7 @@ func (client *ResourceReferenceClient) getByTargetResourcesCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-05-01") + reqQP.Set("api-version", "2023-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/dns/armdns/resourcereference_client_example_test.go b/sdk/resourcemanager/dns/armdns/resourcereference_client_example_test.go index cc3dedce5577..80d42bbf452a 100644 --- a/sdk/resourcemanager/dns/armdns/resourcereference_client_example_test.go +++ b/sdk/resourcemanager/dns/armdns/resourcereference_client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/GetDnsResourceReference.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetDnsResourceReference.json func ExampleResourceReferenceClient_GetByTargetResources() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/dns/armdns/response_types.go b/sdk/resourcemanager/dns/armdns/responses.go similarity index 79% rename from sdk/resourcemanager/dns/armdns/response_types.go rename to sdk/resourcemanager/dns/armdns/responses.go index ccf318d38be8..f79d2dd11b7a 100644 --- a/sdk/resourcemanager/dns/armdns/response_types.go +++ b/sdk/resourcemanager/dns/armdns/responses.go @@ -8,6 +8,29 @@ package armdns +// DnssecConfigsClientCreateOrUpdateResponse contains the response from method DnssecConfigsClient.BeginCreateOrUpdate. +type DnssecConfigsClientCreateOrUpdateResponse struct { + // Represents the DNSSEC configuration. + DnssecConfig +} + +// DnssecConfigsClientDeleteResponse contains the response from method DnssecConfigsClient.BeginDelete. +type DnssecConfigsClientDeleteResponse struct { + // placeholder for future response values +} + +// DnssecConfigsClientGetResponse contains the response from method DnssecConfigsClient.Get. +type DnssecConfigsClientGetResponse struct { + // Represents the DNSSEC configuration. + DnssecConfig +} + +// DnssecConfigsClientListByDNSZoneResponse contains the response from method DnssecConfigsClient.NewListByDNSZonePager. +type DnssecConfigsClientListByDNSZoneResponse struct { + // The response to a List DNSSEC configurations operation. + DnssecConfigListResult +} + // RecordSetsClientCreateOrUpdateResponse contains the response from method RecordSetsClient.CreateOrUpdate. type RecordSetsClientCreateOrUpdateResponse struct { // Describes a DNS record set (a collection of DNS records with the same name and type). diff --git a/sdk/resourcemanager/dns/armdns/time_rfc3339.go b/sdk/resourcemanager/dns/armdns/time_rfc3339.go new file mode 100644 index 000000000000..71a490e09a6b --- /dev/null +++ b/sdk/resourcemanager/dns/armdns/time_rfc3339.go @@ -0,0 +1,110 @@ +//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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armdns + +import ( + "encoding/json" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "reflect" + "regexp" + "strings" + "time" +) + +// Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. +var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`) + +const ( + utcDateTime = "2006-01-02T15:04:05.999999999" + utcDateTimeJSON = `"` + utcDateTime + `"` + utcDateTimeNoT = "2006-01-02 15:04:05.999999999" + utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"` + dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00` + dateTimeJSON = `"` + time.RFC3339Nano + `"` + dateTimeJSONNoT = `"` + dateTimeNoT + `"` +) + +type dateTimeRFC3339 time.Time + +func (t dateTimeRFC3339) MarshalJSON() ([]byte, error) { + tt := time.Time(t) + return tt.MarshalJSON() +} + +func (t dateTimeRFC3339) MarshalText() ([]byte, error) { + tt := time.Time(t) + return tt.MarshalText() +} + +func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { + layout = dateTimeJSON + } else if tzOffset { + layout = dateTimeJSONNoT + } else if hasT { + layout = utcDateTimeJSON + } else { + layout = utcDateTimeJSONNoT + } + return t.Parse(layout, string(data)) +} + +func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { + layout = time.RFC3339Nano + } else if tzOffset { + layout = dateTimeNoT + } else if hasT { + layout = utcDateTime + } else { + layout = utcDateTimeNoT + } + return t.Parse(layout, string(data)) +} + +func (t *dateTimeRFC3339) Parse(layout, value string) error { + p, err := time.Parse(layout, strings.ToUpper(value)) + *t = dateTimeRFC3339(p) + return err +} + +func (t dateTimeRFC3339) String() string { + return time.Time(t).Format(time.RFC3339Nano) +} + +func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { + if t == nil { + return + } else if azcore.IsNullValue(t) { + m[k] = nil + return + } else if reflect.ValueOf(t).IsNil() { + return + } + m[k] = (*dateTimeRFC3339)(t) +} + +func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { + if data == nil || string(data) == "null" { + return nil + } + var aux dateTimeRFC3339 + if err := json.Unmarshal(data, &aux); err != nil { + return fmt.Errorf("struct field %s: %v", fn, err) + } + *t = (*time.Time)(&aux) + return nil +} diff --git a/sdk/resourcemanager/dns/armdns/zones_client.go b/sdk/resourcemanager/dns/armdns/zones_client.go index 08bdcbf42d99..eda7a8bcb6bc 100644 --- a/sdk/resourcemanager/dns/armdns/zones_client.go +++ b/sdk/resourcemanager/dns/armdns/zones_client.go @@ -29,7 +29,7 @@ type ZonesClient struct { } // NewZonesClient creates a new instance of ZonesClient with the specified values. -// - subscriptionID - Specifies the Azure subscription ID, which uniquely identifies the Microsoft Azure subscription. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewZonesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ZonesClient, error) { @@ -47,8 +47,8 @@ func NewZonesClient(subscriptionID string, credential azcore.TokenCredential, op // CreateOrUpdate - Creates or updates a DNS zone. Does not modify DNS records within the zone. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2018-05-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2023-07-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - zoneName - The name of the DNS zone (without a terminating dot). // - parameters - Parameters supplied to the CreateOrUpdate operation. // - options - ZonesClientCreateOrUpdateOptions contains the optional parameters for the ZonesClient.CreateOrUpdate method. @@ -94,15 +94,15 @@ func (client *ZonesClient) createOrUpdateCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-05-01") + reqQP.Set("api-version", "2023-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } if options != nil && options.IfNoneMatch != nil { req.Raw().Header["If-None-Match"] = []string{*options.IfNoneMatch} } - req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -121,8 +121,8 @@ func (client *ZonesClient) createOrUpdateHandleResponse(resp *http.Response) (Zo // BeginDelete - Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2018-05-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2023-07-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - zoneName - The name of the DNS zone (without a terminating dot). // - options - ZonesClientBeginDeleteOptions contains the optional parameters for the ZonesClient.BeginDelete method. func (client *ZonesClient) BeginDelete(ctx context.Context, resourceGroupName string, zoneName string, options *ZonesClientBeginDeleteOptions) (*runtime.Poller[ZonesClientDeleteResponse], error) { @@ -145,7 +145,7 @@ func (client *ZonesClient) BeginDelete(ctx context.Context, resourceGroupName st // Delete - Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2018-05-01 +// Generated from API version 2023-07-01-preview func (client *ZonesClient) deleteOperation(ctx context.Context, resourceGroupName string, zoneName string, options *ZonesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ZonesClient.BeginDelete" @@ -187,20 +187,20 @@ func (client *ZonesClient) deleteCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-05-01") + reqQP.Set("api-version", "2023-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // Get - Gets a DNS zone. Retrieves the zone properties, but not the record sets within the zone. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2018-05-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2023-07-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - zoneName - The name of the DNS zone (without a terminating dot). // - options - ZonesClientGetOptions contains the optional parameters for the ZonesClient.Get method. func (client *ZonesClient) Get(ctx context.Context, resourceGroupName string, zoneName string, options *ZonesClientGetOptions) (ZonesClientGetResponse, error) { @@ -245,7 +245,7 @@ func (client *ZonesClient) getCreateRequest(ctx context.Context, resourceGroupNa return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-05-01") + reqQP.Set("api-version", "2023-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -262,7 +262,7 @@ func (client *ZonesClient) getHandleResponse(resp *http.Response) (ZonesClientGe // NewListPager - Lists the DNS zones in all resource groups in a subscription. // -// Generated from API version 2018-05-01 +// Generated from API version 2023-07-01-preview // - options - ZonesClientListOptions contains the optional parameters for the ZonesClient.NewListPager method. func (client *ZonesClient) NewListPager(options *ZonesClientListOptions) *runtime.Pager[ZonesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ZonesClientListResponse]{ @@ -302,7 +302,7 @@ func (client *ZonesClient) listCreateRequest(ctx context.Context, options *Zones if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2018-05-01") + reqQP.Set("api-version", "2023-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -319,8 +319,8 @@ func (client *ZonesClient) listHandleResponse(resp *http.Response) (ZonesClientL // NewListByResourceGroupPager - Lists the DNS zones within a resource group. // -// Generated from API version 2018-05-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2023-07-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - ZonesClientListByResourceGroupOptions contains the optional parameters for the ZonesClient.NewListByResourceGroupPager // method. func (client *ZonesClient) NewListByResourceGroupPager(resourceGroupName string, options *ZonesClientListByResourceGroupOptions) *runtime.Pager[ZonesClientListByResourceGroupResponse] { @@ -365,7 +365,7 @@ func (client *ZonesClient) listByResourceGroupCreateRequest(ctx context.Context, if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2018-05-01") + reqQP.Set("api-version", "2023-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -383,8 +383,8 @@ func (client *ZonesClient) listByResourceGroupHandleResponse(resp *http.Response // Update - Updates a DNS zone. Does not modify DNS records within the zone. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2018-05-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2023-07-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - zoneName - The name of the DNS zone (without a terminating dot). // - parameters - Parameters supplied to the Update operation. // - options - ZonesClientUpdateOptions contains the optional parameters for the ZonesClient.Update method. @@ -430,12 +430,12 @@ func (client *ZonesClient) updateCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2018-05-01") + reqQP.Set("api-version", "2023-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } - req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/dns/armdns/zones_client_example_test.go b/sdk/resourcemanager/dns/armdns/zones_client_example_test.go index 5ea55b369314..a6a1e8490944 100644 --- a/sdk/resourcemanager/dns/armdns/zones_client_example_test.go +++ b/sdk/resourcemanager/dns/armdns/zones_client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/CreateOrUpdateZone.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/CreateOrUpdateZone.json func ExampleZonesClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -65,7 +65,7 @@ func ExampleZonesClient_CreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/DeleteZone.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/DeleteZone.json func ExampleZonesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -86,7 +86,7 @@ func ExampleZonesClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/GetZone.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/GetZone.json func ExampleZonesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -125,7 +125,7 @@ func ExampleZonesClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/PatchZone.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/PatchZone.json func ExampleZonesClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -168,7 +168,7 @@ func ExampleZonesClient_Update() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListZonesByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListZonesByResourceGroup.json func ExampleZonesClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -231,7 +231,7 @@ func ExampleZonesClient_NewListByResourceGroupPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/Microsoft.Network/stable/2018-05-01/examples/ListZonesBySubscription.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/987a8f38ab2a8359d085e149be042267a9ecc66f/specification/dns/resource-manager/Microsoft.Network/preview/2023-07-01-preview/examples/ListZonesBySubscription.json func ExampleZonesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil {