Cloud Domains API v1beta1 - Package cloud.google.com/go/domains/apiv1beta1 (v0.10.7)

Beta

This library is covered by thePre-GA Offerings Terms of the Terms of Service. Pre-GA libraries might have limited support, and changes to pre-GA libraries might not be compatible with other pre-GA versions. For more information, see thelaunch stage descriptions.

Note: To get more information about this package, such as access to older versions, viewthis package on pkg.go.dev.

Package domains is an auto-generated package for theCloud Domains API.

Enables management and configuration of domain names.

NOTE:Thispackageisinbeta.Itisnotstable,andmaybesubjecttochanges.

General documentation

For information that is relevant for all client libraries please referencehttps://pkg.go.dev/cloud.google.com/go#pkg-overview. Some information on thispage includes:

Example usage

To get started with this package, create a client.

// go get cloud.google.com/go/domains/apiv1beta1@latestctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in://   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=domains.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()

The client will use your default application credentials. Clients should be reused instead of created as needed.The methods of Client are safe for concurrent use by multiple goroutines.The returned client must be Closed when it is done being used.

Using the Client

The following is an example of making an API call with the newly created client, mentioned above.

req:=&domainspb.ConfigureContactSettingsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/domains/apiv1beta1/domainspb#ConfigureContactSettingsRequest.}op,err:=c.ConfigureContactSettings(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp

Use of Context

The ctx passed to NewClient is used for authentication requests andfor creating the underlying connection, but is not used for subsequent calls.Individual methods on the client use the ctx given to them.

To close the open connection, use the Close() method.

Functions

func DefaultAuthScopes

funcDefaultAuthScopes()[]string

DefaultAuthScopes reports the default set of authentication scopes to use with this package.

CallOptions

typeCallOptionsstruct{SearchDomains[]gax.CallOptionRetrieveRegisterParameters[]gax.CallOptionRegisterDomain[]gax.CallOptionRetrieveTransferParameters[]gax.CallOptionTransferDomain[]gax.CallOptionListRegistrations[]gax.CallOptionGetRegistration[]gax.CallOptionUpdateRegistration[]gax.CallOptionConfigureManagementSettings[]gax.CallOptionConfigureDnsSettings[]gax.CallOptionConfigureContactSettings[]gax.CallOptionExportRegistration[]gax.CallOptionDeleteRegistration[]gax.CallOptionRetrieveAuthorizationCode[]gax.CallOptionResetAuthorizationCode[]gax.CallOption}

CallOptions contains the retry settings for each method of Client.

Client

typeClientstruct{// The call options for this service.CallOptions*CallOptions// LROClient is used internally to handle long-running operations.// It is exposed so that its CallOptions can be modified if required.// Users should not Close this client.LROClient*lroauto.OperationsClient// contains filtered or unexported fields}

Client is a client for interacting with Cloud Domains API.Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

The Cloud Domains API enables management and configuration of domain names.

func NewClient

funcNewClient(ctxcontext.Context,opts...option.ClientOption)(*Client,error)

NewClient creates a new domains client based on gRPC.The returned client must be Closed when it is done being used to clean up its underlying connections.

The Cloud Domains API enables management and configuration of domain names.

Example

packagemainimport("context"domains"cloud.google.com/go/domains/apiv1beta1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in://   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=domains.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}

func NewRESTClient

funcNewRESTClient(ctxcontext.Context,opts...option.ClientOption)(*Client,error)

NewRESTClient creates a new domains rest client.

The Cloud Domains API enables management and configuration of domain names.

Example

packagemainimport("context"domains"cloud.google.com/go/domains/apiv1beta1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in://   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=domains.NewRESTClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}

func (*Client) Close

func(c*Client)Close()error

Close closes the connection to the API service. The user should invoke this whenthe client is no longer required.

func (*Client) ConfigureContactSettings

ConfigureContactSettings updates a Registration's contact settings. Some changes requireconfirmation by the domain’s registrant contact .

Example

packagemainimport("context"domains"cloud.google.com/go/domains/apiv1beta1"domainspb"cloud.google.com/go/domains/apiv1beta1/domainspb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in://   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=domains.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&domainspb.ConfigureContactSettingsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/domains/apiv1beta1/domainspb#ConfigureContactSettingsRequest.}op,err:=c.ConfigureContactSettings(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*Client) ConfigureContactSettingsOperation

func(c*Client)ConfigureContactSettingsOperation(namestring)*ConfigureContactSettingsOperation

ConfigureContactSettingsOperation returns a new ConfigureContactSettingsOperation from a given name.The name must be that of a previously created ConfigureContactSettingsOperation, possibly from a different process.

func (*Client) ConfigureDnsSettings

ConfigureDnsSettings updates a Registration's DNS settings.

Example

packagemainimport("context"domains"cloud.google.com/go/domains/apiv1beta1"domainspb"cloud.google.com/go/domains/apiv1beta1/domainspb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in://   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=domains.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&domainspb.ConfigureDnsSettingsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/domains/apiv1beta1/domainspb#ConfigureDnsSettingsRequest.}op,err:=c.ConfigureDnsSettings(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*Client) ConfigureDnsSettingsOperation

func(c*Client)ConfigureDnsSettingsOperation(namestring)*ConfigureDnsSettingsOperation

ConfigureDnsSettingsOperation returns a new ConfigureDnsSettingsOperation from a given name.The name must be that of a previously created ConfigureDnsSettingsOperation, possibly from a different process.

func (*Client) ConfigureManagementSettings

ConfigureManagementSettings updates a Registration's management settings.

Example

packagemainimport("context"domains"cloud.google.com/go/domains/apiv1beta1"domainspb"cloud.google.com/go/domains/apiv1beta1/domainspb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in://   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=domains.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&domainspb.ConfigureManagementSettingsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/domains/apiv1beta1/domainspb#ConfigureManagementSettingsRequest.}op,err:=c.ConfigureManagementSettings(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*Client) ConfigureManagementSettingsOperation

func(c*Client)ConfigureManagementSettingsOperation(namestring)*ConfigureManagementSettingsOperation

ConfigureManagementSettingsOperation returns a new ConfigureManagementSettingsOperation from a given name.The name must be that of a previously created ConfigureManagementSettingsOperation, possibly from a different process.

func (*Client) Connection (deprecated)

func(c*Client)Connection()*grpc.ClientConn

Connection returns a connection to the API service.

Deprecated: Connections are now pooled so this method does not alwaysreturn the same resource.

func (*Client) DeleteRegistration

DeleteRegistration deletes a Registration resource.

This method works on any Registration resource using Subscription orCommitment billing (at /domains/pricing#billing-models), provided that theresource was created at least 1 day in the past.

For Registration resources usingMonthly billing (at /domains/pricing#billing-models), this method works if:

state is EXPORTED with expire_time in the paststate is REGISTRATION_FAILEDstate is TRANSFER_FAILED

When an active registration is successfully deleted, you can continue touse the domain in Google Domains (athttps://domains.google/) until itexpires. The calling user becomes the domain’s sole owner in GoogleDomains, and permissions for the domain are subsequently managed there. Thedomain does not renew automatically unless the new owner sets up billing inGoogle Domains.

Example

packagemainimport("context"domains"cloud.google.com/go/domains/apiv1beta1"domainspb"cloud.google.com/go/domains/apiv1beta1/domainspb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in://   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=domains.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&domainspb.DeleteRegistrationRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/domains/apiv1beta1/domainspb#DeleteRegistrationRequest.}op,err:=c.DeleteRegistration(ctx,req)iferr!=nil{// TODO: Handle error.}err=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}}

func (*Client) DeleteRegistrationOperation

func(c*Client)DeleteRegistrationOperation(namestring)*DeleteRegistrationOperation

DeleteRegistrationOperation returns a new DeleteRegistrationOperation from a given name.The name must be that of a previously created DeleteRegistrationOperation, possibly from a different process.

func (*Client) ExportRegistration

ExportRegistration exports a Registration resource, such that it is no longer managed byCloud Domains.

When an active domain is successfully exported, you can continue to use thedomain in Google Domains (athttps://domains.google/) until it expires. Thecalling user becomes the domain’s sole owner in Google Domains, andpermissions for the domain are subsequently managed there. The domain doesnot renew automatically unless the new owner sets up billing in GoogleDomains.

Example

packagemainimport("context"domains"cloud.google.com/go/domains/apiv1beta1"domainspb"cloud.google.com/go/domains/apiv1beta1/domainspb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in://   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=domains.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&domainspb.ExportRegistrationRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/domains/apiv1beta1/domainspb#ExportRegistrationRequest.}op,err:=c.ExportRegistration(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*Client) ExportRegistrationOperation

func(c*Client)ExportRegistrationOperation(namestring)*ExportRegistrationOperation

ExportRegistrationOperation returns a new ExportRegistrationOperation from a given name.The name must be that of a previously created ExportRegistrationOperation, possibly from a different process.

func (*Client) GetRegistration

GetRegistration gets the details of a Registration resource.

Example

packagemainimport("context"domains"cloud.google.com/go/domains/apiv1beta1"domainspb"cloud.google.com/go/domains/apiv1beta1/domainspb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in://   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=domains.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&domainspb.GetRegistrationRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/domains/apiv1beta1/domainspb#GetRegistrationRequest.}resp,err:=c.GetRegistration(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*Client) ListRegistrations

ListRegistrations lists the Registration resources in a project.

Examples

packagemainimport("context"domains"cloud.google.com/go/domains/apiv1beta1"domainspb"cloud.google.com/go/domains/apiv1beta1/domainspb""google.golang.org/api/iterator")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in://   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=domains.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&domainspb.ListRegistrationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/domains/apiv1beta1/domainspb#ListRegistrationsRequest.}it:=c.ListRegistrations(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp// If you need to access the underlying RPC response,// you can do so by casting the `Response` as below.// Otherwise, remove this line. Only populated after// first call to Next(). Not safe for concurrent access._=it.Response.(*domainspb.ListRegistrationsResponse)}}
all
packagemainimport("context"domains"cloud.google.com/go/domains/apiv1beta1"domainspb"cloud.google.com/go/domains/apiv1beta1/domainspb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in://   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=domains.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&domainspb.ListRegistrationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/domains/apiv1beta1/domainspb#ListRegistrationsRequest.}forresp,err:=rangec.ListRegistrations(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}

func (*Client) RegisterDomain

RegisterDomain registers a new domain name and creates a corresponding Registrationresource.

Call RetrieveRegisterParameters first to check availability of the domainname and determine parameters like price that are needed to build a call tothis method.

A successful call creates a Registration resource in stateREGISTRATION_PENDING, which resolves to ACTIVE within 1-2minutes, indicating that the domain was successfully registered. If theresource ends up in state REGISTRATION_FAILED, it indicates that thedomain was not registered successfully, and you can safely delete theresource and retry registration.

Example

packagemainimport("context"domains"cloud.google.com/go/domains/apiv1beta1"domainspb"cloud.google.com/go/domains/apiv1beta1/domainspb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in://   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=domains.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&domainspb.RegisterDomainRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/domains/apiv1beta1/domainspb#RegisterDomainRequest.}op,err:=c.RegisterDomain(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*Client) RegisterDomainOperation

func(c*Client)RegisterDomainOperation(namestring)*RegisterDomainOperation

RegisterDomainOperation returns a new RegisterDomainOperation from a given name.The name must be that of a previously created RegisterDomainOperation, possibly from a different process.

func (*Client) ResetAuthorizationCode

ResetAuthorizationCode resets the authorization code of the Registration to a new random string.

You can call this method only after 60 days have elapsed since the initialdomain registration.

Example

packagemainimport("context"domains"cloud.google.com/go/domains/apiv1beta1"domainspb"cloud.google.com/go/domains/apiv1beta1/domainspb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in://   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=domains.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&domainspb.ResetAuthorizationCodeRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/domains/apiv1beta1/domainspb#ResetAuthorizationCodeRequest.}resp,err:=c.ResetAuthorizationCode(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*Client) RetrieveAuthorizationCode

RetrieveAuthorizationCode gets the authorization code of the Registration for the purpose oftransferring the domain to another registrar.

You can call this method only after 60 days have elapsed since the initialdomain registration.

Example

packagemainimport("context"domains"cloud.google.com/go/domains/apiv1beta1"domainspb"cloud.google.com/go/domains/apiv1beta1/domainspb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in://   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=domains.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&domainspb.RetrieveAuthorizationCodeRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/domains/apiv1beta1/domainspb#RetrieveAuthorizationCodeRequest.}resp,err:=c.RetrieveAuthorizationCode(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*Client) RetrieveRegisterParameters

RetrieveRegisterParameters gets parameters needed to register a new domain name, including price andup-to-date availability. Use the returned values to call RegisterDomain.

Example

packagemainimport("context"domains"cloud.google.com/go/domains/apiv1beta1"domainspb"cloud.google.com/go/domains/apiv1beta1/domainspb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in://   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=domains.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&domainspb.RetrieveRegisterParametersRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/domains/apiv1beta1/domainspb#RetrieveRegisterParametersRequest.}resp,err:=c.RetrieveRegisterParameters(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*Client) RetrieveTransferParameters

RetrieveTransferParameters gets parameters needed to transfer a domain name from another registrar toCloud Domains. For domains managed by Google Domains, transferring to CloudDomains is not supported.

Use the returned values to call TransferDomain.

Example

packagemainimport("context"domains"cloud.google.com/go/domains/apiv1beta1"domainspb"cloud.google.com/go/domains/apiv1beta1/domainspb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in://   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=domains.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&domainspb.RetrieveTransferParametersRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/domains/apiv1beta1/domainspb#RetrieveTransferParametersRequest.}resp,err:=c.RetrieveTransferParameters(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*Client) SearchDomains

SearchDomains searches for available domain names similar to the provided query.

Availability results from this method are approximate; callRetrieveRegisterParameters on a domain before registering to confirmavailability.

Example

packagemainimport("context"domains"cloud.google.com/go/domains/apiv1beta1"domainspb"cloud.google.com/go/domains/apiv1beta1/domainspb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in://   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=domains.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&domainspb.SearchDomainsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/domains/apiv1beta1/domainspb#SearchDomainsRequest.}resp,err:=c.SearchDomains(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*Client) TransferDomain

TransferDomain transfers a domain name from another registrar to Cloud Domains. Fordomains managed by Google Domains, transferring to Cloud Domains is notsupported.

Before calling this method, go to the domain’s current registrar to unlockthe domain for transfer and retrieve the domain’s transfer authorizationcode. Then call RetrieveTransferParameters to confirm that the domain isunlocked and to get values needed to build a call to this method.

A successful call creates a Registration resource in stateTRANSFER_PENDING. It can take several days to complete the transferprocess. The registrant can often speed up this process by approving thetransfer through the current registrar, either by clicking a link in anemail from the registrar or by visiting the registrar’s website.

A few minutes after transfer approval, the resource transitions to stateACTIVE, indicating that the transfer was successful. If the transfer isrejected or the request expires without being approved, the resource canend up in state TRANSFER_FAILED. If transfer fails, you can safely deletethe resource and retry the transfer.

Example

packagemainimport("context"domains"cloud.google.com/go/domains/apiv1beta1"domainspb"cloud.google.com/go/domains/apiv1beta1/domainspb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in://   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=domains.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&domainspb.TransferDomainRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/domains/apiv1beta1/domainspb#TransferDomainRequest.}op,err:=c.TransferDomain(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*Client) TransferDomainOperation

func(c*Client)TransferDomainOperation(namestring)*TransferDomainOperation

TransferDomainOperation returns a new TransferDomainOperation from a given name.The name must be that of a previously created TransferDomainOperation, possibly from a different process.

func (*Client) UpdateRegistration

UpdateRegistration updates select fields of a Registration resource, notably labels. Toupdate other fields, use the appropriate custom update method:

To update management settings, see ConfigureManagementSettingsTo update DNS configuration, see ConfigureDnsSettingsTo update contact information, see ConfigureContactSettings

Example

packagemainimport("context"domains"cloud.google.com/go/domains/apiv1beta1"domainspb"cloud.google.com/go/domains/apiv1beta1/domainspb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in://   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=domains.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&domainspb.UpdateRegistrationRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/domains/apiv1beta1/domainspb#UpdateRegistrationRequest.}op,err:=c.UpdateRegistration(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*Client) UpdateRegistrationOperation

func(c*Client)UpdateRegistrationOperation(namestring)*UpdateRegistrationOperation

UpdateRegistrationOperation returns a new UpdateRegistrationOperation from a given name.The name must be that of a previously created UpdateRegistrationOperation, possibly from a different process.

ConfigureContactSettingsOperation

typeConfigureContactSettingsOperationstruct{// contains filtered or unexported fields}

ConfigureContactSettingsOperation manages a long-running operation from ConfigureContactSettings.

func (*ConfigureContactSettingsOperation) Done

Done reports whether the long-running operation has completed.

func (*ConfigureContactSettingsOperation) Metadata

Metadata returns metadata associated with the long-running operation.Metadata itself does not contact the server, but Poll does.To get the latest metadata, call this method after a successful call to Poll.If the metadata is not available, the returned metadata and error are both nil.

func (*ConfigureContactSettingsOperation) Name

Name returns the name of the long-running operation.The name is assigned by the server and is unique within the service from which the operation is created.

func (*ConfigureContactSettingsOperation) Poll

Poll fetches the latest state of the long-running operation.

Poll also fetches the latest metadata, which can be retrieved by Metadata.

If Poll fails, the error is returned and op is unmodified. If Poll succeeds andthe operation has completed with failure, the error is returned and op.Done will return true.If Poll succeeds and the operation has completed successfully,op.Done will return true, and the response of the operation is returned.If Poll succeeds and the operation has not completed, the returned response and error are both nil.

func (*ConfigureContactSettingsOperation) Wait

Wait blocks until the long-running operation is completed, returning the response and any errors encountered.

See documentation of Poll for error-handling information.

ConfigureDnsSettingsOperation

typeConfigureDnsSettingsOperationstruct{// contains filtered or unexported fields}

ConfigureDnsSettingsOperation manages a long-running operation from ConfigureDnsSettings.

func (*ConfigureDnsSettingsOperation) Done

Done reports whether the long-running operation has completed.

func (*ConfigureDnsSettingsOperation) Metadata

Metadata returns metadata associated with the long-running operation.Metadata itself does not contact the server, but Poll does.To get the latest metadata, call this method after a successful call to Poll.If the metadata is not available, the returned metadata and error are both nil.

func (*ConfigureDnsSettingsOperation) Name

Name returns the name of the long-running operation.The name is assigned by the server and is unique within the service from which the operation is created.

func (*ConfigureDnsSettingsOperation) Poll

Poll fetches the latest state of the long-running operation.

Poll also fetches the latest metadata, which can be retrieved by Metadata.

If Poll fails, the error is returned and op is unmodified. If Poll succeeds andthe operation has completed with failure, the error is returned and op.Done will return true.If Poll succeeds and the operation has completed successfully,op.Done will return true, and the response of the operation is returned.If Poll succeeds and the operation has not completed, the returned response and error are both nil.

func (*ConfigureDnsSettingsOperation) Wait

Wait blocks until the long-running operation is completed, returning the response and any errors encountered.

See documentation of Poll for error-handling information.

ConfigureManagementSettingsOperation

typeConfigureManagementSettingsOperationstruct{// contains filtered or unexported fields}

ConfigureManagementSettingsOperation manages a long-running operation from ConfigureManagementSettings.

func (*ConfigureManagementSettingsOperation) Done

Done reports whether the long-running operation has completed.

func (*ConfigureManagementSettingsOperation) Metadata

Metadata returns metadata associated with the long-running operation.Metadata itself does not contact the server, but Poll does.To get the latest metadata, call this method after a successful call to Poll.If the metadata is not available, the returned metadata and error are both nil.

func (*ConfigureManagementSettingsOperation) Name

Name returns the name of the long-running operation.The name is assigned by the server and is unique within the service from which the operation is created.

func (*ConfigureManagementSettingsOperation) Poll

Poll fetches the latest state of the long-running operation.

Poll also fetches the latest metadata, which can be retrieved by Metadata.

If Poll fails, the error is returned and op is unmodified. If Poll succeeds andthe operation has completed with failure, the error is returned and op.Done will return true.If Poll succeeds and the operation has completed successfully,op.Done will return true, and the response of the operation is returned.If Poll succeeds and the operation has not completed, the returned response and error are both nil.

func (*ConfigureManagementSettingsOperation) Wait

Wait blocks until the long-running operation is completed, returning the response and any errors encountered.

See documentation of Poll for error-handling information.

DeleteRegistrationOperation

typeDeleteRegistrationOperationstruct{// contains filtered or unexported fields}

DeleteRegistrationOperation manages a long-running operation from DeleteRegistration.

func (*DeleteRegistrationOperation) Done

Done reports whether the long-running operation has completed.

func (*DeleteRegistrationOperation) Metadata

Metadata returns metadata associated with the long-running operation.Metadata itself does not contact the server, but Poll does.To get the latest metadata, call this method after a successful call to Poll.If the metadata is not available, the returned metadata and error are both nil.

func (*DeleteRegistrationOperation) Name

Name returns the name of the long-running operation.The name is assigned by the server and is unique within the service from which the operation is created.

func (*DeleteRegistrationOperation) Poll

Poll fetches the latest state of the long-running operation.

Poll also fetches the latest metadata, which can be retrieved by Metadata.

If Poll fails, the error is returned and op is unmodified. If Poll succeeds andthe operation has completed with failure, the error is returned and op.Done will return true.If Poll succeeds and the operation has completed successfully,op.Done will return true, and the response of the operation is returned.If Poll succeeds and the operation has not completed, the returned response and error are both nil.

func (*DeleteRegistrationOperation) Wait

Wait blocks until the long-running operation is completed, returning the response and any errors encountered.

See documentation of Poll for error-handling information.

ExportRegistrationOperation

typeExportRegistrationOperationstruct{// contains filtered or unexported fields}

ExportRegistrationOperation manages a long-running operation from ExportRegistration.

func (*ExportRegistrationOperation) Done

Done reports whether the long-running operation has completed.

func (*ExportRegistrationOperation) Metadata

Metadata returns metadata associated with the long-running operation.Metadata itself does not contact the server, but Poll does.To get the latest metadata, call this method after a successful call to Poll.If the metadata is not available, the returned metadata and error are both nil.

func (*ExportRegistrationOperation) Name

Name returns the name of the long-running operation.The name is assigned by the server and is unique within the service from which the operation is created.

func (*ExportRegistrationOperation) Poll

Poll fetches the latest state of the long-running operation.

Poll also fetches the latest metadata, which can be retrieved by Metadata.

If Poll fails, the error is returned and op is unmodified. If Poll succeeds andthe operation has completed with failure, the error is returned and op.Done will return true.If Poll succeeds and the operation has completed successfully,op.Done will return true, and the response of the operation is returned.If Poll succeeds and the operation has not completed, the returned response and error are both nil.

func (*ExportRegistrationOperation) Wait

Wait blocks until the long-running operation is completed, returning the response and any errors encountered.

See documentation of Poll for error-handling information.

RegisterDomainOperation

typeRegisterDomainOperationstruct{// contains filtered or unexported fields}

RegisterDomainOperation manages a long-running operation from RegisterDomain.

func (*RegisterDomainOperation) Done

Done reports whether the long-running operation has completed.

func (*RegisterDomainOperation) Metadata

Metadata returns metadata associated with the long-running operation.Metadata itself does not contact the server, but Poll does.To get the latest metadata, call this method after a successful call to Poll.If the metadata is not available, the returned metadata and error are both nil.

func (*RegisterDomainOperation) Name

Name returns the name of the long-running operation.The name is assigned by the server and is unique within the service from which the operation is created.

func (*RegisterDomainOperation) Poll

Poll fetches the latest state of the long-running operation.

Poll also fetches the latest metadata, which can be retrieved by Metadata.

If Poll fails, the error is returned and op is unmodified. If Poll succeeds andthe operation has completed with failure, the error is returned and op.Done will return true.If Poll succeeds and the operation has completed successfully,op.Done will return true, and the response of the operation is returned.If Poll succeeds and the operation has not completed, the returned response and error are both nil.

func (*RegisterDomainOperation) Wait

Wait blocks until the long-running operation is completed, returning the response and any errors encountered.

See documentation of Poll for error-handling information.

RegistrationIterator

typeRegistrationIteratorstruct{// Response is the raw response for the current page.// It must be cast to the RPC response type.// Calling Next() or InternalFetch() updates this value.Responseinterface{}// InternalFetch is for use by the Google Cloud Libraries only.// It is not part of the stable interface of this package.//// InternalFetch returns results from a single call to the underlying RPC.// The number of results is no greater than pageSize.// If there are no more results, nextPageToken is empty and err is nil.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*domainspb.Registration,nextPageTokenstring,errerror)// contains filtered or unexported fields}

RegistrationIterator manages a stream of *domainspb.Registration.

func (*RegistrationIterator) All

func(it*RegistrationIterator)All()iter.Seq2[*domainspb.Registration,error]

All returns an iterator. If an error is returned by the iterator, theiterator will stop after that iteration.

func (*RegistrationIterator) Next

Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.

func (*RegistrationIterator) PageInfo

func(it*RegistrationIterator)PageInfo()*iterator.PageInfo

PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.

TransferDomainOperation

typeTransferDomainOperationstruct{// contains filtered or unexported fields}

TransferDomainOperation manages a long-running operation from TransferDomain.

func (*TransferDomainOperation) Done

Done reports whether the long-running operation has completed.

func (*TransferDomainOperation) Metadata

Metadata returns metadata associated with the long-running operation.Metadata itself does not contact the server, but Poll does.To get the latest metadata, call this method after a successful call to Poll.If the metadata is not available, the returned metadata and error are both nil.

func (*TransferDomainOperation) Name

Name returns the name of the long-running operation.The name is assigned by the server and is unique within the service from which the operation is created.

func (*TransferDomainOperation) Poll

Poll fetches the latest state of the long-running operation.

Poll also fetches the latest metadata, which can be retrieved by Metadata.

If Poll fails, the error is returned and op is unmodified. If Poll succeeds andthe operation has completed with failure, the error is returned and op.Done will return true.If Poll succeeds and the operation has completed successfully,op.Done will return true, and the response of the operation is returned.If Poll succeeds and the operation has not completed, the returned response and error are both nil.

func (*TransferDomainOperation) Wait

Wait blocks until the long-running operation is completed, returning the response and any errors encountered.

See documentation of Poll for error-handling information.

UpdateRegistrationOperation

typeUpdateRegistrationOperationstruct{// contains filtered or unexported fields}

UpdateRegistrationOperation manages a long-running operation from UpdateRegistration.

func (*UpdateRegistrationOperation) Done

Done reports whether the long-running operation has completed.

func (*UpdateRegistrationOperation) Metadata

Metadata returns metadata associated with the long-running operation.Metadata itself does not contact the server, but Poll does.To get the latest metadata, call this method after a successful call to Poll.If the metadata is not available, the returned metadata and error are both nil.

func (*UpdateRegistrationOperation) Name

Name returns the name of the long-running operation.The name is assigned by the server and is unique within the service from which the operation is created.

func (*UpdateRegistrationOperation) Poll

Poll fetches the latest state of the long-running operation.

Poll also fetches the latest metadata, which can be retrieved by Metadata.

If Poll fails, the error is returned and op is unmodified. If Poll succeeds andthe operation has completed with failure, the error is returned and op.Done will return true.If Poll succeeds and the operation has completed successfully,op.Done will return true, and the response of the operation is returned.If Poll succeeds and the operation has not completed, the returned response and error are both nil.

func (*UpdateRegistrationOperation) Wait

Wait blocks until the long-running operation is completed, returning the response and any errors encountered.

See documentation of Poll for error-handling information.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-10-30 UTC.