class Google::Cloud::Domains::V1beta1::Domains::Client

Client for the Domains service.

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

Attributes

domains_stub[R]

@private

operations_client[R]

Get the associated client for long-running operations.

@return [::Google::Cloud::Domains::V1beta1::Domains::Operations]

Public Class Methods

configure() { |configure| ... } click to toggle source

Configure the Domains Client class.

See {::Google::Cloud::Domains::V1beta1::Domains::Client::Configuration} for a description of the configuration fields.

@example

# Modify the configuration for all Domains clients
::Google::Cloud::Domains::V1beta1::Domains::Client.configure do |config|
  config.timeout = 10.0
end

@yield [config] Configure the Client client. @yieldparam config [Client::Configuration]

@return [Client::Configuration]

# File lib/google/cloud/domains/v1beta1/domains/client.rb, line 56
def self.configure
  @configure ||= begin
    namespace = ["Google", "Cloud", "Domains", "V1beta1"]
    parent_config = while namespace.any?
                      parent_name = namespace.join "::"
                      parent_const = const_get parent_name
                      break parent_const.configure if parent_const.respond_to? :configure
                      namespace.pop
                    end
    default_config = Client::Configuration.new parent_config

    default_config
  end
  yield @configure if block_given?
  @configure
end
new() { |config| ... } click to toggle source

Create a new Domains client object.

@example

# Create a client using the default configuration
client = ::Google::Cloud::Domains::V1beta1::Domains::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::Domains::V1beta1::Domains::Client.new do |config|
  config.timeout = 10.0
end

@yield [config] Configure the Domains client. @yieldparam config [Client::Configuration]

# File lib/google/cloud/domains/v1beta1/domains/client.rb, line 109
def initialize
  # These require statements are intentionally placed here to initialize
  # the gRPC module only when it's required.
  # See https://github.com/googleapis/toolkit/issues/446
  require "gapic/grpc"
  require "google/cloud/domains/v1beta1/domains_services_pb"

  # Create the configuration object
  @config = Configuration.new Client.configure

  # Yield the configuration if needed
  yield @config if block_given?

  # Create credentials
  credentials = @config.credentials
  # Use self-signed JWT if the endpoint is unchanged from default,
  # but only if the default endpoint does not have a region prefix.
  enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
                           !@config.endpoint.split(".").first.include?("-")
  credentials ||= Credentials.default scope: @config.scope,
                                      enable_self_signed_jwt: enable_self_signed_jwt
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
    credentials = Credentials.new credentials, scope: @config.scope
  end
  @quota_project_id = @config.quota_project
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id

  @operations_client = Operations.new do |config|
    config.credentials = credentials
    config.endpoint = @config.endpoint
  end

  @domains_stub = ::Gapic::ServiceStub.new(
    ::Google::Cloud::Domains::V1beta1::Domains::Stub,
    credentials:  credentials,
    endpoint:     @config.endpoint,
    channel_args: @config.channel_args,
    interceptors: @config.interceptors
  )
end

Public Instance Methods

configure() { |config| ... } click to toggle source

Configure the Domains Client instance.

The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on {Client.configure}.

See {::Google::Cloud::Domains::V1beta1::Domains::Client::Configuration} for a description of the configuration fields.

@yield [config] Configure the Client client. @yieldparam config [Client::Configuration]

@return [Client::Configuration]

# File lib/google/cloud/domains/v1beta1/domains/client.rb, line 88
def configure
  yield @config if block_given?
  @config
end
configure_contact_settings(request, options = nil) { |response, operation| ... } click to toggle source

Updates a `Registration`'s contact settings. Some changes require confirmation by the domain's registrant contact .

@overload configure_contact_settings(request, options = nil)

Pass arguments to `configure_contact_settings` via a request object, either of type
{::Google::Cloud::Domains::V1beta1::ConfigureContactSettingsRequest} or an equivalent Hash.

@param request [::Google::Cloud::Domains::V1beta1::ConfigureContactSettingsRequest, ::Hash]
  A request object representing the call parameters. Required. To specify no
  parameters, or to keep all the default parameter values, pass an empty Hash.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload configure_contact_settings(registration: nil, contact_settings: nil, update_mask: nil, contact_notices: nil, validate_only: nil)

Pass arguments to `configure_contact_settings` via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).

@param registration [::String]
  Required. The name of the `Registration` whose contact settings are being updated,
  in the format `projects/*/locations/*/registrations/*`.
@param contact_settings [::Google::Cloud::Domains::V1beta1::ContactSettings, ::Hash]
  Fields of the `ContactSettings` to update.
@param update_mask [::Google::Protobuf::FieldMask, ::Hash]
  Required. The field mask describing which fields to update as a comma-separated list.
  For example, if only the registrant contact is being updated, the
  `update_mask` would be `"registrant_contact"`.
@param contact_notices [::Array<::Google::Cloud::Domains::V1beta1::ContactNotice>]
  The list of contact notices that the caller acknowledges. The notices
  required here depend on the values specified in `contact_settings`.
@param validate_only [::Boolean]
  Validate the request without actually updating the contact settings.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::Operation]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/domains/v1beta1/domains/client.rb, line 844
def configure_contact_settings request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Domains::V1beta1::ConfigureContactSettingsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.configure_contact_settings.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Domains::V1beta1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "registration" => request.registration
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.configure_contact_settings.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.configure_contact_settings.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @domains_stub.call_rpc :configure_contact_settings, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
configure_dns_settings(request, options = nil) { |response, operation| ... } click to toggle source

Updates a `Registration`'s DNS settings.

@overload configure_dns_settings(request, options = nil)

Pass arguments to `configure_dns_settings` via a request object, either of type
{::Google::Cloud::Domains::V1beta1::ConfigureDnsSettingsRequest} or an equivalent Hash.

@param request [::Google::Cloud::Domains::V1beta1::ConfigureDnsSettingsRequest, ::Hash]
  A request object representing the call parameters. Required. To specify no
  parameters, or to keep all the default parameter values, pass an empty Hash.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload configure_dns_settings(registration: nil, dns_settings: nil, update_mask: nil, validate_only: nil)

Pass arguments to `configure_dns_settings` via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).

@param registration [::String]
  Required. The name of the `Registration` whose DNS settings are being updated,
  in the format `projects/*/locations/*/registrations/*`.
@param dns_settings [::Google::Cloud::Domains::V1beta1::DnsSettings, ::Hash]
  Fields of the `DnsSettings` to update.
@param update_mask [::Google::Protobuf::FieldMask, ::Hash]
  Required. The field mask describing which fields to update as a comma-separated list.
  For example, if only the name servers are being updated for an existing
  Custom DNS configuration, the `update_mask` would be
  `"custom_dns.name_servers"`.

  When changing the DNS provider from one type to another, pass the new
  provider's field name as part of the field mask. For example, when changing
  from a Google Domains DNS configuration to a Custom DNS configuration, the
  `update_mask` would be `"custom_dns"`. //
@param validate_only [::Boolean]
  Validate the request without actually updating the DNS settings.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::Operation]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/domains/v1beta1/domains/client.rb, line 762
def configure_dns_settings request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Domains::V1beta1::ConfigureDnsSettingsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.configure_dns_settings.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Domains::V1beta1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "registration" => request.registration
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.configure_dns_settings.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.configure_dns_settings.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @domains_stub.call_rpc :configure_dns_settings, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
configure_management_settings(request, options = nil) { |response, operation| ... } click to toggle source

Updates a `Registration`'s management settings.

@overload configure_management_settings(request, options = nil)

Pass arguments to `configure_management_settings` via a request object, either of type
{::Google::Cloud::Domains::V1beta1::ConfigureManagementSettingsRequest} or an equivalent Hash.

@param request [::Google::Cloud::Domains::V1beta1::ConfigureManagementSettingsRequest, ::Hash]
  A request object representing the call parameters. Required. To specify no
  parameters, or to keep all the default parameter values, pass an empty Hash.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload configure_management_settings(registration: nil, management_settings: nil, update_mask: nil)

Pass arguments to `configure_management_settings` via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).

@param registration [::String]
  Required. The name of the `Registration` whose management settings are being updated,
  in the format `projects/*/locations/*/registrations/*`.
@param management_settings [::Google::Cloud::Domains::V1beta1::ManagementSettings, ::Hash]
  Fields of the `ManagementSettings` to update.
@param update_mask [::Google::Protobuf::FieldMask, ::Hash]
  Required. The field mask describing which fields to update as a comma-separated list.
  For example, if only the transfer lock is being updated, the `update_mask`
  would be `"transfer_lock_state"`.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::Operation]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/domains/v1beta1/domains/client.rb, line 678
def configure_management_settings request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Domains::V1beta1::ConfigureManagementSettingsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.configure_management_settings.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Domains::V1beta1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "registration" => request.registration
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.configure_management_settings.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.configure_management_settings.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @domains_stub.call_rpc :configure_management_settings, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
delete_registration(request, options = nil) { |response, operation| ... } click to toggle source

Deletes a `Registration` resource.

This method only works on resources in one of the following states:

  • `state` is `EXPORTED` with `expire_time` in the past

  • `state` is `REGISTRATION_FAILED`

@overload delete_registration(request, options = nil)

Pass arguments to `delete_registration` via a request object, either of type
{::Google::Cloud::Domains::V1beta1::DeleteRegistrationRequest} or an equivalent Hash.

@param request [::Google::Cloud::Domains::V1beta1::DeleteRegistrationRequest, ::Hash]
  A request object representing the call parameters. Required. To specify no
  parameters, or to keep all the default parameter values, pass an empty Hash.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload delete_registration(name: nil)

Pass arguments to `delete_registration` via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).

@param name [::String]
  Required. The name of the `Registration` to delete,
  in the format `projects/*/locations/*/registrations/*`.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::Operation]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/domains/v1beta1/domains/client.rb, line 1002
def delete_registration request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Domains::V1beta1::DeleteRegistrationRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.delete_registration.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Domains::V1beta1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "name" => request.name
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.delete_registration.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.delete_registration.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @domains_stub.call_rpc :delete_registration, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
export_registration(request, options = nil) { |response, operation| ... } click to toggle source

Exports a `Registration` that you no longer want to use with Cloud Domains. You can continue to use the domain in [Google Domains](domains.google/) until it expires.

If the export is successful:

  • The resource's `state` becomes `EXPORTED`, meaning that it is no longer

managed by Cloud Domains

  • Because individual users can own domains in Google Domains, the calling

user becomes the domain's sole owner. Permissions for the domain are subsequently managed in Google Domains.

  • Without further action, the domain does not renew automatically.

The new owner can set up billing in Google Domains to renew the domain if needed.

@overload export_registration(request, options = nil)

Pass arguments to `export_registration` via a request object, either of type
{::Google::Cloud::Domains::V1beta1::ExportRegistrationRequest} or an equivalent Hash.

@param request [::Google::Cloud::Domains::V1beta1::ExportRegistrationRequest, ::Hash]
  A request object representing the call parameters. Required. To specify no
  parameters, or to keep all the default parameter values, pass an empty Hash.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload export_registration(name: nil)

Pass arguments to `export_registration` via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).

@param name [::String]
  Required. The name of the `Registration` to export,
  in the format `projects/*/locations/*/registrations/*`.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::Operation]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/domains/v1beta1/domains/client.rb, line 927
def export_registration request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Domains::V1beta1::ExportRegistrationRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.export_registration.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Domains::V1beta1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "name" => request.name
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.export_registration.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.export_registration.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @domains_stub.call_rpc :export_registration, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
get_registration(request, options = nil) { |response, operation| ... } click to toggle source

Gets the details of a `Registration` resource.

@overload get_registration(request, options = nil)

Pass arguments to `get_registration` via a request object, either of type
{::Google::Cloud::Domains::V1beta1::GetRegistrationRequest} or an equivalent Hash.

@param request [::Google::Cloud::Domains::V1beta1::GetRegistrationRequest, ::Hash]
  A request object representing the call parameters. Required. To specify no
  parameters, or to keep all the default parameter values, pass an empty Hash.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload get_registration(name: nil)

Pass arguments to `get_registration` via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).

@param name [::String]
  Required. The name of the `Registration` to get, in the format
  `projects/*/locations/*/registrations/*`.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Cloud::Domains::V1beta1::Registration] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Cloud::Domains::V1beta1::Registration]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/domains/v1beta1/domains/client.rb, line 525
def get_registration request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Domains::V1beta1::GetRegistrationRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.get_registration.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Domains::V1beta1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "name" => request.name
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_registration.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.get_registration.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @domains_stub.call_rpc :get_registration, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
list_registrations(request, options = nil) { |response, operation| ... } click to toggle source

Lists the `Registration` resources in a project.

@overload list_registrations(request, options = nil)

Pass arguments to `list_registrations` via a request object, either of type
{::Google::Cloud::Domains::V1beta1::ListRegistrationsRequest} or an equivalent Hash.

@param request [::Google::Cloud::Domains::V1beta1::ListRegistrationsRequest, ::Hash]
  A request object representing the call parameters. Required. To specify no
  parameters, or to keep all the default parameter values, pass an empty Hash.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload list_registrations(parent: nil, page_size: nil, page_token: nil, filter: nil)

Pass arguments to `list_registrations` via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).

@param parent [::String]
  Required. The project and location from which to list `Registration`s, specified in
  the format `projects/*/locations/*`.
@param page_size [::Integer]
  Maximum number of results to return.
@param page_token [::String]
  When set to the `next_page_token` from a prior response, provides the next
  page of results.
@param filter [::String]
  Filter expression to restrict the `Registration`s returned.

  The expression must specify the field name, a comparison operator, and the
  value that you want to use for filtering. The value must be a string, a
  number, a boolean, or an enum value. The comparison operator should be one
  of =, !=, >, <, >=, <=, or : for prefix or wildcard matches.

  For example, to filter to a specific domain name, use an expression like
  `domainName="example.com"`. You can also check for the existence of a
  field; for example, to find domains using custom DNS settings, use an
  expression like `dnsSettings.customDns:*`.

  You can also create compound filters by combining expressions with the
  `AND` and `OR` operators. For example, to find domains that are suspended
  or have specific issues flagged, use an expression like
  `(state=SUSPENDED) OR (issue:*)`.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Domains::V1beta1::Registration>] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::PagedEnumerable<::Google::Cloud::Domains::V1beta1::Registration>]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/domains/v1beta1/domains/client.rb, line 455
def list_registrations request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Domains::V1beta1::ListRegistrationsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.list_registrations.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Domains::V1beta1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "parent" => request.parent
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_registrations.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.list_registrations.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @domains_stub.call_rpc :list_registrations, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @domains_stub, :list_registrations, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
register_domain(request, options = nil) { |response, operation| ... } click to toggle source

Registers a new domain name and creates a corresponding `Registration` resource.

Call `RetrieveRegisterParameters` first to check availability of the domain name and determine parameters like price that are needed to build a call to this method.

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

@overload register_domain(request, options = nil)

Pass arguments to `register_domain` via a request object, either of type
{::Google::Cloud::Domains::V1beta1::RegisterDomainRequest} or an equivalent Hash.

@param request [::Google::Cloud::Domains::V1beta1::RegisterDomainRequest, ::Hash]
  A request object representing the call parameters. Required. To specify no
  parameters, or to keep all the default parameter values, pass an empty Hash.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload register_domain(parent: nil, registration: nil, domain_notices: nil, contact_notices: nil, yearly_price: nil, validate_only: nil)

Pass arguments to `register_domain` via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).

@param parent [::String]
  Required. The parent resource of the `Registration`. Must be in the
  format `projects/*/locations/*`.
@param registration [::Google::Cloud::Domains::V1beta1::Registration, ::Hash]
  Required. The complete `Registration` resource to be created.
@param domain_notices [::Array<::Google::Cloud::Domains::V1beta1::DomainNotice>]
  The list of domain notices that you acknowledge. Call
  `RetrieveRegisterParameters` to see the notices that need acknowledgement.
@param contact_notices [::Array<::Google::Cloud::Domains::V1beta1::ContactNotice>]
  The list of contact notices that the caller acknowledges. The notices
  required here depend on the values specified in
  `registration.contact_settings`.
@param yearly_price [::Google::Type::Money, ::Hash]
  Required. Yearly price to register or renew the domain.
  The value that should be put here can be obtained from
  RetrieveRegisterParameters or SearchDomains calls.
@param validate_only [::Boolean]
  When true, only validation will be performed, without actually registering
  the domain. Follows:
  https://cloud.google.com/apis/design/design_patterns#request_validation

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::Operation]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/domains/v1beta1/domains/client.rb, line 363
def register_domain request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Domains::V1beta1::RegisterDomainRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.register_domain.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Domains::V1beta1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "parent" => request.parent
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.register_domain.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.register_domain.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @domains_stub.call_rpc :register_domain, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
reset_authorization_code(request, options = nil) { |response, operation| ... } click to toggle source

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 initial domain registration.

@overload reset_authorization_code(request, options = nil)

Pass arguments to `reset_authorization_code` via a request object, either of type
{::Google::Cloud::Domains::V1beta1::ResetAuthorizationCodeRequest} or an equivalent Hash.

@param request [::Google::Cloud::Domains::V1beta1::ResetAuthorizationCodeRequest, ::Hash]
  A request object representing the call parameters. Required. To specify no
  parameters, or to keep all the default parameter values, pass an empty Hash.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload reset_authorization_code(registration: nil)

Pass arguments to `reset_authorization_code` via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).

@param registration [::String]
  Required. The name of the `Registration` whose authorization code is being reset,
  in the format `projects/*/locations/*/registrations/*`.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Cloud::Domains::V1beta1::AuthorizationCode] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Cloud::Domains::V1beta1::AuthorizationCode]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/domains/v1beta1/domains/client.rb, line 1148
def reset_authorization_code request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Domains::V1beta1::ResetAuthorizationCodeRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.reset_authorization_code.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Domains::V1beta1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "registration" => request.registration
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.reset_authorization_code.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.reset_authorization_code.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @domains_stub.call_rpc :reset_authorization_code, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
retrieve_authorization_code(request, options = nil) { |response, operation| ... } click to toggle source

Gets the authorization code of the `Registration` for the purpose of transferring the domain to another registrar.

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

@overload retrieve_authorization_code(request, options = nil)

Pass arguments to `retrieve_authorization_code` via a request object, either of type
{::Google::Cloud::Domains::V1beta1::RetrieveAuthorizationCodeRequest} or an equivalent Hash.

@param request [::Google::Cloud::Domains::V1beta1::RetrieveAuthorizationCodeRequest, ::Hash]
  A request object representing the call parameters. Required. To specify no
  parameters, or to keep all the default parameter values, pass an empty Hash.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload retrieve_authorization_code(registration: nil)

Pass arguments to `retrieve_authorization_code` via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).

@param registration [::String]
  Required. The name of the `Registration` whose authorization code is being retrieved,
  in the format `projects/*/locations/*/registrations/*`.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Cloud::Domains::V1beta1::AuthorizationCode] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Cloud::Domains::V1beta1::AuthorizationCode]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/domains/v1beta1/domains/client.rb, line 1076
def retrieve_authorization_code request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Domains::V1beta1::RetrieveAuthorizationCodeRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.retrieve_authorization_code.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Domains::V1beta1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "registration" => request.registration
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.retrieve_authorization_code.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.retrieve_authorization_code.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @domains_stub.call_rpc :retrieve_authorization_code, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
retrieve_register_parameters(request, options = nil) { |response, operation| ... } click to toggle source

Gets parameters needed to register a new domain name, including price and up-to-date availability. Use the returned values to call `RegisterDomain`.

@overload retrieve_register_parameters(request, options = nil)

Pass arguments to `retrieve_register_parameters` via a request object, either of type
{::Google::Cloud::Domains::V1beta1::RetrieveRegisterParametersRequest} or an equivalent Hash.

@param request [::Google::Cloud::Domains::V1beta1::RetrieveRegisterParametersRequest, ::Hash]
  A request object representing the call parameters. Required. To specify no
  parameters, or to keep all the default parameter values, pass an empty Hash.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload retrieve_register_parameters(domain_name: nil, location: nil)

Pass arguments to `retrieve_register_parameters` via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).

@param domain_name [::String]
  Required. The domain name. Unicode domain names must be expressed in Punycode format.
@param location [::String]
  Required. The location. Must be in the format `projects/*/locations/*`.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Cloud::Domains::V1beta1::RetrieveRegisterParametersResponse] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Cloud::Domains::V1beta1::RetrieveRegisterParametersResponse]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/domains/v1beta1/domains/client.rb, line 265
def retrieve_register_parameters request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Domains::V1beta1::RetrieveRegisterParametersRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.retrieve_register_parameters.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Domains::V1beta1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "location" => request.location
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.retrieve_register_parameters.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.retrieve_register_parameters.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @domains_stub.call_rpc :retrieve_register_parameters, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
search_domains(request, options = nil) { |response, operation| ... } click to toggle source

Searches for available domain names similar to the provided query.

Availability results from this method are approximate; call `RetrieveRegisterParameters` on a domain before registering to confirm availability.

@overload search_domains(request, options = nil)

Pass arguments to `search_domains` via a request object, either of type
{::Google::Cloud::Domains::V1beta1::SearchDomainsRequest} or an equivalent Hash.

@param request [::Google::Cloud::Domains::V1beta1::SearchDomainsRequest, ::Hash]
  A request object representing the call parameters. Required. To specify no
  parameters, or to keep all the default parameter values, pass an empty Hash.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload search_domains(query: nil, location: nil)

Pass arguments to `search_domains` via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).

@param query [::String]
  Required. String used to search for available domain names.
@param location [::String]
  Required. The location. Must be in the format `projects/*/locations/*`.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Cloud::Domains::V1beta1::SearchDomainsResponse] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Cloud::Domains::V1beta1::SearchDomainsResponse]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/domains/v1beta1/domains/client.rb, line 194
def search_domains request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Domains::V1beta1::SearchDomainsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.search_domains.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Domains::V1beta1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "location" => request.location
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.search_domains.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.search_domains.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @domains_stub.call_rpc :search_domains, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
update_registration(request, options = nil) { |response, operation| ... } click to toggle source

Updates select fields of a `Registration` resource, notably `labels`. To update other fields, use the appropriate custom update method:

  • To update management settings, see `ConfigureManagementSettings`

  • To update DNS configuration, see `ConfigureDnsSettings`

  • To update contact information, see `ConfigureContactSettings`

@overload update_registration(request, options = nil)

Pass arguments to `update_registration` via a request object, either of type
{::Google::Cloud::Domains::V1beta1::UpdateRegistrationRequest} or an equivalent Hash.

@param request [::Google::Cloud::Domains::V1beta1::UpdateRegistrationRequest, ::Hash]
  A request object representing the call parameters. Required. To specify no
  parameters, or to keep all the default parameter values, pass an empty Hash.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload update_registration(registration: nil, update_mask: nil)

Pass arguments to `update_registration` via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).

@param registration [::Google::Cloud::Domains::V1beta1::Registration, ::Hash]
  Fields of the `Registration` to update.
@param update_mask [::Google::Protobuf::FieldMask, ::Hash]
  Required. The field mask describing which fields to update as a comma-separated list.
  For example, if only the labels are being updated, the `update_mask` would
  be `"labels"`.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::Operation]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/domains/v1beta1/domains/client.rb, line 602
def update_registration request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Domains::V1beta1::UpdateRegistrationRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.update_registration.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Domains::V1beta1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "registration.name" => request.registration.name
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.update_registration.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.update_registration.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @domains_stub.call_rpc :update_registration, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end