Class: Google::Cloud::Domains::V1::Domains::Rest::Client

Inherits:
Object
  • Object
show all
Includes:
Paths
Defined in:
lib/google/cloud/domains/v1/domains/rest/client.rb

Overview

REST client for the Domains service.

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

Defined Under Namespace

Classes: Configuration

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Paths

#location_path, #registration_path

Constructor Details

#initialize {|config| ... } ⇒ Client

Create a new Domains REST client object.

Examples:


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

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

Yields:

  • (config)

    Configure the Domains client.

Yield Parameters:



126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
# File 'lib/google/cloud/domains/v1/domains/rest/client.rb', line 126

def initialize
  # 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.nil? ||
                           (@config.endpoint == Configuration::DEFAULT_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 = ::Google::Cloud::Domains::V1::Domains::Rest::Operations.new do |config|
    config.credentials = credentials
    config.quota_project = @quota_project_id
    config.endpoint = @config.endpoint
    config.universe_domain = @config.universe_domain
  end

  @domains_stub = ::Google::Cloud::Domains::V1::Domains::Rest::ServiceStub.new(
    endpoint: @config.endpoint,
    endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
    universe_domain: @config.universe_domain,
    credentials: credentials,
    logger: @config.logger
  )

  @domains_stub.logger(stub: true)&.info do |entry|
    entry.set_system_name
    entry.set_service
    entry.message = "Created client for #{entry.service}"
    entry.set_credentials_fields credentials
    entry.set "customEndpoint", @config.endpoint if @config.endpoint
    entry.set "defaultTimeout", @config.timeout if @config.timeout
    entry.set "quotaProject", @quota_project_id if @quota_project_id
  end
end

Instance Attribute Details

#operations_client::Google::Cloud::Domains::V1::Domains::Rest::Operations (readonly)

Get the associated client for long-running operations.



180
181
182
# File 'lib/google/cloud/domains/v1/domains/rest/client.rb', line 180

def operations_client
  @operations_client
end

Class Method Details

.configure {|config| ... } ⇒ Client::Configuration

Configure the Domains Client class.

See Configuration for a description of the configuration fields.

Examples:


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

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/google/cloud/domains/v1/domains/rest/client.rb', line 64

def self.configure
  @configure ||= begin
    namespace = ["Google", "Cloud", "Domains", "V1"]
    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

Instance Method Details

#configure {|config| ... } ⇒ Client::Configuration

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 configure.

See Configuration for a description of the configuration fields.

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



96
97
98
99
# File 'lib/google/cloud/domains/v1/domains/rest/client.rb', line 96

def configure
  yield @config if block_given?
  @config
end

#configure_contact_settings(request, options = nil) ⇒ ::Gapic::Operation #configure_contact_settings(registration: nil, contact_settings: nil, update_mask: nil, contact_notices: nil, validate_only: nil) ⇒ ::Gapic::Operation

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

Examples:

Basic example

require "google/cloud/domains/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Domains::V1::Domains::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Domains::V1::ConfigureContactSettingsRequest.new

# Call the configure_contact_settings method.
result = client.configure_contact_settings request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #configure_contact_settings(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to configure_contact_settings via a request object, either of type ConfigureContactSettingsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Domains::V1::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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #configure_contact_settings(registration: nil, contact_settings: nil, update_mask: nil, contact_notices: nil, validate_only: nil) ⇒ ::Gapic::Operation

    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).

    Parameters:

    • registration (::String) (defaults to: nil)

      Required. The name of the Registration whose contact settings are being updated, in the format projects/*/locations/*/registrations/*.

    • contact_settings (::Google::Cloud::Domains::V1::ContactSettings, ::Hash) (defaults to: nil)

      Fields of the ContactSettings to update.

    • update_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      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 is "registrant_contact".

    • contact_notices (::Array<::Google::Cloud::Domains::V1::ContactNotice>) (defaults to: nil)

      The list of contact notices that the caller acknowledges. The notices needed here depend on the values specified in contact_settings.

    • validate_only (::Boolean) (defaults to: nil)

      Validate the request without actually updating the contact settings.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
# File 'lib/google/cloud/domains/v1/domains/rest/client.rb', line 1230

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::V1::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
   = @config.rpcs.configure_contact_settings..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"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::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  @domains_stub.configure_contact_settings request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#configure_dns_settings(request, options = nil) ⇒ ::Gapic::Operation #configure_dns_settings(registration: nil, dns_settings: nil, update_mask: nil, validate_only: nil) ⇒ ::Gapic::Operation

Updates a Registration's DNS settings.

Examples:

Basic example

require "google/cloud/domains/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Domains::V1::Domains::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Domains::V1::ConfigureDnsSettingsRequest.new

# Call the configure_dns_settings method.
result = client.configure_dns_settings request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #configure_dns_settings(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to configure_dns_settings via a request object, either of type ConfigureDnsSettingsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Domains::V1::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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #configure_dns_settings(registration: nil, dns_settings: nil, update_mask: nil, validate_only: nil) ⇒ ::Gapic::Operation

    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).

    Parameters:

    • registration (::String) (defaults to: nil)

      Required. The name of the Registration whose DNS settings are being updated, in the format projects/*/locations/*/registrations/*.

    • dns_settings (::Google::Cloud::Domains::V1::DnsSettings, ::Hash) (defaults to: nil)

      Fields of the DnsSettings to update.

    • update_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      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 is "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 is "custom_dns". //

    • validate_only (::Boolean) (defaults to: nil)

      Validate the request without actually updating the DNS settings.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
# File 'lib/google/cloud/domains/v1/domains/rest/client.rb', line 1130

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::V1::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
   = @config.rpcs.configure_dns_settings..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"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::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  @domains_stub.configure_dns_settings request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#configure_management_settings(request, options = nil) ⇒ ::Gapic::Operation #configure_management_settings(registration: nil, management_settings: nil, update_mask: nil) ⇒ ::Gapic::Operation

Updates a Registration's management settings.

Examples:

Basic example

require "google/cloud/domains/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Domains::V1::Domains::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Domains::V1::ConfigureManagementSettingsRequest.new

# Call the configure_management_settings method.
result = client.configure_management_settings request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #configure_management_settings(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to configure_management_settings via a request object, either of type ConfigureManagementSettingsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Domains::V1::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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #configure_management_settings(registration: nil, management_settings: nil, update_mask: nil) ⇒ ::Gapic::Operation

    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).

    Parameters:

    • registration (::String) (defaults to: nil)

      Required. The name of the Registration whose management settings are being updated, in the format projects/*/locations/*/registrations/*.

    • management_settings (::Google::Cloud::Domains::V1::ManagementSettings, ::Hash) (defaults to: nil)

      Fields of the ManagementSettings to update.

    • update_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      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 is "transfer_lock_state".

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
# File 'lib/google/cloud/domains/v1/domains/rest/client.rb', line 1028

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::V1::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
   = @config.rpcs.configure_management_settings..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"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::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  @domains_stub.configure_management_settings request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_registration(request, options = nil) ⇒ ::Gapic::Operation #delete_registration(name: nil) ⇒ ::Gapic::Operation

Deletes a Registration resource.

This method works on any Registration resource using Subscription or Commitment billing, provided that the resource was created at least 1 day in the past.

For Registration resources using Monthly billing, this method works if:

  • state is EXPORTED with expire_time in the past
  • state is REGISTRATION_FAILED
  • state is TRANSFER_FAILED

When an active registration is successfully deleted, you can continue to use the domain in Google Domains until it expires. The calling user becomes the domain's sole owner in Google Domains, and permissions for the domain are subsequently managed there. The domain does not renew automatically unless the new owner sets up billing in Google Domains.

Examples:

Basic example

require "google/cloud/domains/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Domains::V1::Domains::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Domains::V1::DeleteRegistrationRequest.new

# Call the delete_registration method.
result = client.delete_registration request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #delete_registration(request, options = nil) ⇒ ::Gapic::Operation

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

    Parameters:

    • request (::Google::Cloud::Domains::V1::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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #delete_registration(name: nil) ⇒ ::Gapic::Operation

    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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the Registration to delete, in the format projects/*/locations/*/registrations/*.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
# File 'lib/google/cloud/domains/v1/domains/rest/client.rb', line 1432

def delete_registration request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Domains::V1::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
   = @config.rpcs.delete_registration..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"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::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  @domains_stub.delete_registration request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#export_registration(request, options = nil) ⇒ ::Gapic::Operation #export_registration(name: nil) ⇒ ::Gapic::Operation

Exports a Registration resource, such that it is no longer managed by Cloud Domains.

When an active domain is successfully exported, you can continue to use the domain in Google Domains until it expires. The calling user becomes the domain's sole owner in Google Domains, and permissions for the domain are subsequently managed there. The domain does not renew automatically unless the new owner sets up billing in Google Domains.

Examples:

Basic example

require "google/cloud/domains/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Domains::V1::Domains::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Domains::V1::ExportRegistrationRequest.new

# Call the export_registration method.
result = client.export_registration request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #export_registration(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to export_registration via a request object, either of type ExportRegistrationRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Domains::V1::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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #export_registration(name: nil) ⇒ ::Gapic::Operation

    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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the Registration to export, in the format projects/*/locations/*/registrations/*.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
# File 'lib/google/cloud/domains/v1/domains/rest/client.rb', line 1326

def export_registration request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Domains::V1::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
   = @config.rpcs.export_registration..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"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::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  @domains_stub.export_registration request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_registration(request, options = nil) ⇒ ::Google::Cloud::Domains::V1::Registration #get_registration(name: nil) ⇒ ::Google::Cloud::Domains::V1::Registration

Gets the details of a Registration resource.

Examples:

Basic example

require "google/cloud/domains/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Domains::V1::Domains::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Domains::V1::GetRegistrationRequest.new

# Call the get_registration method.
result = client.get_registration request

# The returned object is of type Google::Cloud::Domains::V1::Registration.
p result

Overloads:

  • #get_registration(request, options = nil) ⇒ ::Google::Cloud::Domains::V1::Registration

    Pass arguments to get_registration via a request object, either of type GetRegistrationRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Domains::V1::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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #get_registration(name: nil) ⇒ ::Google::Cloud::Domains::V1::Registration

    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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the Registration to get, in the format projects/*/locations/*/registrations/*.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
# File 'lib/google/cloud/domains/v1/domains/rest/client.rb', line 840

def get_registration request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Domains::V1::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
   = @config.rpcs.get_registration..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"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::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  @domains_stub.get_registration request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_registrations(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Domains::V1::Registration> #list_registrations(parent: nil, page_size: nil, page_token: nil, filter: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Domains::V1::Registration>

Lists the Registration resources in a project.

Examples:

Basic example

require "google/cloud/domains/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Domains::V1::Domains::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Domains::V1::ListRegistrationsRequest.new

# Call the list_registrations method.
result = client.list_registrations request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Domains::V1::Registration.
  p item
end

Overloads:

  • #list_registrations(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Domains::V1::Registration>

    Pass arguments to list_registrations via a request object, either of type ListRegistrationsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Domains::V1::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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_registrations(parent: nil, page_size: nil, page_token: nil, filter: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Domains::V1::Registration>

    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).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The project and location from which to list Registrations, specified in the format projects/*/locations/*.

    • page_size (::Integer) (defaults to: nil)

      Maximum number of results to return.

    • page_token (::String) (defaults to: nil)

      When set to the next_page_token from a prior response, provides the next page of results.

    • filter (::String) (defaults to: nil)

      Filter expression to restrict the Registrations 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:*).

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
# File 'lib/google/cloud/domains/v1/domains/rest/client.rb', line 759

def list_registrations request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Domains::V1::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
   = @config.rpcs.list_registrations..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"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::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  @domains_stub.list_registrations request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @domains_stub, :list_registrations, "registrations", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#loggerLogger

The logger used for request/response debug logging.

Returns:

  • (Logger)


187
188
189
# File 'lib/google/cloud/domains/v1/domains/rest/client.rb', line 187

def logger
  @domains_stub.logger
end

#register_domain(request, options = nil) ⇒ ::Gapic::Operation #register_domain(parent: nil, registration: nil, domain_notices: nil, contact_notices: nil, yearly_price: nil, validate_only: nil) ⇒ ::Gapic::Operation

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.

Examples:

Basic example

require "google/cloud/domains/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Domains::V1::Domains::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Domains::V1::RegisterDomainRequest.new

# Call the register_domain method.
result = client.register_domain request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #register_domain(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to register_domain via a request object, either of type RegisterDomainRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Domains::V1::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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #register_domain(parent: nil, registration: nil, domain_notices: nil, contact_notices: nil, yearly_price: nil, validate_only: nil) ⇒ ::Gapic::Operation

    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).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The parent resource of the Registration. Must be in the format projects/*/locations/*.

    • registration (::Google::Cloud::Domains::V1::Registration, ::Hash) (defaults to: nil)

      Required. The complete Registration resource to be created.

    • domain_notices (::Array<::Google::Cloud::Domains::V1::DomainNotice>) (defaults to: nil)

      The list of domain notices that you acknowledge. Call RetrieveRegisterParameters to see the notices that need acknowledgement.

    • contact_notices (::Array<::Google::Cloud::Domains::V1::ContactNotice>) (defaults to: nil)

      The list of contact notices that the caller acknowledges. The notices needed here depend on the values specified in registration.contact_settings.

    • yearly_price (::Google::Type::Money, ::Hash) (defaults to: nil)

      Required. Yearly price to register or renew the domain. The value that should be put here can be obtained from RetrieveRegisterParameters or SearchDomains calls.

    • validate_only (::Boolean) (defaults to: nil)

      When true, only validation is performed, without actually registering the domain. Follows: https://cloud.google.com/apis/design/design_patterns#request_validation

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
# File 'lib/google/cloud/domains/v1/domains/rest/client.rb', line 438

def register_domain request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Domains::V1::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
   = @config.rpcs.register_domain..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"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::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  @domains_stub.register_domain request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#reset_authorization_code(request, options = nil) ⇒ ::Google::Cloud::Domains::V1::AuthorizationCode #reset_authorization_code(registration: nil) ⇒ ::Google::Cloud::Domains::V1::AuthorizationCode

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.

Examples:

Basic example

require "google/cloud/domains/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Domains::V1::Domains::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Domains::V1::ResetAuthorizationCodeRequest.new

# Call the reset_authorization_code method.
result = client.reset_authorization_code request

# The returned object is of type Google::Cloud::Domains::V1::AuthorizationCode.
p result

Overloads:

  • #reset_authorization_code(request, options = nil) ⇒ ::Google::Cloud::Domains::V1::AuthorizationCode

    Pass arguments to reset_authorization_code via a request object, either of type ResetAuthorizationCodeRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Domains::V1::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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #reset_authorization_code(registration: nil) ⇒ ::Google::Cloud::Domains::V1::AuthorizationCode

    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).

    Parameters:

    • registration (::String) (defaults to: nil)

      Required. The name of the Registration whose authorization code is being reset, in the format projects/*/locations/*/registrations/*.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
# File 'lib/google/cloud/domains/v1/domains/rest/client.rb', line 1599

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::V1::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
   = @config.rpcs.reset_authorization_code..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"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::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  @domains_stub.reset_authorization_code request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#retrieve_authorization_code(request, options = nil) ⇒ ::Google::Cloud::Domains::V1::AuthorizationCode #retrieve_authorization_code(registration: nil) ⇒ ::Google::Cloud::Domains::V1::AuthorizationCode

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.

Examples:

Basic example

require "google/cloud/domains/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Domains::V1::Domains::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Domains::V1::RetrieveAuthorizationCodeRequest.new

# Call the retrieve_authorization_code method.
result = client.retrieve_authorization_code request

# The returned object is of type Google::Cloud::Domains::V1::AuthorizationCode.
p result

Overloads:

  • #retrieve_authorization_code(request, options = nil) ⇒ ::Google::Cloud::Domains::V1::AuthorizationCode

    Pass arguments to retrieve_authorization_code via a request object, either of type RetrieveAuthorizationCodeRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Domains::V1::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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #retrieve_authorization_code(registration: nil) ⇒ ::Google::Cloud::Domains::V1::AuthorizationCode

    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).

    Parameters:

    • registration (::String) (defaults to: nil)

      Required. The name of the Registration whose authorization code is being retrieved, in the format projects/*/locations/*/registrations/*.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
# File 'lib/google/cloud/domains/v1/domains/rest/client.rb', line 1517

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::V1::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
   = @config.rpcs.retrieve_authorization_code..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"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::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  @domains_stub.retrieve_authorization_code request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#retrieve_register_parameters(request, options = nil) ⇒ ::Google::Cloud::Domains::V1::RetrieveRegisterParametersResponse #retrieve_register_parameters(domain_name: nil, location: nil) ⇒ ::Google::Cloud::Domains::V1::RetrieveRegisterParametersResponse

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

Examples:

Basic example

require "google/cloud/domains/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Domains::V1::Domains::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Domains::V1::RetrieveRegisterParametersRequest.new

# Call the retrieve_register_parameters method.
result = client.retrieve_register_parameters request

# The returned object is of type Google::Cloud::Domains::V1::RetrieveRegisterParametersResponse.
p result

Overloads:

  • #retrieve_register_parameters(request, options = nil) ⇒ ::Google::Cloud::Domains::V1::RetrieveRegisterParametersResponse

    Pass arguments to retrieve_register_parameters via a request object, either of type RetrieveRegisterParametersRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Domains::V1::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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #retrieve_register_parameters(domain_name: nil, location: nil) ⇒ ::Google::Cloud::Domains::V1::RetrieveRegisterParametersResponse

    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).

    Parameters:

    • domain_name (::String) (defaults to: nil)

      Required. The domain name. Unicode domain names must be expressed in Punycode format.

    • location (::String) (defaults to: nil)

      Required. The location. Must be in the format projects/*/locations/*.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
# File 'lib/google/cloud/domains/v1/domains/rest/client.rb', line 323

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::V1::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
   = @config.rpcs.retrieve_register_parameters..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"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::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  @domains_stub.retrieve_register_parameters request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#retrieve_transfer_parameters(request, options = nil) ⇒ ::Google::Cloud::Domains::V1::RetrieveTransferParametersResponse #retrieve_transfer_parameters(domain_name: nil, location: nil) ⇒ ::Google::Cloud::Domains::V1::RetrieveTransferParametersResponse

Gets parameters needed to transfer a domain name from another registrar to Cloud Domains. For domains managed by Google Domains, transferring to Cloud Domains is not supported.

Use the returned values to call TransferDomain.

Examples:

Basic example

require "google/cloud/domains/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Domains::V1::Domains::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Domains::V1::RetrieveTransferParametersRequest.new

# Call the retrieve_transfer_parameters method.
result = client.retrieve_transfer_parameters request

# The returned object is of type Google::Cloud::Domains::V1::RetrieveTransferParametersResponse.
p result

Overloads:

  • #retrieve_transfer_parameters(request, options = nil) ⇒ ::Google::Cloud::Domains::V1::RetrieveTransferParametersResponse

    Pass arguments to retrieve_transfer_parameters via a request object, either of type RetrieveTransferParametersRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Domains::V1::RetrieveTransferParametersRequest, ::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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #retrieve_transfer_parameters(domain_name: nil, location: nil) ⇒ ::Google::Cloud::Domains::V1::RetrieveTransferParametersResponse

    Pass arguments to retrieve_transfer_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).

    Parameters:

    • domain_name (::String) (defaults to: nil)

      Required. The domain name. Unicode domain names must be expressed in Punycode format.

    • location (::String) (defaults to: nil)

      Required. The location. Must be in the format projects/*/locations/*.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
# File 'lib/google/cloud/domains/v1/domains/rest/client.rb', line 525

def retrieve_transfer_parameters request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Domains::V1::RetrieveTransferParametersRequest

  # 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
   = @config.rpcs.retrieve_transfer_parameters..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"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::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  @domains_stub.retrieve_transfer_parameters request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#search_domains(request, options = nil) ⇒ ::Google::Cloud::Domains::V1::SearchDomainsResponse #search_domains(query: nil, location: nil) ⇒ ::Google::Cloud::Domains::V1::SearchDomainsResponse

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.

Examples:

Basic example

require "google/cloud/domains/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Domains::V1::Domains::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Domains::V1::SearchDomainsRequest.new

# Call the search_domains method.
result = client.search_domains request

# The returned object is of type Google::Cloud::Domains::V1::SearchDomainsResponse.
p result

Overloads:

  • #search_domains(request, options = nil) ⇒ ::Google::Cloud::Domains::V1::SearchDomainsResponse

    Pass arguments to search_domains via a request object, either of type SearchDomainsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Domains::V1::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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #search_domains(query: nil, location: nil) ⇒ ::Google::Cloud::Domains::V1::SearchDomainsResponse

    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).

    Parameters:

    • query (::String) (defaults to: nil)

      Required. String used to search for available domain names.

    • location (::String) (defaults to: nil)

      Required. The location. Must be in the format projects/*/locations/*.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
# File 'lib/google/cloud/domains/v1/domains/rest/client.rb', line 242

def search_domains request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Domains::V1::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
   = @config.rpcs.search_domains..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"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::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  @domains_stub.search_domains request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#transfer_domain(request, options = nil) ⇒ ::Gapic::Operation #transfer_domain(parent: nil, registration: nil, contact_notices: nil, yearly_price: nil, authorization_code: nil, validate_only: nil) ⇒ ::Gapic::Operation

Transfers a domain name from another registrar to Cloud Domains. For domains managed by Google Domains, transferring to Cloud Domains is not supported.

Before calling this method, go to the domain's current registrar to unlock the domain for transfer and retrieve the domain's transfer authorization code. Then call RetrieveTransferParameters to confirm that the domain is unlocked and to get values needed to build a call to this method.

A successful call creates a Registration resource in state TRANSFER_PENDING. It can take several days to complete the transfer process. The registrant can often speed up this process by approving the transfer through the current registrar, either by clicking a link in an email from the registrar or by visiting the registrar's website.

A few minutes after transfer approval, the resource transitions to state ACTIVE, indicating that the transfer was successful. If the transfer is rejected or the request expires without being approved, the resource can end up in state TRANSFER_FAILED. If transfer fails, you can safely delete the resource and retry the transfer.

Examples:

Basic example

require "google/cloud/domains/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Domains::V1::Domains::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Domains::V1::TransferDomainRequest.new

# Call the transfer_domain method.
result = client.transfer_domain request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #transfer_domain(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to transfer_domain via a request object, either of type TransferDomainRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Domains::V1::TransferDomainRequest, ::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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #transfer_domain(parent: nil, registration: nil, contact_notices: nil, yearly_price: nil, authorization_code: nil, validate_only: nil) ⇒ ::Gapic::Operation

    Pass arguments to transfer_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).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The parent resource of the Registration. Must be in the format projects/*/locations/*.

    • registration (::Google::Cloud::Domains::V1::Registration, ::Hash) (defaults to: nil)

      Required. The complete Registration resource to be created.

      You can leave registration.dns_settings unset to import the domain's current DNS configuration from its current registrar. Use this option only if you are sure that the domain's current DNS service does not cease upon transfer, as is often the case for DNS services provided for free by the registrar.

    • contact_notices (::Array<::Google::Cloud::Domains::V1::ContactNotice>) (defaults to: nil)

      The list of contact notices that you acknowledge. The notices needed here depend on the values specified in registration.contact_settings.

    • yearly_price (::Google::Type::Money, ::Hash) (defaults to: nil)

      Required. Acknowledgement of the price to transfer or renew the domain for one year. Call RetrieveTransferParameters to obtain the price, which you must acknowledge.

    • authorization_code (::Google::Cloud::Domains::V1::AuthorizationCode, ::Hash) (defaults to: nil)

      The domain's transfer authorization code. You can obtain this from the domain's current registrar.

    • validate_only (::Boolean) (defaults to: nil)

      Validate the request without actually transferring the domain.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
# File 'lib/google/cloud/domains/v1/domains/rest/client.rb', line 652

def transfer_domain request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Domains::V1::TransferDomainRequest

  # 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
   = @config.rpcs.transfer_domain..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"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::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  @domains_stub.transfer_domain request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#universe_domainString

The effective universe domain

Returns:

  • (String)


106
107
108
# File 'lib/google/cloud/domains/v1/domains/rest/client.rb', line 106

def universe_domain
  @domains_stub.universe_domain
end

#update_registration(request, options = nil) ⇒ ::Gapic::Operation #update_registration(registration: nil, update_mask: nil) ⇒ ::Gapic::Operation

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

Examples:

Basic example

require "google/cloud/domains/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Domains::V1::Domains::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Domains::V1::UpdateRegistrationRequest.new

# Call the update_registration method.
result = client.update_registration request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #update_registration(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to update_registration via a request object, either of type UpdateRegistrationRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Domains::V1::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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #update_registration(registration: nil, update_mask: nil) ⇒ ::Gapic::Operation

    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).

    Parameters:

    • registration (::Google::Cloud::Domains::V1::Registration, ::Hash) (defaults to: nil)

      Fields of the Registration to update.

    • update_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      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 is "labels".

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
# File 'lib/google/cloud/domains/v1/domains/rest/client.rb', line 934

def update_registration request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Domains::V1::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
   = @config.rpcs.update_registration..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"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::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

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