From d799fa11ff7b0a67499792a12bd019b8594b5236 Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Thu, 12 Feb 2026 00:27:36 +0000 Subject: [PATCH 1/3] Configurations: 'specification/domainregistration/resource-manager/Microsoft.DomainRegistration/DomainRegistration/tspconfig.yaml', API Version: 2024-11-01, SDK Release Type: stable, and CommitSHA: '49e23eb28ab52a6dc3453b0a7ba10351d672f547' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=5870461 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. --- .../armdomainregistration/CHANGELOG.md | 8 + .../armdomainregistration/LICENSE.txt | 21 + .../armdomainregistration/README.md | 90 + .../armdomainregistration/ci.yml | 27 + .../armdomainregistration/client_factory.go | 56 + .../armdomainregistration/constants.go | 207 +++ .../armdomainregistration/domains_client.go | 1120 +++++++++++++ .../domains_client_example_test.go | 1255 ++++++++++++++ .../fake/domains_server.go | 788 +++++++++ .../armdomainregistration/fake/internal.go | 76 + .../fake/provider_server.go | 117 ++ .../fake/server_factory.go | 88 + .../fake/topleveldomains_server.go | 210 +++ .../armdomainregistration/go.mod | 21 + .../armdomainregistration/go.sum | 39 + .../armdomainregistration/models.go | 606 +++++++ .../armdomainregistration/models_serde.go | 1473 +++++++++++++++++ .../armdomainregistration/options.go | 117 ++ .../armdomainregistration/provider_client.go | 87 + .../provider_client_example_test.go | 133 ++ .../armdomainregistration/responses.go | 126 ++ .../testdata/_metadata.json | 4 + .../topleveldomains_client.go | 225 +++ .../topleveldomains_client_example_test.go | 192 +++ .../armdomainregistration/tsp-location.yaml | 4 + .../armdomainregistration/version.go | 10 + 26 files changed, 7100 insertions(+) create mode 100644 sdk/resourcemanager/domainregistration/armdomainregistration/CHANGELOG.md create mode 100644 sdk/resourcemanager/domainregistration/armdomainregistration/LICENSE.txt create mode 100644 sdk/resourcemanager/domainregistration/armdomainregistration/README.md create mode 100644 sdk/resourcemanager/domainregistration/armdomainregistration/ci.yml create mode 100644 sdk/resourcemanager/domainregistration/armdomainregistration/client_factory.go create mode 100644 sdk/resourcemanager/domainregistration/armdomainregistration/constants.go create mode 100644 sdk/resourcemanager/domainregistration/armdomainregistration/domains_client.go create mode 100644 sdk/resourcemanager/domainregistration/armdomainregistration/domains_client_example_test.go create mode 100644 sdk/resourcemanager/domainregistration/armdomainregistration/fake/domains_server.go create mode 100644 sdk/resourcemanager/domainregistration/armdomainregistration/fake/internal.go create mode 100644 sdk/resourcemanager/domainregistration/armdomainregistration/fake/provider_server.go create mode 100644 sdk/resourcemanager/domainregistration/armdomainregistration/fake/server_factory.go create mode 100644 sdk/resourcemanager/domainregistration/armdomainregistration/fake/topleveldomains_server.go create mode 100644 sdk/resourcemanager/domainregistration/armdomainregistration/go.mod create mode 100644 sdk/resourcemanager/domainregistration/armdomainregistration/go.sum create mode 100644 sdk/resourcemanager/domainregistration/armdomainregistration/models.go create mode 100644 sdk/resourcemanager/domainregistration/armdomainregistration/models_serde.go create mode 100644 sdk/resourcemanager/domainregistration/armdomainregistration/options.go create mode 100644 sdk/resourcemanager/domainregistration/armdomainregistration/provider_client.go create mode 100644 sdk/resourcemanager/domainregistration/armdomainregistration/provider_client_example_test.go create mode 100644 sdk/resourcemanager/domainregistration/armdomainregistration/responses.go create mode 100644 sdk/resourcemanager/domainregistration/armdomainregistration/testdata/_metadata.json create mode 100644 sdk/resourcemanager/domainregistration/armdomainregistration/topleveldomains_client.go create mode 100644 sdk/resourcemanager/domainregistration/armdomainregistration/topleveldomains_client_example_test.go create mode 100644 sdk/resourcemanager/domainregistration/armdomainregistration/tsp-location.yaml create mode 100644 sdk/resourcemanager/domainregistration/armdomainregistration/version.go diff --git a/sdk/resourcemanager/domainregistration/armdomainregistration/CHANGELOG.md b/sdk/resourcemanager/domainregistration/armdomainregistration/CHANGELOG.md new file mode 100644 index 000000000000..35efeab155cd --- /dev/null +++ b/sdk/resourcemanager/domainregistration/armdomainregistration/CHANGELOG.md @@ -0,0 +1,8 @@ +# Release History + +## 0.1.0 (2026-02-12) +### Other Changes + +The package of `github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/domainregistration/armdomainregistration` is using our [next generation design principles](https://azure.github.io/azure-sdk/general_introduction.html). + +To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/go/mgmt). \ No newline at end of file diff --git a/sdk/resourcemanager/domainregistration/armdomainregistration/LICENSE.txt b/sdk/resourcemanager/domainregistration/armdomainregistration/LICENSE.txt new file mode 100644 index 000000000000..dc0c2ffb3dc1 --- /dev/null +++ b/sdk/resourcemanager/domainregistration/armdomainregistration/LICENSE.txt @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Microsoft Corporation. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/sdk/resourcemanager/domainregistration/armdomainregistration/README.md b/sdk/resourcemanager/domainregistration/armdomainregistration/README.md new file mode 100644 index 000000000000..47cd45d63576 --- /dev/null +++ b/sdk/resourcemanager/domainregistration/armdomainregistration/README.md @@ -0,0 +1,90 @@ +# Azure Domainregistration Module for Go + +The `armdomainregistration` module provides operations for working with Azure Domainregistration. + +[Source code](https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/resourcemanager/domainregistration/armdomainregistration) + +# Getting started + +## Prerequisites + +- An [Azure subscription](https://azure.microsoft.com/free/) +- [Supported](https://aka.ms/azsdk/go/supported-versions) version of Go (You could download and install the latest version of Go from [here](https://go.dev/doc/install). It will replace the existing Go on your machine. If you want to install multiple Go versions on the same machine, you could refer this [doc](https://go.dev/doc/manage-install).) + +## Install the package + +This project uses [Go modules](https://github.com/golang/go/wiki/Modules) for versioning and dependency management. + +Install the Azure Domainregistration module: + +```sh +go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/domainregistration/armdomainregistration +``` + +## Authorization + +When creating a client, you will need to provide a credential for authenticating with Azure Domainregistration. The `azidentity` module provides facilities for various ways of authenticating with Azure including client/secret, certificate, managed identity, and more. + +```go +cred, err := azidentity.NewDefaultAzureCredential(nil) +``` + +For more information on authentication, please see the documentation for `azidentity` at [pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity). + +## Client Factory + +Azure Domainregistration module consists of one or more clients. We provide a client factory which could be used to create any client in this module. + +```go +clientFactory, err := armdomainregistration.NewClientFactory(, cred, nil) +``` + +You can use `ClientOptions` in package `github.com/Azure/azure-sdk-for-go/sdk/azcore/arm` to set endpoint to connect with public and sovereign clouds as well as Azure Stack. For more information, please see the documentation for `azcore` at [pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azcore](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azcore). + +```go +options := arm.ClientOptions { + ClientOptions: azcore.ClientOptions { + Cloud: cloud.AzureChina, + }, +} +clientFactory, err := armdomainregistration.NewClientFactory(, cred, &options) +``` + +## Clients + +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.NewDomainsClient() +``` + +## Fakes + +The fake package contains types used for constructing in-memory fake servers used in unit tests. +This allows writing tests to cover various success/error conditions without the need for connecting to a live service. + +Please see https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/samples/fakes for details and examples on how to use fakes. + +## Provide Feedback + +If you encounter bugs or have suggestions, please +[open an issue](https://github.com/Azure/azure-sdk-for-go/issues) and assign the `Domainregistration` label. + +# Contributing + +This project welcomes contributions and suggestions. Most contributions require +you to agree to a Contributor License Agreement (CLA) declaring that you have +the right to, and actually do, grant us the rights to use your contribution. +For details, visit [https://cla.microsoft.com](https://cla.microsoft.com). + +When you submit a pull request, a CLA-bot will automatically determine whether +you need to provide a CLA and decorate the PR appropriately (e.g., label, +comment). Simply follow the instructions provided by the bot. You will only +need to do this once across all repos using our CLA. + +This project has adopted the +[Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). +For more information, see the +[Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) +or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any +additional questions or comments. \ No newline at end of file diff --git a/sdk/resourcemanager/domainregistration/armdomainregistration/ci.yml b/sdk/resourcemanager/domainregistration/armdomainregistration/ci.yml new file mode 100644 index 000000000000..acad856d3926 --- /dev/null +++ b/sdk/resourcemanager/domainregistration/armdomainregistration/ci.yml @@ -0,0 +1,27 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. +trigger: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resourcemanager/domainregistration/armdomainregistration/ + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resourcemanager/domainregistration/armdomainregistration/ + +extends: + template: /eng/pipelines/templates/jobs/archetype-sdk-client.yml + parameters: + ServiceDirectory: 'resourcemanager/domainregistration/armdomainregistration' diff --git a/sdk/resourcemanager/domainregistration/armdomainregistration/client_factory.go b/sdk/resourcemanager/domainregistration/armdomainregistration/client_factory.go new file mode 100644 index 000000000000..0f8047c573d4 --- /dev/null +++ b/sdk/resourcemanager/domainregistration/armdomainregistration/client_factory.go @@ -0,0 +1,56 @@ +// 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) Go Code Generator. DO NOT EDIT. + +package armdomainregistration + +import ( + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" +) + +// ClientFactory is a client factory used to create any client in this module. +// Don't use this type directly, use NewClientFactory instead. +type ClientFactory struct { + subscriptionID string + 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 - The ID of the target subscription. The value must be an UUID. +// - 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) { + internal, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + return &ClientFactory{ + subscriptionID: subscriptionID, + internal: internal, + }, nil +} + +// NewDomainsClient creates a new instance of DomainsClient. +func (c *ClientFactory) NewDomainsClient() *DomainsClient { + return &DomainsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewProviderClient creates a new instance of ProviderClient. +func (c *ClientFactory) NewProviderClient() *ProviderClient { + return &ProviderClient{ + internal: c.internal, + } +} + +// NewTopLevelDomainsClient creates a new instance of TopLevelDomainsClient. +func (c *ClientFactory) NewTopLevelDomainsClient() *TopLevelDomainsClient { + return &TopLevelDomainsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} diff --git a/sdk/resourcemanager/domainregistration/armdomainregistration/constants.go b/sdk/resourcemanager/domainregistration/armdomainregistration/constants.go new file mode 100644 index 000000000000..87771a29b0f3 --- /dev/null +++ b/sdk/resourcemanager/domainregistration/armdomainregistration/constants.go @@ -0,0 +1,207 @@ +// 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) Go Code Generator. DO NOT EDIT. + +package armdomainregistration + +// AzureResourceType - Type of the Azure resource the hostname is assigned to. +type AzureResourceType string + +const ( + AzureResourceTypeTrafficManager AzureResourceType = "TrafficManager" + AzureResourceTypeWebsite AzureResourceType = "Website" +) + +// PossibleAzureResourceTypeValues returns the possible values for the AzureResourceType const type. +func PossibleAzureResourceTypeValues() []AzureResourceType { + return []AzureResourceType{ + AzureResourceTypeTrafficManager, + AzureResourceTypeWebsite, + } +} + +// CreatedByType - The kind of entity that created the resource. +type CreatedByType string + +const ( + // CreatedByTypeApplication - The entity was created by an application. + CreatedByTypeApplication CreatedByType = "Application" + // CreatedByTypeKey - The entity was created by a key. + CreatedByTypeKey CreatedByType = "Key" + // CreatedByTypeManagedIdentity - The entity was created by a managed identity. + CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity" + // CreatedByTypeUser - The entity was created by a user. + CreatedByTypeUser CreatedByType = "User" +) + +// PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type. +func PossibleCreatedByTypeValues() []CreatedByType { + return []CreatedByType{ + CreatedByTypeApplication, + CreatedByTypeKey, + CreatedByTypeManagedIdentity, + CreatedByTypeUser, + } +} + +// CustomHostNameDNSRecordType - Type of the DNS record. +type CustomHostNameDNSRecordType string + +const ( + CustomHostNameDNSRecordTypeA CustomHostNameDNSRecordType = "A" + CustomHostNameDNSRecordTypeCName CustomHostNameDNSRecordType = "CName" +) + +// PossibleCustomHostNameDNSRecordTypeValues returns the possible values for the CustomHostNameDNSRecordType const type. +func PossibleCustomHostNameDNSRecordTypeValues() []CustomHostNameDNSRecordType { + return []CustomHostNameDNSRecordType{ + CustomHostNameDNSRecordTypeA, + CustomHostNameDNSRecordTypeCName, + } +} + +// DNSType - Current DNS type +type DNSType string + +const ( + DNSTypeAzureDNS DNSType = "AzureDns" + DNSTypeDefaultDomainRegistrarDNS DNSType = "DefaultDomainRegistrarDns" +) + +// PossibleDNSTypeValues returns the possible values for the DNSType const type. +func PossibleDNSTypeValues() []DNSType { + return []DNSType{ + DNSTypeAzureDNS, + DNSTypeDefaultDomainRegistrarDNS, + } +} + +// DomainStatus - Domain registration status. +type DomainStatus string + +const ( + DomainStatusActive DomainStatus = "Active" + DomainStatusAwaiting DomainStatus = "Awaiting" + DomainStatusCancelled DomainStatus = "Cancelled" + DomainStatusConfiscated DomainStatus = "Confiscated" + DomainStatusDisabled DomainStatus = "Disabled" + DomainStatusExcluded DomainStatus = "Excluded" + DomainStatusExpired DomainStatus = "Expired" + DomainStatusFailed DomainStatus = "Failed" + DomainStatusHeld DomainStatus = "Held" + DomainStatusJSONConverterFailed DomainStatus = "JsonConverterFailed" + DomainStatusLocked DomainStatus = "Locked" + DomainStatusParked DomainStatus = "Parked" + DomainStatusPending DomainStatus = "Pending" + DomainStatusReserved DomainStatus = "Reserved" + DomainStatusReverted DomainStatus = "Reverted" + DomainStatusSuspended DomainStatus = "Suspended" + DomainStatusTransferred DomainStatus = "Transferred" + DomainStatusUnknown DomainStatus = "Unknown" + DomainStatusUnlocked DomainStatus = "Unlocked" + DomainStatusUnparked DomainStatus = "Unparked" + DomainStatusUpdated DomainStatus = "Updated" +) + +// PossibleDomainStatusValues returns the possible values for the DomainStatus const type. +func PossibleDomainStatusValues() []DomainStatus { + return []DomainStatus{ + DomainStatusActive, + DomainStatusAwaiting, + DomainStatusCancelled, + DomainStatusConfiscated, + DomainStatusDisabled, + DomainStatusExcluded, + DomainStatusExpired, + DomainStatusFailed, + DomainStatusHeld, + DomainStatusJSONConverterFailed, + DomainStatusLocked, + DomainStatusParked, + DomainStatusPending, + DomainStatusReserved, + DomainStatusReverted, + DomainStatusSuspended, + DomainStatusTransferred, + DomainStatusUnknown, + DomainStatusUnlocked, + DomainStatusUnparked, + DomainStatusUpdated, + } +} + +// DomainType - Valid values are Regular domain: Azure will charge the full price of domain registration, SoftDeleted: Purchasing +// this domain will simply restore it and this operation will not cost anything. +type DomainType string + +const ( + DomainTypeRegular DomainType = "Regular" + DomainTypeSoftDeleted DomainType = "SoftDeleted" +) + +// PossibleDomainTypeValues returns the possible values for the DomainType const type. +func PossibleDomainTypeValues() []DomainType { + return []DomainType{ + DomainTypeRegular, + DomainTypeSoftDeleted, + } +} + +// HostNameType - Type of the hostname. +type HostNameType string + +const ( + HostNameTypeManaged HostNameType = "Managed" + HostNameTypeVerified HostNameType = "Verified" +) + +// PossibleHostNameTypeValues returns the possible values for the HostNameType const type. +func PossibleHostNameTypeValues() []HostNameType { + return []HostNameType{ + HostNameTypeManaged, + HostNameTypeVerified, + } +} + +// ProvisioningState - Domain provisioning state. +type ProvisioningState string + +const ( + ProvisioningStateCanceled ProvisioningState = "Canceled" + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateInProgress ProvisioningState = "InProgress" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" +) + +// PossibleProvisioningStateValues returns the possible values for the ProvisioningState const type. +func PossibleProvisioningStateValues() []ProvisioningState { + return []ProvisioningState{ + ProvisioningStateCanceled, + ProvisioningStateDeleting, + ProvisioningStateFailed, + ProvisioningStateInProgress, + ProvisioningStateSucceeded, + } +} + +// ResourceNotRenewableReason - Reasons why domain is not renewable. +type ResourceNotRenewableReason string + +const ( + // ResourceNotRenewableReasonExpirationNotInRenewalTimeRange - Domain expiration is not in the renewal time range. + ResourceNotRenewableReasonExpirationNotInRenewalTimeRange ResourceNotRenewableReason = "ExpirationNotInRenewalTimeRange" + // ResourceNotRenewableReasonRegistrationStatusNotSupportedForRenewal - Registration status is not supported for renewal. + ResourceNotRenewableReasonRegistrationStatusNotSupportedForRenewal ResourceNotRenewableReason = "RegistrationStatusNotSupportedForRenewal" + // ResourceNotRenewableReasonSubscriptionNotActive - Subscription is not active. + ResourceNotRenewableReasonSubscriptionNotActive ResourceNotRenewableReason = "SubscriptionNotActive" +) + +// PossibleResourceNotRenewableReasonValues returns the possible values for the ResourceNotRenewableReason const type. +func PossibleResourceNotRenewableReasonValues() []ResourceNotRenewableReason { + return []ResourceNotRenewableReason{ + ResourceNotRenewableReasonExpirationNotInRenewalTimeRange, + ResourceNotRenewableReasonRegistrationStatusNotSupportedForRenewal, + ResourceNotRenewableReasonSubscriptionNotActive, + } +} diff --git a/sdk/resourcemanager/domainregistration/armdomainregistration/domains_client.go b/sdk/resourcemanager/domainregistration/armdomainregistration/domains_client.go new file mode 100644 index 000000000000..7bfba04cac2a --- /dev/null +++ b/sdk/resourcemanager/domainregistration/armdomainregistration/domains_client.go @@ -0,0 +1,1120 @@ +// 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) Go Code Generator. DO NOT EDIT. + +package armdomainregistration + +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" + "strconv" + "strings" +) + +// DomainsClient contains the methods for the Domains group. +// Don't use this type directly, use NewDomainsClient() instead. +type DomainsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewDomainsClient creates a new instance of DomainsClient with the specified values. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - Contains optional client configuration. Pass nil to accept the default values. +func NewDomainsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DomainsClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &DomainsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// CheckAvailability - Check if a domain is available for registration. +// +// Description for Check if a domain is available for registration. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-11-01 +// - identifier - The request body +// - options - DomainsClientCheckAvailabilityOptions contains the optional parameters for the DomainsClient.CheckAvailability +// method. +func (client *DomainsClient) CheckAvailability(ctx context.Context, identifier NameIdentifier, options *DomainsClientCheckAvailabilityOptions) (DomainsClientCheckAvailabilityResponse, error) { + var err error + const operationName = "DomainsClient.CheckAvailability" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.checkAvailabilityCreateRequest(ctx, identifier, options) + if err != nil { + return DomainsClientCheckAvailabilityResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return DomainsClientCheckAvailabilityResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DomainsClientCheckAvailabilityResponse{}, err + } + resp, err := client.checkAvailabilityHandleResponse(httpResp) + return resp, err +} + +// checkAvailabilityCreateRequest creates the CheckAvailability request. +func (client *DomainsClient) checkAvailabilityCreateRequest(ctx context.Context, identifier NameIdentifier, _ *DomainsClientCheckAvailabilityOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/checkDomainAvailability" + 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.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-11-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, identifier); err != nil { + return nil, err + } + return req, nil +} + +// checkAvailabilityHandleResponse handles the CheckAvailability response. +func (client *DomainsClient) checkAvailabilityHandleResponse(resp *http.Response) (DomainsClientCheckAvailabilityResponse, error) { + result := DomainsClientCheckAvailabilityResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DomainAvailabilityCheckResult); err != nil { + return DomainsClientCheckAvailabilityResponse{}, err + } + return result, nil +} + +// BeginCreateOrUpdate - Creates or updates a domain. +// +// Description for Creates or updates a domain. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-11-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - domainName - Name of the domain. +// - domain - Domain registration information. +// - options - DomainsClientBeginCreateOrUpdateOptions contains the optional parameters for the DomainsClient.BeginCreateOrUpdate +// method. +func (client *DomainsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, domainName string, domain Domain, options *DomainsClientBeginCreateOrUpdateOptions) (*runtime.Poller[DomainsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, domainName, domain, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DomainsClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DomainsClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// CreateOrUpdate - Creates or updates a domain. +// +// Description for Creates or updates a domain. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-11-01 +func (client *DomainsClient) createOrUpdate(ctx context.Context, resourceGroupName string, domainName string, domain Domain, options *DomainsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + const operationName = "DomainsClient.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, domainName, domain, 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) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *DomainsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, domainName string, domain Domain, _ *DomainsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if domainName == "" { + return nil, errors.New("parameter domainName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{domainName}", url.PathEscape(domainName)) + 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", "2024-11-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, domain); err != nil { + return nil, err + } + return req, nil +} + +// CreateOrUpdateOwnershipIdentifier - Creates an ownership identifier for a domain or updates identifier details for an existing +// identifier +// +// Description for Creates an ownership identifier for a domain or updates identifier details for an existing identifier +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-11-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - domainName - Name of the domain. +// - name - Name of identifier. +// - domainOwnershipIdentifier - A JSON representation of the domain ownership properties. +// - options - DomainsClientCreateOrUpdateOwnershipIdentifierOptions contains the optional parameters for the DomainsClient.CreateOrUpdateOwnershipIdentifier +// method. +func (client *DomainsClient) CreateOrUpdateOwnershipIdentifier(ctx context.Context, resourceGroupName string, domainName string, name string, domainOwnershipIdentifier DomainOwnershipIdentifier, options *DomainsClientCreateOrUpdateOwnershipIdentifierOptions) (DomainsClientCreateOrUpdateOwnershipIdentifierResponse, error) { + var err error + const operationName = "DomainsClient.CreateOrUpdateOwnershipIdentifier" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrUpdateOwnershipIdentifierCreateRequest(ctx, resourceGroupName, domainName, name, domainOwnershipIdentifier, options) + if err != nil { + return DomainsClientCreateOrUpdateOwnershipIdentifierResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return DomainsClientCreateOrUpdateOwnershipIdentifierResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DomainsClientCreateOrUpdateOwnershipIdentifierResponse{}, err + } + resp, err := client.createOrUpdateOwnershipIdentifierHandleResponse(httpResp) + return resp, err +} + +// createOrUpdateOwnershipIdentifierCreateRequest creates the CreateOrUpdateOwnershipIdentifier request. +func (client *DomainsClient) createOrUpdateOwnershipIdentifierCreateRequest(ctx context.Context, resourceGroupName string, domainName string, name string, domainOwnershipIdentifier DomainOwnershipIdentifier, _ *DomainsClientCreateOrUpdateOwnershipIdentifierOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers/{name}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if domainName == "" { + return nil, errors.New("parameter domainName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{domainName}", url.PathEscape(domainName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + 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", "2024-11-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, domainOwnershipIdentifier); err != nil { + return nil, err + } + return req, nil +} + +// createOrUpdateOwnershipIdentifierHandleResponse handles the CreateOrUpdateOwnershipIdentifier response. +func (client *DomainsClient) createOrUpdateOwnershipIdentifierHandleResponse(resp *http.Response) (DomainsClientCreateOrUpdateOwnershipIdentifierResponse, error) { + result := DomainsClientCreateOrUpdateOwnershipIdentifierResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DomainOwnershipIdentifier); err != nil { + return DomainsClientCreateOrUpdateOwnershipIdentifierResponse{}, err + } + return result, nil +} + +// Delete - Delete a domain. +// +// Description for Delete a domain. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-11-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - domainName - Name of the domain. +// - options - DomainsClientDeleteOptions contains the optional parameters for the DomainsClient.Delete method. +func (client *DomainsClient) Delete(ctx context.Context, resourceGroupName string, domainName string, options *DomainsClientDeleteOptions) (DomainsClientDeleteResponse, error) { + var err error + const operationName = "DomainsClient.Delete" + 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, domainName, options) + if err != nil { + return DomainsClientDeleteResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return DomainsClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return DomainsClientDeleteResponse{}, err + } + return DomainsClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *DomainsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, domainName string, options *DomainsClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if domainName == "" { + return nil, errors.New("parameter domainName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{domainName}", url.PathEscape(domainName)) + 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", "2024-11-01") + if options != nil && options.ForceHardDeleteDomain != nil { + reqQP.Set("forceHardDeleteDomain", strconv.FormatBool(*options.ForceHardDeleteDomain)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + return req, nil +} + +// DeleteOwnershipIdentifier - Delete ownership identifier for domain +// +// Description for Delete ownership identifier for domain +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-11-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - domainName - Name of the domain. +// - name - Name of identifier. +// - options - DomainsClientDeleteOwnershipIdentifierOptions contains the optional parameters for the DomainsClient.DeleteOwnershipIdentifier +// method. +func (client *DomainsClient) DeleteOwnershipIdentifier(ctx context.Context, resourceGroupName string, domainName string, name string, options *DomainsClientDeleteOwnershipIdentifierOptions) (DomainsClientDeleteOwnershipIdentifierResponse, error) { + var err error + const operationName = "DomainsClient.DeleteOwnershipIdentifier" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deleteOwnershipIdentifierCreateRequest(ctx, resourceGroupName, domainName, name, options) + if err != nil { + return DomainsClientDeleteOwnershipIdentifierResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return DomainsClientDeleteOwnershipIdentifierResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return DomainsClientDeleteOwnershipIdentifierResponse{}, err + } + return DomainsClientDeleteOwnershipIdentifierResponse{}, nil +} + +// deleteOwnershipIdentifierCreateRequest creates the DeleteOwnershipIdentifier request. +func (client *DomainsClient) deleteOwnershipIdentifierCreateRequest(ctx context.Context, resourceGroupName string, domainName string, name string, _ *DomainsClientDeleteOwnershipIdentifierOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers/{name}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if domainName == "" { + return nil, errors.New("parameter domainName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{domainName}", url.PathEscape(domainName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + 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", "2024-11-01") + req.Raw().URL.RawQuery = reqQP.Encode() + return req, nil +} + +// Get - Get a domain. +// +// Description for Get a domain. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-11-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - domainName - Name of the domain. +// - options - DomainsClientGetOptions contains the optional parameters for the DomainsClient.Get method. +func (client *DomainsClient) Get(ctx context.Context, resourceGroupName string, domainName string, options *DomainsClientGetOptions) (DomainsClientGetResponse, error) { + var err error + const operationName = "DomainsClient.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, domainName, options) + if err != nil { + return DomainsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return DomainsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DomainsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *DomainsClient) getCreateRequest(ctx context.Context, resourceGroupName string, domainName string, _ *DomainsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if domainName == "" { + return nil, errors.New("parameter domainName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{domainName}", url.PathEscape(domainName)) + 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", "2024-11-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *DomainsClient) getHandleResponse(resp *http.Response) (DomainsClientGetResponse, error) { + result := DomainsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Domain); err != nil { + return DomainsClientGetResponse{}, err + } + return result, nil +} + +// GetControlCenterSsoRequest - Generate a single sign-on request for the domain management portal. +// +// Description for Generate a single sign-on request for the domain management portal. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-11-01 +// - options - DomainsClientGetControlCenterSsoRequestOptions contains the optional parameters for the DomainsClient.GetControlCenterSsoRequest +// method. +func (client *DomainsClient) GetControlCenterSsoRequest(ctx context.Context, options *DomainsClientGetControlCenterSsoRequestOptions) (DomainsClientGetControlCenterSsoRequestResponse, error) { + var err error + const operationName = "DomainsClient.GetControlCenterSsoRequest" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getControlCenterSsoRequestCreateRequest(ctx, options) + if err != nil { + return DomainsClientGetControlCenterSsoRequestResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return DomainsClientGetControlCenterSsoRequestResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DomainsClientGetControlCenterSsoRequestResponse{}, err + } + resp, err := client.getControlCenterSsoRequestHandleResponse(httpResp) + return resp, err +} + +// getControlCenterSsoRequestCreateRequest creates the GetControlCenterSsoRequest request. +func (client *DomainsClient) getControlCenterSsoRequestCreateRequest(ctx context.Context, _ *DomainsClientGetControlCenterSsoRequestOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/generateSsoRequest" + 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.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-11-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getControlCenterSsoRequestHandleResponse handles the GetControlCenterSsoRequest response. +func (client *DomainsClient) getControlCenterSsoRequestHandleResponse(resp *http.Response) (DomainsClientGetControlCenterSsoRequestResponse, error) { + result := DomainsClientGetControlCenterSsoRequestResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DomainControlCenterSsoRequest); err != nil { + return DomainsClientGetControlCenterSsoRequestResponse{}, err + } + return result, nil +} + +// GetOwnershipIdentifier - Get ownership identifier for domain +// +// Description for Get ownership identifier for domain +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-11-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - domainName - Name of the domain. +// - name - Name of identifier. +// - options - DomainsClientGetOwnershipIdentifierOptions contains the optional parameters for the DomainsClient.GetOwnershipIdentifier +// method. +func (client *DomainsClient) GetOwnershipIdentifier(ctx context.Context, resourceGroupName string, domainName string, name string, options *DomainsClientGetOwnershipIdentifierOptions) (DomainsClientGetOwnershipIdentifierResponse, error) { + var err error + const operationName = "DomainsClient.GetOwnershipIdentifier" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getOwnershipIdentifierCreateRequest(ctx, resourceGroupName, domainName, name, options) + if err != nil { + return DomainsClientGetOwnershipIdentifierResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return DomainsClientGetOwnershipIdentifierResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DomainsClientGetOwnershipIdentifierResponse{}, err + } + resp, err := client.getOwnershipIdentifierHandleResponse(httpResp) + return resp, err +} + +// getOwnershipIdentifierCreateRequest creates the GetOwnershipIdentifier request. +func (client *DomainsClient) getOwnershipIdentifierCreateRequest(ctx context.Context, resourceGroupName string, domainName string, name string, _ *DomainsClientGetOwnershipIdentifierOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers/{name}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if domainName == "" { + return nil, errors.New("parameter domainName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{domainName}", url.PathEscape(domainName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + 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", "2024-11-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getOwnershipIdentifierHandleResponse handles the GetOwnershipIdentifier response. +func (client *DomainsClient) getOwnershipIdentifierHandleResponse(resp *http.Response) (DomainsClientGetOwnershipIdentifierResponse, error) { + result := DomainsClientGetOwnershipIdentifierResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DomainOwnershipIdentifier); err != nil { + return DomainsClientGetOwnershipIdentifierResponse{}, err + } + return result, nil +} + +// NewListPager - Get all domains in a subscription. +// +// Description for Get all domains in a subscription. +// +// Generated from API version 2024-11-01 +// - options - DomainsClientListOptions contains the optional parameters for the DomainsClient.NewListPager method. +func (client *DomainsClient) NewListPager(options *DomainsClientListOptions) *runtime.Pager[DomainsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[DomainsClientListResponse]{ + More: func(page DomainsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *DomainsClientListResponse) (DomainsClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DomainsClient.NewListPager") + 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.listCreateRequest(ctx, options) + }, nil) + if err != nil { + return DomainsClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *DomainsClient) listCreateRequest(ctx context.Context, _ *DomainsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/domains" + 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", "2024-11-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *DomainsClient) listHandleResponse(resp *http.Response) (DomainsClientListResponse, error) { + result := DomainsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DomainCollection); err != nil { + return DomainsClientListResponse{}, err + } + return result, nil +} + +// NewListByResourceGroupPager - Get all domains in a resource group. +// +// Description for Get all domains in a resource group. +// +// Generated from API version 2024-11-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - options - DomainsClientListByResourceGroupOptions contains the optional parameters for the DomainsClient.NewListByResourceGroupPager +// method. +func (client *DomainsClient) NewListByResourceGroupPager(resourceGroupName string, options *DomainsClientListByResourceGroupOptions) *runtime.Pager[DomainsClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[DomainsClientListByResourceGroupResponse]{ + More: func(page DomainsClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *DomainsClientListByResourceGroupResponse) (DomainsClientListByResourceGroupResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DomainsClient.NewListByResourceGroupPager") + 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.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + }, nil) + if err != nil { + return DomainsClientListByResourceGroupResponse{}, err + } + return client.listByResourceGroupHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *DomainsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, _ *DomainsClientListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + 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", "2024-11-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *DomainsClient) listByResourceGroupHandleResponse(resp *http.Response) (DomainsClientListByResourceGroupResponse, error) { + result := DomainsClientListByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DomainCollection); err != nil { + return DomainsClientListByResourceGroupResponse{}, err + } + return result, nil +} + +// NewListOwnershipIdentifiersPager - Lists domain ownership identifiers. +// +// Description for Lists domain ownership identifiers. +// +// Generated from API version 2024-11-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - domainName - Name of the domain. +// - options - DomainsClientListOwnershipIdentifiersOptions contains the optional parameters for the DomainsClient.NewListOwnershipIdentifiersPager +// method. +func (client *DomainsClient) NewListOwnershipIdentifiersPager(resourceGroupName string, domainName string, options *DomainsClientListOwnershipIdentifiersOptions) *runtime.Pager[DomainsClientListOwnershipIdentifiersResponse] { + return runtime.NewPager(runtime.PagingHandler[DomainsClientListOwnershipIdentifiersResponse]{ + More: func(page DomainsClientListOwnershipIdentifiersResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *DomainsClientListOwnershipIdentifiersResponse) (DomainsClientListOwnershipIdentifiersResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DomainsClient.NewListOwnershipIdentifiersPager") + 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.listOwnershipIdentifiersCreateRequest(ctx, resourceGroupName, domainName, options) + }, nil) + if err != nil { + return DomainsClientListOwnershipIdentifiersResponse{}, err + } + return client.listOwnershipIdentifiersHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listOwnershipIdentifiersCreateRequest creates the ListOwnershipIdentifiers request. +func (client *DomainsClient) listOwnershipIdentifiersCreateRequest(ctx context.Context, resourceGroupName string, domainName string, _ *DomainsClientListOwnershipIdentifiersOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if domainName == "" { + return nil, errors.New("parameter domainName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{domainName}", url.PathEscape(domainName)) + 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", "2024-11-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listOwnershipIdentifiersHandleResponse handles the ListOwnershipIdentifiers response. +func (client *DomainsClient) listOwnershipIdentifiersHandleResponse(resp *http.Response) (DomainsClientListOwnershipIdentifiersResponse, error) { + result := DomainsClientListOwnershipIdentifiersResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DomainOwnershipIdentifierCollection); err != nil { + return DomainsClientListOwnershipIdentifiersResponse{}, err + } + return result, nil +} + +// NewListRecommendationsPager - Get domain name recommendations based on keywords. +// +// Description for Get domain name recommendations based on keywords. +// +// Generated from API version 2024-11-01 +// - parameters - The request body +// - options - DomainsClientListRecommendationsOptions contains the optional parameters for the DomainsClient.NewListRecommendationsPager +// method. +func (client *DomainsClient) NewListRecommendationsPager(parameters DomainRecommendationSearchParameters, options *DomainsClientListRecommendationsOptions) *runtime.Pager[DomainsClientListRecommendationsResponse] { + return runtime.NewPager(runtime.PagingHandler[DomainsClientListRecommendationsResponse]{ + More: func(page DomainsClientListRecommendationsResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *DomainsClientListRecommendationsResponse) (DomainsClientListRecommendationsResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DomainsClient.NewListRecommendationsPager") + 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.listRecommendationsCreateRequest(ctx, parameters, options) + }, nil) + if err != nil { + return DomainsClientListRecommendationsResponse{}, err + } + return client.listRecommendationsHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listRecommendationsCreateRequest creates the ListRecommendations request. +func (client *DomainsClient) listRecommendationsCreateRequest(ctx context.Context, parameters DomainRecommendationSearchParameters, _ *DomainsClientListRecommendationsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/listDomainRecommendations" + 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.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-11-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// listRecommendationsHandleResponse handles the ListRecommendations response. +func (client *DomainsClient) listRecommendationsHandleResponse(resp *http.Response) (DomainsClientListRecommendationsResponse, error) { + result := DomainsClientListRecommendationsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NameIdentifierCollection); err != nil { + return DomainsClientListRecommendationsResponse{}, err + } + return result, nil +} + +// Renew - Renew a domain. +// +// Description for Renew a domain. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-11-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - domainName - Name of the domain. +// - options - DomainsClientRenewOptions contains the optional parameters for the DomainsClient.Renew method. +func (client *DomainsClient) Renew(ctx context.Context, resourceGroupName string, domainName string, options *DomainsClientRenewOptions) (DomainsClientRenewResponse, error) { + var err error + const operationName = "DomainsClient.Renew" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.renewCreateRequest(ctx, resourceGroupName, domainName, options) + if err != nil { + return DomainsClientRenewResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return DomainsClientRenewResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return DomainsClientRenewResponse{}, err + } + resp, err := client.renewHandleResponse(httpResp) + return resp, err +} + +// renewCreateRequest creates the Renew request. +func (client *DomainsClient) renewCreateRequest(ctx context.Context, resourceGroupName string, domainName string, _ *DomainsClientRenewOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/renew" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if domainName == "" { + return nil, errors.New("parameter domainName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{domainName}", url.PathEscape(domainName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-11-01") + req.Raw().URL.RawQuery = reqQP.Encode() + return req, nil +} + +// renewHandleResponse handles the Renew response. +func (client *DomainsClient) renewHandleResponse(resp *http.Response) (DomainsClientRenewResponse, error) { + result := DomainsClientRenewResponse{} + if val := resp.Header.Get("Retry-After"); val != "" { + retryAfter32, err := strconv.ParseInt(val, 10, 32) + retryAfter := int32(retryAfter32) + if err != nil { + return DomainsClientRenewResponse{}, err + } + result.RetryAfter = &retryAfter + } + return result, nil +} + +// TransferOut - Transfer out domain to another registrar +// +// Transfer out domain to another registrar +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-11-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - domainName - Name of the domain. +// - options - DomainsClientTransferOutOptions contains the optional parameters for the DomainsClient.TransferOut method. +func (client *DomainsClient) TransferOut(ctx context.Context, resourceGroupName string, domainName string, options *DomainsClientTransferOutOptions) (DomainsClientTransferOutResponse, error) { + var err error + const operationName = "DomainsClient.TransferOut" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.transferOutCreateRequest(ctx, resourceGroupName, domainName, options) + if err != nil { + return DomainsClientTransferOutResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return DomainsClientTransferOutResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DomainsClientTransferOutResponse{}, err + } + resp, err := client.transferOutHandleResponse(httpResp) + return resp, err +} + +// transferOutCreateRequest creates the TransferOut request. +func (client *DomainsClient) transferOutCreateRequest(ctx context.Context, resourceGroupName string, domainName string, _ *DomainsClientTransferOutOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/transferOut" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if domainName == "" { + return nil, errors.New("parameter domainName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{domainName}", url.PathEscape(domainName)) + 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", "2024-11-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// transferOutHandleResponse handles the TransferOut response. +func (client *DomainsClient) transferOutHandleResponse(resp *http.Response) (DomainsClientTransferOutResponse, error) { + result := DomainsClientTransferOutResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Domain); err != nil { + return DomainsClientTransferOutResponse{}, err + } + return result, nil +} + +// Update - Creates or updates a domain. +// +// Description for Creates or updates a domain. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-11-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - domainName - Name of the domain. +// - domain - Domain registration information. +// - options - DomainsClientUpdateOptions contains the optional parameters for the DomainsClient.Update method. +func (client *DomainsClient) Update(ctx context.Context, resourceGroupName string, domainName string, domain DomainPatchResource, options *DomainsClientUpdateOptions) (DomainsClientUpdateResponse, error) { + var err error + const operationName = "DomainsClient.Update" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.updateCreateRequest(ctx, resourceGroupName, domainName, domain, options) + if err != nil { + return DomainsClientUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return DomainsClientUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return DomainsClientUpdateResponse{}, err + } + resp, err := client.updateHandleResponse(httpResp) + return resp, err +} + +// updateCreateRequest creates the Update request. +func (client *DomainsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, domainName string, domain DomainPatchResource, _ *DomainsClientUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if domainName == "" { + return nil, errors.New("parameter domainName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{domainName}", url.PathEscape(domainName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-11-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, domain); err != nil { + return nil, err + } + return req, nil +} + +// updateHandleResponse handles the Update response. +func (client *DomainsClient) updateHandleResponse(resp *http.Response) (DomainsClientUpdateResponse, error) { + result := DomainsClientUpdateResponse{} + if val := resp.Header.Get("Retry-After"); val != "" { + retryAfter32, err := strconv.ParseInt(val, 10, 32) + retryAfter := int32(retryAfter32) + if err != nil { + return DomainsClientUpdateResponse{}, err + } + result.RetryAfter = &retryAfter + } + if err := runtime.UnmarshalAsJSON(resp, &result.Domain); err != nil { + return DomainsClientUpdateResponse{}, err + } + return result, nil +} + +// UpdateOwnershipIdentifier - Creates an ownership identifier for a domain or updates identifier details for an existing +// identifier +// +// Description for Creates an ownership identifier for a domain or updates identifier details for an existing identifier +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-11-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - domainName - Name of the domain. +// - name - Name of identifier. +// - domainOwnershipIdentifier - A JSON representation of the domain ownership properties. +// - options - DomainsClientUpdateOwnershipIdentifierOptions contains the optional parameters for the DomainsClient.UpdateOwnershipIdentifier +// method. +func (client *DomainsClient) UpdateOwnershipIdentifier(ctx context.Context, resourceGroupName string, domainName string, name string, domainOwnershipIdentifier DomainOwnershipIdentifier, options *DomainsClientUpdateOwnershipIdentifierOptions) (DomainsClientUpdateOwnershipIdentifierResponse, error) { + var err error + const operationName = "DomainsClient.UpdateOwnershipIdentifier" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.updateOwnershipIdentifierCreateRequest(ctx, resourceGroupName, domainName, name, domainOwnershipIdentifier, options) + if err != nil { + return DomainsClientUpdateOwnershipIdentifierResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return DomainsClientUpdateOwnershipIdentifierResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DomainsClientUpdateOwnershipIdentifierResponse{}, err + } + resp, err := client.updateOwnershipIdentifierHandleResponse(httpResp) + return resp, err +} + +// updateOwnershipIdentifierCreateRequest creates the UpdateOwnershipIdentifier request. +func (client *DomainsClient) updateOwnershipIdentifierCreateRequest(ctx context.Context, resourceGroupName string, domainName string, name string, domainOwnershipIdentifier DomainOwnershipIdentifier, _ *DomainsClientUpdateOwnershipIdentifierOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers/{name}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if domainName == "" { + return nil, errors.New("parameter domainName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{domainName}", url.PathEscape(domainName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-11-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, domainOwnershipIdentifier); err != nil { + return nil, err + } + return req, nil +} + +// updateOwnershipIdentifierHandleResponse handles the UpdateOwnershipIdentifier response. +func (client *DomainsClient) updateOwnershipIdentifierHandleResponse(resp *http.Response) (DomainsClientUpdateOwnershipIdentifierResponse, error) { + result := DomainsClientUpdateOwnershipIdentifierResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DomainOwnershipIdentifier); err != nil { + return DomainsClientUpdateOwnershipIdentifierResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/domainregistration/armdomainregistration/domains_client_example_test.go b/sdk/resourcemanager/domainregistration/armdomainregistration/domains_client_example_test.go new file mode 100644 index 000000000000..212156c0a33b --- /dev/null +++ b/sdk/resourcemanager/domainregistration/armdomainregistration/domains_client_example_test.go @@ -0,0 +1,1255 @@ +// 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) Go Code Generator. DO NOT EDIT. + +package armdomainregistration_test + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/domainregistration/armdomainregistration" + "log" + "time" +) + +// Generated from example definition: 2024-11-01/CheckDomainAvailability.json +func ExampleDomainsClient_CheckAvailability() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armdomainregistration.NewClientFactory("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewDomainsClient().CheckAvailability(ctx, armdomainregistration.NameIdentifier{ + Name: to.Ptr("abcd.com"), + }, 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 = armdomainregistration.DomainsClientCheckAvailabilityResponse{ + // DomainAvailabilityCheckResult: &armdomainregistration.DomainAvailabilityCheckResult{ + // Name: to.Ptr("abcd.com"), + // Available: to.Ptr(true), + // DomainType: to.Ptr(armdomainregistration.DomainTypeRegular), + // }, + // } +} + +// Generated from example definition: 2024-11-01/CreateAppServiceDomain.json +func ExampleDomainsClient_BeginCreateOrUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armdomainregistration.NewClientFactory("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewDomainsClient().BeginCreateOrUpdate(ctx, "testrg123", "example.com", armdomainregistration.Domain{ + Location: to.Ptr("global"), + Properties: &armdomainregistration.DomainProperties{ + AuthCode: to.Ptr("exampleAuthCode"), + AutoRenew: to.Ptr(true), + Consent: &armdomainregistration.DomainPurchaseConsent{ + AgreedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-10T19:30:53Z"); return t }()), + AgreedBy: to.Ptr("192.0.2.1"), + AgreementKeys: []*string{ + to.Ptr("agreementKey1"), + }, + }, + ContactAdmin: &armdomainregistration.Contact{ + AddressMailing: &armdomainregistration.Address{ + Address1: to.Ptr("3400 State St"), + City: to.Ptr("Chicago"), + Country: to.Ptr("United States"), + PostalCode: to.Ptr("67098"), + State: to.Ptr("IL"), + }, + Email: to.Ptr("admin@email.com"), + Fax: to.Ptr("1-245-534-2242"), + JobTitle: to.Ptr("Admin"), + NameFirst: to.Ptr("John"), + NameLast: to.Ptr("Doe"), + NameMiddle: to.Ptr(""), + Organization: to.Ptr("Microsoft Inc."), + Phone: to.Ptr("1-245-534-2242"), + }, + ContactBilling: &armdomainregistration.Contact{ + AddressMailing: &armdomainregistration.Address{ + Address1: to.Ptr("3400 State St"), + City: to.Ptr("Chicago"), + Country: to.Ptr("United States"), + PostalCode: to.Ptr("67098"), + State: to.Ptr("IL"), + }, + Email: to.Ptr("billing@email.com"), + Fax: to.Ptr("1-245-534-2242"), + JobTitle: to.Ptr("Billing"), + NameFirst: to.Ptr("John"), + NameLast: to.Ptr("Doe"), + NameMiddle: to.Ptr(""), + Organization: to.Ptr("Microsoft Inc."), + Phone: to.Ptr("1-245-534-2242"), + }, + ContactRegistrant: &armdomainregistration.Contact{ + AddressMailing: &armdomainregistration.Address{ + Address1: to.Ptr("3400 State St"), + City: to.Ptr("Chicago"), + Country: to.Ptr("United States"), + PostalCode: to.Ptr("67098"), + State: to.Ptr("IL"), + }, + Email: to.Ptr("registrant@email.com"), + Fax: to.Ptr("1-245-534-2242"), + JobTitle: to.Ptr("Registrant"), + NameFirst: to.Ptr("John"), + NameLast: to.Ptr("Doe"), + NameMiddle: to.Ptr(""), + Organization: to.Ptr("Microsoft Inc."), + Phone: to.Ptr("1-245-534-2242"), + }, + ContactTech: &armdomainregistration.Contact{ + AddressMailing: &armdomainregistration.Address{ + Address1: to.Ptr("3400 State St"), + City: to.Ptr("Chicago"), + Country: to.Ptr("United States"), + PostalCode: to.Ptr("67098"), + State: to.Ptr("IL"), + }, + Email: to.Ptr("tech@email.com"), + Fax: to.Ptr("1-245-534-2242"), + JobTitle: to.Ptr("Tech"), + NameFirst: to.Ptr("John"), + NameLast: to.Ptr("Doe"), + NameMiddle: to.Ptr(""), + Organization: to.Ptr("Microsoft Inc."), + Phone: to.Ptr("1-245-534-2242"), + }, + DNSType: to.Ptr(armdomainregistration.DNSTypeDefaultDomainRegistrarDNS), + Privacy: to.Ptr(false), + }, + Tags: map[string]*string{}, + }, 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 = armdomainregistration.DomainsClientCreateOrUpdateResponse{ + // Domain: &armdomainregistration.Domain{ + // Name: to.Ptr("example.com"), + // Type: to.Ptr("Microsoft.DomainRegistration/domains"), + // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.DomainRegistration/domains/example.com"), + // Location: to.Ptr("global"), + // Properties: &armdomainregistration.DomainProperties{ + // AuthCode: to.Ptr("exampleAuthCode"), + // AutoRenew: to.Ptr(true), + // Consent: &armdomainregistration.DomainPurchaseConsent{ + // AgreedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-10T19:30:53Z"); return t}()), + // AgreedBy: to.Ptr("192.0.2.1"), + // AgreementKeys: []*string{ + // to.Ptr("agreementKey1"), + // }, + // }, + // ContactAdmin: &armdomainregistration.Contact{ + // AddressMailing: &armdomainregistration.Address{ + // Address1: to.Ptr("3400 State St"), + // City: to.Ptr("Chicago"), + // Country: to.Ptr("United States"), + // PostalCode: to.Ptr("67098"), + // State: to.Ptr("IL"), + // }, + // Email: to.Ptr("admin@email.com"), + // Fax: to.Ptr("1-245-534-2242"), + // JobTitle: to.Ptr("Admin"), + // NameFirst: to.Ptr("John"), + // NameLast: to.Ptr("Doe"), + // NameMiddle: to.Ptr(""), + // Organization: to.Ptr("Microsoft Inc."), + // Phone: to.Ptr("1-245-534-2242"), + // }, + // ContactBilling: &armdomainregistration.Contact{ + // AddressMailing: &armdomainregistration.Address{ + // Address1: to.Ptr("3400 State St"), + // City: to.Ptr("Chicago"), + // Country: to.Ptr("United States"), + // PostalCode: to.Ptr("67098"), + // State: to.Ptr("IL"), + // }, + // Email: to.Ptr("billing@email.com"), + // Fax: to.Ptr("1-245-534-2242"), + // JobTitle: to.Ptr("Billing"), + // NameFirst: to.Ptr("John"), + // NameLast: to.Ptr("Doe"), + // NameMiddle: to.Ptr(""), + // Organization: to.Ptr("Microsoft Inc."), + // Phone: to.Ptr("1-245-534-2242"), + // }, + // ContactRegistrant: &armdomainregistration.Contact{ + // AddressMailing: &armdomainregistration.Address{ + // Address1: to.Ptr("3400 State St"), + // City: to.Ptr("Chicago"), + // Country: to.Ptr("United States"), + // PostalCode: to.Ptr("67098"), + // State: to.Ptr("IL"), + // }, + // Email: to.Ptr("registrant@email.com"), + // Fax: to.Ptr("1-245-534-2242"), + // JobTitle: to.Ptr("Registrant"), + // NameFirst: to.Ptr("John"), + // NameLast: to.Ptr("Doe"), + // NameMiddle: to.Ptr(""), + // Organization: to.Ptr("Microsoft Inc."), + // Phone: to.Ptr("1-245-534-2242"), + // }, + // ContactTech: &armdomainregistration.Contact{ + // AddressMailing: &armdomainregistration.Address{ + // Address1: to.Ptr("3400 State St"), + // City: to.Ptr("Chicago"), + // Country: to.Ptr("United States"), + // PostalCode: to.Ptr("67098"), + // State: to.Ptr("IL"), + // }, + // Email: to.Ptr("tech@email.com"), + // Fax: to.Ptr("1-245-534-2242"), + // JobTitle: to.Ptr("Tech"), + // NameFirst: to.Ptr("John"), + // NameLast: to.Ptr("Doe"), + // NameMiddle: to.Ptr(""), + // Organization: to.Ptr("Microsoft Inc."), + // Phone: to.Ptr("1-245-534-2242"), + // }, + // CreatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-10T19:30:53Z"); return t}()), + // DNSType: to.Ptr(armdomainregistration.DNSTypeDefaultDomainRegistrarDNS), + // DomainNotRenewableReasons: []*armdomainregistration.ResourceNotRenewableReason{ + // to.Ptr(armdomainregistration.ResourceNotRenewableReasonExpirationNotInRenewalTimeRange), + // }, + // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-10T19:30:53Z"); return t}()), + // ManagedHostNames: []*armdomainregistration.HostName{ + // }, + // NameServers: []*string{ + // to.Ptr("ns01.ote.domaincontrol.com"), + // to.Ptr("ns02.ote.domaincontrol.com"), + // }, + // Privacy: to.Ptr(false), + // ProvisioningState: to.Ptr(armdomainregistration.ProvisioningStateSucceeded), + // ReadyForDNSRecordManagement: to.Ptr(true), + // RegistrationStatus: to.Ptr(armdomainregistration.DomainStatusActive), + // }, + // Tags: map[string]*string{ + // }, + // }, + // } +} + +// Generated from example definition: 2024-11-01/CreateAppServiceDomainOwnershipIdentifier.json +func ExampleDomainsClient_CreateOrUpdateOwnershipIdentifier() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armdomainregistration.NewClientFactory("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewDomainsClient().CreateOrUpdateOwnershipIdentifier(ctx, "testrg123", "example.com", "SampleOwnershipId", armdomainregistration.DomainOwnershipIdentifier{ + Properties: &armdomainregistration.DomainOwnershipIdentifierProperties{ + OwnershipID: to.Ptr("SampleOwnershipId"), + }, + }, 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 = armdomainregistration.DomainsClientCreateOrUpdateOwnershipIdentifierResponse{ + // DomainOwnershipIdentifier: &armdomainregistration.DomainOwnershipIdentifier{ + // Name: to.Ptr("SampleOwnershipId"), + // Type: to.Ptr("Microsoft.DomainRegistration/domains/domainownershipidentifiers"), + // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.DomainRegistration/domains/example.com/domainownershipidentifiers/SampleOwnershipId"), + // Properties: &armdomainregistration.DomainOwnershipIdentifierProperties{ + // OwnershipID: to.Ptr("SampleOwnershipId"), + // }, + // }, + // } +} + +// Generated from example definition: 2024-11-01/DeleteAppServiceDomain.json +func ExampleDomainsClient_Delete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armdomainregistration.NewClientFactory("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewDomainsClient().Delete(ctx, "testrg123", "example.com", &armdomainregistration.DomainsClientDeleteOptions{ + ForceHardDeleteDomain: to.Ptr(true)}) + 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 = armdomainregistration.DomainsClientDeleteResponse{ + // } +} + +// Generated from example definition: 2024-11-01/DeleteAppServiceDomainOwnershipIdentifier.json +func ExampleDomainsClient_DeleteOwnershipIdentifier() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armdomainregistration.NewClientFactory("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewDomainsClient().DeleteOwnershipIdentifier(ctx, "testrg123", "example.com", "ownershipIdentifier", 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 = armdomainregistration.DomainsClientDeleteOwnershipIdentifierResponse{ + // } +} + +// Generated from example definition: 2024-11-01/GetDomain.json +func ExampleDomainsClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armdomainregistration.NewClientFactory("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewDomainsClient().Get(ctx, "testrg123", "example.com", 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 = armdomainregistration.DomainsClientGetResponse{ + // Domain: &armdomainregistration.Domain{ + // Name: to.Ptr("example.com"), + // Type: to.Ptr("Microsoft.DomainRegistration/domains"), + // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.DomainRegistration/domains/example.com"), + // Location: to.Ptr("global"), + // Properties: &armdomainregistration.DomainProperties{ + // AuthCode: to.Ptr("exampleAuthCode"), + // AutoRenew: to.Ptr(true), + // Consent: &armdomainregistration.DomainPurchaseConsent{ + // AgreedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-10T19:30:53Z"); return t}()), + // AgreedBy: to.Ptr("192.0.2.1"), + // AgreementKeys: []*string{ + // to.Ptr("agreementKey1"), + // }, + // }, + // ContactAdmin: &armdomainregistration.Contact{ + // AddressMailing: &armdomainregistration.Address{ + // Address1: to.Ptr("3400 State St"), + // City: to.Ptr("Chicago"), + // Country: to.Ptr("United States"), + // PostalCode: to.Ptr("67098"), + // State: to.Ptr("IL"), + // }, + // Email: to.Ptr("admin@email.com"), + // Fax: to.Ptr("1-245-534-2242"), + // JobTitle: to.Ptr("Admin"), + // NameFirst: to.Ptr("John"), + // NameLast: to.Ptr("Doe"), + // NameMiddle: to.Ptr(""), + // Organization: to.Ptr("Microsoft Inc."), + // Phone: to.Ptr("1-245-534-2242"), + // }, + // ContactBilling: &armdomainregistration.Contact{ + // AddressMailing: &armdomainregistration.Address{ + // Address1: to.Ptr("3400 State St"), + // City: to.Ptr("Chicago"), + // Country: to.Ptr("United States"), + // PostalCode: to.Ptr("67098"), + // State: to.Ptr("IL"), + // }, + // Email: to.Ptr("billing@email.com"), + // Fax: to.Ptr("1-245-534-2242"), + // JobTitle: to.Ptr("Billing"), + // NameFirst: to.Ptr("John"), + // NameLast: to.Ptr("Doe"), + // NameMiddle: to.Ptr(""), + // Organization: to.Ptr("Microsoft Inc."), + // Phone: to.Ptr("1-245-534-2242"), + // }, + // ContactRegistrant: &armdomainregistration.Contact{ + // AddressMailing: &armdomainregistration.Address{ + // Address1: to.Ptr("3400 State St"), + // City: to.Ptr("Chicago"), + // Country: to.Ptr("United States"), + // PostalCode: to.Ptr("67098"), + // State: to.Ptr("IL"), + // }, + // Email: to.Ptr("registrant@email.com"), + // Fax: to.Ptr("1-245-534-2242"), + // JobTitle: to.Ptr("Registrant"), + // NameFirst: to.Ptr("John"), + // NameLast: to.Ptr("Doe"), + // NameMiddle: to.Ptr(""), + // Organization: to.Ptr("Microsoft Inc."), + // Phone: to.Ptr("1-245-534-2242"), + // }, + // ContactTech: &armdomainregistration.Contact{ + // AddressMailing: &armdomainregistration.Address{ + // Address1: to.Ptr("3400 State St"), + // City: to.Ptr("Chicago"), + // Country: to.Ptr("United States"), + // PostalCode: to.Ptr("67098"), + // State: to.Ptr("IL"), + // }, + // Email: to.Ptr("tech@email.com"), + // Fax: to.Ptr("1-245-534-2242"), + // JobTitle: to.Ptr("Tech"), + // NameFirst: to.Ptr("John"), + // NameLast: to.Ptr("Doe"), + // NameMiddle: to.Ptr(""), + // Organization: to.Ptr("Microsoft Inc."), + // Phone: to.Ptr("1-245-534-2242"), + // }, + // CreatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-10T19:30:53Z"); return t}()), + // DNSType: to.Ptr(armdomainregistration.DNSTypeDefaultDomainRegistrarDNS), + // DomainNotRenewableReasons: []*armdomainregistration.ResourceNotRenewableReason{ + // to.Ptr(armdomainregistration.ResourceNotRenewableReasonExpirationNotInRenewalTimeRange), + // }, + // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-10T19:30:53Z"); return t}()), + // ManagedHostNames: []*armdomainregistration.HostName{ + // }, + // NameServers: []*string{ + // to.Ptr("ns01.ote.domaincontrol.com"), + // to.Ptr("ns02.ote.domaincontrol.com"), + // }, + // Privacy: to.Ptr(false), + // ProvisioningState: to.Ptr(armdomainregistration.ProvisioningStateSucceeded), + // ReadyForDNSRecordManagement: to.Ptr(true), + // RegistrationStatus: to.Ptr(armdomainregistration.DomainStatusActive), + // }, + // Tags: map[string]*string{ + // }, + // }, + // } +} + +// Generated from example definition: 2024-11-01/GetDomainControlCenterSsoRequest.json +func ExampleDomainsClient_GetControlCenterSsoRequest() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armdomainregistration.NewClientFactory("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewDomainsClient().GetControlCenterSsoRequest(ctx, 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 = armdomainregistration.DomainsClientGetControlCenterSsoRequestResponse{ + // DomainControlCenterSsoRequest: &armdomainregistration.DomainControlCenterSsoRequest{ + // PostParameterKey: to.Ptr("saml"), + // PostParameterValue: to.Ptr("1242sds|k1340"), + // URL: to.Ptr("https://Reseller.provider.com/?xRequestId=sdsdsds&app=dcc"), + // }, + // } +} + +// Generated from example definition: 2024-11-01/GetDomainOwnershipIdentifier.json +func ExampleDomainsClient_GetOwnershipIdentifier() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armdomainregistration.NewClientFactory("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewDomainsClient().GetOwnershipIdentifier(ctx, "testrg123", "example.com", "SampleOwnershipId", 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 = armdomainregistration.DomainsClientGetOwnershipIdentifierResponse{ + // DomainOwnershipIdentifier: &armdomainregistration.DomainOwnershipIdentifier{ + // Name: to.Ptr("SampleOwnershipId"), + // Type: to.Ptr("Microsoft.DomainRegistration/domains/domainownershipidentifiers"), + // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.DomainRegistration/domains/example.com/domainownershipidentifiers/SampleOwnershipId"), + // Properties: &armdomainregistration.DomainOwnershipIdentifierProperties{ + // OwnershipID: to.Ptr("SampleOwnershipId"), + // }, + // }, + // } +} + +// Generated from example definition: 2024-11-01/ListDomainsBySubscription.json +func ExampleDomainsClient_NewListPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armdomainregistration.NewClientFactory("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewDomainsClient().NewListPager(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 = armdomainregistration.DomainsClientListResponse{ + // DomainCollection: armdomainregistration.DomainCollection{ + // Value: []*armdomainregistration.Domain{ + // { + // Name: to.Ptr("example.com"), + // Type: to.Ptr("Microsoft.DomainRegistration/domains"), + // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.DomainRegistration/domains/example.com"), + // Location: to.Ptr("global"), + // Properties: &armdomainregistration.DomainProperties{ + // AuthCode: to.Ptr("exampleAuthCode"), + // AutoRenew: to.Ptr(true), + // Consent: &armdomainregistration.DomainPurchaseConsent{ + // AgreedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-10T19:30:53Z"); return t}()), + // AgreedBy: to.Ptr("192.0.2.1"), + // AgreementKeys: []*string{ + // to.Ptr("agreementKey1"), + // }, + // }, + // ContactAdmin: &armdomainregistration.Contact{ + // AddressMailing: &armdomainregistration.Address{ + // Address1: to.Ptr("3400 State St"), + // City: to.Ptr("Chicago"), + // Country: to.Ptr("United States"), + // PostalCode: to.Ptr("67098"), + // State: to.Ptr("IL"), + // }, + // Email: to.Ptr("admin@email.com"), + // Fax: to.Ptr("1-245-534-2242"), + // JobTitle: to.Ptr("Admin"), + // NameFirst: to.Ptr("John"), + // NameLast: to.Ptr("Doe"), + // NameMiddle: to.Ptr(""), + // Organization: to.Ptr("Microsoft Inc."), + // Phone: to.Ptr("1-245-534-2242"), + // }, + // ContactBilling: &armdomainregistration.Contact{ + // AddressMailing: &armdomainregistration.Address{ + // Address1: to.Ptr("3400 State St"), + // City: to.Ptr("Chicago"), + // Country: to.Ptr("United States"), + // PostalCode: to.Ptr("67098"), + // State: to.Ptr("IL"), + // }, + // Email: to.Ptr("billing@email.com"), + // Fax: to.Ptr("1-245-534-2242"), + // JobTitle: to.Ptr("Billing"), + // NameFirst: to.Ptr("John"), + // NameLast: to.Ptr("Doe"), + // NameMiddle: to.Ptr(""), + // Organization: to.Ptr("Microsoft Inc."), + // Phone: to.Ptr("1-245-534-2242"), + // }, + // ContactRegistrant: &armdomainregistration.Contact{ + // AddressMailing: &armdomainregistration.Address{ + // Address1: to.Ptr("3400 State St"), + // City: to.Ptr("Chicago"), + // Country: to.Ptr("United States"), + // PostalCode: to.Ptr("67098"), + // State: to.Ptr("IL"), + // }, + // Email: to.Ptr("registrant@email.com"), + // Fax: to.Ptr("1-245-534-2242"), + // JobTitle: to.Ptr("Registrant"), + // NameFirst: to.Ptr("John"), + // NameLast: to.Ptr("Doe"), + // NameMiddle: to.Ptr(""), + // Organization: to.Ptr("Microsoft Inc."), + // Phone: to.Ptr("1-245-534-2242"), + // }, + // ContactTech: &armdomainregistration.Contact{ + // AddressMailing: &armdomainregistration.Address{ + // Address1: to.Ptr("3400 State St"), + // City: to.Ptr("Chicago"), + // Country: to.Ptr("United States"), + // PostalCode: to.Ptr("67098"), + // State: to.Ptr("IL"), + // }, + // Email: to.Ptr("tech@email.com"), + // Fax: to.Ptr("1-245-534-2242"), + // JobTitle: to.Ptr("Tech"), + // NameFirst: to.Ptr("John"), + // NameLast: to.Ptr("Doe"), + // NameMiddle: to.Ptr(""), + // Organization: to.Ptr("Microsoft Inc."), + // Phone: to.Ptr("1-245-534-2242"), + // }, + // CreatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-10T19:30:53Z"); return t}()), + // DNSType: to.Ptr(armdomainregistration.DNSTypeDefaultDomainRegistrarDNS), + // DomainNotRenewableReasons: []*armdomainregistration.ResourceNotRenewableReason{ + // to.Ptr(armdomainregistration.ResourceNotRenewableReasonExpirationNotInRenewalTimeRange), + // }, + // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-10T19:30:53Z"); return t}()), + // ManagedHostNames: []*armdomainregistration.HostName{ + // }, + // NameServers: []*string{ + // to.Ptr("ns01.ote.domaincontrol.com"), + // to.Ptr("ns02.ote.domaincontrol.com"), + // }, + // Privacy: to.Ptr(false), + // ProvisioningState: to.Ptr(armdomainregistration.ProvisioningStateSucceeded), + // ReadyForDNSRecordManagement: to.Ptr(true), + // RegistrationStatus: to.Ptr(armdomainregistration.DomainStatusActive), + // }, + // Tags: map[string]*string{ + // }, + // }, + // }, + // }, + // } + } +} + +// Generated from example definition: 2024-11-01/ListDomainsByResourceGroup.json +func ExampleDomainsClient_NewListByResourceGroupPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armdomainregistration.NewClientFactory("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewDomainsClient().NewListByResourceGroupPager("testrg123", 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 = armdomainregistration.DomainsClientListByResourceGroupResponse{ + // DomainCollection: armdomainregistration.DomainCollection{ + // Value: []*armdomainregistration.Domain{ + // { + // Name: to.Ptr("example.com"), + // Type: to.Ptr("Microsoft.DomainRegistration/domains"), + // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.DomainRegistration/domains/example.com"), + // Location: to.Ptr("global"), + // Properties: &armdomainregistration.DomainProperties{ + // AuthCode: to.Ptr("exampleAuthCode"), + // AutoRenew: to.Ptr(true), + // Consent: &armdomainregistration.DomainPurchaseConsent{ + // AgreedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-10T19:30:53Z"); return t}()), + // AgreedBy: to.Ptr("192.0.2.1"), + // AgreementKeys: []*string{ + // to.Ptr("agreementKey1"), + // }, + // }, + // ContactAdmin: &armdomainregistration.Contact{ + // AddressMailing: &armdomainregistration.Address{ + // Address1: to.Ptr("3400 State St"), + // City: to.Ptr("Chicago"), + // Country: to.Ptr("United States"), + // PostalCode: to.Ptr("67098"), + // State: to.Ptr("IL"), + // }, + // Email: to.Ptr("admin@email.com"), + // Fax: to.Ptr("1-245-534-2242"), + // JobTitle: to.Ptr("Admin"), + // NameFirst: to.Ptr("John"), + // NameLast: to.Ptr("Doe"), + // NameMiddle: to.Ptr(""), + // Organization: to.Ptr("Microsoft Inc."), + // Phone: to.Ptr("1-245-534-2242"), + // }, + // ContactBilling: &armdomainregistration.Contact{ + // AddressMailing: &armdomainregistration.Address{ + // Address1: to.Ptr("3400 State St"), + // City: to.Ptr("Chicago"), + // Country: to.Ptr("United States"), + // PostalCode: to.Ptr("67098"), + // State: to.Ptr("IL"), + // }, + // Email: to.Ptr("billing@email.com"), + // Fax: to.Ptr("1-245-534-2242"), + // JobTitle: to.Ptr("Billing"), + // NameFirst: to.Ptr("John"), + // NameLast: to.Ptr("Doe"), + // NameMiddle: to.Ptr(""), + // Organization: to.Ptr("Microsoft Inc."), + // Phone: to.Ptr("1-245-534-2242"), + // }, + // ContactRegistrant: &armdomainregistration.Contact{ + // AddressMailing: &armdomainregistration.Address{ + // Address1: to.Ptr("3400 State St"), + // City: to.Ptr("Chicago"), + // Country: to.Ptr("United States"), + // PostalCode: to.Ptr("67098"), + // State: to.Ptr("IL"), + // }, + // Email: to.Ptr("registrant@email.com"), + // Fax: to.Ptr("1-245-534-2242"), + // JobTitle: to.Ptr("Registrant"), + // NameFirst: to.Ptr("John"), + // NameLast: to.Ptr("Doe"), + // NameMiddle: to.Ptr(""), + // Organization: to.Ptr("Microsoft Inc."), + // Phone: to.Ptr("1-245-534-2242"), + // }, + // ContactTech: &armdomainregistration.Contact{ + // AddressMailing: &armdomainregistration.Address{ + // Address1: to.Ptr("3400 State St"), + // City: to.Ptr("Chicago"), + // Country: to.Ptr("United States"), + // PostalCode: to.Ptr("67098"), + // State: to.Ptr("IL"), + // }, + // Email: to.Ptr("tech@email.com"), + // Fax: to.Ptr("1-245-534-2242"), + // JobTitle: to.Ptr("Tech"), + // NameFirst: to.Ptr("John"), + // NameLast: to.Ptr("Doe"), + // NameMiddle: to.Ptr(""), + // Organization: to.Ptr("Microsoft Inc."), + // Phone: to.Ptr("1-245-534-2242"), + // }, + // CreatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-10T19:30:53Z"); return t}()), + // DNSType: to.Ptr(armdomainregistration.DNSTypeDefaultDomainRegistrarDNS), + // DomainNotRenewableReasons: []*armdomainregistration.ResourceNotRenewableReason{ + // to.Ptr(armdomainregistration.ResourceNotRenewableReasonExpirationNotInRenewalTimeRange), + // }, + // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-10T19:30:53Z"); return t}()), + // ManagedHostNames: []*armdomainregistration.HostName{ + // }, + // NameServers: []*string{ + // to.Ptr("ns01.ote.domaincontrol.com"), + // to.Ptr("ns02.ote.domaincontrol.com"), + // }, + // Privacy: to.Ptr(false), + // ProvisioningState: to.Ptr(armdomainregistration.ProvisioningStateSucceeded), + // ReadyForDNSRecordManagement: to.Ptr(true), + // RegistrationStatus: to.Ptr(armdomainregistration.DomainStatusActive), + // }, + // Tags: map[string]*string{ + // }, + // }, + // }, + // }, + // } + } +} + +// Generated from example definition: 2024-11-01/ListDomainOwnershipIdentifiers.json +func ExampleDomainsClient_NewListOwnershipIdentifiersPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armdomainregistration.NewClientFactory("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewDomainsClient().NewListOwnershipIdentifiersPager("testrg123", "example.com", 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 = armdomainregistration.DomainsClientListOwnershipIdentifiersResponse{ + // DomainOwnershipIdentifierCollection: armdomainregistration.DomainOwnershipIdentifierCollection{ + // Value: []*armdomainregistration.DomainOwnershipIdentifier{ + // { + // Name: to.Ptr("SampleOwnershipId"), + // Type: to.Ptr("Microsoft.DomainRegistration/domains/domainownershipidentifiers"), + // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.DomainRegistration/domains/example.com/domainownershipidentifiers/SampleOwnershipId"), + // Properties: &armdomainregistration.DomainOwnershipIdentifierProperties{ + // OwnershipID: to.Ptr("SampleOwnershipId"), + // }, + // }, + // }, + // }, + // } + } +} + +// Generated from example definition: 2024-11-01/ListDomainRecommendations.json +func ExampleDomainsClient_NewListRecommendationsPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armdomainregistration.NewClientFactory("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewDomainsClient().NewListRecommendationsPager(armdomainregistration.DomainRecommendationSearchParameters{ + Keywords: to.Ptr("example1"), + MaxDomainRecommendations: to.Ptr[int32](10), + }, 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 = armdomainregistration.DomainsClientListRecommendationsResponse{ + // NameIdentifierCollection: armdomainregistration.NameIdentifierCollection{ + // Value: []*armdomainregistration.NameIdentifier{ + // { + // Name: to.Ptr("domainnamesuggestion1"), + // }, + // { + // Name: to.Ptr("domainnamesuggestion2"), + // }, + // { + // Name: to.Ptr("domainnamesuggestion3"), + // }, + // }, + // }, + // } + } +} + +// Generated from example definition: 2024-11-01/RenewDomain.json +func ExampleDomainsClient_Renew() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armdomainregistration.NewClientFactory("3dddfa4f-cedf-4dc0-ba29-b6d1a69ab545", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewDomainsClient().Renew(ctx, "RG", "example.com", 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 = armdomainregistration.DomainsClientRenewResponse{ + // } +} + +// Generated from example definition: 2024-11-01/TransferOutDomain.json +func ExampleDomainsClient_TransferOut() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armdomainregistration.NewClientFactory("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewDomainsClient().TransferOut(ctx, "testrg123", "example.com", 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 = armdomainregistration.DomainsClientTransferOutResponse{ + // Domain: &armdomainregistration.Domain{ + // Name: to.Ptr("example.com"), + // Type: to.Ptr("Microsoft.DomainRegistration/domains"), + // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.DomainRegistration/domains/example.com"), + // Location: to.Ptr("global"), + // Properties: &armdomainregistration.DomainProperties{ + // AuthCode: to.Ptr("exampleAuthCode"), + // AutoRenew: to.Ptr(true), + // Consent: &armdomainregistration.DomainPurchaseConsent{ + // AgreedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-10T19:30:53Z"); return t}()), + // AgreedBy: to.Ptr("192.0.2.1"), + // AgreementKeys: []*string{ + // to.Ptr("agreementKey1"), + // }, + // }, + // ContactAdmin: &armdomainregistration.Contact{ + // AddressMailing: &armdomainregistration.Address{ + // Address1: to.Ptr("3400 State St"), + // City: to.Ptr("Chicago"), + // Country: to.Ptr("United States"), + // PostalCode: to.Ptr("67098"), + // State: to.Ptr("IL"), + // }, + // Email: to.Ptr("admin@email.com"), + // Fax: to.Ptr("1-245-534-2242"), + // JobTitle: to.Ptr("Admin"), + // NameFirst: to.Ptr("John"), + // NameLast: to.Ptr("Doe"), + // NameMiddle: to.Ptr(""), + // Organization: to.Ptr("Microsoft Inc."), + // Phone: to.Ptr("1-245-534-2242"), + // }, + // ContactBilling: &armdomainregistration.Contact{ + // AddressMailing: &armdomainregistration.Address{ + // Address1: to.Ptr("3400 State St"), + // City: to.Ptr("Chicago"), + // Country: to.Ptr("United States"), + // PostalCode: to.Ptr("67098"), + // State: to.Ptr("IL"), + // }, + // Email: to.Ptr("billing@email.com"), + // Fax: to.Ptr("1-245-534-2242"), + // JobTitle: to.Ptr("Billing"), + // NameFirst: to.Ptr("John"), + // NameLast: to.Ptr("Doe"), + // NameMiddle: to.Ptr(""), + // Organization: to.Ptr("Microsoft Inc."), + // Phone: to.Ptr("1-245-534-2242"), + // }, + // ContactRegistrant: &armdomainregistration.Contact{ + // AddressMailing: &armdomainregistration.Address{ + // Address1: to.Ptr("3400 State St"), + // City: to.Ptr("Chicago"), + // Country: to.Ptr("United States"), + // PostalCode: to.Ptr("67098"), + // State: to.Ptr("IL"), + // }, + // Email: to.Ptr("registrant@email.com"), + // Fax: to.Ptr("1-245-534-2242"), + // JobTitle: to.Ptr("Registrant"), + // NameFirst: to.Ptr("John"), + // NameLast: to.Ptr("Doe"), + // NameMiddle: to.Ptr(""), + // Organization: to.Ptr("Microsoft Inc."), + // Phone: to.Ptr("1-245-534-2242"), + // }, + // ContactTech: &armdomainregistration.Contact{ + // AddressMailing: &armdomainregistration.Address{ + // Address1: to.Ptr("3400 State St"), + // City: to.Ptr("Chicago"), + // Country: to.Ptr("United States"), + // PostalCode: to.Ptr("67098"), + // State: to.Ptr("IL"), + // }, + // Email: to.Ptr("tech@email.com"), + // Fax: to.Ptr("1-245-534-2242"), + // JobTitle: to.Ptr("Tech"), + // NameFirst: to.Ptr("John"), + // NameLast: to.Ptr("Doe"), + // NameMiddle: to.Ptr(""), + // Organization: to.Ptr("Microsoft Inc."), + // Phone: to.Ptr("1-245-534-2242"), + // }, + // CreatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-10T19:30:53Z"); return t}()), + // DNSType: to.Ptr(armdomainregistration.DNSTypeDefaultDomainRegistrarDNS), + // DomainNotRenewableReasons: []*armdomainregistration.ResourceNotRenewableReason{ + // to.Ptr(armdomainregistration.ResourceNotRenewableReasonExpirationNotInRenewalTimeRange), + // }, + // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-10T19:30:53Z"); return t}()), + // ManagedHostNames: []*armdomainregistration.HostName{ + // }, + // NameServers: []*string{ + // to.Ptr("ns01.ote.domaincontrol.com"), + // to.Ptr("ns02.ote.domaincontrol.com"), + // }, + // Privacy: to.Ptr(false), + // ProvisioningState: to.Ptr(armdomainregistration.ProvisioningStateSucceeded), + // ReadyForDNSRecordManagement: to.Ptr(true), + // RegistrationStatus: to.Ptr(armdomainregistration.DomainStatusActive), + // }, + // Tags: map[string]*string{ + // }, + // }, + // } +} + +// Generated from example definition: 2024-11-01/UpdateAppServiceDomain.json +func ExampleDomainsClient_Update() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armdomainregistration.NewClientFactory("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewDomainsClient().Update(ctx, "testrg123", "example.com", armdomainregistration.DomainPatchResource{ + Properties: &armdomainregistration.DomainPatchResourceProperties{ + AuthCode: to.Ptr("exampleAuthCode"), + AutoRenew: to.Ptr(true), + Consent: &armdomainregistration.DomainPurchaseConsent{ + AgreedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-10T19:30:53Z"); return t }()), + AgreedBy: to.Ptr("192.0.2.1"), + AgreementKeys: []*string{ + to.Ptr("agreementKey1"), + }, + }, + ContactAdmin: &armdomainregistration.Contact{ + AddressMailing: &armdomainregistration.Address{ + Address1: to.Ptr("3400 State St"), + City: to.Ptr("Chicago"), + Country: to.Ptr("United States"), + PostalCode: to.Ptr("67098"), + State: to.Ptr("IL"), + }, + Email: to.Ptr("admin@email.com"), + Fax: to.Ptr("1-245-534-2242"), + JobTitle: to.Ptr("Admin"), + NameFirst: to.Ptr("John"), + NameLast: to.Ptr("Doe"), + NameMiddle: to.Ptr(""), + Organization: to.Ptr("Microsoft Inc."), + Phone: to.Ptr("1-245-534-2242"), + }, + ContactBilling: &armdomainregistration.Contact{ + AddressMailing: &armdomainregistration.Address{ + Address1: to.Ptr("3400 State St"), + City: to.Ptr("Chicago"), + Country: to.Ptr("United States"), + PostalCode: to.Ptr("67098"), + State: to.Ptr("IL"), + }, + Email: to.Ptr("billing@email.com"), + Fax: to.Ptr("1-245-534-2242"), + JobTitle: to.Ptr("Billing"), + NameFirst: to.Ptr("John"), + NameLast: to.Ptr("Doe"), + NameMiddle: to.Ptr(""), + Organization: to.Ptr("Microsoft Inc."), + Phone: to.Ptr("1-245-534-2242"), + }, + ContactRegistrant: &armdomainregistration.Contact{ + AddressMailing: &armdomainregistration.Address{ + Address1: to.Ptr("3400 State St"), + City: to.Ptr("Chicago"), + Country: to.Ptr("United States"), + PostalCode: to.Ptr("67098"), + State: to.Ptr("IL"), + }, + Email: to.Ptr("registrant@email.com"), + Fax: to.Ptr("1-245-534-2242"), + JobTitle: to.Ptr("Registrant"), + NameFirst: to.Ptr("John"), + NameLast: to.Ptr("Doe"), + NameMiddle: to.Ptr(""), + Organization: to.Ptr("Microsoft Inc."), + Phone: to.Ptr("1-245-534-2242"), + }, + ContactTech: &armdomainregistration.Contact{ + AddressMailing: &armdomainregistration.Address{ + Address1: to.Ptr("3400 State St"), + City: to.Ptr("Chicago"), + Country: to.Ptr("United States"), + PostalCode: to.Ptr("67098"), + State: to.Ptr("IL"), + }, + Email: to.Ptr("tech@email.com"), + Fax: to.Ptr("1-245-534-2242"), + JobTitle: to.Ptr("Tech"), + NameFirst: to.Ptr("John"), + NameLast: to.Ptr("Doe"), + NameMiddle: to.Ptr(""), + Organization: to.Ptr("Microsoft Inc."), + Phone: to.Ptr("1-245-534-2242"), + }, + DNSType: to.Ptr(armdomainregistration.DNSTypeDefaultDomainRegistrarDNS), + Privacy: to.Ptr(false), + }, + }, 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 = armdomainregistration.DomainsClientUpdateResponse{ + // Domain: &armdomainregistration.Domain{ + // Name: to.Ptr("example.com"), + // Type: to.Ptr("Microsoft.DomainRegistration/domains"), + // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.DomainRegistration/domains/example.com"), + // Location: to.Ptr("global"), + // Properties: &armdomainregistration.DomainProperties{ + // AuthCode: to.Ptr("exampleAuthCode"), + // AutoRenew: to.Ptr(true), + // Consent: &armdomainregistration.DomainPurchaseConsent{ + // AgreedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-10T19:30:53Z"); return t}()), + // AgreedBy: to.Ptr("192.0.2.1"), + // AgreementKeys: []*string{ + // to.Ptr("agreementKey1"), + // }, + // }, + // ContactAdmin: &armdomainregistration.Contact{ + // AddressMailing: &armdomainregistration.Address{ + // Address1: to.Ptr("3400 State St"), + // City: to.Ptr("Chicago"), + // Country: to.Ptr("United States"), + // PostalCode: to.Ptr("67098"), + // State: to.Ptr("IL"), + // }, + // Email: to.Ptr("admin@email.com"), + // Fax: to.Ptr("1-245-534-2242"), + // JobTitle: to.Ptr("Admin"), + // NameFirst: to.Ptr("John"), + // NameLast: to.Ptr("Doe"), + // NameMiddle: to.Ptr(""), + // Organization: to.Ptr("Microsoft Inc."), + // Phone: to.Ptr("1-245-534-2242"), + // }, + // ContactBilling: &armdomainregistration.Contact{ + // AddressMailing: &armdomainregistration.Address{ + // Address1: to.Ptr("3400 State St"), + // City: to.Ptr("Chicago"), + // Country: to.Ptr("United States"), + // PostalCode: to.Ptr("67098"), + // State: to.Ptr("IL"), + // }, + // Email: to.Ptr("billing@email.com"), + // Fax: to.Ptr("1-245-534-2242"), + // JobTitle: to.Ptr("Billing"), + // NameFirst: to.Ptr("John"), + // NameLast: to.Ptr("Doe"), + // NameMiddle: to.Ptr(""), + // Organization: to.Ptr("Microsoft Inc."), + // Phone: to.Ptr("1-245-534-2242"), + // }, + // ContactRegistrant: &armdomainregistration.Contact{ + // AddressMailing: &armdomainregistration.Address{ + // Address1: to.Ptr("3400 State St"), + // City: to.Ptr("Chicago"), + // Country: to.Ptr("United States"), + // PostalCode: to.Ptr("67098"), + // State: to.Ptr("IL"), + // }, + // Email: to.Ptr("registrant@email.com"), + // Fax: to.Ptr("1-245-534-2242"), + // JobTitle: to.Ptr("Registrant"), + // NameFirst: to.Ptr("John"), + // NameLast: to.Ptr("Doe"), + // NameMiddle: to.Ptr(""), + // Organization: to.Ptr("Microsoft Inc."), + // Phone: to.Ptr("1-245-534-2242"), + // }, + // ContactTech: &armdomainregistration.Contact{ + // AddressMailing: &armdomainregistration.Address{ + // Address1: to.Ptr("3400 State St"), + // City: to.Ptr("Chicago"), + // Country: to.Ptr("United States"), + // PostalCode: to.Ptr("67098"), + // State: to.Ptr("IL"), + // }, + // Email: to.Ptr("tech@email.com"), + // Fax: to.Ptr("1-245-534-2242"), + // JobTitle: to.Ptr("Tech"), + // NameFirst: to.Ptr("John"), + // NameLast: to.Ptr("Doe"), + // NameMiddle: to.Ptr(""), + // Organization: to.Ptr("Microsoft Inc."), + // Phone: to.Ptr("1-245-534-2242"), + // }, + // CreatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-10T19:30:53Z"); return t}()), + // DNSType: to.Ptr(armdomainregistration.DNSTypeDefaultDomainRegistrarDNS), + // DomainNotRenewableReasons: []*armdomainregistration.ResourceNotRenewableReason{ + // to.Ptr(armdomainregistration.ResourceNotRenewableReasonExpirationNotInRenewalTimeRange), + // }, + // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-10T19:30:53Z"); return t}()), + // ManagedHostNames: []*armdomainregistration.HostName{ + // }, + // NameServers: []*string{ + // to.Ptr("ns01.ote.domaincontrol.com"), + // to.Ptr("ns02.ote.domaincontrol.com"), + // }, + // Privacy: to.Ptr(false), + // ProvisioningState: to.Ptr(armdomainregistration.ProvisioningStateSucceeded), + // ReadyForDNSRecordManagement: to.Ptr(true), + // RegistrationStatus: to.Ptr(armdomainregistration.DomainStatusActive), + // }, + // Tags: map[string]*string{ + // }, + // }, + // } +} + +// Generated from example definition: 2024-11-01/UpdateAppServiceDomainOwnershipIdentifier.json +func ExampleDomainsClient_UpdateOwnershipIdentifier() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armdomainregistration.NewClientFactory("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewDomainsClient().UpdateOwnershipIdentifier(ctx, "testrg123", "example.com", "SampleOwnershipId", armdomainregistration.DomainOwnershipIdentifier{ + Properties: &armdomainregistration.DomainOwnershipIdentifierProperties{ + OwnershipID: to.Ptr("SampleOwnershipId"), + }, + }, 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 = armdomainregistration.DomainsClientUpdateOwnershipIdentifierResponse{ + // DomainOwnershipIdentifier: &armdomainregistration.DomainOwnershipIdentifier{ + // Name: to.Ptr("SampleOwnershipId"), + // Type: to.Ptr("Microsoft.DomainRegistration/domains/domainownershipidentifiers"), + // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.DomainRegistration/domains/example.com/domainownershipidentifiers/SampleOwnershipId"), + // Properties: &armdomainregistration.DomainOwnershipIdentifierProperties{ + // OwnershipID: to.Ptr("SampleOwnershipId"), + // }, + // }, + // } +} diff --git a/sdk/resourcemanager/domainregistration/armdomainregistration/fake/domains_server.go b/sdk/resourcemanager/domainregistration/armdomainregistration/fake/domains_server.go new file mode 100644 index 000000000000..8925984f2abf --- /dev/null +++ b/sdk/resourcemanager/domainregistration/armdomainregistration/fake/domains_server.go @@ -0,0 +1,788 @@ +// 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) Go Code Generator. DO NOT EDIT. + +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/domainregistration/armdomainregistration" + "net/http" + "net/url" + "regexp" + "strconv" +) + +// DomainsServer is a fake server for instances of the armdomainregistration.DomainsClient type. +type DomainsServer struct { + // CheckAvailability is the fake for method DomainsClient.CheckAvailability + // HTTP status codes to indicate success: http.StatusOK + CheckAvailability func(ctx context.Context, identifier armdomainregistration.NameIdentifier, options *armdomainregistration.DomainsClientCheckAvailabilityOptions) (resp azfake.Responder[armdomainregistration.DomainsClientCheckAvailabilityResponse], errResp azfake.ErrorResponder) + + // BeginCreateOrUpdate is the fake for method DomainsClient.BeginCreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, domainName string, domain armdomainregistration.Domain, options *armdomainregistration.DomainsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armdomainregistration.DomainsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // CreateOrUpdateOwnershipIdentifier is the fake for method DomainsClient.CreateOrUpdateOwnershipIdentifier + // HTTP status codes to indicate success: http.StatusOK + CreateOrUpdateOwnershipIdentifier func(ctx context.Context, resourceGroupName string, domainName string, name string, domainOwnershipIdentifier armdomainregistration.DomainOwnershipIdentifier, options *armdomainregistration.DomainsClientCreateOrUpdateOwnershipIdentifierOptions) (resp azfake.Responder[armdomainregistration.DomainsClientCreateOrUpdateOwnershipIdentifierResponse], errResp azfake.ErrorResponder) + + // Delete is the fake for method DomainsClient.Delete + // HTTP status codes to indicate success: http.StatusOK, http.StatusNoContent + Delete func(ctx context.Context, resourceGroupName string, domainName string, options *armdomainregistration.DomainsClientDeleteOptions) (resp azfake.Responder[armdomainregistration.DomainsClientDeleteResponse], errResp azfake.ErrorResponder) + + // DeleteOwnershipIdentifier is the fake for method DomainsClient.DeleteOwnershipIdentifier + // HTTP status codes to indicate success: http.StatusOK, http.StatusNoContent + DeleteOwnershipIdentifier func(ctx context.Context, resourceGroupName string, domainName string, name string, options *armdomainregistration.DomainsClientDeleteOwnershipIdentifierOptions) (resp azfake.Responder[armdomainregistration.DomainsClientDeleteOwnershipIdentifierResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method DomainsClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, domainName string, options *armdomainregistration.DomainsClientGetOptions) (resp azfake.Responder[armdomainregistration.DomainsClientGetResponse], errResp azfake.ErrorResponder) + + // GetControlCenterSsoRequest is the fake for method DomainsClient.GetControlCenterSsoRequest + // HTTP status codes to indicate success: http.StatusOK + GetControlCenterSsoRequest func(ctx context.Context, options *armdomainregistration.DomainsClientGetControlCenterSsoRequestOptions) (resp azfake.Responder[armdomainregistration.DomainsClientGetControlCenterSsoRequestResponse], errResp azfake.ErrorResponder) + + // GetOwnershipIdentifier is the fake for method DomainsClient.GetOwnershipIdentifier + // HTTP status codes to indicate success: http.StatusOK + GetOwnershipIdentifier func(ctx context.Context, resourceGroupName string, domainName string, name string, options *armdomainregistration.DomainsClientGetOwnershipIdentifierOptions) (resp azfake.Responder[armdomainregistration.DomainsClientGetOwnershipIdentifierResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method DomainsClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(options *armdomainregistration.DomainsClientListOptions) (resp azfake.PagerResponder[armdomainregistration.DomainsClientListResponse]) + + // NewListByResourceGroupPager is the fake for method DomainsClient.NewListByResourceGroupPager + // HTTP status codes to indicate success: http.StatusOK + NewListByResourceGroupPager func(resourceGroupName string, options *armdomainregistration.DomainsClientListByResourceGroupOptions) (resp azfake.PagerResponder[armdomainregistration.DomainsClientListByResourceGroupResponse]) + + // NewListOwnershipIdentifiersPager is the fake for method DomainsClient.NewListOwnershipIdentifiersPager + // HTTP status codes to indicate success: http.StatusOK + NewListOwnershipIdentifiersPager func(resourceGroupName string, domainName string, options *armdomainregistration.DomainsClientListOwnershipIdentifiersOptions) (resp azfake.PagerResponder[armdomainregistration.DomainsClientListOwnershipIdentifiersResponse]) + + // NewListRecommendationsPager is the fake for method DomainsClient.NewListRecommendationsPager + // HTTP status codes to indicate success: http.StatusOK + NewListRecommendationsPager func(parameters armdomainregistration.DomainRecommendationSearchParameters, options *armdomainregistration.DomainsClientListRecommendationsOptions) (resp azfake.PagerResponder[armdomainregistration.DomainsClientListRecommendationsResponse]) + + // Renew is the fake for method DomainsClient.Renew + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + Renew func(ctx context.Context, resourceGroupName string, domainName string, options *armdomainregistration.DomainsClientRenewOptions) (resp azfake.Responder[armdomainregistration.DomainsClientRenewResponse], errResp azfake.ErrorResponder) + + // TransferOut is the fake for method DomainsClient.TransferOut + // HTTP status codes to indicate success: http.StatusOK + TransferOut func(ctx context.Context, resourceGroupName string, domainName string, options *armdomainregistration.DomainsClientTransferOutOptions) (resp azfake.Responder[armdomainregistration.DomainsClientTransferOutResponse], errResp azfake.ErrorResponder) + + // Update is the fake for method DomainsClient.Update + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + Update func(ctx context.Context, resourceGroupName string, domainName string, domain armdomainregistration.DomainPatchResource, options *armdomainregistration.DomainsClientUpdateOptions) (resp azfake.Responder[armdomainregistration.DomainsClientUpdateResponse], errResp azfake.ErrorResponder) + + // UpdateOwnershipIdentifier is the fake for method DomainsClient.UpdateOwnershipIdentifier + // HTTP status codes to indicate success: http.StatusOK + UpdateOwnershipIdentifier func(ctx context.Context, resourceGroupName string, domainName string, name string, domainOwnershipIdentifier armdomainregistration.DomainOwnershipIdentifier, options *armdomainregistration.DomainsClientUpdateOwnershipIdentifierOptions) (resp azfake.Responder[armdomainregistration.DomainsClientUpdateOwnershipIdentifierResponse], errResp azfake.ErrorResponder) +} + +// NewDomainsServerTransport creates a new instance of DomainsServerTransport with the provided implementation. +// The returned DomainsServerTransport instance is connected to an instance of armdomainregistration.DomainsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewDomainsServerTransport(srv *DomainsServer) *DomainsServerTransport { + return &DomainsServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armdomainregistration.DomainsClientCreateOrUpdateResponse]](), + newListPager: newTracker[azfake.PagerResponder[armdomainregistration.DomainsClientListResponse]](), + newListByResourceGroupPager: newTracker[azfake.PagerResponder[armdomainregistration.DomainsClientListByResourceGroupResponse]](), + newListOwnershipIdentifiersPager: newTracker[azfake.PagerResponder[armdomainregistration.DomainsClientListOwnershipIdentifiersResponse]](), + newListRecommendationsPager: newTracker[azfake.PagerResponder[armdomainregistration.DomainsClientListRecommendationsResponse]](), + } +} + +// DomainsServerTransport connects instances of armdomainregistration.DomainsClient to instances of DomainsServer. +// Don't use this type directly, use NewDomainsServerTransport instead. +type DomainsServerTransport struct { + srv *DomainsServer + beginCreateOrUpdate *tracker[azfake.PollerResponder[armdomainregistration.DomainsClientCreateOrUpdateResponse]] + newListPager *tracker[azfake.PagerResponder[armdomainregistration.DomainsClientListResponse]] + newListByResourceGroupPager *tracker[azfake.PagerResponder[armdomainregistration.DomainsClientListByResourceGroupResponse]] + newListOwnershipIdentifiersPager *tracker[azfake.PagerResponder[armdomainregistration.DomainsClientListOwnershipIdentifiersResponse]] + newListRecommendationsPager *tracker[azfake.PagerResponder[armdomainregistration.DomainsClientListRecommendationsResponse]] +} + +// Do implements the policy.Transporter interface for DomainsServerTransport. +func (d *DomainsServerTransport) 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")} + } + + return d.dispatchToMethodFake(req, method) +} + +func (d *DomainsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if domainsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = domainsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "DomainsClient.CheckAvailability": + res.resp, res.err = d.dispatchCheckAvailability(req) + case "DomainsClient.BeginCreateOrUpdate": + res.resp, res.err = d.dispatchBeginCreateOrUpdate(req) + case "DomainsClient.CreateOrUpdateOwnershipIdentifier": + res.resp, res.err = d.dispatchCreateOrUpdateOwnershipIdentifier(req) + case "DomainsClient.Delete": + res.resp, res.err = d.dispatchDelete(req) + case "DomainsClient.DeleteOwnershipIdentifier": + res.resp, res.err = d.dispatchDeleteOwnershipIdentifier(req) + case "DomainsClient.Get": + res.resp, res.err = d.dispatchGet(req) + case "DomainsClient.GetControlCenterSsoRequest": + res.resp, res.err = d.dispatchGetControlCenterSsoRequest(req) + case "DomainsClient.GetOwnershipIdentifier": + res.resp, res.err = d.dispatchGetOwnershipIdentifier(req) + case "DomainsClient.NewListPager": + res.resp, res.err = d.dispatchNewListPager(req) + case "DomainsClient.NewListByResourceGroupPager": + res.resp, res.err = d.dispatchNewListByResourceGroupPager(req) + case "DomainsClient.NewListOwnershipIdentifiersPager": + res.resp, res.err = d.dispatchNewListOwnershipIdentifiersPager(req) + case "DomainsClient.NewListRecommendationsPager": + res.resp, res.err = d.dispatchNewListRecommendationsPager(req) + case "DomainsClient.Renew": + res.resp, res.err = d.dispatchRenew(req) + case "DomainsClient.TransferOut": + res.resp, res.err = d.dispatchTransferOut(req) + case "DomainsClient.Update": + res.resp, res.err = d.dispatchUpdate(req) + case "DomainsClient.UpdateOwnershipIdentifier": + res.resp, res.err = d.dispatchUpdateOwnershipIdentifier(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } +} + +func (d *DomainsServerTransport) dispatchCheckAvailability(req *http.Request) (*http.Response, error) { + if d.srv.CheckAvailability == nil { + return nil, &nonRetriableError{errors.New("fake for method CheckAvailability not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DomainRegistration/checkDomainAvailability` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 2 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armdomainregistration.NameIdentifier](req) + if err != nil { + return nil, err + } + respr, errRespr := d.srv.CheckAvailability(req.Context(), body, 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).DomainAvailabilityCheckResult, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (d *DomainsServerTransport) 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\.DomainRegistration/domains/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armdomainregistration.Domain](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + domainNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("domainName")]) + if err != nil { + return nil, err + } + respr, errRespr := d.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, domainNameParam, body, nil) + 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.StatusAccepted}, resp.StatusCode) { + d.beginCreateOrUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCreateOrUpdate) { + d.beginCreateOrUpdate.remove(req) + } + + return resp, nil +} + +func (d *DomainsServerTransport) dispatchCreateOrUpdateOwnershipIdentifier(req *http.Request) (*http.Response, error) { + if d.srv.CreateOrUpdateOwnershipIdentifier == nil { + return nil, &nonRetriableError{errors.New("fake for method CreateOrUpdateOwnershipIdentifier not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DomainRegistration/domains/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/domainOwnershipIdentifiers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armdomainregistration.DomainOwnershipIdentifier](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + domainNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("domainName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + respr, errRespr := d.srv.CreateOrUpdateOwnershipIdentifier(req.Context(), resourceGroupNameParam, domainNameParam, nameParam, body, 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).DomainOwnershipIdentifier, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (d *DomainsServerTransport) dispatchDelete(req *http.Request) (*http.Response, error) { + if d.srv.Delete == nil { + return nil, &nonRetriableError{errors.New("fake for method Delete not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DomainRegistration/domains/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + domainNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("domainName")]) + if err != nil { + return nil, err + } + forceHardDeleteDomainUnescaped, err := url.QueryUnescape(qp.Get("forceHardDeleteDomain")) + if err != nil { + return nil, err + } + forceHardDeleteDomainParam, err := parseOptional(forceHardDeleteDomainUnescaped, strconv.ParseBool) + if err != nil { + return nil, err + } + var options *armdomainregistration.DomainsClientDeleteOptions + if forceHardDeleteDomainParam != nil { + options = &armdomainregistration.DomainsClientDeleteOptions{ + ForceHardDeleteDomain: forceHardDeleteDomainParam, + } + } + respr, errRespr := d.srv.Delete(req.Context(), resourceGroupNameParam, domainNameParam, options) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusNoContent", respContent.HTTPStatus)} + } + resp, err := server.NewResponse(respContent, req, nil) + if err != nil { + return nil, err + } + return resp, nil +} + +func (d *DomainsServerTransport) dispatchDeleteOwnershipIdentifier(req *http.Request) (*http.Response, error) { + if d.srv.DeleteOwnershipIdentifier == nil { + return nil, &nonRetriableError{errors.New("fake for method DeleteOwnershipIdentifier not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DomainRegistration/domains/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/domainOwnershipIdentifiers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 5 { + 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 + } + domainNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("domainName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + respr, errRespr := d.srv.DeleteOwnershipIdentifier(req.Context(), resourceGroupNameParam, domainNameParam, nameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusNoContent", respContent.HTTPStatus)} + } + resp, err := server.NewResponse(respContent, req, nil) + if err != nil { + return nil, err + } + return resp, nil +} + +func (d *DomainsServerTransport) 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\.DomainRegistration/domains/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 4 { + 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 + } + domainNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("domainName")]) + if err != nil { + return nil, err + } + respr, errRespr := d.srv.Get(req.Context(), resourceGroupNameParam, domainNameParam, 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).Domain, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (d *DomainsServerTransport) dispatchGetControlCenterSsoRequest(req *http.Request) (*http.Response, error) { + if d.srv.GetControlCenterSsoRequest == nil { + return nil, &nonRetriableError{errors.New("fake for method GetControlCenterSsoRequest not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DomainRegistration/generateSsoRequest` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 2 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + respr, errRespr := d.srv.GetControlCenterSsoRequest(req.Context(), 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).DomainControlCenterSsoRequest, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (d *DomainsServerTransport) dispatchGetOwnershipIdentifier(req *http.Request) (*http.Response, error) { + if d.srv.GetOwnershipIdentifier == nil { + return nil, &nonRetriableError{errors.New("fake for method GetOwnershipIdentifier not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DomainRegistration/domains/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/domainOwnershipIdentifiers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 5 { + 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 + } + domainNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("domainName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + respr, errRespr := d.srv.GetOwnershipIdentifier(req.Context(), resourceGroupNameParam, domainNameParam, nameParam, 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).DomainOwnershipIdentifier, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (d *DomainsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if d.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := d.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DomainRegistration/domains` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 2 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resp := d.srv.NewListPager(nil) + newListPager = &resp + d.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armdomainregistration.DomainsClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + d.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + d.newListPager.remove(req) + } + return resp, nil +} + +func (d *DomainsServerTransport) dispatchNewListByResourceGroupPager(req *http.Request) (*http.Response, error) { + if d.srv.NewListByResourceGroupPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListByResourceGroupPager not implemented")} + } + newListByResourceGroupPager := d.newListByResourceGroupPager.get(req) + if newListByResourceGroupPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DomainRegistration/domains` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if 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 + } + resp := d.srv.NewListByResourceGroupPager(resourceGroupNameParam, nil) + newListByResourceGroupPager = &resp + d.newListByResourceGroupPager.add(req, newListByResourceGroupPager) + server.PagerResponderInjectNextLinks(newListByResourceGroupPager, req, func(page *armdomainregistration.DomainsClientListByResourceGroupResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListByResourceGroupPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + d.newListByResourceGroupPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListByResourceGroupPager) { + d.newListByResourceGroupPager.remove(req) + } + return resp, nil +} + +func (d *DomainsServerTransport) dispatchNewListOwnershipIdentifiersPager(req *http.Request) (*http.Response, error) { + if d.srv.NewListOwnershipIdentifiersPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListOwnershipIdentifiersPager not implemented")} + } + newListOwnershipIdentifiersPager := d.newListOwnershipIdentifiersPager.get(req) + if newListOwnershipIdentifiersPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DomainRegistration/domains/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/domainOwnershipIdentifiers` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 4 { + 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 + } + domainNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("domainName")]) + if err != nil { + return nil, err + } + resp := d.srv.NewListOwnershipIdentifiersPager(resourceGroupNameParam, domainNameParam, nil) + newListOwnershipIdentifiersPager = &resp + d.newListOwnershipIdentifiersPager.add(req, newListOwnershipIdentifiersPager) + server.PagerResponderInjectNextLinks(newListOwnershipIdentifiersPager, req, func(page *armdomainregistration.DomainsClientListOwnershipIdentifiersResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListOwnershipIdentifiersPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + d.newListOwnershipIdentifiersPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListOwnershipIdentifiersPager) { + d.newListOwnershipIdentifiersPager.remove(req) + } + return resp, nil +} + +func (d *DomainsServerTransport) dispatchNewListRecommendationsPager(req *http.Request) (*http.Response, error) { + if d.srv.NewListRecommendationsPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListRecommendationsPager not implemented")} + } + newListRecommendationsPager := d.newListRecommendationsPager.get(req) + if newListRecommendationsPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DomainRegistration/listDomainRecommendations` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 2 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armdomainregistration.DomainRecommendationSearchParameters](req) + if err != nil { + return nil, err + } + resp := d.srv.NewListRecommendationsPager(body, nil) + newListRecommendationsPager = &resp + d.newListRecommendationsPager.add(req, newListRecommendationsPager) + server.PagerResponderInjectNextLinks(newListRecommendationsPager, req, func(page *armdomainregistration.DomainsClientListRecommendationsResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListRecommendationsPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + d.newListRecommendationsPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListRecommendationsPager) { + d.newListRecommendationsPager.remove(req) + } + return resp, nil +} + +func (d *DomainsServerTransport) dispatchRenew(req *http.Request) (*http.Response, error) { + if d.srv.Renew == nil { + return nil, &nonRetriableError{errors.New("fake for method Renew not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DomainRegistration/domains/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/renew` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 4 { + 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 + } + domainNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("domainName")]) + if err != nil { + return nil, err + } + respr, errRespr := d.srv.Renew(req.Context(), resourceGroupNameParam, domainNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", respContent.HTTPStatus)} + } + resp, err := server.NewResponse(respContent, req, nil) + if err != nil { + return nil, err + } + if val := server.GetResponse(respr).RetryAfter; val != nil { + resp.Header.Set("Retry-After", strconv.FormatInt(int64(*val), 10)) + } + return resp, nil +} + +func (d *DomainsServerTransport) dispatchTransferOut(req *http.Request) (*http.Response, error) { + if d.srv.TransferOut == nil { + return nil, &nonRetriableError{errors.New("fake for method TransferOut not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DomainRegistration/domains/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/transferOut` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 4 { + 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 + } + domainNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("domainName")]) + if err != nil { + return nil, err + } + respr, errRespr := d.srv.TransferOut(req.Context(), resourceGroupNameParam, domainNameParam, 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).Domain, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (d *DomainsServerTransport) dispatchUpdate(req *http.Request) (*http.Response, error) { + if d.srv.Update == nil { + return nil, &nonRetriableError{errors.New("fake for method Update not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DomainRegistration/domains/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armdomainregistration.DomainPatchResource](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + domainNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("domainName")]) + if err != nil { + return nil, err + } + respr, errRespr := d.srv.Update(req.Context(), resourceGroupNameParam, domainNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK, http.StatusAccepted}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Domain, req) + if err != nil { + return nil, err + } + if val := server.GetResponse(respr).RetryAfter; val != nil { + resp.Header.Set("Retry-After", strconv.FormatInt(int64(*val), 10)) + } + return resp, nil +} + +func (d *DomainsServerTransport) dispatchUpdateOwnershipIdentifier(req *http.Request) (*http.Response, error) { + if d.srv.UpdateOwnershipIdentifier == nil { + return nil, &nonRetriableError{errors.New("fake for method UpdateOwnershipIdentifier not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DomainRegistration/domains/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/domainOwnershipIdentifiers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armdomainregistration.DomainOwnershipIdentifier](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + domainNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("domainName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + respr, errRespr := d.srv.UpdateOwnershipIdentifier(req.Context(), resourceGroupNameParam, domainNameParam, nameParam, body, 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).DomainOwnershipIdentifier, req) + if err != nil { + return nil, err + } + return resp, nil +} + +// set this to conditionally intercept incoming requests to DomainsServerTransport +var domainsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/domainregistration/armdomainregistration/fake/internal.go b/sdk/resourcemanager/domainregistration/armdomainregistration/fake/internal.go new file mode 100644 index 000000000000..88d11305e74b --- /dev/null +++ b/sdk/resourcemanager/domainregistration/armdomainregistration/fake/internal.go @@ -0,0 +1,76 @@ +// 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) Go Code Generator. DO NOT EDIT. + +package fake + +import ( + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "net/http" + "sync" +) + +type result struct { + resp *http.Response + err error +} + +type nonRetriableError struct { + error +} + +func (nonRetriableError) NonRetriable() { + // marker method +} + +func contains[T comparable](s []T, v T) bool { + for _, vv := range s { + if vv == v { + return true + } + } + return false +} + +func parseOptional[T any](v string, parse func(v string) (T, error)) (*T, error) { + if v == "" { + return nil, nil + } + t, err := parse(v) + if err != nil { + return nil, err + } + return &t, err +} + +func newTracker[T any]() *tracker[T] { + return &tracker[T]{ + items: map[string]*T{}, + } +} + +type tracker[T any] struct { + items map[string]*T + mu sync.Mutex +} + +func (p *tracker[T]) get(req *http.Request) *T { + p.mu.Lock() + defer p.mu.Unlock() + if item, ok := p.items[server.SanitizePagerPollerPath(req.URL.Path)]; ok { + return item + } + return nil +} + +func (p *tracker[T]) add(req *http.Request, item *T) { + p.mu.Lock() + defer p.mu.Unlock() + p.items[server.SanitizePagerPollerPath(req.URL.Path)] = item +} + +func (p *tracker[T]) remove(req *http.Request) { + p.mu.Lock() + defer p.mu.Unlock() + delete(p.items, server.SanitizePagerPollerPath(req.URL.Path)) +} diff --git a/sdk/resourcemanager/domainregistration/armdomainregistration/fake/provider_server.go b/sdk/resourcemanager/domainregistration/armdomainregistration/fake/provider_server.go new file mode 100644 index 000000000000..4ecb876a6ba9 --- /dev/null +++ b/sdk/resourcemanager/domainregistration/armdomainregistration/fake/provider_server.go @@ -0,0 +1,117 @@ +// 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) Go Code Generator. DO NOT EDIT. + +package fake + +import ( + "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/domainregistration/armdomainregistration" + "net/http" +) + +// ProviderServer is a fake server for instances of the armdomainregistration.ProviderClient type. +type ProviderServer struct { + // NewListOperationsPager is the fake for method ProviderClient.NewListOperationsPager + // HTTP status codes to indicate success: http.StatusOK + NewListOperationsPager func(options *armdomainregistration.ProviderClientListOperationsOptions) (resp azfake.PagerResponder[armdomainregistration.ProviderClientListOperationsResponse]) +} + +// NewProviderServerTransport creates a new instance of ProviderServerTransport with the provided implementation. +// The returned ProviderServerTransport instance is connected to an instance of armdomainregistration.ProviderClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewProviderServerTransport(srv *ProviderServer) *ProviderServerTransport { + return &ProviderServerTransport{ + srv: srv, + newListOperationsPager: newTracker[azfake.PagerResponder[armdomainregistration.ProviderClientListOperationsResponse]](), + } +} + +// ProviderServerTransport connects instances of armdomainregistration.ProviderClient to instances of ProviderServer. +// Don't use this type directly, use NewProviderServerTransport instead. +type ProviderServerTransport struct { + srv *ProviderServer + newListOperationsPager *tracker[azfake.PagerResponder[armdomainregistration.ProviderClientListOperationsResponse]] +} + +// Do implements the policy.Transporter interface for ProviderServerTransport. +func (p *ProviderServerTransport) 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")} + } + + return p.dispatchToMethodFake(req, method) +} + +func (p *ProviderServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if providerServerTransportInterceptor != nil { + res.resp, res.err, intercepted = providerServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ProviderClient.NewListOperationsPager": + res.resp, res.err = p.dispatchNewListOperationsPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } +} + +func (p *ProviderServerTransport) dispatchNewListOperationsPager(req *http.Request) (*http.Response, error) { + if p.srv.NewListOperationsPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListOperationsPager not implemented")} + } + newListOperationsPager := p.newListOperationsPager.get(req) + if newListOperationsPager == nil { + resp := p.srv.NewListOperationsPager(nil) + newListOperationsPager = &resp + p.newListOperationsPager.add(req, newListOperationsPager) + server.PagerResponderInjectNextLinks(newListOperationsPager, req, func(page *armdomainregistration.ProviderClientListOperationsResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListOperationsPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + p.newListOperationsPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListOperationsPager) { + p.newListOperationsPager.remove(req) + } + return resp, nil +} + +// set this to conditionally intercept incoming requests to ProviderServerTransport +var providerServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/domainregistration/armdomainregistration/fake/server_factory.go b/sdk/resourcemanager/domainregistration/armdomainregistration/fake/server_factory.go new file mode 100644 index 000000000000..43a54b9bbb8f --- /dev/null +++ b/sdk/resourcemanager/domainregistration/armdomainregistration/fake/server_factory.go @@ -0,0 +1,88 @@ +// 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) Go Code Generator. DO NOT EDIT. + +package fake + +import ( + "errors" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "strings" + "sync" +) + +// ServerFactory is a fake server for instances of the armdomainregistration.ClientFactory type. +type ServerFactory struct { + // DomainsServer contains the fakes for client DomainsClient + DomainsServer DomainsServer + + // ProviderServer contains the fakes for client ProviderClient + ProviderServer ProviderServer + + // TopLevelDomainsServer contains the fakes for client TopLevelDomainsClient + TopLevelDomainsServer TopLevelDomainsServer +} + +// NewServerFactoryTransport creates a new instance of ServerFactoryTransport with the provided implementation. +// The returned ServerFactoryTransport instance is connected to an instance of armdomainregistration.ClientFactory via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewServerFactoryTransport(srv *ServerFactory) *ServerFactoryTransport { + return &ServerFactoryTransport{ + srv: srv, + } +} + +// ServerFactoryTransport connects instances of armdomainregistration.ClientFactory to instances of ServerFactory. +// Don't use this type directly, use NewServerFactoryTransport instead. +type ServerFactoryTransport struct { + srv *ServerFactory + trMu sync.Mutex + trDomainsServer *DomainsServerTransport + trProviderServer *ProviderServerTransport + trTopLevelDomainsServer *TopLevelDomainsServerTransport +} + +// Do implements the policy.Transporter interface for ServerFactoryTransport. +func (s *ServerFactoryTransport) 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")} + } + + client := method[:strings.Index(method, ".")] + var resp *http.Response + var err error + + switch client { + case "DomainsClient": + initServer(s, &s.trDomainsServer, func() *DomainsServerTransport { return NewDomainsServerTransport(&s.srv.DomainsServer) }) + resp, err = s.trDomainsServer.Do(req) + case "ProviderClient": + initServer(s, &s.trProviderServer, func() *ProviderServerTransport { return NewProviderServerTransport(&s.srv.ProviderServer) }) + resp, err = s.trProviderServer.Do(req) + case "TopLevelDomainsClient": + initServer(s, &s.trTopLevelDomainsServer, func() *TopLevelDomainsServerTransport { + return NewTopLevelDomainsServerTransport(&s.srv.TopLevelDomainsServer) + }) + resp, err = s.trTopLevelDomainsServer.Do(req) + default: + err = fmt.Errorf("unhandled client %s", client) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func initServer[T any](s *ServerFactoryTransport, dst **T, src func() *T) { + s.trMu.Lock() + if *dst == nil { + *dst = src() + } + s.trMu.Unlock() +} diff --git a/sdk/resourcemanager/domainregistration/armdomainregistration/fake/topleveldomains_server.go b/sdk/resourcemanager/domainregistration/armdomainregistration/fake/topleveldomains_server.go new file mode 100644 index 000000000000..dde09f5e9fee --- /dev/null +++ b/sdk/resourcemanager/domainregistration/armdomainregistration/fake/topleveldomains_server.go @@ -0,0 +1,210 @@ +// 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) Go Code Generator. DO NOT EDIT. + +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/domainregistration/armdomainregistration" + "net/http" + "net/url" + "regexp" +) + +// TopLevelDomainsServer is a fake server for instances of the armdomainregistration.TopLevelDomainsClient type. +type TopLevelDomainsServer struct { + // Get is the fake for method TopLevelDomainsClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, name string, options *armdomainregistration.TopLevelDomainsClientGetOptions) (resp azfake.Responder[armdomainregistration.TopLevelDomainsClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method TopLevelDomainsClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(options *armdomainregistration.TopLevelDomainsClientListOptions) (resp azfake.PagerResponder[armdomainregistration.TopLevelDomainsClientListResponse]) + + // NewListAgreementsPager is the fake for method TopLevelDomainsClient.NewListAgreementsPager + // HTTP status codes to indicate success: http.StatusOK + NewListAgreementsPager func(name string, agreementOption armdomainregistration.TopLevelDomainAgreementOption, options *armdomainregistration.TopLevelDomainsClientListAgreementsOptions) (resp azfake.PagerResponder[armdomainregistration.TopLevelDomainsClientListAgreementsResponse]) +} + +// NewTopLevelDomainsServerTransport creates a new instance of TopLevelDomainsServerTransport with the provided implementation. +// The returned TopLevelDomainsServerTransport instance is connected to an instance of armdomainregistration.TopLevelDomainsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewTopLevelDomainsServerTransport(srv *TopLevelDomainsServer) *TopLevelDomainsServerTransport { + return &TopLevelDomainsServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armdomainregistration.TopLevelDomainsClientListResponse]](), + newListAgreementsPager: newTracker[azfake.PagerResponder[armdomainregistration.TopLevelDomainsClientListAgreementsResponse]](), + } +} + +// TopLevelDomainsServerTransport connects instances of armdomainregistration.TopLevelDomainsClient to instances of TopLevelDomainsServer. +// Don't use this type directly, use NewTopLevelDomainsServerTransport instead. +type TopLevelDomainsServerTransport struct { + srv *TopLevelDomainsServer + newListPager *tracker[azfake.PagerResponder[armdomainregistration.TopLevelDomainsClientListResponse]] + newListAgreementsPager *tracker[azfake.PagerResponder[armdomainregistration.TopLevelDomainsClientListAgreementsResponse]] +} + +// Do implements the policy.Transporter interface for TopLevelDomainsServerTransport. +func (t *TopLevelDomainsServerTransport) 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")} + } + + return t.dispatchToMethodFake(req, method) +} + +func (t *TopLevelDomainsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if topLevelDomainsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = topLevelDomainsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "TopLevelDomainsClient.Get": + res.resp, res.err = t.dispatchGet(req) + case "TopLevelDomainsClient.NewListPager": + res.resp, res.err = t.dispatchNewListPager(req) + case "TopLevelDomainsClient.NewListAgreementsPager": + res.resp, res.err = t.dispatchNewListAgreementsPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } +} + +func (t *TopLevelDomainsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if t.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DomainRegistration/topLevelDomains/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + respr, errRespr := t.srv.Get(req.Context(), nameParam, 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).TopLevelDomain, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (t *TopLevelDomainsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if t.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := t.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DomainRegistration/topLevelDomains` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 2 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resp := t.srv.NewListPager(nil) + newListPager = &resp + t.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armdomainregistration.TopLevelDomainsClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + t.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + t.newListPager.remove(req) + } + return resp, nil +} + +func (t *TopLevelDomainsServerTransport) dispatchNewListAgreementsPager(req *http.Request) (*http.Response, error) { + if t.srv.NewListAgreementsPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListAgreementsPager not implemented")} + } + newListAgreementsPager := t.newListAgreementsPager.get(req) + if newListAgreementsPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DomainRegistration/topLevelDomains/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/listAgreements` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armdomainregistration.TopLevelDomainAgreementOption](req) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + resp := t.srv.NewListAgreementsPager(nameParam, body, nil) + newListAgreementsPager = &resp + t.newListAgreementsPager.add(req, newListAgreementsPager) + server.PagerResponderInjectNextLinks(newListAgreementsPager, req, func(page *armdomainregistration.TopLevelDomainsClientListAgreementsResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListAgreementsPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + t.newListAgreementsPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListAgreementsPager) { + t.newListAgreementsPager.remove(req) + } + return resp, nil +} + +// set this to conditionally intercept incoming requests to TopLevelDomainsServerTransport +var topLevelDomainsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/domainregistration/armdomainregistration/go.mod b/sdk/resourcemanager/domainregistration/armdomainregistration/go.mod new file mode 100644 index 000000000000..77d7cd1785de --- /dev/null +++ b/sdk/resourcemanager/domainregistration/armdomainregistration/go.mod @@ -0,0 +1,21 @@ +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/domainregistration/armdomainregistration + +go 1.24.0 + +require ( + github.com/Azure/azure-sdk-for-go/sdk/azcore v1.21.0 + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.13.1 +) + +require ( + github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.2 // indirect + github.com/AzureAD/microsoft-authentication-library-for-go v1.6.0 // indirect + github.com/golang-jwt/jwt/v5 v5.3.1 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/kylelemons/godebug v1.1.0 // indirect + github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect + golang.org/x/crypto v0.48.0 // indirect + golang.org/x/net v0.50.0 // indirect + golang.org/x/sys v0.41.0 // indirect + golang.org/x/text v0.34.0 // indirect +) diff --git a/sdk/resourcemanager/domainregistration/armdomainregistration/go.sum b/sdk/resourcemanager/domainregistration/armdomainregistration/go.sum new file mode 100644 index 000000000000..055ab9800374 --- /dev/null +++ b/sdk/resourcemanager/domainregistration/armdomainregistration/go.sum @@ -0,0 +1,39 @@ +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.21.0 h1:fou+2+WFTib47nS+nz/ozhEBnvU96bKHy6LjRsY4E28= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.21.0/go.mod h1:t76Ruy8AHvUAC8GfMWJMa0ElSbuIcO03NLpynfbgsPA= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.13.1 h1:Hk5QBxZQC1jb2Fwj6mpzme37xbCDdNTxU7O9eb5+LB4= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.13.1/go.mod h1:IYus9qsFobWIc2YVwe/WPjcnyCkPKtnHAqUYeebc8z0= +github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.2 h1:yz1bePFlP5Vws5+8ez6T3HWXPmwOK7Yvq8QxDBD3SKY= +github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.2/go.mod h1:Pa9ZNPuoNu/GztvBSKk9J1cDJW6vk/n0zLtV4mgd8N8= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.2 h1:9iefClla7iYpfYWdzPCRDozdmndjTm8DXdpCzPajMgA= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.2/go.mod h1:XtLgD3ZD34DAaVIIAyG3objl5DynM3CQ/vMcbBNJZGI= +github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1 h1:WJTmL004Abzc5wDB5VtZG2PJk5ndYDgVacGqfirKxjM= +github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1/go.mod h1:tCcJZ0uHAmvjsVYzEFivsRTN00oz5BEsRgQHu5JZ9WE= +github.com/AzureAD/microsoft-authentication-library-for-go v1.6.0 h1:XRzhVemXdgvJqCH0sFfrBUTnUJSBrBf7++ypk+twtRs= +github.com/AzureAD/microsoft-authentication-library-for-go v1.6.0/go.mod h1:HKpQxkWaGLJ+D/5H8QRpyQXA1eKjxkFlOMwck5+33Jk= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/golang-jwt/jwt/v5 v5.3.1 h1:kYf81DTWFe7t+1VvL7eS+jKFVWaUnK9cB1qbwn63YCY= +github.com/golang-jwt/jwt/v5 v5.3.1/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/keybase/go-keychain v0.0.1 h1:way+bWYa6lDppZoZcgMbYsvC7GxljxrskdNInRtuthU= +github.com/keybase/go-keychain v0.0.1/go.mod h1:PdEILRW3i9D8JcdM+FmY6RwkHGnhHxXwkPPMeUgOK1k= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= +github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= +github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= +github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= +golang.org/x/crypto v0.48.0 h1:/VRzVqiRSggnhY7gNRxPauEQ5Drw9haKdM0jqfcCFts= +golang.org/x/crypto v0.48.0/go.mod h1:r0kV5h3qnFPlQnBSrULhlsRfryS2pmewsg+XfMgkVos= +golang.org/x/net v0.50.0 h1:ucWh9eiCGyDR3vtzso0WMQinm2Dnt8cFMuQa9K33J60= +golang.org/x/net v0.50.0/go.mod h1:UgoSli3F/pBgdJBHCTc+tp3gmrU4XswgGRgtnwWTfyM= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.41.0 h1:Ivj+2Cp/ylzLiEU89QhWblYnOE9zerudt9Ftecq2C6k= +golang.org/x/sys v0.41.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= +golang.org/x/text v0.34.0 h1:oL/Qq0Kdaqxa1KbNeMKwQq0reLCCaFtqu2eNuSeNHbk= +golang.org/x/text v0.34.0/go.mod h1:homfLqTYRFyVYemLBFl5GgL/DWEiH5wcsQ5gSh1yziA= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/domainregistration/armdomainregistration/models.go b/sdk/resourcemanager/domainregistration/armdomainregistration/models.go new file mode 100644 index 000000000000..653112127ce8 --- /dev/null +++ b/sdk/resourcemanager/domainregistration/armdomainregistration/models.go @@ -0,0 +1,606 @@ +// 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) Go Code Generator. DO NOT EDIT. + +package armdomainregistration + +import "time" + +// Address information for domain registration. +type Address struct { + // REQUIRED; First line of an Address. + Address1 *string + + // REQUIRED; The city for the address. + City *string + + // REQUIRED; The country for the address. + Country *string + + // REQUIRED; The postal code for the address. + PostalCode *string + + // REQUIRED; The state or province for the address. + State *string + + // The second line of the Address. Optional. + Address2 *string +} + +// Contact information for domain registration. If 'Domain Privacy' option is not selected then the contact information is +// made publicly available through the Whois +// directories as per ICANN requirements. +type Contact struct { + // REQUIRED; Email address. + Email *string + + // REQUIRED; First name. + NameFirst *string + + // REQUIRED; Last name. + NameLast *string + + // REQUIRED; Phone number. + Phone *string + + // Mailing address. + AddressMailing *Address + + // Fax number. + Fax *string + + // Job title. + JobTitle *string + + // Middle name. + NameMiddle *string + + // Organization contact belongs to. + Organization *string +} + +// CsmOperationCollection - Collection of Azure resource manager operation metadata. +type CsmOperationCollection struct { + // REQUIRED; Collection of resources. + Value []*CsmOperationDescription + + // READ-ONLY; Link to next page of resources. + NextLink *string +} + +// CsmOperationDescription - Description of an operation available for Microsoft.Web resource provider. +type CsmOperationDescription struct { + // Meta data about operation used for display in portal. + Display *CsmOperationDisplay + + // Operation display name. + IsDataAction *bool + + // Operation name, e.g. Microsoft.Web/sites/write. + Name *string + + // Origin of the operation, e.g. "system" or "user". + Origin *string + + // Properties available for a Microsoft.Web resource provider operation. + Properties *CsmOperationDescriptionProperties +} + +// CsmOperationDescriptionProperties - Properties available for a Microsoft.Web resource provider operation. +type CsmOperationDescriptionProperties struct { + // Resource metrics service provided by Microsoft.Insights resource provider. + ServiceSpecification *ServiceSpecification +} + +// CsmOperationDisplay - Meta data about operation used for display in portal. +type CsmOperationDisplay struct { + // Operation description. + Description *string + + // Operation name. + Operation *string + + // Provider name. + Provider *string + + // Resource type. + Resource *string +} + +// Dimension of a resource metric. For e.g. instance specific HTTP requests for a web app, +// where instance name is dimension of the metric HTTP request +type Dimension struct { + // Display name of the dimension. + DisplayName *string + + // Dimension of the internal name. + InternalName *string + + // Name of the dimension. + Name *string + + // Dimension to be exported for shoebox. + ToBeExportedForShoebox *bool +} + +// Domain - Information about a domain. +type Domain struct { + // REQUIRED; The geo-location where the resource lives + Location *string + + // Kind of resource + Kind *string + + // Domain resource specific properties + Properties *DomainProperties + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// DomainAvailabilityCheckResult - Domain availability check result. +type DomainAvailabilityCheckResult struct { + // true if domain can be purchased using CreateDomain API; otherwise, false. + Available *bool + + // Valid values are Regular domain: Azure will charge the full price of domain registration, SoftDeleted: Purchasing this + // domain will simply restore it and this operation will not cost anything. + DomainType *DomainType + + // Name of the domain. + Name *string +} + +// DomainCollection - Collection of domains. +type DomainCollection struct { + // REQUIRED; The Domain items on this page + Value []*Domain + + // The link to the next page of items + NextLink *string +} + +// DomainControlCenterSsoRequest - Single sign-on request information for domain management. +type DomainControlCenterSsoRequest struct { + // READ-ONLY; Post parameter key. + PostParameterKey *string + + // READ-ONLY; Post parameter value. Client should use 'application/x-www-form-urlencoded' encoding for this value. + PostParameterValue *string + + // READ-ONLY; URL where the single sign-on request is to be made. + URL *string +} + +// DomainOwnershipIdentifier - Domain ownership Identifier. +type DomainOwnershipIdentifier struct { + // Kind of resource + Kind *string + + // DomainOwnershipIdentifier resource specific properties + Properties *DomainOwnershipIdentifierProperties + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// DomainOwnershipIdentifierCollection - Collection of domain ownership identifiers. +type DomainOwnershipIdentifierCollection struct { + // REQUIRED; The DomainOwnershipIdentifier items on this page + Value []*DomainOwnershipIdentifier + + // The link to the next page of items + NextLink *string +} + +// DomainOwnershipIdentifierProperties - DomainOwnershipIdentifier resource specific properties +type DomainOwnershipIdentifierProperties struct { + // Ownership Id. + OwnershipID *string +} + +// DomainPatchResource - ARM resource for a domain. +type DomainPatchResource struct { + // Kind of resource. + Kind *string + + // DomainPatchResource resource specific properties + Properties *DomainPatchResourceProperties + + // READ-ONLY; Resource Id. + ID *string + + // READ-ONLY; Resource Name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// DomainPatchResourceProperties - DomainPatchResource resource specific properties +type DomainPatchResourceProperties struct { + // REQUIRED; Legal agreement consent. + Consent *DomainPurchaseConsent + + // REQUIRED; Administrative contact. + ContactAdmin *Contact + + // REQUIRED; Billing contact. + ContactBilling *Contact + + // REQUIRED; Registrant contact. + ContactRegistrant *Contact + + // REQUIRED; Technical contact. + ContactTech *Contact + + // Authorization code for the domain. + AuthCode *string + + // true if the domain should be automatically renewed; otherwise, false. + AutoRenew *bool + + // Current DNS type + DNSType *DNSType + + // Azure DNS Zone to use + DNSZoneID *string + + // true if domain privacy is enabled for this domain; otherwise, false. + Privacy *bool + + // Target DNS type (would be used for migration) + TargetDNSType *DNSType + + // READ-ONLY; Domain creation timestamp. + CreatedTime *time.Time + + // READ-ONLY; Reasons why domain is not renewable. + DomainNotRenewableReasons []*ResourceNotRenewableReason + + // READ-ONLY; Domain expiration timestamp. + ExpirationTime *time.Time + + // READ-ONLY; Timestamp when the domain was renewed last time. + LastRenewedTime *time.Time + + // READ-ONLY; All hostnames derived from the domain and assigned to Azure resources. + ManagedHostNames []*HostName + + // READ-ONLY; Name servers. + NameServers []*string + + // READ-ONLY; Domain provisioning state. + ProvisioningState *ProvisioningState + + // READ-ONLY; true if Azure can assign this domain to App Service apps; otherwise, false. This value + // will be true if domain registration status is active and \n it is hosted on name servers Azure has programmatic + // access to. + ReadyForDNSRecordManagement *bool + + // READ-ONLY; Domain registration status. + RegistrationStatus *DomainStatus +} + +// DomainProperties - Domain resource specific properties +type DomainProperties struct { + // REQUIRED; Legal agreement consent. + Consent *DomainPurchaseConsent + + // REQUIRED; Administrative contact. + ContactAdmin *Contact + + // REQUIRED; Billing contact. + ContactBilling *Contact + + // REQUIRED; Registrant contact. + ContactRegistrant *Contact + + // REQUIRED; Technical contact. + ContactTech *Contact + + // Authorization code for the domain. + AuthCode *string + + // true if the domain should be automatically renewed; otherwise, false. + AutoRenew *bool + + // Current DNS type + DNSType *DNSType + + // Azure DNS Zone to use + DNSZoneID *string + + // true if domain privacy is enabled for this domain; otherwise, false. + Privacy *bool + + // Target DNS type (would be used for migration) + TargetDNSType *DNSType + + // READ-ONLY; Domain creation timestamp. + CreatedTime *time.Time + + // READ-ONLY; Reasons why domain is not renewable. + DomainNotRenewableReasons []*ResourceNotRenewableReason + + // READ-ONLY; Domain expiration timestamp. + ExpirationTime *time.Time + + // READ-ONLY; Timestamp when the domain was renewed last time. + LastRenewedTime *time.Time + + // READ-ONLY; All hostnames derived from the domain and assigned to Azure resources. + ManagedHostNames []*HostName + + // READ-ONLY; Name servers. + NameServers []*string + + // READ-ONLY; Domain provisioning state. + ProvisioningState *ProvisioningState + + // READ-ONLY; true if Azure can assign this domain to App Service apps; otherwise, false. This value + // will be true if domain registration status is active and \n it is hosted on name servers Azure has programmatic + // access to. + ReadyForDNSRecordManagement *bool + + // READ-ONLY; Domain registration status. + RegistrationStatus *DomainStatus +} + +// DomainPurchaseConsent - Domain purchase consent object, representing acceptance of applicable legal agreements. +type DomainPurchaseConsent struct { + // Timestamp when the agreements were accepted. + AgreedAt *time.Time + + // Client IP address. + AgreedBy *string + + // List of applicable legal agreement keys. This list can be retrieved using ListLegalAgreements API under TopLevelDomain + // resource. + AgreementKeys []*string +} + +// DomainRecommendationSearchParameters - Domain recommendation search parameters. +type DomainRecommendationSearchParameters struct { + // Keywords to be used for generating domain recommendations. + Keywords *string + + // Maximum number of recommendations. + MaxDomainRecommendations *int32 +} + +// HostName - Details of a hostname derived from a domain. +type HostName struct { + // Name of the Azure resource the hostname is assigned to. If it is assigned to a Traffic Manager then it will be the Traffic + // Manager name otherwise it will be the app name. + AzureResourceName *string + + // Type of the Azure resource the hostname is assigned to. + AzureResourceType *AzureResourceType + + // Type of the DNS record. + CustomHostNameDNSRecordType *CustomHostNameDNSRecordType + + // Type of the hostname. + HostNameType *HostNameType + + // Name of the hostname. + Name *string + + // List of apps the hostname is assigned to. This list will have more than one app only if the hostname is pointing to a Traffic + // Manager. + SiteNames []*string +} + +// LogSpecification - Log Definition of a single resource metric. +type LogSpecification struct { + // Blob duration of the log. + BlobDuration *string + + // Display name of the log. + DisplayName *string + + // Log filtered pattern of the log. + LogFilterPattern *string + + // Name of the log. + Name *string +} + +// MetricAvailability - Retention policy of a resource metric. +type MetricAvailability struct { + // Metric availability blob duration. + BlobDuration *string + + // Metric availability time grain. + TimeGrain *string +} + +// MetricSpecification - Definition of a single resource metric. +type MetricSpecification struct { + // Resource metric aggregation type. + AggregationType *string + + // Resource metric availability. + Availabilities []*MetricAvailability + + // Resource metric category. + Category *string + + // Resource metric dimensions. + Dimensions []*Dimension + + // Description of the resource metric. + DisplayDescription *string + + // Display name of the resource metric. + DisplayName *string + + // Resource metric supported time grain types. + EnableRegionalMdmAccount *bool + + // Resource metric fill gap with zero. + FillGapWithZero *bool + + // Resource metric is internal. + IsInternal *bool + + // Resource metric filter pattern. + MetricFilterPattern *string + + // Name of the resource metric. + Name *string + + // Resource metric source MDM account. + SourceMdmAccount *string + + // Resource metric source MDM namespace. + SourceMdmNamespace *string + + // Resource metric supported aggregation types. + SupportedAggregationTypes []*string + + // Resource metric supported time grain types. + SupportedTimeGrainTypes []*string + + // Resource metric supported aggregation types. + SupportsInstanceLevelAggregation *bool + + // Resource metric unit. + Unit *string +} + +// NameIdentifier - Identifies an object. +type NameIdentifier struct { + // Name of the object. + Name *string +} + +// NameIdentifierCollection - Paged collection of NameIdentifier items +type NameIdentifierCollection struct { + // REQUIRED; The NameIdentifier items on this page + Value []*NameIdentifier + + // The link to the next page of items + NextLink *string +} + +// ServiceSpecification - Resource metrics service provided by Microsoft.Insights resource provider. +type ServiceSpecification struct { + // Resource logs service provided by Microsoft.Insights resource provider. + LogSpecifications []*LogSpecification + + // Resource metrics service name. + MetricSpecifications []*MetricSpecification +} + +// 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 +} + +// TldLegalAgreement - Legal agreement for a top level domain. +type TldLegalAgreement struct { + // REQUIRED; Unique identifier for the agreement. + AgreementKey *string + + // REQUIRED; Agreement details. + Content *string + + // REQUIRED; Agreement title. + Title *string + + // URL where a copy of the agreement details is hosted. + URL *string +} + +// TldLegalAgreementCollection - Paged collection of TldLegalAgreement items +type TldLegalAgreementCollection struct { + // REQUIRED; The TldLegalAgreement items on this page + Value []*TldLegalAgreement + + // The link to the next page of items + NextLink *string +} + +// TopLevelDomain - A top level domain object. +type TopLevelDomain struct { + // Kind of resource + Kind *string + + // TopLevelDomain resource specific properties + Properties *TopLevelDomainProperties + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// TopLevelDomainAgreementOption - Options for retrieving the list of top level domain legal agreements. +type TopLevelDomainAgreementOption struct { + // If true, then the list of agreements will include agreements for domain transfer as well; otherwise, false. + ForTransfer *bool + + // If true, then the list of agreements will include agreements for domain privacy as well; otherwise, false. + IncludePrivacy *bool +} + +// TopLevelDomainCollection - Collection of Top-level domains. +type TopLevelDomainCollection struct { + // REQUIRED; The TopLevelDomain items on this page + Value []*TopLevelDomain + + // The link to the next page of items + NextLink *string +} + +// TopLevelDomainProperties - TopLevelDomain resource specific properties +type TopLevelDomainProperties struct { + // If true, then the top level domain supports domain privacy; otherwise, false. + Privacy *bool +} diff --git a/sdk/resourcemanager/domainregistration/armdomainregistration/models_serde.go b/sdk/resourcemanager/domainregistration/armdomainregistration/models_serde.go new file mode 100644 index 000000000000..14cfef12693e --- /dev/null +++ b/sdk/resourcemanager/domainregistration/armdomainregistration/models_serde.go @@ -0,0 +1,1473 @@ +// 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) Go Code Generator. DO NOT EDIT. + +package armdomainregistration + +import ( + "encoding/json" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/datetime" + "reflect" + "time" +) + +// MarshalJSON implements the json.Marshaller interface for type Address. +func (a Address) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "address1", a.Address1) + populate(objectMap, "address2", a.Address2) + populate(objectMap, "city", a.City) + populate(objectMap, "country", a.Country) + populate(objectMap, "postalCode", a.PostalCode) + populate(objectMap, "state", a.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Address. +func (a *Address) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "address1": + err = unpopulate(val, "Address1", &a.Address1) + delete(rawMsg, key) + case "address2": + err = unpopulate(val, "Address2", &a.Address2) + delete(rawMsg, key) + case "city": + err = unpopulate(val, "City", &a.City) + delete(rawMsg, key) + case "country": + err = unpopulate(val, "Country", &a.Country) + delete(rawMsg, key) + case "postalCode": + err = unpopulate(val, "PostalCode", &a.PostalCode) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &a.State) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Contact. +func (c Contact) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "addressMailing", c.AddressMailing) + populate(objectMap, "email", c.Email) + populate(objectMap, "fax", c.Fax) + populate(objectMap, "jobTitle", c.JobTitle) + populate(objectMap, "nameFirst", c.NameFirst) + populate(objectMap, "nameLast", c.NameLast) + populate(objectMap, "nameMiddle", c.NameMiddle) + populate(objectMap, "organization", c.Organization) + populate(objectMap, "phone", c.Phone) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Contact. +func (c *Contact) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "addressMailing": + err = unpopulate(val, "AddressMailing", &c.AddressMailing) + delete(rawMsg, key) + case "email": + err = unpopulate(val, "Email", &c.Email) + delete(rawMsg, key) + case "fax": + err = unpopulate(val, "Fax", &c.Fax) + delete(rawMsg, key) + case "jobTitle": + err = unpopulate(val, "JobTitle", &c.JobTitle) + delete(rawMsg, key) + case "nameFirst": + err = unpopulate(val, "NameFirst", &c.NameFirst) + delete(rawMsg, key) + case "nameLast": + err = unpopulate(val, "NameLast", &c.NameLast) + delete(rawMsg, key) + case "nameMiddle": + err = unpopulate(val, "NameMiddle", &c.NameMiddle) + delete(rawMsg, key) + case "organization": + err = unpopulate(val, "Organization", &c.Organization) + delete(rawMsg, key) + case "phone": + err = unpopulate(val, "Phone", &c.Phone) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CsmOperationCollection. +func (c CsmOperationCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CsmOperationCollection. +func (c *CsmOperationCollection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &c.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CsmOperationDescription. +func (c CsmOperationDescription) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "display", c.Display) + populate(objectMap, "isDataAction", c.IsDataAction) + populate(objectMap, "name", c.Name) + populate(objectMap, "origin", c.Origin) + populate(objectMap, "properties", c.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CsmOperationDescription. +func (c *CsmOperationDescription) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "display": + err = unpopulate(val, "Display", &c.Display) + delete(rawMsg, key) + case "isDataAction": + err = unpopulate(val, "IsDataAction", &c.IsDataAction) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "origin": + err = unpopulate(val, "Origin", &c.Origin) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CsmOperationDescriptionProperties. +func (c CsmOperationDescriptionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "serviceSpecification", c.ServiceSpecification) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CsmOperationDescriptionProperties. +func (c *CsmOperationDescriptionProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "serviceSpecification": + err = unpopulate(val, "ServiceSpecification", &c.ServiceSpecification) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CsmOperationDisplay. +func (c CsmOperationDisplay) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", c.Description) + populate(objectMap, "operation", c.Operation) + populate(objectMap, "provider", c.Provider) + populate(objectMap, "resource", c.Resource) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CsmOperationDisplay. +func (c *CsmOperationDisplay) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &c.Description) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &c.Operation) + delete(rawMsg, key) + case "provider": + err = unpopulate(val, "Provider", &c.Provider) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &c.Resource) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Dimension. +func (d Dimension) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "displayName", d.DisplayName) + populate(objectMap, "internalName", d.InternalName) + populate(objectMap, "name", d.Name) + populate(objectMap, "toBeExportedForShoebox", d.ToBeExportedForShoebox) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Dimension. +func (d *Dimension) 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 "displayName": + err = unpopulate(val, "DisplayName", &d.DisplayName) + delete(rawMsg, key) + case "internalName": + err = unpopulate(val, "InternalName", &d.InternalName) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "toBeExportedForShoebox": + err = unpopulate(val, "ToBeExportedForShoebox", &d.ToBeExportedForShoebox) + 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 Domain. +func (d Domain) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", d.ID) + populate(objectMap, "kind", d.Kind) + populate(objectMap, "location", d.Location) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "systemData", d.SystemData) + populate(objectMap, "tags", d.Tags) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Domain. +func (d *Domain) 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 "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &d.Kind) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &d.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &d.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &d.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DomainAvailabilityCheckResult. +func (d DomainAvailabilityCheckResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "available", d.Available) + populate(objectMap, "domainType", d.DomainType) + populate(objectMap, "name", d.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DomainAvailabilityCheckResult. +func (d *DomainAvailabilityCheckResult) 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 "available": + err = unpopulate(val, "Available", &d.Available) + delete(rawMsg, key) + case "domainType": + err = unpopulate(val, "DomainType", &d.DomainType) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + 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 DomainCollection. +func (d DomainCollection) 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 DomainCollection. +func (d *DomainCollection) 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 DomainControlCenterSsoRequest. +func (d DomainControlCenterSsoRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "postParameterKey", d.PostParameterKey) + populate(objectMap, "postParameterValue", d.PostParameterValue) + populate(objectMap, "url", d.URL) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DomainControlCenterSsoRequest. +func (d *DomainControlCenterSsoRequest) 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 "postParameterKey": + err = unpopulate(val, "PostParameterKey", &d.PostParameterKey) + delete(rawMsg, key) + case "postParameterValue": + err = unpopulate(val, "PostParameterValue", &d.PostParameterValue) + delete(rawMsg, key) + case "url": + err = unpopulate(val, "URL", &d.URL) + 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 DomainOwnershipIdentifier. +func (d DomainOwnershipIdentifier) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", d.ID) + populate(objectMap, "kind", d.Kind) + 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 DomainOwnershipIdentifier. +func (d *DomainOwnershipIdentifier) 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 "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &d.Kind) + 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 DomainOwnershipIdentifierCollection. +func (d DomainOwnershipIdentifierCollection) 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 DomainOwnershipIdentifierCollection. +func (d *DomainOwnershipIdentifierCollection) 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 DomainOwnershipIdentifierProperties. +func (d DomainOwnershipIdentifierProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "ownershipId", d.OwnershipID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DomainOwnershipIdentifierProperties. +func (d *DomainOwnershipIdentifierProperties) 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 "ownershipId": + err = unpopulate(val, "OwnershipID", &d.OwnershipID) + 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 DomainPatchResource. +func (d DomainPatchResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", d.ID) + populate(objectMap, "kind", d.Kind) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DomainPatchResource. +func (d *DomainPatchResource) 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 "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &d.Kind) + 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 "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 DomainPatchResourceProperties. +func (d DomainPatchResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "authCode", d.AuthCode) + populate(objectMap, "autoRenew", d.AutoRenew) + populate(objectMap, "consent", d.Consent) + populate(objectMap, "contactAdmin", d.ContactAdmin) + populate(objectMap, "contactBilling", d.ContactBilling) + populate(objectMap, "contactRegistrant", d.ContactRegistrant) + populate(objectMap, "contactTech", d.ContactTech) + populateTime[datetime.RFC3339](objectMap, "createdTime", d.CreatedTime) + populate(objectMap, "dnsType", d.DNSType) + populate(objectMap, "dnsZoneId", d.DNSZoneID) + populate(objectMap, "domainNotRenewableReasons", d.DomainNotRenewableReasons) + populateTime[datetime.RFC3339](objectMap, "expirationTime", d.ExpirationTime) + populateTime[datetime.RFC3339](objectMap, "lastRenewedTime", d.LastRenewedTime) + populate(objectMap, "managedHostNames", d.ManagedHostNames) + populate(objectMap, "nameServers", d.NameServers) + populate(objectMap, "privacy", d.Privacy) + populate(objectMap, "provisioningState", d.ProvisioningState) + populate(objectMap, "readyForDnsRecordManagement", d.ReadyForDNSRecordManagement) + populate(objectMap, "registrationStatus", d.RegistrationStatus) + populate(objectMap, "targetDnsType", d.TargetDNSType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DomainPatchResourceProperties. +func (d *DomainPatchResourceProperties) 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 "authCode": + err = unpopulate(val, "AuthCode", &d.AuthCode) + delete(rawMsg, key) + case "autoRenew": + err = unpopulate(val, "AutoRenew", &d.AutoRenew) + delete(rawMsg, key) + case "consent": + err = unpopulate(val, "Consent", &d.Consent) + delete(rawMsg, key) + case "contactAdmin": + err = unpopulate(val, "ContactAdmin", &d.ContactAdmin) + delete(rawMsg, key) + case "contactBilling": + err = unpopulate(val, "ContactBilling", &d.ContactBilling) + delete(rawMsg, key) + case "contactRegistrant": + err = unpopulate(val, "ContactRegistrant", &d.ContactRegistrant) + delete(rawMsg, key) + case "contactTech": + err = unpopulate(val, "ContactTech", &d.ContactTech) + delete(rawMsg, key) + case "createdTime": + err = unpopulateTime[datetime.RFC3339](val, "CreatedTime", &d.CreatedTime) + delete(rawMsg, key) + case "dnsType": + err = unpopulate(val, "DNSType", &d.DNSType) + delete(rawMsg, key) + case "dnsZoneId": + err = unpopulate(val, "DNSZoneID", &d.DNSZoneID) + delete(rawMsg, key) + case "domainNotRenewableReasons": + err = unpopulate(val, "DomainNotRenewableReasons", &d.DomainNotRenewableReasons) + delete(rawMsg, key) + case "expirationTime": + err = unpopulateTime[datetime.RFC3339](val, "ExpirationTime", &d.ExpirationTime) + delete(rawMsg, key) + case "lastRenewedTime": + err = unpopulateTime[datetime.RFC3339](val, "LastRenewedTime", &d.LastRenewedTime) + delete(rawMsg, key) + case "managedHostNames": + err = unpopulate(val, "ManagedHostNames", &d.ManagedHostNames) + delete(rawMsg, key) + case "nameServers": + err = unpopulate(val, "NameServers", &d.NameServers) + delete(rawMsg, key) + case "privacy": + err = unpopulate(val, "Privacy", &d.Privacy) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) + delete(rawMsg, key) + case "readyForDnsRecordManagement": + err = unpopulate(val, "ReadyForDNSRecordManagement", &d.ReadyForDNSRecordManagement) + delete(rawMsg, key) + case "registrationStatus": + err = unpopulate(val, "RegistrationStatus", &d.RegistrationStatus) + delete(rawMsg, key) + case "targetDnsType": + err = unpopulate(val, "TargetDNSType", &d.TargetDNSType) + 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 DomainProperties. +func (d DomainProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "authCode", d.AuthCode) + populate(objectMap, "autoRenew", d.AutoRenew) + populate(objectMap, "consent", d.Consent) + populate(objectMap, "contactAdmin", d.ContactAdmin) + populate(objectMap, "contactBilling", d.ContactBilling) + populate(objectMap, "contactRegistrant", d.ContactRegistrant) + populate(objectMap, "contactTech", d.ContactTech) + populateTime[datetime.RFC3339](objectMap, "createdTime", d.CreatedTime) + populate(objectMap, "dnsType", d.DNSType) + populate(objectMap, "dnsZoneId", d.DNSZoneID) + populate(objectMap, "domainNotRenewableReasons", d.DomainNotRenewableReasons) + populateTime[datetime.RFC3339](objectMap, "expirationTime", d.ExpirationTime) + populateTime[datetime.RFC3339](objectMap, "lastRenewedTime", d.LastRenewedTime) + populate(objectMap, "managedHostNames", d.ManagedHostNames) + populate(objectMap, "nameServers", d.NameServers) + populate(objectMap, "privacy", d.Privacy) + populate(objectMap, "provisioningState", d.ProvisioningState) + populate(objectMap, "readyForDnsRecordManagement", d.ReadyForDNSRecordManagement) + populate(objectMap, "registrationStatus", d.RegistrationStatus) + populate(objectMap, "targetDnsType", d.TargetDNSType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DomainProperties. +func (d *DomainProperties) 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 "authCode": + err = unpopulate(val, "AuthCode", &d.AuthCode) + delete(rawMsg, key) + case "autoRenew": + err = unpopulate(val, "AutoRenew", &d.AutoRenew) + delete(rawMsg, key) + case "consent": + err = unpopulate(val, "Consent", &d.Consent) + delete(rawMsg, key) + case "contactAdmin": + err = unpopulate(val, "ContactAdmin", &d.ContactAdmin) + delete(rawMsg, key) + case "contactBilling": + err = unpopulate(val, "ContactBilling", &d.ContactBilling) + delete(rawMsg, key) + case "contactRegistrant": + err = unpopulate(val, "ContactRegistrant", &d.ContactRegistrant) + delete(rawMsg, key) + case "contactTech": + err = unpopulate(val, "ContactTech", &d.ContactTech) + delete(rawMsg, key) + case "createdTime": + err = unpopulateTime[datetime.RFC3339](val, "CreatedTime", &d.CreatedTime) + delete(rawMsg, key) + case "dnsType": + err = unpopulate(val, "DNSType", &d.DNSType) + delete(rawMsg, key) + case "dnsZoneId": + err = unpopulate(val, "DNSZoneID", &d.DNSZoneID) + delete(rawMsg, key) + case "domainNotRenewableReasons": + err = unpopulate(val, "DomainNotRenewableReasons", &d.DomainNotRenewableReasons) + delete(rawMsg, key) + case "expirationTime": + err = unpopulateTime[datetime.RFC3339](val, "ExpirationTime", &d.ExpirationTime) + delete(rawMsg, key) + case "lastRenewedTime": + err = unpopulateTime[datetime.RFC3339](val, "LastRenewedTime", &d.LastRenewedTime) + delete(rawMsg, key) + case "managedHostNames": + err = unpopulate(val, "ManagedHostNames", &d.ManagedHostNames) + delete(rawMsg, key) + case "nameServers": + err = unpopulate(val, "NameServers", &d.NameServers) + delete(rawMsg, key) + case "privacy": + err = unpopulate(val, "Privacy", &d.Privacy) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) + delete(rawMsg, key) + case "readyForDnsRecordManagement": + err = unpopulate(val, "ReadyForDNSRecordManagement", &d.ReadyForDNSRecordManagement) + delete(rawMsg, key) + case "registrationStatus": + err = unpopulate(val, "RegistrationStatus", &d.RegistrationStatus) + delete(rawMsg, key) + case "targetDnsType": + err = unpopulate(val, "TargetDNSType", &d.TargetDNSType) + 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 DomainPurchaseConsent. +func (d DomainPurchaseConsent) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTime[datetime.RFC3339](objectMap, "agreedAt", d.AgreedAt) + populate(objectMap, "agreedBy", d.AgreedBy) + populate(objectMap, "agreementKeys", d.AgreementKeys) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DomainPurchaseConsent. +func (d *DomainPurchaseConsent) 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 "agreedAt": + err = unpopulateTime[datetime.RFC3339](val, "AgreedAt", &d.AgreedAt) + delete(rawMsg, key) + case "agreedBy": + err = unpopulate(val, "AgreedBy", &d.AgreedBy) + delete(rawMsg, key) + case "agreementKeys": + err = unpopulate(val, "AgreementKeys", &d.AgreementKeys) + 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 DomainRecommendationSearchParameters. +func (d DomainRecommendationSearchParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "keywords", d.Keywords) + populate(objectMap, "maxDomainRecommendations", d.MaxDomainRecommendations) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DomainRecommendationSearchParameters. +func (d *DomainRecommendationSearchParameters) 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 "keywords": + err = unpopulate(val, "Keywords", &d.Keywords) + delete(rawMsg, key) + case "maxDomainRecommendations": + err = unpopulate(val, "MaxDomainRecommendations", &d.MaxDomainRecommendations) + 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 HostName. +func (h HostName) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "azureResourceName", h.AzureResourceName) + populate(objectMap, "azureResourceType", h.AzureResourceType) + populate(objectMap, "customHostNameDnsRecordType", h.CustomHostNameDNSRecordType) + populate(objectMap, "hostNameType", h.HostNameType) + populate(objectMap, "name", h.Name) + populate(objectMap, "siteNames", h.SiteNames) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HostName. +func (h *HostName) 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", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "azureResourceName": + err = unpopulate(val, "AzureResourceName", &h.AzureResourceName) + delete(rawMsg, key) + case "azureResourceType": + err = unpopulate(val, "AzureResourceType", &h.AzureResourceType) + delete(rawMsg, key) + case "customHostNameDnsRecordType": + err = unpopulate(val, "CustomHostNameDNSRecordType", &h.CustomHostNameDNSRecordType) + delete(rawMsg, key) + case "hostNameType": + err = unpopulate(val, "HostNameType", &h.HostNameType) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &h.Name) + delete(rawMsg, key) + case "siteNames": + err = unpopulate(val, "SiteNames", &h.SiteNames) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LogSpecification. +func (l LogSpecification) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "blobDuration", l.BlobDuration) + populate(objectMap, "displayName", l.DisplayName) + populate(objectMap, "logFilterPattern", l.LogFilterPattern) + populate(objectMap, "name", l.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LogSpecification. +func (l *LogSpecification) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "blobDuration": + err = unpopulate(val, "BlobDuration", &l.BlobDuration) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &l.DisplayName) + delete(rawMsg, key) + case "logFilterPattern": + err = unpopulate(val, "LogFilterPattern", &l.LogFilterPattern) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &l.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MetricAvailability. +func (m MetricAvailability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "blobDuration", m.BlobDuration) + populate(objectMap, "timeGrain", m.TimeGrain) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MetricAvailability. +func (m *MetricAvailability) 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", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "blobDuration": + err = unpopulate(val, "BlobDuration", &m.BlobDuration) + delete(rawMsg, key) + case "timeGrain": + err = unpopulate(val, "TimeGrain", &m.TimeGrain) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MetricSpecification. +func (m MetricSpecification) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "aggregationType", m.AggregationType) + populate(objectMap, "availabilities", m.Availabilities) + populate(objectMap, "category", m.Category) + populate(objectMap, "dimensions", m.Dimensions) + populate(objectMap, "displayDescription", m.DisplayDescription) + populate(objectMap, "displayName", m.DisplayName) + populate(objectMap, "enableRegionalMdmAccount", m.EnableRegionalMdmAccount) + populate(objectMap, "fillGapWithZero", m.FillGapWithZero) + populate(objectMap, "isInternal", m.IsInternal) + populate(objectMap, "metricFilterPattern", m.MetricFilterPattern) + populate(objectMap, "name", m.Name) + populate(objectMap, "sourceMdmAccount", m.SourceMdmAccount) + populate(objectMap, "sourceMdmNamespace", m.SourceMdmNamespace) + populate(objectMap, "supportedAggregationTypes", m.SupportedAggregationTypes) + populate(objectMap, "supportedTimeGrainTypes", m.SupportedTimeGrainTypes) + populate(objectMap, "supportsInstanceLevelAggregation", m.SupportsInstanceLevelAggregation) + populate(objectMap, "unit", m.Unit) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MetricSpecification. +func (m *MetricSpecification) 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", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "aggregationType": + err = unpopulate(val, "AggregationType", &m.AggregationType) + delete(rawMsg, key) + case "availabilities": + err = unpopulate(val, "Availabilities", &m.Availabilities) + delete(rawMsg, key) + case "category": + err = unpopulate(val, "Category", &m.Category) + delete(rawMsg, key) + case "dimensions": + err = unpopulate(val, "Dimensions", &m.Dimensions) + delete(rawMsg, key) + case "displayDescription": + err = unpopulate(val, "DisplayDescription", &m.DisplayDescription) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &m.DisplayName) + delete(rawMsg, key) + case "enableRegionalMdmAccount": + err = unpopulate(val, "EnableRegionalMdmAccount", &m.EnableRegionalMdmAccount) + delete(rawMsg, key) + case "fillGapWithZero": + err = unpopulate(val, "FillGapWithZero", &m.FillGapWithZero) + delete(rawMsg, key) + case "isInternal": + err = unpopulate(val, "IsInternal", &m.IsInternal) + delete(rawMsg, key) + case "metricFilterPattern": + err = unpopulate(val, "MetricFilterPattern", &m.MetricFilterPattern) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "sourceMdmAccount": + err = unpopulate(val, "SourceMdmAccount", &m.SourceMdmAccount) + delete(rawMsg, key) + case "sourceMdmNamespace": + err = unpopulate(val, "SourceMdmNamespace", &m.SourceMdmNamespace) + delete(rawMsg, key) + case "supportedAggregationTypes": + err = unpopulate(val, "SupportedAggregationTypes", &m.SupportedAggregationTypes) + delete(rawMsg, key) + case "supportedTimeGrainTypes": + err = unpopulate(val, "SupportedTimeGrainTypes", &m.SupportedTimeGrainTypes) + delete(rawMsg, key) + case "supportsInstanceLevelAggregation": + err = unpopulate(val, "SupportsInstanceLevelAggregation", &m.SupportsInstanceLevelAggregation) + delete(rawMsg, key) + case "unit": + err = unpopulate(val, "Unit", &m.Unit) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NameIdentifier. +func (n NameIdentifier) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", n.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NameIdentifier. +func (n *NameIdentifier) 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 "name": + err = unpopulate(val, "Name", &n.Name) + 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 NameIdentifierCollection. +func (n NameIdentifierCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", n.NextLink) + populate(objectMap, "value", n.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NameIdentifierCollection. +func (n *NameIdentifierCollection) 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 "nextLink": + err = unpopulate(val, "NextLink", &n.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &n.Value) + 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 ServiceSpecification. +func (s ServiceSpecification) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "logSpecifications", s.LogSpecifications) + populate(objectMap, "metricSpecifications", s.MetricSpecifications) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceSpecification. +func (s *ServiceSpecification) 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 "logSpecifications": + err = unpopulate(val, "LogSpecifications", &s.LogSpecifications) + delete(rawMsg, key) + case "metricSpecifications": + err = unpopulate(val, "MetricSpecifications", &s.MetricSpecifications) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SystemData. +func (s SystemData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTime[datetime.RFC3339](objectMap, "createdAt", s.CreatedAt) + populate(objectMap, "createdBy", s.CreatedBy) + populate(objectMap, "createdByType", s.CreatedByType) + populateTime[datetime.RFC3339](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 = unpopulateTime[datetime.RFC3339](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 = unpopulateTime[datetime.RFC3339](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 TldLegalAgreement. +func (t TldLegalAgreement) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "agreementKey", t.AgreementKey) + populate(objectMap, "content", t.Content) + populate(objectMap, "title", t.Title) + populate(objectMap, "url", t.URL) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TldLegalAgreement. +func (t *TldLegalAgreement) 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 "agreementKey": + err = unpopulate(val, "AgreementKey", &t.AgreementKey) + delete(rawMsg, key) + case "content": + err = unpopulate(val, "Content", &t.Content) + delete(rawMsg, key) + case "title": + err = unpopulate(val, "Title", &t.Title) + delete(rawMsg, key) + case "url": + err = unpopulate(val, "URL", &t.URL) + 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 TldLegalAgreementCollection. +func (t TldLegalAgreementCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", t.NextLink) + populate(objectMap, "value", t.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TldLegalAgreementCollection. +func (t *TldLegalAgreementCollection) 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 "nextLink": + err = unpopulate(val, "NextLink", &t.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &t.Value) + 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 TopLevelDomain. +func (t TopLevelDomain) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", t.ID) + populate(objectMap, "kind", t.Kind) + populate(objectMap, "name", t.Name) + populate(objectMap, "properties", t.Properties) + populate(objectMap, "systemData", t.SystemData) + populate(objectMap, "type", t.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TopLevelDomain. +func (t *TopLevelDomain) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &t.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &t.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &t.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &t.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &t.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &t.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TopLevelDomainAgreementOption. +func (t TopLevelDomainAgreementOption) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "forTransfer", t.ForTransfer) + populate(objectMap, "includePrivacy", t.IncludePrivacy) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TopLevelDomainAgreementOption. +func (t *TopLevelDomainAgreementOption) 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 "forTransfer": + err = unpopulate(val, "ForTransfer", &t.ForTransfer) + delete(rawMsg, key) + case "includePrivacy": + err = unpopulate(val, "IncludePrivacy", &t.IncludePrivacy) + 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 TopLevelDomainCollection. +func (t TopLevelDomainCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", t.NextLink) + populate(objectMap, "value", t.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TopLevelDomainCollection. +func (t *TopLevelDomainCollection) 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 "nextLink": + err = unpopulate(val, "NextLink", &t.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &t.Value) + 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 TopLevelDomainProperties. +func (t TopLevelDomainProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "privacy", t.Privacy) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TopLevelDomainProperties. +func (t *TopLevelDomainProperties) 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 "privacy": + err = unpopulate(val, "Privacy", &t.Privacy) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +func populate(m map[string]any, k string, v any) { + if v == nil { + return + } else if azcore.IsNullValue(v) { + m[k] = nil + } else if !reflect.ValueOf(v).IsNil() { + m[k] = v + } +} + +func populateTime[T dateTimeConstraints](m map[string]any, k string, t *time.Time) { + if t == nil { + return + } else if azcore.IsNullValue(t) { + m[k] = nil + } else if !reflect.ValueOf(t).IsNil() { + newTime := T(*t) + m[k] = (*T)(&newTime) + } +} + +func unpopulate(data json.RawMessage, fn string, v any) error { + if data == nil || string(data) == "null" { + return nil + } + if err := json.Unmarshal(data, v); err != nil { + return fmt.Errorf("struct field %s: %v", fn, err) + } + return nil +} + +func unpopulateTime[T dateTimeConstraints](data json.RawMessage, fn string, t **time.Time) error { + if data == nil || string(data) == "null" { + return nil + } + var aux T + if err := json.Unmarshal(data, &aux); err != nil { + return fmt.Errorf("struct field %s: %v", fn, err) + } + newTime := time.Time(aux) + *t = &newTime + return nil +} + +type dateTimeConstraints interface { + datetime.PlainDate | datetime.PlainTime | datetime.RFC1123 | datetime.RFC3339 | datetime.Unix +} diff --git a/sdk/resourcemanager/domainregistration/armdomainregistration/options.go b/sdk/resourcemanager/domainregistration/armdomainregistration/options.go new file mode 100644 index 000000000000..3dde9c9de27f --- /dev/null +++ b/sdk/resourcemanager/domainregistration/armdomainregistration/options.go @@ -0,0 +1,117 @@ +// 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) Go Code Generator. DO NOT EDIT. + +package armdomainregistration + +// DomainsClientBeginCreateOrUpdateOptions contains the optional parameters for the DomainsClient.BeginCreateOrUpdate method. +type DomainsClientBeginCreateOrUpdateOptions struct { + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// DomainsClientCheckAvailabilityOptions contains the optional parameters for the DomainsClient.CheckAvailability method. +type DomainsClientCheckAvailabilityOptions struct { + // placeholder for future optional parameters +} + +// DomainsClientCreateOrUpdateOwnershipIdentifierOptions contains the optional parameters for the DomainsClient.CreateOrUpdateOwnershipIdentifier +// method. +type DomainsClientCreateOrUpdateOwnershipIdentifierOptions struct { + // placeholder for future optional parameters +} + +// DomainsClientDeleteOptions contains the optional parameters for the DomainsClient.Delete method. +type DomainsClientDeleteOptions struct { + // Specify true to delete the domain immediately. The default is false which deletes the domain + // after 24 hours. + ForceHardDeleteDomain *bool +} + +// DomainsClientDeleteOwnershipIdentifierOptions contains the optional parameters for the DomainsClient.DeleteOwnershipIdentifier +// method. +type DomainsClientDeleteOwnershipIdentifierOptions struct { + // placeholder for future optional parameters +} + +// DomainsClientGetControlCenterSsoRequestOptions contains the optional parameters for the DomainsClient.GetControlCenterSsoRequest +// method. +type DomainsClientGetControlCenterSsoRequestOptions struct { + // placeholder for future optional parameters +} + +// DomainsClientGetOptions contains the optional parameters for the DomainsClient.Get method. +type DomainsClientGetOptions struct { + // placeholder for future optional parameters +} + +// DomainsClientGetOwnershipIdentifierOptions contains the optional parameters for the DomainsClient.GetOwnershipIdentifier +// method. +type DomainsClientGetOwnershipIdentifierOptions struct { + // placeholder for future optional parameters +} + +// DomainsClientListByResourceGroupOptions contains the optional parameters for the DomainsClient.NewListByResourceGroupPager +// method. +type DomainsClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// DomainsClientListOptions contains the optional parameters for the DomainsClient.NewListPager method. +type DomainsClientListOptions struct { + // placeholder for future optional parameters +} + +// DomainsClientListOwnershipIdentifiersOptions contains the optional parameters for the DomainsClient.NewListOwnershipIdentifiersPager +// method. +type DomainsClientListOwnershipIdentifiersOptions struct { + // placeholder for future optional parameters +} + +// DomainsClientListRecommendationsOptions contains the optional parameters for the DomainsClient.NewListRecommendationsPager +// method. +type DomainsClientListRecommendationsOptions struct { + // placeholder for future optional parameters +} + +// DomainsClientRenewOptions contains the optional parameters for the DomainsClient.Renew method. +type DomainsClientRenewOptions struct { + // placeholder for future optional parameters +} + +// DomainsClientTransferOutOptions contains the optional parameters for the DomainsClient.TransferOut method. +type DomainsClientTransferOutOptions struct { + // placeholder for future optional parameters +} + +// DomainsClientUpdateOptions contains the optional parameters for the DomainsClient.Update method. +type DomainsClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// DomainsClientUpdateOwnershipIdentifierOptions contains the optional parameters for the DomainsClient.UpdateOwnershipIdentifier +// method. +type DomainsClientUpdateOwnershipIdentifierOptions struct { + // placeholder for future optional parameters +} + +// ProviderClientListOperationsOptions contains the optional parameters for the ProviderClient.NewListOperationsPager method. +type ProviderClientListOperationsOptions struct { + // placeholder for future optional parameters +} + +// TopLevelDomainsClientGetOptions contains the optional parameters for the TopLevelDomainsClient.Get method. +type TopLevelDomainsClientGetOptions struct { + // placeholder for future optional parameters +} + +// TopLevelDomainsClientListAgreementsOptions contains the optional parameters for the TopLevelDomainsClient.NewListAgreementsPager +// method. +type TopLevelDomainsClientListAgreementsOptions struct { + // placeholder for future optional parameters +} + +// TopLevelDomainsClientListOptions contains the optional parameters for the TopLevelDomainsClient.NewListPager method. +type TopLevelDomainsClientListOptions struct { + // placeholder for future optional parameters +} diff --git a/sdk/resourcemanager/domainregistration/armdomainregistration/provider_client.go b/sdk/resourcemanager/domainregistration/armdomainregistration/provider_client.go new file mode 100644 index 000000000000..cf5ab3fbe8ec --- /dev/null +++ b/sdk/resourcemanager/domainregistration/armdomainregistration/provider_client.go @@ -0,0 +1,87 @@ +// 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) Go Code Generator. DO NOT EDIT. + +package armdomainregistration + +import ( + "context" + "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" +) + +// ProviderClient contains the methods for the Provider group. +// Don't use this type directly, use NewProviderClient() instead. +type ProviderClient struct { + internal *arm.Client +} + +// NewProviderClient creates a new instance of ProviderClient with the specified values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - Contains optional client configuration. Pass nil to accept the default values. +func NewProviderClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*ProviderClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ProviderClient{ + internal: cl, + } + return client, nil +} + +// NewListOperationsPager - Implements Csm operations Api to exposes the list of available Csm Apis under the resource provider +// +// # Description for Implements Csm operations Api to exposes the list of available Csm Apis under the resource provider +// +// Generated from API version 2024-11-01 +// - options - ProviderClientListOperationsOptions contains the optional parameters for the ProviderClient.NewListOperationsPager +// method. +func (client *ProviderClient) NewListOperationsPager(options *ProviderClientListOperationsOptions) *runtime.Pager[ProviderClientListOperationsResponse] { + return runtime.NewPager(runtime.PagingHandler[ProviderClientListOperationsResponse]{ + More: func(page ProviderClientListOperationsResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ProviderClientListOperationsResponse) (ProviderClientListOperationsResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ProviderClient.NewListOperationsPager") + 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.listOperationsCreateRequest(ctx, options) + }, nil) + if err != nil { + return ProviderClientListOperationsResponse{}, err + } + return client.listOperationsHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listOperationsCreateRequest creates the ListOperations request. +func (client *ProviderClient) listOperationsCreateRequest(ctx context.Context, _ *ProviderClientListOperationsOptions) (*policy.Request, error) { + urlPath := "/providers/Microsoft.DomainRegistration/operations" + 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", "2024-11-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listOperationsHandleResponse handles the ListOperations response. +func (client *ProviderClient) listOperationsHandleResponse(resp *http.Response) (ProviderClientListOperationsResponse, error) { + result := ProviderClientListOperationsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.CsmOperationCollection); err != nil { + return ProviderClientListOperationsResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/domainregistration/armdomainregistration/provider_client_example_test.go b/sdk/resourcemanager/domainregistration/armdomainregistration/provider_client_example_test.go new file mode 100644 index 000000000000..b938b5ccbeb8 --- /dev/null +++ b/sdk/resourcemanager/domainregistration/armdomainregistration/provider_client_example_test.go @@ -0,0 +1,133 @@ +// 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) Go Code Generator. DO NOT EDIT. + +package armdomainregistration_test + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/domainregistration/armdomainregistration" + "log" +) + +// Generated from example definition: 2024-11-01/ListOperations.json +func ExampleProviderClient_NewListOperationsPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armdomainregistration.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewProviderClient().NewListOperationsPager(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 = armdomainregistration.ProviderClientListOperationsResponse{ + // CsmOperationCollection: armdomainregistration.CsmOperationCollection{ + // Value: []*armdomainregistration.CsmOperationDescription{ + // { + // Name: to.Ptr("Microsoft.DomainRegistration/domains/Read"), + // Display: &armdomainregistration.CsmOperationDisplay{ + // Description: to.Ptr("Get the list of domains"), + // Operation: to.Ptr("Get Domains"), + // Provider: to.Ptr("Microsoft Domains"), + // Resource: to.Ptr("Domain"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.DomainRegistration/domains/Write"), + // Display: &armdomainregistration.CsmOperationDisplay{ + // Description: to.Ptr("Add a new Domain or update an existing one"), + // Operation: to.Ptr("Add or Update Domain"), + // Provider: to.Ptr("Microsoft Domains"), + // Resource: to.Ptr("Domain"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.DomainRegistration/domains/Delete"), + // Display: &armdomainregistration.CsmOperationDisplay{ + // Description: to.Ptr("Delete an existing domain."), + // Operation: to.Ptr("Delete Domain"), + // Provider: to.Ptr("Microsoft Domains"), + // Resource: to.Ptr("Domain"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.DomainRegistration/domains/operationresults/Read"), + // Display: &armdomainregistration.CsmOperationDisplay{ + // Description: to.Ptr("Get a domain operation"), + // Operation: to.Ptr("Get Domain Operation"), + // Provider: to.Ptr("Microsoft Domains"), + // Resource: to.Ptr("Domain operation"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.DomainRegistration/generateSsoRequest/Action"), + // Display: &armdomainregistration.CsmOperationDisplay{ + // Description: to.Ptr("Generate a request for signing into domain control center."), + // Operation: to.Ptr("Generate Domain Control Center Single Sign On Request"), + // Provider: to.Ptr("Microsoft Domains"), + // Resource: to.Ptr("Domain Control Center Single Sign On Request"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.DomainRegistration/validateDomainRegistrationInformation/Action"), + // Display: &armdomainregistration.CsmOperationDisplay{ + // Description: to.Ptr("Validate domain purchase object without submitting it"), + // Operation: to.Ptr("Domain Purchase Info Validation"), + // Provider: to.Ptr("Microsoft Domains"), + // Resource: to.Ptr("Domain Validation"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.DomainRegistration/checkDomainAvailability/Action"), + // Display: &armdomainregistration.CsmOperationDisplay{ + // Description: to.Ptr("Check if a domain is available for purchase"), + // Operation: to.Ptr("Check Domain Availability"), + // Provider: to.Ptr("Microsoft Domains"), + // Resource: to.Ptr("Domain Availability Result"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.DomainRegistration/listDomainRecommendations/Action"), + // Display: &armdomainregistration.CsmOperationDisplay{ + // Description: to.Ptr("Retrieve the list domain recommendations based on keywords"), + // Operation: to.Ptr("Retrieve Domain Recommendations"), + // Provider: to.Ptr("Microsoft Domains"), + // Resource: to.Ptr("Domain Recommendations"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.DomainRegistration/register/action"), + // Display: &armdomainregistration.CsmOperationDisplay{ + // Description: to.Ptr("Register the Microsoft Domains resource provider for the subscription"), + // Operation: to.Ptr("Register Microsoft Domains resource provider"), + // Provider: to.Ptr("Microsoft Domains"), + // Resource: to.Ptr("Microsoft Domains resource provider"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // }, + // }, + // } + } +} diff --git a/sdk/resourcemanager/domainregistration/armdomainregistration/responses.go b/sdk/resourcemanager/domainregistration/armdomainregistration/responses.go new file mode 100644 index 000000000000..f0d0a66ff199 --- /dev/null +++ b/sdk/resourcemanager/domainregistration/armdomainregistration/responses.go @@ -0,0 +1,126 @@ +// 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) Go Code Generator. DO NOT EDIT. + +package armdomainregistration + +// DomainsClientCheckAvailabilityResponse contains the response from method DomainsClient.CheckAvailability. +type DomainsClientCheckAvailabilityResponse struct { + // Domain availability check result. + DomainAvailabilityCheckResult +} + +// DomainsClientCreateOrUpdateOwnershipIdentifierResponse contains the response from method DomainsClient.CreateOrUpdateOwnershipIdentifier. +type DomainsClientCreateOrUpdateOwnershipIdentifierResponse struct { + // Domain ownership Identifier. + DomainOwnershipIdentifier +} + +// DomainsClientCreateOrUpdateResponse contains the response from method DomainsClient.BeginCreateOrUpdate. +type DomainsClientCreateOrUpdateResponse struct { + // Information about a domain. + Domain +} + +// DomainsClientDeleteOwnershipIdentifierResponse contains the response from method DomainsClient.DeleteOwnershipIdentifier. +type DomainsClientDeleteOwnershipIdentifierResponse struct { + // placeholder for future response values +} + +// DomainsClientDeleteResponse contains the response from method DomainsClient.Delete. +type DomainsClientDeleteResponse struct { + // placeholder for future response values +} + +// DomainsClientGetControlCenterSsoRequestResponse contains the response from method DomainsClient.GetControlCenterSsoRequest. +type DomainsClientGetControlCenterSsoRequestResponse struct { + // Single sign-on request information for domain management. + DomainControlCenterSsoRequest +} + +// DomainsClientGetOwnershipIdentifierResponse contains the response from method DomainsClient.GetOwnershipIdentifier. +type DomainsClientGetOwnershipIdentifierResponse struct { + // Domain ownership Identifier. + DomainOwnershipIdentifier +} + +// DomainsClientGetResponse contains the response from method DomainsClient.Get. +type DomainsClientGetResponse struct { + // Information about a domain. + Domain +} + +// DomainsClientListByResourceGroupResponse contains the response from method DomainsClient.NewListByResourceGroupPager. +type DomainsClientListByResourceGroupResponse struct { + // Collection of domains. + DomainCollection +} + +// DomainsClientListOwnershipIdentifiersResponse contains the response from method DomainsClient.NewListOwnershipIdentifiersPager. +type DomainsClientListOwnershipIdentifiersResponse struct { + // Collection of domain ownership identifiers. + DomainOwnershipIdentifierCollection +} + +// DomainsClientListRecommendationsResponse contains the response from method DomainsClient.NewListRecommendationsPager. +type DomainsClientListRecommendationsResponse struct { + // Paged collection of NameIdentifier items + NameIdentifierCollection +} + +// DomainsClientListResponse contains the response from method DomainsClient.NewListPager. +type DomainsClientListResponse struct { + // Collection of domains. + DomainCollection +} + +// DomainsClientRenewResponse contains the response from method DomainsClient.Renew. +type DomainsClientRenewResponse struct { + // The Retry-After header can indicate how long the client should wait before polling the operation status. + RetryAfter *int32 +} + +// DomainsClientTransferOutResponse contains the response from method DomainsClient.TransferOut. +type DomainsClientTransferOutResponse struct { + // Information about a domain. + Domain +} + +// DomainsClientUpdateOwnershipIdentifierResponse contains the response from method DomainsClient.UpdateOwnershipIdentifier. +type DomainsClientUpdateOwnershipIdentifierResponse struct { + // Domain ownership Identifier. + DomainOwnershipIdentifier +} + +// DomainsClientUpdateResponse contains the response from method DomainsClient.Update. +type DomainsClientUpdateResponse struct { + // Information about a domain. + Domain + + // The Retry-After header can indicate how long the client should wait before polling the operation status. + RetryAfter *int32 +} + +// ProviderClientListOperationsResponse contains the response from method ProviderClient.NewListOperationsPager. +type ProviderClientListOperationsResponse struct { + // Collection of Azure resource manager operation metadata. + CsmOperationCollection +} + +// TopLevelDomainsClientGetResponse contains the response from method TopLevelDomainsClient.Get. +type TopLevelDomainsClientGetResponse struct { + // A top level domain object. + TopLevelDomain +} + +// TopLevelDomainsClientListAgreementsResponse contains the response from method TopLevelDomainsClient.NewListAgreementsPager. +type TopLevelDomainsClientListAgreementsResponse struct { + // Paged collection of TldLegalAgreement items + TldLegalAgreementCollection +} + +// TopLevelDomainsClientListResponse contains the response from method TopLevelDomainsClient.NewListPager. +type TopLevelDomainsClientListResponse struct { + // Collection of Top-level domains. + TopLevelDomainCollection +} diff --git a/sdk/resourcemanager/domainregistration/armdomainregistration/testdata/_metadata.json b/sdk/resourcemanager/domainregistration/armdomainregistration/testdata/_metadata.json new file mode 100644 index 000000000000..803e28732007 --- /dev/null +++ b/sdk/resourcemanager/domainregistration/armdomainregistration/testdata/_metadata.json @@ -0,0 +1,4 @@ +{ + "apiVersion": "2024-11-01", + "emitterVersion": "0.9.2" +} diff --git a/sdk/resourcemanager/domainregistration/armdomainregistration/topleveldomains_client.go b/sdk/resourcemanager/domainregistration/armdomainregistration/topleveldomains_client.go new file mode 100644 index 000000000000..bd272438e58a --- /dev/null +++ b/sdk/resourcemanager/domainregistration/armdomainregistration/topleveldomains_client.go @@ -0,0 +1,225 @@ +// 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) Go Code Generator. DO NOT EDIT. + +package armdomainregistration + +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" +) + +// TopLevelDomainsClient contains the methods for the TopLevelDomains group. +// Don't use this type directly, use NewTopLevelDomainsClient() instead. +type TopLevelDomainsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewTopLevelDomainsClient creates a new instance of TopLevelDomainsClient with the specified values. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - Contains optional client configuration. Pass nil to accept the default values. +func NewTopLevelDomainsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TopLevelDomainsClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &TopLevelDomainsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Get - Get details of a top-level domain. +// +// Description for Get details of a top-level domain. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-11-01 +// - name - Name of the top-level domain. +// - options - TopLevelDomainsClientGetOptions contains the optional parameters for the TopLevelDomainsClient.Get method. +func (client *TopLevelDomainsClient) Get(ctx context.Context, name string, options *TopLevelDomainsClientGetOptions) (TopLevelDomainsClientGetResponse, error) { + var err error + const operationName = "TopLevelDomainsClient.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, name, options) + if err != nil { + return TopLevelDomainsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return TopLevelDomainsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return TopLevelDomainsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *TopLevelDomainsClient) getCreateRequest(ctx context.Context, name string, _ *TopLevelDomainsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/topLevelDomains/{name}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + 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", "2024-11-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *TopLevelDomainsClient) getHandleResponse(resp *http.Response) (TopLevelDomainsClientGetResponse, error) { + result := TopLevelDomainsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.TopLevelDomain); err != nil { + return TopLevelDomainsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Get all top-level domains supported for registration. +// +// Description for Get all top-level domains supported for registration. +// +// Generated from API version 2024-11-01 +// - options - TopLevelDomainsClientListOptions contains the optional parameters for the TopLevelDomainsClient.NewListPager +// method. +func (client *TopLevelDomainsClient) NewListPager(options *TopLevelDomainsClientListOptions) *runtime.Pager[TopLevelDomainsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[TopLevelDomainsClientListResponse]{ + More: func(page TopLevelDomainsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *TopLevelDomainsClientListResponse) (TopLevelDomainsClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "TopLevelDomainsClient.NewListPager") + 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.listCreateRequest(ctx, options) + }, nil) + if err != nil { + return TopLevelDomainsClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *TopLevelDomainsClient) listCreateRequest(ctx context.Context, _ *TopLevelDomainsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/topLevelDomains" + 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", "2024-11-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *TopLevelDomainsClient) listHandleResponse(resp *http.Response) (TopLevelDomainsClientListResponse, error) { + result := TopLevelDomainsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.TopLevelDomainCollection); err != nil { + return TopLevelDomainsClientListResponse{}, err + } + return result, nil +} + +// NewListAgreementsPager - Gets all legal agreements that user needs to accept before purchasing a domain. +// +// Description for Gets all legal agreements that user needs to accept before purchasing a domain. +// +// Generated from API version 2024-11-01 +// - name - Name of the top-level domain. +// - agreementOption - Domain agreement options. +// - options - TopLevelDomainsClientListAgreementsOptions contains the optional parameters for the TopLevelDomainsClient.NewListAgreementsPager +// method. +func (client *TopLevelDomainsClient) NewListAgreementsPager(name string, agreementOption TopLevelDomainAgreementOption, options *TopLevelDomainsClientListAgreementsOptions) *runtime.Pager[TopLevelDomainsClientListAgreementsResponse] { + return runtime.NewPager(runtime.PagingHandler[TopLevelDomainsClientListAgreementsResponse]{ + More: func(page TopLevelDomainsClientListAgreementsResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *TopLevelDomainsClientListAgreementsResponse) (TopLevelDomainsClientListAgreementsResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "TopLevelDomainsClient.NewListAgreementsPager") + 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.listAgreementsCreateRequest(ctx, name, agreementOption, options) + }, nil) + if err != nil { + return TopLevelDomainsClientListAgreementsResponse{}, err + } + return client.listAgreementsHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listAgreementsCreateRequest creates the ListAgreements request. +func (client *TopLevelDomainsClient) listAgreementsCreateRequest(ctx context.Context, name string, agreementOption TopLevelDomainAgreementOption, _ *TopLevelDomainsClientListAgreementsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/topLevelDomains/{name}/listAgreements" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-11-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, agreementOption); err != nil { + return nil, err + } + return req, nil +} + +// listAgreementsHandleResponse handles the ListAgreements response. +func (client *TopLevelDomainsClient) listAgreementsHandleResponse(resp *http.Response) (TopLevelDomainsClientListAgreementsResponse, error) { + result := TopLevelDomainsClientListAgreementsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.TldLegalAgreementCollection); err != nil { + return TopLevelDomainsClientListAgreementsResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/domainregistration/armdomainregistration/topleveldomains_client_example_test.go b/sdk/resourcemanager/domainregistration/armdomainregistration/topleveldomains_client_example_test.go new file mode 100644 index 000000000000..e3a44f24be2f --- /dev/null +++ b/sdk/resourcemanager/domainregistration/armdomainregistration/topleveldomains_client_example_test.go @@ -0,0 +1,192 @@ +// 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) Go Code Generator. DO NOT EDIT. + +package armdomainregistration_test + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/domainregistration/armdomainregistration" + "log" +) + +// Generated from example definition: 2024-11-01/GetTopLevelDomain.json +func ExampleTopLevelDomainsClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armdomainregistration.NewClientFactory("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewTopLevelDomainsClient().Get(ctx, "com", 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 = armdomainregistration.TopLevelDomainsClientGetResponse{ + // TopLevelDomain: &armdomainregistration.TopLevelDomain{ + // Name: to.Ptr("com"), + // Type: to.Ptr("Microsoft.DomainRegistration/topLevelDomains"), + // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/providers/Microsoft.DomainRegistration/topLevelDomains/com"), + // Properties: &armdomainregistration.TopLevelDomainProperties{ + // Privacy: to.Ptr(true), + // }, + // }, + // } +} + +// Generated from example definition: 2024-11-01/ListTopLevelDomains.json +func ExampleTopLevelDomainsClient_NewListPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armdomainregistration.NewClientFactory("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewTopLevelDomainsClient().NewListPager(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 = armdomainregistration.TopLevelDomainsClientListResponse{ + // TopLevelDomainCollection: armdomainregistration.TopLevelDomainCollection{ + // Value: []*armdomainregistration.TopLevelDomain{ + // { + // Name: to.Ptr("com"), + // Type: to.Ptr("Microsoft.DomainRegistration/topLevelDomains"), + // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/providers/Microsoft.DomainRegistration/topLevelDomains/com"), + // Properties: &armdomainregistration.TopLevelDomainProperties{ + // Privacy: to.Ptr(true), + // }, + // }, + // { + // Name: to.Ptr("net"), + // Type: to.Ptr("Microsoft.DomainRegistration/topLevelDomains"), + // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/providers/Microsoft.DomainRegistration/topLevelDomains/net"), + // Properties: &armdomainregistration.TopLevelDomainProperties{ + // Privacy: to.Ptr(true), + // }, + // }, + // { + // Name: to.Ptr("co.uk"), + // Type: to.Ptr("Microsoft.DomainRegistration/topLevelDomains"), + // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/providers/Microsoft.DomainRegistration/topLevelDomains/co.uk"), + // Properties: &armdomainregistration.TopLevelDomainProperties{ + // Privacy: to.Ptr(false), + // }, + // }, + // { + // Name: to.Ptr("org"), + // Type: to.Ptr("Microsoft.DomainRegistration/topLevelDomains"), + // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/providers/Microsoft.DomainRegistration/topLevelDomains/org"), + // Properties: &armdomainregistration.TopLevelDomainProperties{ + // Privacy: to.Ptr(true), + // }, + // }, + // { + // Name: to.Ptr("nl"), + // Type: to.Ptr("Microsoft.DomainRegistration/topLevelDomains"), + // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/providers/Microsoft.DomainRegistration/topLevelDomains/nl"), + // Properties: &armdomainregistration.TopLevelDomainProperties{ + // Privacy: to.Ptr(true), + // }, + // }, + // { + // Name: to.Ptr("in"), + // Type: to.Ptr("Microsoft.DomainRegistration/topLevelDomains"), + // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/providers/Microsoft.DomainRegistration/topLevelDomains/in"), + // Properties: &armdomainregistration.TopLevelDomainProperties{ + // Privacy: to.Ptr(false), + // }, + // }, + // { + // Name: to.Ptr("biz"), + // Type: to.Ptr("Microsoft.DomainRegistration/topLevelDomains"), + // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/providers/Microsoft.DomainRegistration/topLevelDomains/biz"), + // Properties: &armdomainregistration.TopLevelDomainProperties{ + // Privacy: to.Ptr(true), + // }, + // }, + // { + // Name: to.Ptr("org.uk"), + // Type: to.Ptr("Microsoft.DomainRegistration/topLevelDomains"), + // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/providers/Microsoft.DomainRegistration/topLevelDomains/org.uk"), + // Properties: &armdomainregistration.TopLevelDomainProperties{ + // Privacy: to.Ptr(false), + // }, + // }, + // { + // Name: to.Ptr("co.in"), + // Type: to.Ptr("Microsoft.DomainRegistration/topLevelDomains"), + // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/providers/Microsoft.DomainRegistration/topLevelDomains/co.in"), + // Properties: &armdomainregistration.TopLevelDomainProperties{ + // Privacy: to.Ptr(false), + // }, + // }, + // }, + // }, + // } + } +} + +// Generated from example definition: 2024-11-01/ListTopLevelDomainAgreements.json +func ExampleTopLevelDomainsClient_NewListAgreementsPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armdomainregistration.NewClientFactory("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewTopLevelDomainsClient().NewListAgreementsPager("in", armdomainregistration.TopLevelDomainAgreementOption{ + ForTransfer: to.Ptr(false), + IncludePrivacy: to.Ptr(true), + }, 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 = armdomainregistration.TopLevelDomainsClientListAgreementsResponse{ + // TldLegalAgreementCollection: armdomainregistration.TldLegalAgreementCollection{ + // Value: []*armdomainregistration.TldLegalAgreement{ + // { + // AgreementKey: to.Ptr("DNRA"), + // Content: to.Ptr("\n\n\n\n\n
\n\n\n\n\n\n\n
\nDomain Name Registration Agreement\n
\n

Last Revised: October 6, 2017

\n

PLEASE READ THIS AGREEMENT CAREFULLY, AS IT CONTAINS IMPORTANT INFORMATION REGARDING YOUR LEGAL RIGHTS AND REMEDIES.

\r\n

1. OVERVIEW

\r\n

This Domain Name Registration Agreement (this \"Agreement\") is entered into by and between 510456, an individual (\"Azure\") and you, and is made effective as of the date of electronic acceptance.  This Agreement sets forth the terms and conditions of your use of Azure's Domain Name Registration services (the \"Domain Name Registration Services\" or the \"Services\"). The terms \"we\", \"us\" or \"our\" shall refer to Azure.  The terms \"you\", \"your\", \"User\" or \"customer\" shall refer to any individual or entity who accepts this Agreement.  Unless otherwise specified, nothing in this Agreement shall be deemed to confer any third-party rights or benefits.

\r\n

Your electronic acceptance of this Agreement signifies that you have read, understand, acknowledge and agree to be bound by this Agreement, which incorporates by reference each of (i) Azure’s Universal Terms of Service Agreement (\"UTOS\"), (ii) all agreements, guidelines, policies, practices, procedures, registration requirements or operational standards of the top-level domain (\"TLD\") in which you register any domain (“Registry Policies”), and (iii) any plan limits, product disclaimers or other restrictions presented to you on the Domain Name Registration Services landing page of the Azure website (this “Site”). 

\r\n

TO LINK TO AND REVIEW THE REGISTRY POLICIES FOR THE TLD IN WHICH YOU WISH TO REGISTER A DOMAIN NAME, PLEASE CLICK HERE   

\r\n

You acknowledge and agree that (i) Azure, in its sole and absolute discretion, may change or modify this Agreement, and any policies or agreements which are incorporated herein, at any time, and such changes or modifications shall be effective immediately upon posting to this Site, and (ii) your use of this Site or the Services found at this Site after such changes or modifications have been made shall constitute your acceptance of this Agreement as last revised.  If you do not agree to be bound by this Agreement as last revised, do not use (or continue to use) this Site or the Services found at this Site.  In addition, Azure may occasionally notify you of changes or modifications to this Agreement by email.  It is therefore very important that you keep your shopper account (“Shopper Account”) information, including your email address, current.  Azure assumes no liability or responsibility for your failure to receive an email notification if such failure results from an inaccurate or out-of-date email address.    Azure is not an Internet Corporation for Assigned Names and Numbers (\"ICANN\") accredited registrar; it is an authorized reseller of domain name registration services.  Accordingly, you acknowledge and agree that Azure may modify this Agreement in order to comply with any terms and conditions set forth by (i) the sponsoring registrar, (ii) ICANN, and/or (iii) the registry applicable to the TLD or country code top level domain (\"ccTLD\") in question.  As used herein, the terms \"registry\", \"Registry\", \"registry operator\" or \"Registry Operator\" shall refer to the registry applicable to the TLD or ccTLD in question.  To identify the sponsoring registrar, click here

\r\n

2. PROVISIONS SPECIFIC TO ALL REGISTRATIONS

\r\n

Unless otherwise noted, the provisions below in this Section 2 are generally applicable to all TLDs that we offer.  Special provisions specific to any TLD or ccTLD (those in addition to posted Registry Policies) are identified elsewhere below in this Agreement. 

\r\n
    \r\n
  1. \r\n
    Registry Policies. You agree to be bound by all Registry Policies (defined above in this Agreement) applicable to your domain name registration (at any level). IT IS YOUR RESPONSIBILITY TO VISIT THE APPLICABLE TLD SITE AND READ AND REVIEW ALL APPLICABLE REGISTRY POLICIES PRIOR TO YOUR REGISTRATION IN THE TLD.  REGISTRY POLICIES FOR EACH TLD CAN BE FOUND BY VISITING THE CORRESPONDING TLD LINK LISTED HERE.  Notwithstanding anything in this Agreement to the contrary, the Registry Operator of the TLD in which the domain name registration is made is and shall be an intended third party beneficiary of this Agreement. As such the parties to this agreement acknowledge and agree that the third party beneficiary rights of the Registry Operator have vested and that the Registry Operator has relied on its third party beneficiary rights under this Agreement in agreeing to Azure being a registrar for the respective TLD. The third party beneficiary rights of the Registry Operator will survive any termination of this Agreement.    
    \r\n
  2. \r\n
  3. \r\n
    Registration Requirements.  To the extent any TLD or ccTLD requires you meet eligibility (e.g., residency for .JP, .EU, etc.), validation (e.g., DNS validation) or other authentication requirements as a condition to registering a domain name in the TLD, you agree that by submitting an application or registering or renewing your domain name, you represent and warrant that: (a) all information provided to register or renew the domain name (including all supporting documents, if any) is true, complete and correct, and is not misleading in any way, and the application is made in good faith; (b) you meet, and will continue to meet, the eligibility criteria prescribed in the Registry Policies for the applicable TLD for the duration of the domain name registration; (c) you have not previously submitted an application for the domain name with another registrar using the same eligibility criteria, and the other registrar has rejected the application (if applicable); (d) you acknowledge and agree that even if the domain name is accepted for registration, your entitlement to register the domain name may be challenged by others who claim to have an entitlement to the domain name; and (e) you acknowledge and agree that the Registry or the registrar can cancel the registration of the domain name if any of the warranties required are found to be untrue, incomplete, incorrect or misleading.
    \r\n
  4. \r\n
  5. \r\n
    Ownership.  You acknowledge and agree that registration of a domain name does not create any proprietary right for you, the registrar, or any other person in the name used as a domain name or the domain name registration and that the entry of a domain name in the Registry shall not be construed as evidence or ownership of the domain name registered as a domain name. You shall not in any way transfer or purport to transfer a proprietary right in any domain name registration or grant or purport to grant as security or in any other manner encumber or purport to encumber a domain name registration.
    \r\n
  6. \r\n
  7. \r\n
    ICANN Requirements. You agree to comply with the ICANN requirements, standards, policies, procedures, and practices for which each applicable Registry Operator has monitoring responsibility in accordance with the Registry Agreement between ICANN and itself or any other arrangement with ICANN.
    \r\n
  8. \r\n
  9. \r\n
    Indemnification of Registry.  You agree to indemnify, defend and hold harmless (within 30 days of demand) the Registry Operator and Registry Service Provider and their subcontractors, subsidiaries, affiliates, divisions, shareholders, directors, officers, employees, accountants, attorneys, insurers, agents, predecessors, successors and assigns, from and against any and all claims, demands, damages, losses, costs, expenses, causes of action or other liabilities of any kind, whether known or unknown, including reasonable legal and attorney’s fees and expenses, in any way arising out of, relating to, or otherwise in connection with the your domain name registration, including, without limitation, the use, registration, extension, renewal, deletion, and/or transfer thereof and/or the violation of any applicable terms or conditions governing the registration. You shall not enter into any settlement or compromise of any such indemnifiable claim without Registrar’s or Registry Operator’s prior written consent, which consent shall not be unreasonably withheld, and you agree that these indemnification obligations shall survive the termination or expiration of the Agreement for any reason.  IN NO EVENT SHALL THE REGISTRY OPERATOR BE LIABLE TO YOU OR ANY OTHER PERSON FOR ANY DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, SPECIAL, EXEMPLARY OR PUNITIVE DAMAGES, INCLUDING LOSS OF PROFIT OR GOODWILL, FOR ANY MATTER, WHETHER SUCH LIABILITY IS ASSERTED ON THE BASIS OF CONTRACT, TORT (INCLUDING NEGLIGENCE), BREACH OF WARRANTIES, EITHER EXPRESS OR IMPLIED, ANY BREACH OF THIS AGREEMENT OR ITS INCORPORATED AGREEMENTS AND POLICIES YOUR INABILITY TO USE THE DOMAIN NAME, YOUR LOSS OF DATA OR FILES OR OTHERWISE, EVEN IF THE REGISTRY OPERATOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
    \r\n
  10. \r\n
  11. \r\n
    Regulated TLDs.   For domain name registration in any “Regulated” TLD, you acknowledge and agree your registration is subject to the following additional requirements: (a) comply with all applicable laws, including those that relate to privacy, data collection, consumer protection (including in relation to misleading and deceptive conduct), fair lending, debt collection, organic farming, disclosure of data, and financial disclosures; (b) if you collect and maintain sensitive health and financial data you must implement reasonable and appropriate security measures commensurate with the offering of those services, as defined by applicable law.  Regulated TLDs include: .games, .juegos, .school, .schule, .toys, .eco, .care, .diet, .fitness, .health, .clinic, .dental, .healthcare, .cash, .broker, .claims, .exchange, .finance, .financial, .fund, .investments, .lease, .loans, .market, .money, .trading, .credit, .insure, .tax, .mortgage, .degree, .mba, .audio, .book, .broadway, .film, .movie, .music, .software, .fashion, .video, .app, .art, .band, .cloud, .data, .digital, .fan, .free, .gratis, .discount, .sale, .media, .news, .online, .pictures, .radio, .show, .theater, .tours, .accountants, .architect, .associates, .broker, .legal, .realty, .vet, .engineering, .law, .limited, .show; .theater; .town, .city, .reise, and .reisen
    \r\n
  12. \r\n
  13. \r\n
    Highly Regulated TLDs. In addition to the requirements for Regulated TLDs, domain name registration in any Highly-Regulated TLD is subject to the following requirements: (a) you will provide administrative contact information, which must be kept up‐to‐date, for the notification of complaints or reports of registration abuse, as well as the contact details of the relevant regulatory, or Industry self‐regulatory, bodies in their main place of business; (b) you represent that you possess any necessary authorizations, charters, licenses and/or other related credentials for participation in the sector associated with such Highly‐regulated TLD; and (c) you will report any material changes to the validity of you authorizations, charters, licenses and/or other related credentials for participation in the sector associated with the Highly‐regulated TLD to ensure you continue to conform to the appropriate regulations and licensing requirements and generally conduct your activities in the interests of the consumers they serve.  Highly Regulated TLDs include: .abogado, .attorney, .bank, .bet, .bingo, .casino .charity (and IDN equivalent xn--30rr7y), .cpa, .corp, creditcard, .creditunion .dds, .dentist, .doctor, .fail, .gmbh, .gripe, .hospital, .inc, .insurance, .lawyer, .lifeinsurance, .llc, .llp, .ltda, .medical, .mutuelle, .pharmacy, .poker, .university, .sarl, .spreadbetting, .srl, .surgery .university, .vermogensberater, and .vesicherung,  For .doctor, registrants who hold themselves out to be licensed medical practitioners must be able to demonstrate to the Registrar and Registry, upon request, that they hold the applicable license.
    \r\n
  14. \r\n
  15. \r\n
    Special Safeguard TLDs.  In addition to the requirements for Regulated and Highly-Regulated TLDs, by registering a domain name in any “Special-Safeguard” TLD, you agree to take reasonable steps to avoid misrepresenting or falsely implying that you or your business is affiliated with, sponsored or endorsed by one or more country's or government's military forces if such affiliation, sponsorship or endorsement does not exist.  Special Safeguard TLDs include:  .army, .navy, .airforce
    \r\n
  16. \r\n
  17. \r\n
    Third Party Beneficiary.  Notwithstanding anything in this Agreement to the contrary, the Registry Operator for any TLD in which your register a domain name is and shall be an intended third party beneficiary of this Agreement. As such the parties to this agreement acknowledge and agree that the third party beneficiary rights of the Registry Operator have vested and that the Registry Operator has relied on its third party beneficiary rights under this Agreement in agreeing to Azure being a registrar for the TLD. Third party beneficiary rights of the Registry Operator shall survive any termination of this Agreement.
    \r\n
  18. \r\n
  19. \r\n
    Variable and Non-Uniform Pricing.  You acknowledge, understand and agree that certain domain names in certain TLDs are established by Registry Policies to be variably priced (i.e., standard v. premium names) and/or may have non-uniform renewal registration pricing (such that the Fee for a domain name registration renewal may differ from other domain names in the same TLD, e.g., renewal registration for one domain may be $100.00 and $33.00 for a different domain name).
    \r\n
  20. \r\n
  21. \r\n
    Restriction on Availability of Privacy or Proxy.  You acknowledge and agree that, as dictated by the Registry Policies, for certain TLDs you may not be permitted to purchase private or proxy TLD registrations. In such case, you must register for any and all TLD registrations using your personal information, which information you represent and warrant is current, accurate and complete.
    \r\n
  22. \r\n
\r\n

3. FEES AND PAYMENTS

\r\n

(A) GENERAL TERMS, INCLUDING AUTOMATIC RENEWAL TERMS

\r\n

You agree to pay any and all prices and fees due for Services purchased or obtained at this Site at the time you order the Services.  Azure expressly reserves the right to change or modify its prices and fees at any time, and such changes or modifications shall be posted online at this Site and effective immediately without need for further notice to you.  If you have purchased or obtained Services for a period of months or years, changes or modifications in prices and fees shall be effective when the Services in question come up for renewal as further described below. 

\r\n

Unless otherwise specifically noted (for reasons such as those highlighted in Section 2(x) above), the renewal price for any domain name in any TLD will be the same as the list (non-sale) price shown when you search for and select a domain, and again in the cart prior to purchase.  For example, if the list price is $9.99, and a different renewal price is not specifically identified, then the renewal price is also $9.99.  Likewise, if a domain name has a sale price of $8.99, with the list (non-sale) price shown (as a strike-through) at $9.99, the renewal price will be $9.99*.  

\r\n

*Renewal price subject to change prior to actual date of renewal. 

\r\n

For all other terms and conditions relating to fees, payment, refund and billing, etc. applicable to the Services offered under the scope of this Agreement, please refer to the “Fees and Payments” section of our UTOS

\r\n

(B) DOMAIN NAME RENEWAL TERMS

\r\n

When you register a domain name, you will have two renewal options: (i) \"Automatic Renewal\" (ii) \"Extended Automatic Renewal\", and (iii) \"Manual Renewal\": 

\r\n
    \r\n
  1. Automatic Renewal.  Automatic Renewal is the default setting. Therefore, unless you select Extended Automatic Renewal, Azure will enroll you in Automatic Renewal.  Domain names will automatically renew, for a period equivalent to the length of your original domain name registration, any domain name that is up for renewal and will take payment from the Payment Method you have on file with Azure, at Azure's then current rates. Thus, if you have chosen to register your domain name for one (1) year, Azure will automatically renew it for one (1) year. If you have chosen to register your domain name for two (2) years, Azure will automatically renew it for two (2) years, and so on.
  2. \r\n
  3. Extended Automatic Renewal.  If you enroll in the Extended Automatic Renewal plan, Azure will automatically renew any domain name that is up for renewal for an additional one-year period on each and every anniversary of your domain name registration, so the initial registration period will always remain intact.  Thus, if you have chosen to register your domain name for two (2) years, Azure will automatically renew it for one (1) additional year on each and every anniversary of your domain name registration so your two (2) year registration period will always remain intact. If you have chosen to register your domain name for five (5) years, Azure will automatically renew it for one (1) additional year on each and every anniversary of your domain name registration so your five (5) year registration period will always remain intact, and so on.  Azure will take payment from the Payment Method you have on file with Azure, at Azure's then current one-year domain name registration rate.
  4. \r\n
  5. Manual Renewal.  If you have elected to turn off automatic renewal and cancel the product (i.e., cancel the domain name registration) effective at expiration of the then current term, you may nonetheless elect to manually renew the domain name at anytime prior to its expiration date by logging into your Account Manager and manually implementing the renewal or by calling customer service (should you in fact want the domain name to be renewed). If you fail to manually implement the renewal before the expiration date, the domain name will be cancelled and you will no longer have use of that name.
  6. \r\n
\r\n

All renewals will be subject to the terms of this Agreement, as it may be amended from time to time, and you acknowledge and agree to be bound by the terms of this Agreement (as amended) for all renewed domains.  Domain name renewals will be non-refundable. In the event that we are unable to automatically renew your domain name for the renewal option selected for any reason, we may automatically renew your domain name for a period less than your original registration period to the extent necessary for the transaction to succeed. If for any reason Azure is not able to take the payment from the Payment Method you have on file, and you fail to respond to our notices, your domain name registration will expire. It is your responsibility to keep your Payment Method information current, which includes the expiration date if you are using a credit card.

\r\n

For certain ccTLDs (.am, .at, .be, .br, .ca, .cn, .com.cn, .net.cn, .org.cn, .de, .eu, .fm, .gs, .it, .jp, .ms, .nu, .nz, .co.nz, .net.nz, .org.nz, .tc, .tk, .tw, .com.tw, .org.tw, .idv.tw, .uk, and .vg), renewal billing will occur on the first day of the month prior to the month of expiration.

\r\n

For certain ccTLDs (.am, .at, .be, .ca, .cn, .com.cn, .net.cn, .org.cn, .de, .eu, .fm, .gs, .it, .jp, .ms, .nu, .nz, .co.nz, .net.nz, .org.nz, .tc, .tk, .tw, .com.tw, .org.tw, .idv.tw, .uk, and .vg), renewal will occur, or must occur manually if the product was previously cancelled, no later than the 20th of the month prior to the expiration date, or your domain name will be placed in non-renewal status. For some ccTLDs (.es) renewal must be processed no later than seven days before the expiration date, or your domain name will be placed in non-renewal status.  When the domain name is in non-renewal status, you can renew the domain name only by calling Azure and requesting that the domain name be renewed. You cannot renew the domain name through your Account Manager. If you fail to manually implement the renewal of any cancelled product before the expiration date, the domain name will be cancelled and you will no longer have use of that name.

\r\n

You agree that Azure will not be responsible for cancelled domain names that you fail to renew in the timeframes indicated in this Agreement. In any case, if you fail to renew your domain name in a timely fashion, additional charges may apply. If you signed up for privacy services, protected registration, or any other similar service, with your domain name registration, these services will automatically be renewed when your domain name registration is up for renewal, and you will incur the applicable additional renewal fee unless you cancel in advance. 

\r\n

If you fail to renew your domain name in the timeframes indicated in this Agreement, you agree that Azure may, in its sole discretion, renew your expired domain name on your behalf. If Azure decides to renew your expired domain name on your behalf, you will have a Renewal Grace Period during which you may reimburse Azure for the renewal and keep your domain name. The Renewal Grace Period is currently twelve (12) days but subject to change under the terms of this Agreement. For certain ccTLDs (.am, .at, .be, .cn, .com.cn, .net.cn, .org.cn, .de, .eu, .fm, .gs, .it, .jp, .ms, .nu, .nz, .co.nz, .net.nz, .org.nz, .tc, .tk, .tw, .com.tw, .org.tw, .idv.tw, .uk, and .vg) there is no Renewal Grace Period after the expiration date of the domain name. If you do not reimburse Azure for the renewal during the Renewal Grace Period your domain name will be placed on Hold and flagged for deletion after which you will have a 30-day redemption period during which you may pay Azure a Redemption fee and redeem your domain name. The Redemption fee is currently $80.00 USD and is subject to change under the terms of this Agreement. If you do not redeem your domain name prior to the end of the 30-day redemption period Azure may, in its sole discretion, delete your domain name or transfer it to another registrant on your behalf.  During the redemption period your domain name may be parked. 

\r\n

If your domain name is deleted, the Registry also provides a 30-day Redemption Grace Period during which you may pay Azure a redemption fee and redeem your domain name. The redemption fee is currently $80.00 USD and is subject to change under the terms of this Agreement. If you do not redeem your domain name prior to the end of the Registry's Redemption Grace Period the Registry will release your name and it will become available for registration on a first-come-first-served basis.

\r\n

Renewal Grace Periods and Redemption Grace Periods vary for different ccTLDs. Please refer to the specific terms for the applicable TLD. In the event there is a conflict between the provisions of this paragraph and the ccTLD terms, the ccTLD terms shall control.

\r\n

\r\n

Our registration expiration notification policy and associated fees are described here.

\r\n

\r\n

\r\n

(C) FREE PRODUCT TERMS

\r\n

In the event you are provided with free products with the registration of a domain name, you acknowledge and agree that such free products will only be available with a valid purchase and may be terminated in the event the domain name is deleted or cancelled.  For free domain names, you acknowledge and agree that you may not change the account associated with such free domain for the first five (5) days after registration.  In the event a free domain name is offered with the registration of another domain and if the paid domain name registered fails, then we may, in its sole discretion, either delete the registration of the free domain or refund the difference between the amount paid and the value of the free domain.  Failed registrations associated with promotionals offers may result in the deletion of the free or discounted item or an adjustment between the registered domain price and the value of the discounted item, in our sole discretion.

\r\n

4. TERM OF AGREEMENT; TRANSFERS; DOMAIN TASTING

\r\n

The term of this Agreement shall continue in full force and effect as long as you have any domain name registered through Azure.

\r\n

You agree that you will not transfer any domain name registered through Azure to another domain name registrar during the first sixty (60) days after its initial registration date.  You agree that you may not transfer any domain name for ten (10) days after a Change of Account.

\r\n

You further agree that you will not engage in \"domain tasting\" by using the five (5) day grace period in which a registrant may choose to cancel a domain name and get a full refund of the registration fee as a vehicle to test the marketability or viability of a domain name.  If Azure determines (which determination shall be made by Azure in its sole and absolute discretion) that you have been engaging in \"domain tasting\", then Azure reserves the right to (a) charge you a small fee (which fee shall be deducted from any refund issued) or (b) refuse your cancellation/refund request altogether. Azure will not charge you a fee if Azure cancels your domain name during the five (5) day grace period due to fraud or other activity outside of your control. The five (5) day grace period does not apply to Premium Domains, which are non-refundable.

\r\n

You agree that Azure shall not be bound by (i) any representations made by third parties who you may use to purchase services from Azure, or (ii) any statements of a general nature, which may be posted on Azure's website or contained in Azure's promotional materials.

\r\n

5. UP TO DATE INFORMATION; USE OF INFORMATION AND EXPIRATION

\r\n

You agree to notify Azure within five (5) business days when any of the information you provided as part of the application and/or registration process changes. It is your responsibility to keep this information in a current and accurate status. Failure by you, for whatever reason, to provide Azure with accurate and reliable information on an initial and continual basis, shall be considered to be a material breach of this Agreement and a basis for suspension and/or cancellation of the domain name. Failure by you, for whatever reason, to respond within five (5) business days to any inquiries made by Azure to determine the validity of information provided by you, shall also be considered to be a material breach of this Agreement and a basis for suspension and/or cancellation of the domain name. You agree to retain a copy for your record of the receipt for purchase of your domain name.

\r\n

You agree that for each domain name registered by you, the following contact data is required: postal address, email address, telephone number, and if available, a facsimile number for the Registered Name Holder and, if different from the Registered Name Holder, the same contact information for, a technical contact, an administrative contact and a billing contact.

\r\n

You acknowledge and agree that domain name registration requires that this contact information, in whole or in part, be shared with the registry operator, for their use, copying, distribution, publication, modification and other processing  for (among other uses in accordance with our Privacy Policy) the purpose of administration of the domain name registration, which may require such information be transferred back and forth across international borders, to and from the U.S. to the EU, for example. As required by ICANN, this information must also be made publicly available by means of Whois, and that the registry operator may also be required to make this information publicly available by Whois. Both Azure and the registry operator may be required to archive this information with a third-party escrow service. You hereby consent and give permission for all such requirements and disclosures. Further, you represent and warrant that, if you are providing information about a third party, you have notified the third party of the disclosure and the purpose for the disclosure and you have obtained the third party's consent to such disclosure.  Registrar will not process data in a way that is incompatible with this Agreement.  Registrar will take reasonable precautions to protect data from loss or misuse.

\r\n

You agree that for each domain name registered by you the following information will be made publicly available in the Whois directory as determined by ICANN Policy and may be sold in bulk as set forth in the ICANN agreement:

\r\n
    \r\n
  • The domain name;
  • \r\n
  • Your name and postal address;
  • \r\n
  • The name, email address, postal address, voice and fax numbers for technical and administrative contacts;
  • \r\n
  • The Internet protocol numbers for the primary and secondary name servers;
  • \r\n
  • The corresponding names of the name servers; and
  • \r\n
  • The original date of registration and expiration date.
  • \r\n
  • Name of primary name server and secondary name server.
  • \r\n
  • Identity of the registrar.
  • \r\n
\r\n

You agree that, to the extent permitted by ICANN, Azure may make use of the publicly available information you provided during the registration process. If you engage in the reselling of domain names you agree to provide any individuals whose personal information you've obtained, information about the possible uses of their personal information pursuant to ICANN policy. You also agree to obtain consent, and evidence of consent, from those individuals for such use of the personal information they provide.

\r\n

You agree that Azure has the right to make public and share with third parties certain information in connection with the sale or purchase of domain names on the website, including but not limited to (a) the name of the domain name sold or purchased, (b) the sale or purchase price of the domain name sold or purchased, and (c) information relating to the timing of the sale or purchase.

\r\n

\r\n

In order for us to comply with any current or future rules and policies for domain name systems including any rules or policies established by the CIRA or any provincial or federal government or by other organization having control or authority to establish rules or policies, you hereby grant to us the right to disclose to third parties through an interactive publicly accessible registration database the following information that you are required to provide when applying for a domain name:

\r\n
    \r\n
  1. The domain or sub-domain name(s) registered by you;
  2. \r\n
  3. Your organization name, type and postal address;
  4. \r\n
  5. The name(s), position(s), postal address(es), e-mail address(es), voice telephone number(s) and where available the fax number(s) of the technical and administrative contacts for your domain or sub-domain name(s);
  6. \r\n
  7. The full hostnames and Internet protocol (IP) addresses of at least two (2) name server hosts (one primary and at least one secondary) for your domain or sub-domain name. Up to six (6) name servers may be specified. If a host has more than one (1) IP address, use a comma-separated list;
  8. \r\n
  9. The corresponding names of those name servers;
  10. \r\n
  11. The original creation date of the registration; and
  12. \r\n
  13. The expiration date of the registration.
  14. \r\n
\r\n

We may be required to make this information available in bulk form to third parties. We may also transfer or assign this information to CIRA or such other third party as we may decide, in our sole discretion.

\r\n

6. DISPUTE RESOLUTION POLICY

\r\n

You agree to be bound by our current Dispute Resolution Policy. This policy is incorporated herein and made a part of this Agreement. You can view the Uniform Domain Name Dispute Resolution Policy online. You agree that Azure may from time to time modify its Dispute Resolution Policy. Azure will post any changes to its Dispute Resolution Policy at least thirty (30) days before they become effective. You agree that by maintaining your domain name registrations with Azure after the updated policy becomes effective that you agree to the Dispute Resolution policy as amended. You agree to review Azure's website periodically to determine if changes have been made to the Dispute Resolution Policy. If you cancel or terminate your Services with Azure as a result of the modified Dispute Resolution policy, no fees will be refunded to you. You also agree to submit to proceedings commenced under ICANN's Uniform Rapid Suspension System, if applicable. 

\r\n

You agree that if a dispute arises as a result of one (1) or more domain names you have registered using Azure, you will indemnify, defend and hold Azure harmless as provided for in this Agreement. You also agree that if Azure is notified that a complaint has been filed with a governmental, administrative or judicial body, regarding a domain name registered by you using Azure, that Azure, in its sole discretion, may take whatever action Azure deems necessary regarding further modification, assignment of and/or control of the domain name deemed necessary to comply with the actions or requirements of the governmental, administrative or judicial body until such time as the dispute is settled. In this event you agree to hold Azure harmless for any action taken by Azure.

\r\n

You agree to submit, without prejudice to other potentially applicable jurisdictions, to the jurisdiction of the courts (1) of your domicile, (2) where registrar is located or (3) where the registry operator is located (e.g., China for .CN, Columbia for .CO, UK for .EU, etc.).

\r\n

\r\n

In the case of .ca domain names, you agree that, if your use of the service or the registration of a .ca domain name is challenged by a third party, you will be subject to the provisions specified by CIRA in their dispute resolution policy, in effect at the time of the dispute.

\r\n

\r\n

7. TRANSFER OF DOMAIN NAMES; RESALE PRACTICES

\r\n

If you transfer any domain name, you agree to provide the information required by, and to abide by, the procedures and conditions set forth in our Domain Name Transfer Agreement and Change of Registrant Agreement. You may view the latest versions of our Domain Name Transfer Agreement and Change of Registrant Agreementonline. In order to further protect your domain name, any domain name registered with Azure or transferred to Azure shall be placed on lock status, unless an opted-out has occurred as defined in our Change of Registrant Agreement or Domain Name Proxy Agreement. The domain name must be placed on unlock status in order to initiate a transfer of the domain name away from Azure to a new Registrar. You may log into your account with Azure at any time after your domain name has been successfully transferred to Azure, and change the status to unlock.

\r\n

In the event you are purchasing a domain name on behalf of a third party, you agree to inform any customer of yours, who may be acquiring a domain name through you using Azure's registration services, that they are in fact registering their domain name through Azure and that Azure or its licensor is an accredited registrar with ICANN. You agree not to represent that you are an ICANN-accredited registrar or that you are in any way providing superior access to the ICANN Domain Name Registry. You also agree not to use the ICANN trademark logo in any of your promotional materials including your website.

\r\n

You agree to obtain each of your customers' acceptances to the then current version of this Agreement, and to retain evidence of their acceptance for a period of not less than three (3) years. Should you require that your customers accept additional terms and conditions that are not required by Azure, you agree that such additional terms and conditions shall not conflict with this Agreement and the policies and procedures adopted by ICANN.

\r\n

You agree that Azure is not lending you access to its registrar connections or its registry access, nor will you be deemed to be a registrar in your own right. Furthermore, you agree you will not attempt to gain access to Azure's registrar connections or registry access. You agree to provide complete, accurate and current data for each registrant to be added to a registry in accordance with ICANN requirements for inclusion in the Whois database.

\r\n

You agree to provide your customers with adequate customer support, and to maintain contact with them with regard to providing a medium for them to communicate changes in the information they provided as part of the domain name registration process. Upon receiving corrected or updated information you will, within five (5) business days, provide such information to Azure so Azure may update its registration records. You will retain copies of all communications between you and your customers and will upon request provide Azure copies of same.

\r\n

8. YOUR OBLIGATIONS; SUSPENSION OF SERVICES; BREACH OF AGREEMENT

\r\n

You represent and warrant to the best of your knowledge that, neither the registration of the domain nor the manner it is directly or indirectly used, infringes the legal rights of any third party.  You will comply with all applicable laws, including, but not limited to those relating to privacy, data collection, consumer protection, fair lending, debt collection, organic farming, and disclosure of data and financial disclosures.  If you collect and maintain sensitive health and financial data, you must implement reasonable and appropriate security measures commensurate with the offering of those services, as defined by applicable law.  You represent that you possess any necessary authorization, charter, license, and/or other related credential for participation in the sector associated with the associated registry tld string.  You will report any material changes to the validity of your authorization, charter, license, and/or other related credential. You will indemnify and hold harmless the registrar and registry operator, and their directors, officers, employees and agents, from and against any and all claims, damages, liabilities, costs and expenses (including reasonable legal fees and expenses) arising out of or related to the domain name registration.  This obligation shall survive expiration or termination of this Agreement or the domain name registration.

\r\n

You agree that, in addition to other events set forth in this Agreement:

\r\n
    \r\n
  1. Your ability to use any of the services provided by Azure is subject to cancellation or suspension in the event there is an unresolved breach of this Agreement and/or suspension or cancellation is required by any policy now in effect or adopted later by ICANN;
  2. \r\n
  3. Your registration of any domain names shall be subject to suspension, cancellation or transfer pursuant to any ICANN adopted specification or policy, or pursuant to any Azure procedure not inconsistent with an ICANN adopted specification or policy (a) to correct mistakes by Azure or the registry operator in registering any domain name; or (b) for the resolution of disputes concerning any domain name.
  4. \r\n
\r\n

You acknowledge and agree that Azure and registry reserve the right to deny, cancel or transfer any registration or transaction, or place any domain name(s) on registry lock, hold or similar status, as either deems necessary, in the unlimited and sole discretion of either Azure or the registry: (i) to comply with specifications adopted by any industry group generally recognized as authoritative with respect to the Internet (e.g., RFCs), (ii) to correct mistakes made by registry or any registrar in connection with a domain name registration, (iii) for the non-payment of fees to registry, (iv) to protect the integrity and stability of the registry, (v) to comply with any applicable court orders, laws, government rules or requirements, requests of law enforcement, or any dispute resolution process, (vi) to comply with any applicable ICANN rules or regulations, including without limitation, the registry agreement, (vii) to avoid any liability, civil or criminal, on the part of registry operator, as well as its affiliates, subsidiaries, officers, directors, and employees, (viii) per the terms of this Agreement, (ix) following an occurrence of any of the prohibited activities described in Section 8 below, or (x) during the resolution of a dispute.

\r\n

You agree that your failure to comply completely with the terms and conditions of this Agreement and any Azure rule or policy may be considered by Azure to be a material breach of this Agreement and Azure may provide you with notice of such breach either in writing or electronically (i.e. email). In the event you do not provide Azure with material evidence that you have not breached your obligations to Azure within ten (10) business days, Azure may terminate its relationship with you and take any remedial action available to Azure under the applicable laws. Such remedial action may be implemented without notice to you and may include, but is not limited to, cancelling the registration of any of your domain names and discontinuing any services provided by Azure to you. No fees will be refunded to you should your Services be cancelled or terminated because of a breach.

\r\n

Azure's failure to act upon or notify you of any event, which may constitute a breach, shall not relieve you from or excuse you of the fact that you have committed a breach.

\r\n

9. RESTRICTION OF SERVICES; RIGHT OF REFUSAL

\r\n

You agree not to use the services provided by Azure, or to allow or enable others, to use the services provided by Azure for the purposes of:

\r\n
    \r\n
  • The transmission of unsolicited email (Spam); and
  • \r\n
  • Repetitive, high volume inquires into any of the services provided by Azure (i.e. domain name availability, etc.).
  • \r\n
\r\n

You acknowledge and agree that you are prohibited from distributing malware, abusively operating botnets, phishing, piracy, trademark or copyright infringement, fraudulent or deceptive practices, counterfeiting or otherwise engaging in activity contrary to applicable law, and you acknowledge and agree that the consequences for such activities include suspension of the domain name.

\r\n

If you are hosting your domain name system (“DNS”) on Azure’s servers, or are using our systems to forward a domain name, URL, or otherwise to a system or site hosted elsewhere, or if you have your domain name registered with Azure, you are responsible for ensuring there is no excessive overloading on Azure’s servers. You may not use Azure’s servers and your domain name as a source, intermediary, reply to address, or destination address for email denial-of-service attack, Internet packet flooding, packet corruption, or other abusive attack. Server hacking or other perpetration of security breaches is prohibited. You agree that Azure reserves the right to deactivate your domain name from its DNS if Azure deems it is the recipient of activities caused by your site that threaten the stability of its network.

\r\n

You agree that Azure, in its sole discretion and without liability to you, may refuse to accept the registration of any domain name. Azure also may in its sole discretion and without liability to you delete the registration of any domain name during the first thirty (30) days after registration has taken place. Azure may also cancel the registration of a domain name, after thirty (30) days, if that name is being used, as determined by Azure in its sole discretion, in association with spam or morally objectionable activities. Morally objectionable activities will include, but not be limited to:

\r\n
    \r\n
  • Activities prohibited by the laws of the United States and/or foreign territories in which you conduct business;
  • \r\n
  • Activities designed to encourage unlawful behavior by others, such as hate crimes, terrorism and child pornography; and
  • \r\n
  • Activities designed to harm or use unethically minors in any way.
  • \r\n
\r\n

In the event Azure refuses a registration or deletes an existing registration during the first thirty (30) days after registration, you will receive a refund of any fees paid to Azure in connection with the registration either being cancelled or refused. In the event Azure deletes the registration of a domain name being used in association with spam or morally objectionable activities, no refund will be issued.

\r\n

10. DEFAULT SETTINGS; PARKED PAGE

\r\n

Choosing Your Domain Name Settings.  When you register a domain name with Azure, you will be prompted to choose your domain name settings during the checkout process.  If you plan on using another provider for your website or hosting needs, then you should enter the name servers of such provider when you choose your domain name settings.  This will direct your domain name away from Azure’s name servers.  If you are an existing Azure customer and have already set up a customer profile designating your domain name settings for new domain name registrations, you will not need to complete this step again during the checkout process.   

\r\n

Azure’s Default Settings.  If you do not direct your domain name away from Azure’s name servers as described above, Azure will direct your domain name to a “Parked Page” (“Default Setting”).  You acknowledge and agree that Azure has the right to set the Default Setting. 

\r\n

Parked Page Default Setting.  Azure’s Parked Page service is an online domain monetization system designed to generate revenue (through the use of pay per click advertising) from domain names that are not actively being used as websites.  If your domain name is directed to a Parked Page, you acknowledge and agree that Azure may display both (a) in-house advertising (which includes links to Azure products and services) and (b) third-party advertising (which includes links to third-party products and services) on your Parked Page through the use of pop-up or pop-under browser windows, banner advertisements, audio or video streams, or any other advertising means, and we may aggregate for our own use, related usage data by means of cookies and other similar means.  In addition, you acknowledge and agree that all in-house and third-party advertising will be selected by Azure and its advertising partners, as appropriate, and you will not be permitted to customize the advertising, or entitled to any compensation in exchange therefor.  Please note that the third-party advertising displayed on Azure’s Parked Pages may contain content offensive to you, including but not limited to links to adult content.  Azure makes no effort to edit, control, monitor, or restrict the content and third-party advertising displayed on Azure’s Parked Pages, and expressly disclaims any liability or responsibility to you or any third party in connection therewith.

\r\n

Changing Azure’s Default Settings.  You may change Azure’s Default Settings at any time during the term of your domain name registration.

\r\n
    \r\n
  1. Content Displaying On Your Parked Page.  You can not modify the content displaying on your Parked Page.  You may select one of the other options listed below.
  2. \r\n
  3. Participating In Domain Name Monetization.  If you wish to participate in the domain monetization potential presented by Azure’s Parked Page service, please review and consider purchasing our CashParking® service.   
  4. \r\n
  5. No Content.  If the options listed above are not acceptable to you, please contact customer support to learn what other options might be available to you.
  6. \r\n
\r\n

Return To Parked Page Default Setting Upon Domain Name Expiration.  Upon domain name expiration, and regardless of how you use your domain name during the term of your domain name registration, your domain name will automatically return to the Parked Page Default Setting described above.  As used in this paragraph, “expiration” is deemed to include any “renewal period” or “redemption period” immediately after the domain name expires, but before the domain name is returned to the registry.  Once your domain name has returned to the Parked Page Default Setting described above, the only way to opt out of the Parked Page service is to renew, redeem, or re-register your domain name in accordance with Section 2(B), Domain Name Renewal Terms, of this Agreement.   

\r\n

11. DOMAIN ADD-ONS

\r\n

Business Registration:  Business registration allows You to display additional information about the business that is the basis of Your domain name, including, but not limited to, such information as Your fax number, street address, and hours of operation.

\r\n

Certified Domains.  The certified domain service generally allow You to: (i) put a Certified Domain Validation seal on Your website; and (ii) have Your domain name listed as \"Certified\", in WHOIS lookups on our website.   The Certified Domain Validation seal renews independently of Your domain. When You renew Your domain, You must also, when necessary, separately renew Your Certified Validation seal. However, the Certified Domain Validation seal can be cancelled independently of Your domain. If the domain is cancelled, the Certified Domain associated with the cancelled domain will automatically cancel.  The Certified Domain seal is a trademark and is protected by copyright, trademark and other intellectual property laws. You may use the Certified Domain seal only in conjunction with the purchase of the Services set forth in the Agreement, and subject to the terms and conditions hereof. Other than provided for in this Agreement, You may not otherwise use, reproduce, or modify the mark for any additional promotional use, without our prior written approval. Your right to the use of the Certified Domain seal is immediately terminated upon expiration or termination of this Agreement.

\r\n

Expiration Consolidation.  You understand and acknowledge the expiration consolidation service may only be used to consolidate the expiration of .com and .net domain names. The service may not be used to consolidate domains that are on Registrar HOLD, Registry HOLD, or pending Transfer status. You acknowledge the service may only be used to push the expiration date of Your domains forward in time, at least one (1) month forward and no more than ten (10) years forward, and then, only for a period lasting less than twelve (12) months. Once the service has been used to consolidate domains, the new expiration date may not be reversed. To ensure the service is not abused or used as an alternative to renewals, you may only use the service on each domain once in any 12-month period. The service may only be used on domain names that have not passed their expiration date. In order to change the expiration date again, You will be required to renew the domain name first.  You further understand and acknowledge the service may only be used to coordinate domains where we are the registrar of record. Domains not registered with us must be transferred before we can perform the Service. 

\r\n

\r\n

Backordering/Monitoring.  You agree a domain name that has expired shall be subject first to a grace period of twelve (12) days, followed by the ICANN-mandated redemption grace period of thirty (30) days. During this period of time, the current domain name registrant may renew the domain name and retain ownership. We do not guarantee your backorder will result in you obtaining the domain name and expressly reserves the right to (a) refuse additional backorders or (b) cancel existing backorders at any time for any reason.  If your backorder is refused or cancelled, we agree to promptly refund any fees paid for such domain name backorder. The domain name may also be placed in a secondary market for resale through the Auctions® service.  After your first year of Auctions membership, you agree that unless otherwise advised, we will automatically renew your Auctions membership using the payment method you have on file for so long as your backorder credit is active. You may learn more about Auctions by visiting the Auctions website. The domain name may also be subject to a drop pool process before it is available for purchasing. You understand we and our registrar affiliates use our services, including backordering.  Therefore, the domain name may be registered with a different registrar, but can be managed through your account.  By using the Services, you will be able to, among other things:

\r\n
    \r\n
  1. Backorder any domain name under the top level domains .COM, .NET, .US, .BIZ, .INFO, .ORG, .MOBI. A backorder for a domain name will include the price of up to a one-year domain name registration. Should you successfully backorder any domain name, you will be subject to the terms and conditions of the Domain Name Registration and related agreements, which are incorporated herein by reference.
  2. \r\n
  3. Change your backorder until you obtain a domain name. You will have the opportunity to change the credit to a different domain name until you successfully capture one. After three (3) years, if the credit is not used, we reserves the right to remove the credit.
  4. \r\n
  5. Subscribe monthly to an expiring domain name list. You may also choose to purchase a subscription to a list of domain names expiring within the next five (5) days. If you subscribe to the expiring domain name list, you agree the payment method you have on file may be charged on a monthly subscription basis for the term of the Services you purchase.
  6. \r\n
  7. Select domain names off the expiring domain name list you would like to register. Each domain name you attempt to backorder will include the price of up to a one-year domain name registration, as set forth in subsection (i) above.
  8. \r\n
  9. Monitor your currently registered domain names for changes in registrar, status, expiration date or name servers at no additional cost.
  10. \r\n
  11. Subscribe to Domain Alert Pro or monitoring, which enables you to monitor any currently registered domain name, regardless of registrar, for historical tracking of status changes and designation of multiple email notification addresses.
  12. \r\n
\r\n

\r\n

\r\n

Transfer Validation. The transfer validation service is provided to help You keep Your domain name secure. By choosing to use the service, You are making an explicit and voluntary request to us to deny all attempts to transfer Your domain name to another registrar, or to move Your domain name to another account, unless You verify each request as described herein. You will provide us with a contact name, phone number and PIN for domain transfer validations. You will be contacted by us when a domain transfer is requested for a domain name in Your account. When we receive a transfer request, we will call You to verify the transfer request. If we cannot reach You with seventy-two (72) hours of receipt of the transfer request, the transfer will be denied. If You do not provide the proper PIN, the transfer will be denied. When we receive a change of account request, we will call You to verify the change request. If we cannot reach You with seventy-two (72) hours of receipt of the change request, the change will be denied. If You do not provide the proper PIN, the change will be denied. Availability of Services are subject to the terms and conditions of this Agreement and each of our policies and procedures. We shall use commercially reasonable efforts to attempt to provide certain portions of the Services on a twenty-four (24) hours a day, seven (7) days a week basis throughout the term of this Agreement and other portions of the service, during normal business hours. You acknowledge and agree that from time to time the Services may be inaccessible or inoperable for any reason, including, without limitation: (i) equipment malfunctions; (ii) periodic maintenance procedures or repairs that we may undertake from time to time; or (iii) causes beyond the reasonable control of us or that are not reasonably foreseeable by us, including, without limitation, interruption or failure of telecommunication or digital transmission links, hostile network attacks, network congestion or other failures. You acknowledge and agree that we has no control over the availability of the service on a continuous or uninterrupted basis.

\r\n

\r\n

12. PRE-REGISTRATIONS

\r\n

If you submit an application for pre-registration of a domain name, Azure does not guarantee that the name will be secured for you, or that you will have immediate access to the domain name if secured.  Azure may use third-party service providers for the pre-registration services.

\r\n

13. PROVISIONS SPECIFIC TO .BIZ REGISTRATIONS

\r\n

Domain Name Dispute Policy.  If you reserved or registered a .BIZ domain name through us, in addition to our Dispute Resolution Policy, you hereby acknowledge that you have read and understood and agree to be bound by the terms and conditions of the Restrictions Dispute Resolution Policy applicable to the .biz TLD.

\r\n

The RDRP sets forth the terms under which any allegation that a domain name is not used primarily for business or commercial purposes shall be enforced on a case-by-case basis by an independent ICANN-accredited dispute provider. Registry Operator will not review, monitor, or otherwise verify that any particular domain name is being used primarily for business or commercial purposes or that a domain name is being used in compliance with the SUDRP or UDRP processes.

\r\n

One Year Registration.  If you are registering a .BIZ domain name and you elect to take advantage of special pricing applicable to one-year registrations, we will automatically renew your domain name for an additional one-year period at the end of the first year term by taking payment from the Payment Method you have on file, unless you notify us that you do not wish to renew. You will be notified and given the opportunity to accept or decline the one-year renewal prior to your domain name expiration date. In the event you decide not to renew your one-year .BIZ domain name for a second year, your domain name registration will automatically revert back to us and we will gain full rights of registration to such domain name. You agree that if you delete or transfer your .BIZ domain name during the first year, you will automatically be charged the second year renewal fees.

\r\n

\r\n

14. PROVISIONS SPECIFIC TO .INFO REGISTRATIONS 

\r\n

One Year Registration.  If you are registering a .INFO domain name and you elect to take advantage of special pricing applicable to one-year registrations, we will automatically renew your domain name for an additional one-year period at the end of the first year term by taking payment from the Payment Method you have on file, unless you notify us that you do not wish to renew. You will be notified and given the opportunity to accept or decline the one-year renewal prior to your domain name expiration date. In the event you decide not to renew your one-year .INFO domain name for a second year, your domain name registration will automatically revert back to us and we will gain full rights of registration to such domain name. You agree that if you delete or transfer your .INFO domain name during the first year, you will automatically be charged the second year renewal fees.

\r\n

15. PROVISIONS SPECIFIC TO .MOBI REGISTRATIONS 

\r\n

Instant Mobilizer. You are hereby granted a personal, revocable, non-exclusive, non-transferable, non-assignable, non-sublicensable license to use the Instant Mobilizer service (“Service”), provided, however, You abide by the terms and conditions set forth. You shall not alter, modify, adapt or translate the whole or part of the Service in any way whatsoever. You may not create derivative works based on the Service. You may not rent, lease, assign, dispose of, novate, sub-license or otherwise transfer any of its rights to use the Service to any third party.  In the event that the volume of traffic to You from Your use of the Service is sufficient so as to jeopardize the provision of Service for other end users, we and our licensors reserve the right to, at its sole discretion, permanently or temporarily, discontinue Your use of the Service. For the avoidance of doubt, the volume of traffic generated by You should not exceed two thousand (2,000) page views per day.  You acknowledge and agree the text \"Instant Mobilizer from dotMobi\" or equivalent, will be inserted at the footer of Your site.  In the event a dotMobi domain to which the Service is being provided is transferred to another domain name registrar, the Service will be interrupted on that dotMobi domain, and Service will not be restored if the new registrar does not offer the Service. 

\r\n

\r\n

16. PROVISIONS SPECIFIC TO .NAME REGISTRATIONS 

\r\n

\r\n

17. PROVISIONS SPECIFIC TO .REISE REGISTRATIONS

\r\n

Domain Names registered in .REISE should be used for purposes dedicated to travel topics within six months following initial Registration, e.g. utilized on the Internet or otherwise used to perform a function.

\r\n

18. PROVISIONS SPECIFIC TO .SEXY REGISTRATIONS

\r\n

You shall not permit content unsuitable for viewing by a minor to be viewed from the main or top-level directory of a .SEXY domain name. For purposes of clarity, content viewed at the main or top-level directory of a .SEXY domain name is the content immediately visible if a user navigates to http://example.sexy or http://www.example.sexy. No restrictions apply to the content at any other page or subdirectory addressed by a .SEXY Registered Name. 

\r\n

19. COUNTRY CODE TOP LEVEL DOMAINS

\r\n

You represent and warrant that you meet the eligibility requirements of each ccTLD you apply for. You further agree to be bound by any registry rules, policies, and agreements for that particular ccTLD. These may include, but are not limited to, agreeing to indemnify the ccTLD provider, limiting the liability of the ccTLD provider, and requirements that any disputes be resolved under that particular country's laws.

\r\n

(A) PROVISIONS SPECIFIC TO .AU REGISTRATIONS 

\r\n

.au Registrations (to include com.au, net.au and org.au) are governed by the following additional terms and conditions:

\r\n

auDA. auDA means .au Domain Administration Limited ACN 079 009 340, the .au domain names administrator.  The Registrar acts as agent for auDA for the sole purpose, but only to the extent necessary, to enable auDA to receive the benefit of rights and covenants conferred to it under this Agreement. auDA is an intended third party beneficiary of this agreement.

\r\n

auDA Published Policy.  auDA Published Policies means those specifications and policies established and published by auDA from time to time at http://www.auda.org.au.  You must comply with all auDA Published Policies, as if they were incorporated into, and form part of, this Agreement. In the event of any inconsistency between any auDA Published Policy and this Agreement, then the auDA Published Policy will prevail to the extent of such inconsistency.  You acknowledge that under the auDA Published Policies: (1) there are mandatory terms and conditions that apply to all domain names; (2) licences, and such terms and conditions are incorporated into, and form part of, this Agreement; (3) You are bound by, and must submit to, the .au Dispute Resolution Policy; and (4) auDA may delete or cancel the registration of a .au domain name. 

\r\n

auDA's Liabilities and Indemnity.  To the fullest extent permitted by law, auDA will not be liable to Registrant for any direct, indirect, consequential, special, punitive or exemplary losses or damages of any kind (including, without limitation, loss of use, loss or profit, loss or corruption of data, business interruption or indirect costs) suffered by Registrant arising from, as a result of, or otherwise in connection with, any act or omission whatsoever of auDA, its employees, agents or contractors. Registrant agrees to indemnify, keep indemnified and hold auDA, its employees, agents and contractors harmless from all and any claims or liabilities, arising from, as a result of, or otherwise in connection with, Registrant's registration or use of its .au domain name. Nothing in this document is intended to exclude the operation of Trade Practices Act 1974.

\r\n

(B) PROVISIONS SPECIFIC TO .CA REGISTRATIONS

\r\n

You acknowledge and agree that registration of your selected domain name in your first application to CIRA shall not be effective until you have entered into and agreed to be bound by CIRA's Registrant Agreement.

\r\n

CIRA Certified Registrar.  The registrar shall immediately give notice to you in the event that it is no longer a CIRA Certified Registrar, has had its certification as a CIRA Certified Registrar suspended or terminated, or the Registrar Agreement between CIRA and the Registrar is terminated or expires. CIRA may post notice of such suspension, termination, or expiry on its website and may, if CIRA deems appropriate, give notice to the registrants thereof. In the event that the registrar is no longer a CIRA Certified Registrar, has had its certification as a CIRA Certified Registrar suspended or terminated or in the event the Registrar Agreement between CIRA and the Registrar is terminated or expires, you shall be responsible for changing your Registrar of Record to a new CIRA Certified Registrar within thirty (30) days of the earlier of notice thereof being given to you by (i) the Registrar or (ii) CIRA in accordance with CIRA's then current Registry PRP; provided, however, that if any of your domain name registrations are scheduled to expire within thirty (30) days of the giving of such notice, then you shall have thirty (30) days from the anniversary date of the registration(s), to register with a new CIRA certified registrar and to renew such domain name registration(s) in accordance with the Registry PRP.

\r\n

You acknowledge and agree that should there be insufficient funds prepaid by the registrar in the CIRA Deposit Account to be applied in payment of any fees, CIRA may in its sole discretion stop accepting applications for domain name registrations from the registrar, stop effecting registrations of domain names and transfers, renewals, modifications, and cancellations requested by the registrar and stop performing other billable transactions requested by the registrar not paid in full and CIRA may terminate the Registrar Agreement between CIRA and the Registrar.

\r\n

.CA ASCII and IDN domain variants are bundled and reserved for a single registrant.  Registrants are not required to register all variants in a bundle, but all registered variants must be registered and managed at a single registrar. Each variant registered will incur a registration fee.  In addition, when registering multiple .CA domain (ASCII and IDN) variants in a bundle, your registrant information must be identical.  If variants are registered at other registrars or if registrant information does not match, it may result in an \"unavailable\" search result, delayed or failed registration. If information does not match, validation is required and may take up to seven business days and delay availability of domain. 

\r\n

(C) PROVISIONS SPECIFIC TO .CN REGISTRATIONS 

\r\n

.CN is a restricted TLD – applications are subject to both a domain name check and real name verification as required by the China.  Registrations in .CN are therefore subject to the following additional terms:

\r\n

Verification, Registration and Activation.  If a domain name is not permitted to be registered by the Chinese government, as determined by us, the Registry Operator and/or a 3rd party provider utilized for such services and determinations, in either party’s discretion, the application for registration will not be successful.  In such event, the name will be deleted and you will be eligible for a refund as further described below.

\r\n

If permitted, then the Registration may proceed, but a .CN domain name may not be activated (i.e., it will not resolve in the Internet) unless and until you have submitted (via the process described during registration) valid documents required of us and the Registry to perform real name verification.  The following are acceptable forms of documents for the purpose of verification:

\r\n
    \r\n
  • China: Resident ID, temporary resident ID, business license or organization code certificate
  • \r\n
  • Hong Kong Special Administrative Region/Macao Special Administrative Region: Resident ID, driver’s license, passport or business license
  • \r\n
  • Singapore: Driver’s license, passport or business license
  • \r\n
  • Taiwan: Resident ID, driver’s license or business license
  • \r\n
  • Other Countries/Regions: Driver’s license or passport
  • \r\n
\r\n

Documents submitted to us are used by us and shared with the Registry solely for the purpose of real name verification, and are otherwise subject to our Privacy Policy.  By registering a .CN domain, you expressly agree that your data may be stored on servers in the U.S., or otherwise outside of the China.

\r\n

Refunds.  Refunds for .CN Registrations will only be allowed where (i) registration of the applied for domain name is not permitted by the Chinese government; or (ii) you notify us of your intent to cancel for any reason within the first five (5) days after the Registration (i.e., after it is deemed permissible by the Chinese government).  For the avoidance of doubt, refunds will not be permitted under any circumstances after five (5) days from the date of Registration, including, for example, in the event real name verification is not successful or if the Chinese government determines after Registration that the domain name should not have been registered (and directs us to delete).

\r\n

(D) PROVISIONS SPECIFIC TO .JP REGISTRATIONS

\r\n

Registration Restrictions.  You represent and warrant that you have a local presence in Japan with a home or office address. You agree that certain domain names are reserved and can only be registered by certain parties. These include: (i) TLDs, other than ccTLDs, as determined by ICANN; (ii) geographical-type .JP domain names that are defined as metropolitan, prefectural, and municipal labels; (iii) names of primary and secondary educational organizations; (iv) names of organizations related to Internet management; (v) names required for .JP domain name operations; and (vi) character strings which may be confused with ASCII-converted Japanese domain names. The complete list of .JP Reserved Domains is available here

\r\n

20. ENGLISH LANGUAGE CONTROLS

\r\n

This Agreement, along with all policies and the applicable product agreements identified above and incorporated herein by reference (collectively, the “Agreement”), is executed in the English language. To the extent any translation is provided to you, it is provided for convenience purposes only, and in the event of any conflict between the English and translated version, where permitted by law, the English version will control and prevail. Where the translated version is required to be provided to you and is to be considered binding by law (i) both language versions shall have equal validity, (ii) each party acknowledges that it has reviewed both language versions and that they are substantially the same in all material respects, and (iii) in the event of any discrepancy between these two versions, the translated version may prevail, provided that the intent of the Parties has been fully taken into consideration. 

\n
\n
\n\nRevised: 10/6/17
\nCopyright © 2000-2017 All Rights Reserved.\n
\n
\n
"), + // Title: to.Ptr("Domain Name Registration Agreement"), + // URL: to.Ptr("http://www.secureserver.net/agreements/ShowDoc.aspx?pageid=reg_sa&pl_id=510456"), + // }, + // { + // AgreementKey: to.Ptr("DNPA"), + // Content: to.Ptr("\n\n\n\n\n
\n\n\n\n\n\n\n
\nDomain Name Proxy Agreement\n
\n

Last Revised: October 25, 2017

\n

Please read this Domain Name Proxy Agreement (\"Agreement\") carefully. By using the Services and/or website of Domains By Proxy, LLC, a Delaware limited liability company (\"DBP\"), You (as defined below) agree to all the terms and conditions set forth both herein and in the DBP privacy policy, which is incorporated by reference and can be found by clicking here.  You acknowledge that DBP may amend this Agreement at any time upon posting the amended terms on its website, and that any new, different or additional features changing the services provided by DBP will automatically be subject to this Agreement. If You do not agree to be bound by, or if You object to, the terms and conditions of this Agreement and any amendments hereto, do not use or access DBP's services. Continued use of DBP's services and its website after any such changes to this Agreement have been posted, constitutes Your acceptance of those changes.

\r\n

This Agreement is by and between DBP and you, your heirs, assigns, agents and contractors (\"You\") and is made effective as of the date of electronic execution. This Agreement sets forth the terms and conditions of Your relationship with DBP and Your use of DBP's services and represents the entire Agreement between You and DBP. By using DBP's Services, You acknowledge that You have read, understand and agree to be bound by all the terms and conditions of this Agreement, and You further agree to be bound by the terms of this Agreement for transactions entered into by:

\r\n
    \r\n
  1. You on Your behalf;
  2. \r\n
  3. Anyone acting as Your agent; and
  4. \r\n
  5. Anyone who uses the account You have established with DBP, whether or not the transactions were on Your behalf and/or authorized by You.
  6. \r\n
\r\n

You agree You will be bound by representations made by third parties acting on Your behalf, which either use or purchase services from DBP. You further agree that DBP will not be bound by statements of a general nature on DBP's website or DBP promotional materials. You further agree to abide by the terms and conditions promulgated by the Internet Corporation for Assigned Names and Numbers (\"ICANN\") (including the Uniform Domain Name Dispute Resolution Policy (\"Dispute Resolution Policy\") and Your Registrar (i.e., the ICANN-accredited person or entity through which You register a domain name).

\r\n

1. description of DBP's private registration services

\r\n

When You subscribe to DBP's private registration service through a DBP-affiliated Registrar, DBP will display its contact information in the publicly available \"Whois\" directory in place of Your information. DBP shall keep Your name, postal address, email address, phone and fax numbers confidential, subject to Section 4 of this Agreement. The following information (and not Your personal information) will be made publicly available in the \"Whois\" directory as determined by ICANN policy:

\r\n
    \r\n
  1. DBP's name as the proxy Registrant of the domain name and a proxy email address, phone number and postal address for the proxy Registrant's contact information;
  2. \r\n
  3. A proxy postal address and phone number for the domain name registration's technical contact;
  4. \r\n
  5. A proxy email address, postal address and phone number for the domain name registration's administrative contact;
  6. \r\n
  7. A proxy email address, postal address and phone number for the domain's name registration's billing contact;
  8. \r\n
  9. The primary and secondary domain name servers You designate for the domain name;
  10. \r\n
  11. The domain name's original date of registration and expiration date of the registration; and
  12. \r\n
  13. The identity of the Registrar.
  14. \r\n
\r\n

2. full benefits of domain registration retained by you

\r\n

Although DBP will show in the \"Whois\" directory as the Registrant of each domain name registration You designate, You will retain the full benefits of domain name registration with respect to each such domain name registration, including, subject to Section 4 below:

\r\n
    \r\n
  1. The right to sell, transfer or assign each domain name registration, which shall require cancellation of the DBP services associated with each such domain name registration;
  2. \r\n
  3. The right to control the use of each domain name registration, including designating the primary and secondary domain name servers to which each domain name points;
  4. \r\n
  5. The right to cancel each domain name registration;
  6. \r\n
  7. The right to cancel the DBP services associated with each domain name registration and/or Your privacy services with DBP so that Your contract information is listed in the \"Whois\" directory; and
  8. \r\n
  9. The right to renew each domain name registration upon its expiration, subject to Your Registrar's applicable rules and policies.
  10. \r\n
\r\n

3. PERSONAL INFORMATION AND your notification obligations; representation and warranties; ACCOUNT SECURITY

\r\n

Personal Information and Your Notification Obligations 

\r\n

You agree that for each domain name for which you use DBP services, You will provide accurate and current information as to:

\r\n
    \r\n
  1. Your name, the email address, postal address, phone and fax numbers for the domain name registration's Registrant contact;
  2. \r\n
  3. The email address, postal address, phone and fax numbers for the domain name registration's technical contact;
  4. \r\n
  5. The email address, postal address, phone and fax numbers for the domain name registration's administrative contact;
  6. \r\n
  7. The email address, postal address, phone and fax numbers for the domain name registration's billing contact; and
  8. \r\n
  9. You agree to provide government issued photo identification and/or government issued business identification as required for verification of identity when requested.
  10. \r\n
\r\n

You agree to:

\r\n
    \r\n
  1. Notify DBP within three (3) calendar days when any of the personal information You provided upon subscribing to DBP's services, changes;
  2. \r\n
  3. Respond within three (3) calendar days to any inquiries made by DBP to determine the validity of personal information provided by You; and
  4. \r\n
  5. Timely respond to email messages DBP sends to You regarding correspondence DBP has received that is either addressed to or involves You and/or Your domain name registration, as more fully set forth in Section 5(c) below.
  6. \r\n
  7. To allow DBP to act as your Designated Agent (as that term is defined below) in instances when DBP services are added to or cancelled from your domain name and for the purpose of facilitating a change of registrant request (as further described below). 
  8. \r\n
\r\n

It is Your responsibility to keep Your personal information current and accurate at all times.

\r\n

Renewals

\r\n

You agree DBP will arrange for Your Registrar to charge the credit card You have on file with the Registrar, at the Registrar's then current rates.

\r\n

If for any reason DBP and/or the Registrar for Your domain name is unable to charge Your credit card for the full amount of the service provided, or if DBP and/or the Registrar is charged back for any fee it previously charged to the credit card You provided, You agree that DBP and/or the Registrar may, without notice to You, pursue all available remedies in order to obtain payment, including but not limited to immediate cancellation of all services DBP provides to You.

\r\n

Representations and Warranties

\r\n

You warrant that all information provided by You to DBP is truthful, complete, current and accurate. You also warrant that You are using DBP's private registration services in good faith and You have no knowledge of Your domain name infringing upon or conflicting with the legal rights of a third party or a third party's trademark or trade name. You also warrant the domain name being registered by DBP on Your behalf will not be used in connection with any illegal activity, or in connection with the transmission of Spam, or that contains or installs any viruses, worms, bugs, Trojan horses or other code, files or programs designed to, or capable or, disrupting, damaging or limiting the functionality of any software or hardware.

\r\n

Account Security

\r\n

You agree You are entirely responsible for maintaining the confidentiality of Your customer number/login ID and password (\"Account Access Information\").  You agree to notify DBP immediately of any unauthorized use of Your account or any other breach of security.  You agree DBP will not be liable for any loss that You may incur as a result of someone else using Your Account Access Information, either with or without Your knowledge.  You further agree You could be held liable for losses incurred by DBP or another party due to someone else using Your Account Access Information.  For security purposes, You should keep Account Access Information in a secure location and take precautions to prevent others from gaining access to Your Account Access Information.  You agree that You are entirely responsible for all activity in Your account, whether initiated by You, or by others.  DBP specifically disclaims liability for any activity in Your account, regardless of whether You authorized the activity.

\r\n

Designated Agency and Change of Registrant Information

\r\n

“DESIGNATED AGENT” MEANS AN INDIVIDUAL OR ENTITY THAT THE PRIOR REGISTRANT OR NEW REGISTRANT EXPLICITLY AUTHORIZES TO APPROVE A CHANGE OF REGISTRANT REQUEST ON ITS BEHALF.  IN THE CASE OF DBP SERVICES, A CHANGE OF REGISTRANT REQUEST MAY ALSO ARISE DUE TO INSTANCES WHERE DBP SERVICES ARE ADDED, OR REMOVED, FROM A DOMAIN NAME.  FOR THE PURPOSE OF FACILITATING ANY SUCH CHANGE REQUEST, AND IN ACCORDANCE WITH ICANN'S CHANGE OF REGISTRANT POLICY, YOU AGREE TO APPOINT DBP AS YOUR DESIGNATED AGENT FOR THE SOLE PURPOSE OF EXPLICITLY CONSENTING TO MATERIAL CHANGES OF REGISTRATION CONTACT INFORMATION ON YOUR BEHALF.

\r\n

4. DBP's rights to deny, suspend, terminate service and to disclose your personal information

\r\n

You understand and agree that DBP has the absolute right and power, in its sole discretion and without any liability to You whatsoever, to:

\r\n
    \r\n
  1. Cancel the privacy service (which means that Your information will be available in the \"Whois\" directory) and/or reveal Your name and personal information that You provided to DBP:  
    A. When required by law, in the good faith belief that such action is necessary in order to conform to the edicts of the law or in the interest of public safety;
    B. To comply with legal process served upon DBP or in response to a reasonable threat of litigation against DBP (as determined by DBP in its sole and absolute discretion); or
    C. To comply with ICANN rules, policies, or procedures.
  2. \r\n
  3. Resolve any and all third party claims, whether threatened or made, arising out of Your use of a domain name for which DBP is the registrant listed in the \"Whois\" directory on Your behalf; or
  4. \r\n
  5. Take any other action DBP deems necessary:
    A. In the event you breach any provision of this Agreement or the DBP Anti-Spam Policy;
    B. To protect the integrity and stability of, and to comply with registration requirements, terms, conditions and policies of, the applicable domain name Registry and/or Registry Provider;
        C. To comply with any applicable laws, government rules or requirements, subpoenas, court orders or requests of law enforcement; 
    D. To comply with ICANN's Dispute Resolution Policy or ICANN's Change of Registrant Policy;
    E. To avoid any financial loss or legal liability (civil or criminal) on the part of DBP, its parent companies, subsidiaries, affiliates, shareholders, agents, officers, directors and employees;
    F. If the domain name for which DBP is the registrant on Your behalf violates or infringes a third party's trademark, trade name or other legal rights; and
    G. If it comes to DBP's attention that You are using DBP's services in a manner (as determined by DBP in its sole and absolute discretion) that:
  6. \r\n
\r\n
\r\n
    \r\n
  • Is illegal, or promotes or encourages illegal activity;
  • \r\n
  • Promotes, encourages or engages in child pornography or the exploitation of children;
  • \r\n
  • Promotes, encourages or engages in terrorism, violence against people, animals, or property;
  • \r\n
  • Promotes, encourages or engages in any spam or other unsolicited bulk email, or computer or network hacking or cracking;
  • \r\n
  • Violates the Ryan Haight Online Pharmacy Consumer Protection Act of 2008 or similar legislation, or promotes, encourages or engages in the sale or distribution of prescription medication without a valid prescription;  
  • \r\n
  • Infringes on the intellectual property rights of another User or any other person or entity;
  • \r\n
  • Violates the privacy or publicity rights of another User or any other person or entity, or breaches any duty of confidentiality that you owe to another User or any other person or entity;
  • \r\n
  • Interferes with the operation of DBP services;
  • \r\n
  • Contains or installs any viruses, worms, bugs, Trojan horses or other code, files or programs designed to, or capable of, disrupting, damaging or limiting the functionality of any software or hardware; or
  • \r\n
  • Contains false or deceptive language, or unsubstantiated or comparative claims, regarding DBP or its services.
  • \r\n
\r\n
\r\n

You further understand and agree that if DBP is named as a defendant in, or investigated in anticipation of, any legal or administrative proceeding arising out of Your domain name registration or Your use of DBP's services, Your private registration service may be canceled, which means the domain name registration will revert back to You and Your identity will therefore be revealed in the Whois directory as Registrant.

\r\n

In the event:

\r\n
    \r\n
  1. DBP takes any of the actions set forth in subsection i, ii, or iii above or section 5; and/or
  2. \r\n
  3. You elect to cancel DBP's services for any reason --
  4. \r\n
\r\n

Neither DBP nor your Registrar will refund any fees paid by You whatsoever.

\r\n

5. communications forwarding

\r\n

a. Correspondence Forwarding

\r\n

Inasmuch as DBP's name, postal address and phone number will be listed in the Whois directory, You agree DBP will review and forward communications addressed to Your domain name that are received via email, certified or traceable courier mail (such as UPS, FedEx, or DHL), or first class U.S. postal mail. You specifically acknowledge DBP will not forward to You first class postal mail (other than legal notices), \"junk\" mail or other unsolicited communications (whether delivered through email, fax, postal mail or telephone), and You further authorize DBP to either discard all such communications or return all such communications to sender unopened. You agree to waive any and all claims arising from Your failure to receive communications directed to Your domain name but not forwarded to You by DBP.

\r\n

b. Email Forwarding

\r\n

The Whois directory requires an email address for every purchased domain name registration. When You purchase a private domain registration, DBP creates a private email address for that domain name, \"@domainsbyproxy.com\". Thereafter, when messages are sent to that private email address, DBP handles them according to the email preference You selected for that particular domain name. You have three (3) email preferences from which to choose. You can elect to:

\r\n
    \r\n
  1. Have all of the messages forwarded;
  2. \r\n
  3. Have all of the messages filtered for Spam and then forwarded; or
  4. \r\n
  5. Have none of the messages forwarded.
  6. \r\n
\r\n

As with all communications, You agree to waive any and all claims arising from Your failure to receive email directed to Your domain name but not forwarded to You by DBP.

\r\n

c. Notifications Regarding Correspondence and Your Obligation to Respond

\r\n

When DBP receives certified or traceable courier mail or legal notices addressed to Your domain name, in most cases, DBP will attempt to forward the mail to you via email. If You do not respond to the DBP email and/or the correspondence DBP has received regarding Your domain name registration concerns a dispute of any kind or otherwise requires immediate disposition, DBP may immediately reveal Your identity and/or cancel the DBP private registration service regarding either the domain name registration(s) in question. This means the Whois directory will revert to displaying Your name, postal address, email address and phone number that you provided to DBP.

\r\n

d. Additional Administrative Fees

\r\n

DBP reserves the right to charge You reasonable \"administrative fees\" or \"processing fees\" for (i)  tasks DBP may perform outside the normal scope of its Services, (ii) additional time and/or costs DBP may incur in providing its Services, and/or (iii) Your non-compliance with the Agreement (as determined by DBP in its sole and absolute discretion). Typical administrative or processing fee scenarios include, but are not limited to, (i) customer service issues that require additional personal time and attention; (ii) disputes that require accounting or legal services, whether performed by DBP staff or by outside firms retained by DBP; (iii) recouping any and all costs and fees, including the cost of Services, incurred by DBP as the result of chargebacks or other payment disputes brought by You, Your bank or Payment Method processor.  These administrative fees or processing fees will be billed to the Payment Method You have on file with Your Registrar.

\r\n

You agree to waive the right to trial by jury in any proceeding that takes place relating to or arising out of this Agreement.

\r\n

6. limitations of liability

\r\n

UNDER NO CIRCUMSTANCES SHALL DBP BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, PUNITIVE, SPECIAL, OR CONSEQUENTIAL DAMAGES FOR ANY REASON WHATSOEVER RELATED TO THIS AGREEMENT, YOUR DOMAIN NAME REGISTRATION, DBP'S SERVICES, USE OR INABILITY TO USE THE DBP WEBSITE OR THE MATERIALS AND CONTENT OF THE WEBSITE OR ANY OTHER WEBSITES LINKED TO THE DBP WEBSITE OR YOUR PROVISION OF ANY PERSONALLY IDENTIFIABLE INFORMATION TO DBP OR ANY THIRD PARTY. THIS LIMITATION APPLIES REGARDLESS OF WHETHER THE ALLEGED LIABILITY IS BASED ON CONTRACT, TORT, WARRANTY, NEGLIGENCE, STRICT LIABILITY OR ANY OTHER BASIS, EVEN IF DBP HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES OR SUCH DAMAGES WERE REASONABLY FORESEEABLE. BECAUSE CERTAIN JURISDICTIONS DO NOT PERMIT THE LIMITATION OR ELIMINATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES, DBP'S LIABILITY IN SUCH JURISDICTIONS SHALL BE LIMITED TO THE SMALLEST AMOUNT PERMITTED BY LAW.

\r\n

YOU FURTHER UNDERSTAND AND AGREE THAT DBP DISCLAIMS ANY LOSS OR LIABILITY RESULTING FROM:

\r\n
    \r\n
  1. THE INADVERTENT DISCLOSURE OR THEFT OF YOUR PERSONAL INFORMATION;
  2. \r\n
  3. ACCESS DELAYS OR INTERRUPTIONS TO OUR WEBSITE OR THE WEBSITES OF OUR AFFILIATED REGISTRARS;
  4. \r\n
  5. DATA NON-DELIVERY OF MIS-DELIVERY BETWEEN YOU AND DBP;
  6. \r\n
  7. THE FAILURE FOR WHATEVER REASON TO RENEW A PRIVATE DOMAIN NAME REGISTRATION;
  8. \r\n
  9. THE UNAUTHORIZED USE OF YOUR DBP ACCOUNT OR ANY OF DBP'S SERVICES;
  10. \r\n
  11. ERRORS, OMISSIONS OR MISSTATEMENTS BY DBP;
  12. \r\n
  13. DELETION OF, FAILURE TO STORE, FAILURE TO PROCESS OR ACT UPON EMAIL MESSAGES FORWARDED TO EITHER YOU OR YOUR PRIVATE DOMAIN NAME REGISTRATION;
  14. \r\n
  15. PROCESSING OF UPDATED INFORMATION REGARDING YOUR DBP ACCOUNT; AND/OR
  16. \r\n
  17. ANY ACT OR OMISSION CAUSED BY YOU OR YOUR AGENTS (WHETHER AUTHORIZED BY YOU OR NOT).
  18. \r\n
\r\n

7. indemnity

\r\n

You agree to release, defend, indemnify and hold harmless DBP, its parent companies, subsidiaries, affiliates, shareholders, agents, directors, officers and employees and Your Registrar, from and against any and all claims, demands, liabilities, losses, damages or costs, including reasonable attorneys' fees, arising out of or related in any way to this Agreement, the services provided hereunder by DBP, the DBP website, Your account with DBP, Your use of Your domain name registration, and/or disputes arising in connection with the dispute policy.

\r\n

8. DBP warranty disclaimer

\r\n

DBP, ITS PARENT COMPANIES, SUBSIDIARIES, AFFILIATES, SHAREHOLDERS, AGENTS, DIRECTORS, OFFICERS, AND EMPLOYEES EXPRESSLY DISCLAIM ALL REPRESENTATIONS AND WARRANTIES OF ANY KIND IN CONNECTION WITH THIS AGREEMENT, THE SERVICE PROVIDED HEREUNDER, THE DBP WEBSITE OR ANY WEBSITES LINKED TO THE DBP WEBSITE, WHETHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL DBP SERVICES, AS WELL AS THE DBP WEBSITE, ARE PROVIDED \"AS IS\". YOUR SUBSCRIPTION TO AND USE OF DBP'S SERVICES AND ITS WEBSITE ARE ENTIRELY AT YOUR RISK. SOME JURISDICTIONS DO NOT ALLOW THE DISCLAIMER OF IMPLIED WARRANTIES, IN WHICH EVENT THE FOREGOING DISCLAIMER MAY NOT APPLY TO YOU.

\r\n

9. copyright and trademark

\r\n

You understand and agree that all content and materials contained in this Agreement, the Privacy Policy and the DBP website found here , are protected by the various copyright, patent, trademark, service mark and trade secret laws of the United States, as well as any other applicable proprietary rights and laws, and that DBP expressly reserves its rights in and to all such content and materials.

\r\n

You further understand and agree You are prohibited from using, in any manner whatsoever, any of the afore-described content and materials without the express written permission of DBP. No license or right under any copyright, patent, trademark, service mark or other proprietary right or license is granted to You or conferred upon You by this Agreement or otherwise.

\r\n

10. miscellaneous provisions

\r\n

a. Severability; Construction; Entire Agreement

\r\n

If any part of this Agreement shall be held to be illegal, unenforceable or invalid, in whole or in part, such provision shall be modified to the minimum extent necessary to make it legal, enforceable and valid, and the legality, enforceability and validity of the remaining provisions of this Agreement shall not be affected or impaired. The headings herein will not be considered a part of this Agreement. You agree this Agreement, including the policies it incorporates by reference, constitute the complete and only Agreement between You and DBP regarding the services contemplated herein.

\r\n

b. Governing Law; Venue; Waiver Of Trial By Jury

\r\n

This Agreement shall be governed in all respects by the laws and judicial decisions of Maricopa County, Arizona, excluding its conflicts of laws rules. Except as provided immediately below, You agree that any action relating to or arising out of this Agreement, shall be brought exclusively in the courts of Maricopa County, Arizona. For the adjudication of domain name registration disputes, you agree to submit to the exclusive jurisdiction and venue of the U.S. District Court for the District of Arizona located in Phoenix, Arizona. You agree to waive the right to trial by jury in any proceeding, regardless of venue, that takes place relating to or arising out of this Agreement.

\r\n

c. Notices

\r\n

All notices from DBP to You will be sent to the email address You provided to DBP. Notices by email shall be deemed effective twenty-four (24) hours after the email is sent by DBP, unless DBP receives notice that the email address is invalid, in which event DBP may give You notice via first class or certified mail, return receipt requested. All notices from You to DBP shall be sent via certified mail, return receipt requested or traceable courier to:

\r\n
      Domains By Proxy, LLC
      Attn: General Counsel
      14455 North Hayden Rd.
      Suite 219
      Scottsdale, AZ 85260
\r\n

Notices sent via certified mail or traceable courier shall be deemed effective five (5) days after the date of mailing.

\r\n

d. Insurance

\r\n

In the unlikely event You lose Your domain name registration to a third party solely as a result of DBP's negligent actions (and absent fraud or other negligent or willful misconduct committed by a third party), You may be insured against such loss through DBP's Professional Liability Insurance Policy, which is currently underwritten by American International Insurance Company. Of course, every claim is subject to the then-carrier's investigation into the facts and circumstances surrounding such claim. In the event You have reason to believe that circumstances exist which warrant the filing of an insurance claim, please send a written notice (specifying the basis for such claim), via certified mail, return receipt requested, to:

\r\n
      Domains By Proxy, LLC
      Attn: Insurance Claims
      14455 North Hayden Rd.
      Suite 219
      Scottsdale, AZ 85260
\r\n

e. Indemnification

\r\n

In the unlikely event You lose Your domain name registration to a third party solely as a result of DBP's willful misconduct, Your Registrar (the \"Indemnifying Party\") will indemnify and hold You harmless against any losses, damages or costs (including reasonable attorneys' fees) resulting from any claim, action, proceeding, suit or demand arising out of or related to the loss of Your domain name registration. Such indemnification obligations under this Section 10(e) are conditioned upon the following:

\r\n
    \r\n
  1. That You promptly give both DBP and the Indemnifying Party written notice of the claim, demand, or action and provide reasonable assistance to the Indemnifying Party, at its cost and expense, in connection therewith, and
  2. \r\n
  3. That the Indemnifying Party has the right, at its option, to control and direct the defense to any settlement of such claim, demand, or action.
  4. \r\n
\r\n

Any notice concerning indemnification shall, with respect to DBP, be sent in accordance with Section 10(c) of this Agreement. With respect to Your Registrar, notices regarding indemnification should be sent in accordance with the notification provisions contained in Your Registrar's Domain Name Registration Agreement.

\r\n

f. Term of Agreement; Survival

\r\n

The terms of this Agreement shall continue in full force and effect as long as DBP is the Registrant for any domain name on Your behalf. Sections 5 (Communications Forwarding), 6 (Limitation of Liability), 7 (Indemnity), 8 (Warranty Disclaimer) and 10 (Miscellaneous Provisions) shall survive any termination or expiration of this Agreement.

\n
\n
\n\nRevised: 10/25/17
\nCopyright © 2003-2017 All Rights Reserved.\n
\n
\n
"), + // Title: to.Ptr("Domain Name Proxy Agreement"), + // URL: to.Ptr("http://www.secureserver.net/agreements/ShowDoc.aspx?pageid=domain_nameproxy&pl_id=510456"), + // }, + // }, + // }, + // } + } +} diff --git a/sdk/resourcemanager/domainregistration/armdomainregistration/tsp-location.yaml b/sdk/resourcemanager/domainregistration/armdomainregistration/tsp-location.yaml new file mode 100644 index 000000000000..046199205c1d --- /dev/null +++ b/sdk/resourcemanager/domainregistration/armdomainregistration/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/domainregistration/resource-manager/Microsoft.DomainRegistration/DomainRegistration +commit: 49e23eb28ab52a6dc3453b0a7ba10351d672f547 +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/resourcemanager/domainregistration/armdomainregistration/version.go b/sdk/resourcemanager/domainregistration/armdomainregistration/version.go new file mode 100644 index 000000000000..6d015f66164f --- /dev/null +++ b/sdk/resourcemanager/domainregistration/armdomainregistration/version.go @@ -0,0 +1,10 @@ +// 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) Go Code Generator. + +package armdomainregistration + +const ( + moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/domainregistration/armdomainregistration" + moduleVersion = "v0.1.0" +) From 100a1cdd616fee27b02e19829ccf50b10f46eb07 Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Sat, 14 Feb 2026 08:13:35 +0000 Subject: [PATCH 2/3] Configurations: 'specification/domainregistration/resource-manager/Microsoft.DomainRegistration/DomainRegistration/tspconfig.yaml', API Version: 2024-11-01, SDK Release Type: stable, and CommitSHA: 'ef2861b087812b48cf32bdacf604a98406ce0ae7' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=5883107 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. --- .../armdomainregistration/CHANGELOG.md | 2 +- .../armdomainregistration/domains_client.go | 25 +------------------ .../fake/domains_server.go | 6 ----- .../armdomainregistration/responses.go | 6 +---- .../armdomainregistration/tsp-location.yaml | 2 +- 5 files changed, 4 insertions(+), 37 deletions(-) diff --git a/sdk/resourcemanager/domainregistration/armdomainregistration/CHANGELOG.md b/sdk/resourcemanager/domainregistration/armdomainregistration/CHANGELOG.md index 35efeab155cd..c016c289fc50 100644 --- a/sdk/resourcemanager/domainregistration/armdomainregistration/CHANGELOG.md +++ b/sdk/resourcemanager/domainregistration/armdomainregistration/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 0.1.0 (2026-02-12) +## 0.1.0 (2026-02-14) ### Other Changes The package of `github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/domainregistration/armdomainregistration` is using our [next generation design principles](https://azure.github.io/azure-sdk/general_introduction.html). diff --git a/sdk/resourcemanager/domainregistration/armdomainregistration/domains_client.go b/sdk/resourcemanager/domainregistration/armdomainregistration/domains_client.go index 7bfba04cac2a..972baffbf91f 100644 --- a/sdk/resourcemanager/domainregistration/armdomainregistration/domains_client.go +++ b/sdk/resourcemanager/domainregistration/armdomainregistration/domains_client.go @@ -853,8 +853,7 @@ func (client *DomainsClient) Renew(ctx context.Context, resourceGroupName string err = runtime.NewResponseError(httpResp) return DomainsClientRenewResponse{}, err } - resp, err := client.renewHandleResponse(httpResp) - return resp, err + return DomainsClientRenewResponse{}, nil } // renewCreateRequest creates the Renew request. @@ -882,20 +881,6 @@ func (client *DomainsClient) renewCreateRequest(ctx context.Context, resourceGro return req, nil } -// renewHandleResponse handles the Renew response. -func (client *DomainsClient) renewHandleResponse(resp *http.Response) (DomainsClientRenewResponse, error) { - result := DomainsClientRenewResponse{} - if val := resp.Header.Get("Retry-After"); val != "" { - retryAfter32, err := strconv.ParseInt(val, 10, 32) - retryAfter := int32(retryAfter32) - if err != nil { - return DomainsClientRenewResponse{}, err - } - result.RetryAfter = &retryAfter - } - return result, nil -} - // TransferOut - Transfer out domain to another registrar // // Transfer out domain to another registrar @@ -1027,14 +1012,6 @@ func (client *DomainsClient) updateCreateRequest(ctx context.Context, resourceGr // updateHandleResponse handles the Update response. func (client *DomainsClient) updateHandleResponse(resp *http.Response) (DomainsClientUpdateResponse, error) { result := DomainsClientUpdateResponse{} - if val := resp.Header.Get("Retry-After"); val != "" { - retryAfter32, err := strconv.ParseInt(val, 10, 32) - retryAfter := int32(retryAfter32) - if err != nil { - return DomainsClientUpdateResponse{}, err - } - result.RetryAfter = &retryAfter - } if err := runtime.UnmarshalAsJSON(resp, &result.Domain); err != nil { return DomainsClientUpdateResponse{}, err } diff --git a/sdk/resourcemanager/domainregistration/armdomainregistration/fake/domains_server.go b/sdk/resourcemanager/domainregistration/armdomainregistration/fake/domains_server.go index 8925984f2abf..347e85094060 100644 --- a/sdk/resourcemanager/domainregistration/armdomainregistration/fake/domains_server.go +++ b/sdk/resourcemanager/domainregistration/armdomainregistration/fake/domains_server.go @@ -661,9 +661,6 @@ func (d *DomainsServerTransport) dispatchRenew(req *http.Request) (*http.Respons if err != nil { return nil, err } - if val := server.GetResponse(respr).RetryAfter; val != nil { - resp.Header.Set("Retry-After", strconv.FormatInt(int64(*val), 10)) - } return resp, nil } @@ -734,9 +731,6 @@ func (d *DomainsServerTransport) dispatchUpdate(req *http.Request) (*http.Respon if err != nil { return nil, err } - if val := server.GetResponse(respr).RetryAfter; val != nil { - resp.Header.Set("Retry-After", strconv.FormatInt(int64(*val), 10)) - } return resp, nil } diff --git a/sdk/resourcemanager/domainregistration/armdomainregistration/responses.go b/sdk/resourcemanager/domainregistration/armdomainregistration/responses.go index f0d0a66ff199..b815e8deae15 100644 --- a/sdk/resourcemanager/domainregistration/armdomainregistration/responses.go +++ b/sdk/resourcemanager/domainregistration/armdomainregistration/responses.go @@ -76,8 +76,7 @@ type DomainsClientListResponse struct { // DomainsClientRenewResponse contains the response from method DomainsClient.Renew. type DomainsClientRenewResponse struct { - // The Retry-After header can indicate how long the client should wait before polling the operation status. - RetryAfter *int32 + // placeholder for future response values } // DomainsClientTransferOutResponse contains the response from method DomainsClient.TransferOut. @@ -96,9 +95,6 @@ type DomainsClientUpdateOwnershipIdentifierResponse struct { type DomainsClientUpdateResponse struct { // Information about a domain. Domain - - // The Retry-After header can indicate how long the client should wait before polling the operation status. - RetryAfter *int32 } // ProviderClientListOperationsResponse contains the response from method ProviderClient.NewListOperationsPager. diff --git a/sdk/resourcemanager/domainregistration/armdomainregistration/tsp-location.yaml b/sdk/resourcemanager/domainregistration/armdomainregistration/tsp-location.yaml index 046199205c1d..79f61d613c3b 100644 --- a/sdk/resourcemanager/domainregistration/armdomainregistration/tsp-location.yaml +++ b/sdk/resourcemanager/domainregistration/armdomainregistration/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/domainregistration/resource-manager/Microsoft.DomainRegistration/DomainRegistration -commit: 49e23eb28ab52a6dc3453b0a7ba10351d672f547 +commit: ef2861b087812b48cf32bdacf604a98406ce0ae7 repo: Azure/azure-rest-api-specs additionalDirectories: From 0b4f1db94e354707f444404078138936eefc78d5 Mon Sep 17 00:00:00 2001 From: "judy.liu" Date: Sat, 14 Feb 2026 16:35:02 +0800 Subject: [PATCH 3/3] update readme --- .../domainregistration/armdomainregistration/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sdk/resourcemanager/domainregistration/armdomainregistration/README.md b/sdk/resourcemanager/domainregistration/armdomainregistration/README.md index 47cd45d63576..3a3eda74eb04 100644 --- a/sdk/resourcemanager/domainregistration/armdomainregistration/README.md +++ b/sdk/resourcemanager/domainregistration/armdomainregistration/README.md @@ -1,6 +1,6 @@ -# Azure Domainregistration Module for Go +# Azure Domain Registration Module for Go -The `armdomainregistration` module provides operations for working with Azure Domainregistration. +The `armdomainregistration` module provides operations for working with Azure Domain Registration. [Source code](https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/resourcemanager/domainregistration/armdomainregistration) @@ -15,7 +15,7 @@ The `armdomainregistration` module provides operations for working with Azure Do This project uses [Go modules](https://github.com/golang/go/wiki/Modules) for versioning and dependency management. -Install the Azure Domainregistration module: +Install the Azure Domain Registration module: ```sh go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/domainregistration/armdomainregistration @@ -23,7 +23,7 @@ go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/domainregistration/ ## Authorization -When creating a client, you will need to provide a credential for authenticating with Azure Domainregistration. The `azidentity` module provides facilities for various ways of authenticating with Azure including client/secret, certificate, managed identity, and more. +When creating a client, you will need to provide a credential for authenticating with Azure Domain Registration. The `azidentity` module provides facilities for various ways of authenticating with Azure including client/secret, certificate, managed identity, and more. ```go cred, err := azidentity.NewDefaultAzureCredential(nil) @@ -33,7 +33,7 @@ For more information on authentication, please see the documentation for `aziden ## Client Factory -Azure Domainregistration module consists of one or more clients. We provide a client factory which could be used to create any client in this module. +Azure Domain Registration module consists of one or more clients. We provide a client factory which could be used to create any client in this module. ```go clientFactory, err := armdomainregistration.NewClientFactory(, cred, nil)