google-cloud-domains-v1 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1952 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2022 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/cloud/domains/v1/domains_pb"
21
+
22
+ module Google
23
+ module Cloud
24
+ module Domains
25
+ module V1
26
+ module Domains
27
+ ##
28
+ # Client for the Domains service.
29
+ #
30
+ # The Cloud Domains API enables management and configuration of domain names.
31
+ #
32
+ class Client
33
+ include Paths
34
+
35
+ # @private
36
+ attr_reader :domains_stub
37
+
38
+ ##
39
+ # Configure the Domains Client class.
40
+ #
41
+ # See {::Google::Cloud::Domains::V1::Domains::Client::Configuration}
42
+ # for a description of the configuration fields.
43
+ #
44
+ # @example
45
+ #
46
+ # # Modify the configuration for all Domains clients
47
+ # ::Google::Cloud::Domains::V1::Domains::Client.configure do |config|
48
+ # config.timeout = 10.0
49
+ # end
50
+ #
51
+ # @yield [config] Configure the Client client.
52
+ # @yieldparam config [Client::Configuration]
53
+ #
54
+ # @return [Client::Configuration]
55
+ #
56
+ def self.configure
57
+ @configure ||= begin
58
+ namespace = ["Google", "Cloud", "Domains", "V1"]
59
+ parent_config = while namespace.any?
60
+ parent_name = namespace.join "::"
61
+ parent_const = const_get parent_name
62
+ break parent_const.configure if parent_const.respond_to? :configure
63
+ namespace.pop
64
+ end
65
+ default_config = Client::Configuration.new parent_config
66
+
67
+ default_config
68
+ end
69
+ yield @configure if block_given?
70
+ @configure
71
+ end
72
+
73
+ ##
74
+ # Configure the Domains Client instance.
75
+ #
76
+ # The configuration is set to the derived mode, meaning that values can be changed,
77
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
78
+ # should be made on {Client.configure}.
79
+ #
80
+ # See {::Google::Cloud::Domains::V1::Domains::Client::Configuration}
81
+ # for a description of the configuration fields.
82
+ #
83
+ # @yield [config] Configure the Client client.
84
+ # @yieldparam config [Client::Configuration]
85
+ #
86
+ # @return [Client::Configuration]
87
+ #
88
+ def configure
89
+ yield @config if block_given?
90
+ @config
91
+ end
92
+
93
+ ##
94
+ # Create a new Domains client object.
95
+ #
96
+ # @example
97
+ #
98
+ # # Create a client using the default configuration
99
+ # client = ::Google::Cloud::Domains::V1::Domains::Client.new
100
+ #
101
+ # # Create a client using a custom configuration
102
+ # client = ::Google::Cloud::Domains::V1::Domains::Client.new do |config|
103
+ # config.timeout = 10.0
104
+ # end
105
+ #
106
+ # @yield [config] Configure the Domains client.
107
+ # @yieldparam config [Client::Configuration]
108
+ #
109
+ def initialize
110
+ # These require statements are intentionally placed here to initialize
111
+ # the gRPC module only when it's required.
112
+ # See https://github.com/googleapis/toolkit/issues/446
113
+ require "gapic/grpc"
114
+ require "google/cloud/domains/v1/domains_services_pb"
115
+
116
+ # Create the configuration object
117
+ @config = Configuration.new Client.configure
118
+
119
+ # Yield the configuration if needed
120
+ yield @config if block_given?
121
+
122
+ # Create credentials
123
+ credentials = @config.credentials
124
+ # Use self-signed JWT if the endpoint is unchanged from default,
125
+ # but only if the default endpoint does not have a region prefix.
126
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
127
+ !@config.endpoint.split(".").first.include?("-")
128
+ credentials ||= Credentials.default scope: @config.scope,
129
+ enable_self_signed_jwt: enable_self_signed_jwt
130
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
131
+ credentials = Credentials.new credentials, scope: @config.scope
132
+ end
133
+ @quota_project_id = @config.quota_project
134
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
135
+
136
+ @operations_client = Operations.new do |config|
137
+ config.credentials = credentials
138
+ config.quota_project = @quota_project_id
139
+ config.endpoint = @config.endpoint
140
+ end
141
+
142
+ @domains_stub = ::Gapic::ServiceStub.new(
143
+ ::Google::Cloud::Domains::V1::Domains::Stub,
144
+ credentials: credentials,
145
+ endpoint: @config.endpoint,
146
+ channel_args: @config.channel_args,
147
+ interceptors: @config.interceptors
148
+ )
149
+ end
150
+
151
+ ##
152
+ # Get the associated client for long-running operations.
153
+ #
154
+ # @return [::Google::Cloud::Domains::V1::Domains::Operations]
155
+ #
156
+ attr_reader :operations_client
157
+
158
+ # Service calls
159
+
160
+ ##
161
+ # Searches for available domain names similar to the provided query.
162
+ #
163
+ # Availability results from this method are approximate; call
164
+ # `RetrieveRegisterParameters` on a domain before registering to confirm
165
+ # availability.
166
+ #
167
+ # @overload search_domains(request, options = nil)
168
+ # Pass arguments to `search_domains` via a request object, either of type
169
+ # {::Google::Cloud::Domains::V1::SearchDomainsRequest} or an equivalent Hash.
170
+ #
171
+ # @param request [::Google::Cloud::Domains::V1::SearchDomainsRequest, ::Hash]
172
+ # A request object representing the call parameters. Required. To specify no
173
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
174
+ # @param options [::Gapic::CallOptions, ::Hash]
175
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
176
+ #
177
+ # @overload search_domains(query: nil, location: nil)
178
+ # Pass arguments to `search_domains` via keyword arguments. Note that at
179
+ # least one keyword argument is required. To specify no parameters, or to keep all
180
+ # the default parameter values, pass an empty Hash as a request object (see above).
181
+ #
182
+ # @param query [::String]
183
+ # Required. String used to search for available domain names.
184
+ # @param location [::String]
185
+ # Required. The location. Must be in the format `projects/*/locations/*`.
186
+ #
187
+ # @yield [response, operation] Access the result along with the RPC operation
188
+ # @yieldparam response [::Google::Cloud::Domains::V1::SearchDomainsResponse]
189
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
190
+ #
191
+ # @return [::Google::Cloud::Domains::V1::SearchDomainsResponse]
192
+ #
193
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
194
+ #
195
+ # @example Basic example
196
+ # require "google/cloud/domains/v1"
197
+ #
198
+ # # Create a client object. The client can be reused for multiple calls.
199
+ # client = Google::Cloud::Domains::V1::Domains::Client.new
200
+ #
201
+ # # Create a request. To set request fields, pass in keyword arguments.
202
+ # request = Google::Cloud::Domains::V1::SearchDomainsRequest.new
203
+ #
204
+ # # Call the search_domains method.
205
+ # result = client.search_domains request
206
+ #
207
+ # # The returned object is of type Google::Cloud::Domains::V1::SearchDomainsResponse.
208
+ # p result
209
+ #
210
+ def search_domains request, options = nil
211
+ raise ::ArgumentError, "request must be provided" if request.nil?
212
+
213
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Domains::V1::SearchDomainsRequest
214
+
215
+ # Converts hash and nil to an options object
216
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
217
+
218
+ # Customize the options with defaults
219
+ metadata = @config.rpcs.search_domains.metadata.to_h
220
+
221
+ # Set x-goog-api-client and x-goog-user-project headers
222
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
223
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
224
+ gapic_version: ::Google::Cloud::Domains::V1::VERSION
225
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
226
+
227
+ header_params = {}
228
+ if request.location
229
+ header_params["location"] = request.location
230
+ end
231
+
232
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
233
+ metadata[:"x-goog-request-params"] ||= request_params_header
234
+
235
+ options.apply_defaults timeout: @config.rpcs.search_domains.timeout,
236
+ metadata: metadata,
237
+ retry_policy: @config.rpcs.search_domains.retry_policy
238
+
239
+ options.apply_defaults timeout: @config.timeout,
240
+ metadata: @config.metadata,
241
+ retry_policy: @config.retry_policy
242
+
243
+ @domains_stub.call_rpc :search_domains, request, options: options do |response, operation|
244
+ yield response, operation if block_given?
245
+ return response
246
+ end
247
+ rescue ::GRPC::BadStatus => e
248
+ raise ::Google::Cloud::Error.from_error(e)
249
+ end
250
+
251
+ ##
252
+ # Gets parameters needed to register a new domain name, including price and
253
+ # up-to-date availability. Use the returned values to call `RegisterDomain`.
254
+ #
255
+ # @overload retrieve_register_parameters(request, options = nil)
256
+ # Pass arguments to `retrieve_register_parameters` via a request object, either of type
257
+ # {::Google::Cloud::Domains::V1::RetrieveRegisterParametersRequest} or an equivalent Hash.
258
+ #
259
+ # @param request [::Google::Cloud::Domains::V1::RetrieveRegisterParametersRequest, ::Hash]
260
+ # A request object representing the call parameters. Required. To specify no
261
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
262
+ # @param options [::Gapic::CallOptions, ::Hash]
263
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
264
+ #
265
+ # @overload retrieve_register_parameters(domain_name: nil, location: nil)
266
+ # Pass arguments to `retrieve_register_parameters` via keyword arguments. Note that at
267
+ # least one keyword argument is required. To specify no parameters, or to keep all
268
+ # the default parameter values, pass an empty Hash as a request object (see above).
269
+ #
270
+ # @param domain_name [::String]
271
+ # Required. The domain name. Unicode domain names must be expressed in Punycode format.
272
+ # @param location [::String]
273
+ # Required. The location. Must be in the format `projects/*/locations/*`.
274
+ #
275
+ # @yield [response, operation] Access the result along with the RPC operation
276
+ # @yieldparam response [::Google::Cloud::Domains::V1::RetrieveRegisterParametersResponse]
277
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
278
+ #
279
+ # @return [::Google::Cloud::Domains::V1::RetrieveRegisterParametersResponse]
280
+ #
281
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
282
+ #
283
+ # @example Basic example
284
+ # require "google/cloud/domains/v1"
285
+ #
286
+ # # Create a client object. The client can be reused for multiple calls.
287
+ # client = Google::Cloud::Domains::V1::Domains::Client.new
288
+ #
289
+ # # Create a request. To set request fields, pass in keyword arguments.
290
+ # request = Google::Cloud::Domains::V1::RetrieveRegisterParametersRequest.new
291
+ #
292
+ # # Call the retrieve_register_parameters method.
293
+ # result = client.retrieve_register_parameters request
294
+ #
295
+ # # The returned object is of type Google::Cloud::Domains::V1::RetrieveRegisterParametersResponse.
296
+ # p result
297
+ #
298
+ def retrieve_register_parameters request, options = nil
299
+ raise ::ArgumentError, "request must be provided" if request.nil?
300
+
301
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Domains::V1::RetrieveRegisterParametersRequest
302
+
303
+ # Converts hash and nil to an options object
304
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
305
+
306
+ # Customize the options with defaults
307
+ metadata = @config.rpcs.retrieve_register_parameters.metadata.to_h
308
+
309
+ # Set x-goog-api-client and x-goog-user-project headers
310
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
311
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
312
+ gapic_version: ::Google::Cloud::Domains::V1::VERSION
313
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
314
+
315
+ header_params = {}
316
+ if request.location
317
+ header_params["location"] = request.location
318
+ end
319
+
320
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
321
+ metadata[:"x-goog-request-params"] ||= request_params_header
322
+
323
+ options.apply_defaults timeout: @config.rpcs.retrieve_register_parameters.timeout,
324
+ metadata: metadata,
325
+ retry_policy: @config.rpcs.retrieve_register_parameters.retry_policy
326
+
327
+ options.apply_defaults timeout: @config.timeout,
328
+ metadata: @config.metadata,
329
+ retry_policy: @config.retry_policy
330
+
331
+ @domains_stub.call_rpc :retrieve_register_parameters, request, options: options do |response, operation|
332
+ yield response, operation if block_given?
333
+ return response
334
+ end
335
+ rescue ::GRPC::BadStatus => e
336
+ raise ::Google::Cloud::Error.from_error(e)
337
+ end
338
+
339
+ ##
340
+ # Registers a new domain name and creates a corresponding `Registration`
341
+ # resource.
342
+ #
343
+ # Call `RetrieveRegisterParameters` first to check availability of the domain
344
+ # name and determine parameters like price that are needed to build a call to
345
+ # this method.
346
+ #
347
+ # A successful call creates a `Registration` resource in state
348
+ # `REGISTRATION_PENDING`, which resolves to `ACTIVE` within 1-2
349
+ # minutes, indicating that the domain was successfully registered. If the
350
+ # resource ends up in state `REGISTRATION_FAILED`, it indicates that the
351
+ # domain was not registered successfully, and you can safely delete the
352
+ # resource and retry registration.
353
+ #
354
+ # @overload register_domain(request, options = nil)
355
+ # Pass arguments to `register_domain` via a request object, either of type
356
+ # {::Google::Cloud::Domains::V1::RegisterDomainRequest} or an equivalent Hash.
357
+ #
358
+ # @param request [::Google::Cloud::Domains::V1::RegisterDomainRequest, ::Hash]
359
+ # A request object representing the call parameters. Required. To specify no
360
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
361
+ # @param options [::Gapic::CallOptions, ::Hash]
362
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
363
+ #
364
+ # @overload register_domain(parent: nil, registration: nil, domain_notices: nil, contact_notices: nil, yearly_price: nil, validate_only: nil)
365
+ # Pass arguments to `register_domain` via keyword arguments. Note that at
366
+ # least one keyword argument is required. To specify no parameters, or to keep all
367
+ # the default parameter values, pass an empty Hash as a request object (see above).
368
+ #
369
+ # @param parent [::String]
370
+ # Required. The parent resource of the `Registration`. Must be in the
371
+ # format `projects/*/locations/*`.
372
+ # @param registration [::Google::Cloud::Domains::V1::Registration, ::Hash]
373
+ # Required. The complete `Registration` resource to be created.
374
+ # @param domain_notices [::Array<::Google::Cloud::Domains::V1::DomainNotice>]
375
+ # The list of domain notices that you acknowledge. Call
376
+ # `RetrieveRegisterParameters` to see the notices that need acknowledgement.
377
+ # @param contact_notices [::Array<::Google::Cloud::Domains::V1::ContactNotice>]
378
+ # The list of contact notices that the caller acknowledges. The notices
379
+ # needed here depend on the values specified in
380
+ # `registration.contact_settings`.
381
+ # @param yearly_price [::Google::Type::Money, ::Hash]
382
+ # Required. Yearly price to register or renew the domain.
383
+ # The value that should be put here can be obtained from
384
+ # RetrieveRegisterParameters or SearchDomains calls.
385
+ # @param validate_only [::Boolean]
386
+ # When true, only validation is performed, without actually registering
387
+ # the domain. Follows:
388
+ # https://cloud.google.com/apis/design/design_patterns#request_validation
389
+ #
390
+ # @yield [response, operation] Access the result along with the RPC operation
391
+ # @yieldparam response [::Gapic::Operation]
392
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
393
+ #
394
+ # @return [::Gapic::Operation]
395
+ #
396
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
397
+ #
398
+ # @example Basic example
399
+ # require "google/cloud/domains/v1"
400
+ #
401
+ # # Create a client object. The client can be reused for multiple calls.
402
+ # client = Google::Cloud::Domains::V1::Domains::Client.new
403
+ #
404
+ # # Create a request. To set request fields, pass in keyword arguments.
405
+ # request = Google::Cloud::Domains::V1::RegisterDomainRequest.new
406
+ #
407
+ # # Call the register_domain method.
408
+ # result = client.register_domain request
409
+ #
410
+ # # The returned object is of type Gapic::Operation. You can use this
411
+ # # object to check the status of an operation, cancel it, or wait
412
+ # # for results. Here is how to block until completion:
413
+ # result.wait_until_done! timeout: 60
414
+ # if result.response?
415
+ # p result.response
416
+ # else
417
+ # puts "Error!"
418
+ # end
419
+ #
420
+ def register_domain request, options = nil
421
+ raise ::ArgumentError, "request must be provided" if request.nil?
422
+
423
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Domains::V1::RegisterDomainRequest
424
+
425
+ # Converts hash and nil to an options object
426
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
427
+
428
+ # Customize the options with defaults
429
+ metadata = @config.rpcs.register_domain.metadata.to_h
430
+
431
+ # Set x-goog-api-client and x-goog-user-project headers
432
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
433
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
434
+ gapic_version: ::Google::Cloud::Domains::V1::VERSION
435
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
436
+
437
+ header_params = {}
438
+ if request.parent
439
+ header_params["parent"] = request.parent
440
+ end
441
+
442
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
443
+ metadata[:"x-goog-request-params"] ||= request_params_header
444
+
445
+ options.apply_defaults timeout: @config.rpcs.register_domain.timeout,
446
+ metadata: metadata,
447
+ retry_policy: @config.rpcs.register_domain.retry_policy
448
+
449
+ options.apply_defaults timeout: @config.timeout,
450
+ metadata: @config.metadata,
451
+ retry_policy: @config.retry_policy
452
+
453
+ @domains_stub.call_rpc :register_domain, request, options: options do |response, operation|
454
+ response = ::Gapic::Operation.new response, @operations_client, options: options
455
+ yield response, operation if block_given?
456
+ return response
457
+ end
458
+ rescue ::GRPC::BadStatus => e
459
+ raise ::Google::Cloud::Error.from_error(e)
460
+ end
461
+
462
+ ##
463
+ # Gets parameters needed to transfer a domain name from another registrar to
464
+ # Cloud Domains. For domains managed by Google Domains, transferring to Cloud
465
+ # Domains is not supported.
466
+ #
467
+ #
468
+ # Use the returned values to call `TransferDomain`.
469
+ #
470
+ # @overload retrieve_transfer_parameters(request, options = nil)
471
+ # Pass arguments to `retrieve_transfer_parameters` via a request object, either of type
472
+ # {::Google::Cloud::Domains::V1::RetrieveTransferParametersRequest} or an equivalent Hash.
473
+ #
474
+ # @param request [::Google::Cloud::Domains::V1::RetrieveTransferParametersRequest, ::Hash]
475
+ # A request object representing the call parameters. Required. To specify no
476
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
477
+ # @param options [::Gapic::CallOptions, ::Hash]
478
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
479
+ #
480
+ # @overload retrieve_transfer_parameters(domain_name: nil, location: nil)
481
+ # Pass arguments to `retrieve_transfer_parameters` via keyword arguments. Note that at
482
+ # least one keyword argument is required. To specify no parameters, or to keep all
483
+ # the default parameter values, pass an empty Hash as a request object (see above).
484
+ #
485
+ # @param domain_name [::String]
486
+ # Required. The domain name. Unicode domain names must be expressed in Punycode format.
487
+ # @param location [::String]
488
+ # Required. The location. Must be in the format `projects/*/locations/*`.
489
+ #
490
+ # @yield [response, operation] Access the result along with the RPC operation
491
+ # @yieldparam response [::Google::Cloud::Domains::V1::RetrieveTransferParametersResponse]
492
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
493
+ #
494
+ # @return [::Google::Cloud::Domains::V1::RetrieveTransferParametersResponse]
495
+ #
496
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
497
+ #
498
+ # @example Basic example
499
+ # require "google/cloud/domains/v1"
500
+ #
501
+ # # Create a client object. The client can be reused for multiple calls.
502
+ # client = Google::Cloud::Domains::V1::Domains::Client.new
503
+ #
504
+ # # Create a request. To set request fields, pass in keyword arguments.
505
+ # request = Google::Cloud::Domains::V1::RetrieveTransferParametersRequest.new
506
+ #
507
+ # # Call the retrieve_transfer_parameters method.
508
+ # result = client.retrieve_transfer_parameters request
509
+ #
510
+ # # The returned object is of type Google::Cloud::Domains::V1::RetrieveTransferParametersResponse.
511
+ # p result
512
+ #
513
+ def retrieve_transfer_parameters request, options = nil
514
+ raise ::ArgumentError, "request must be provided" if request.nil?
515
+
516
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Domains::V1::RetrieveTransferParametersRequest
517
+
518
+ # Converts hash and nil to an options object
519
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
520
+
521
+ # Customize the options with defaults
522
+ metadata = @config.rpcs.retrieve_transfer_parameters.metadata.to_h
523
+
524
+ # Set x-goog-api-client and x-goog-user-project headers
525
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
526
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
527
+ gapic_version: ::Google::Cloud::Domains::V1::VERSION
528
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
529
+
530
+ header_params = {}
531
+ if request.location
532
+ header_params["location"] = request.location
533
+ end
534
+
535
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
536
+ metadata[:"x-goog-request-params"] ||= request_params_header
537
+
538
+ options.apply_defaults timeout: @config.rpcs.retrieve_transfer_parameters.timeout,
539
+ metadata: metadata,
540
+ retry_policy: @config.rpcs.retrieve_transfer_parameters.retry_policy
541
+
542
+ options.apply_defaults timeout: @config.timeout,
543
+ metadata: @config.metadata,
544
+ retry_policy: @config.retry_policy
545
+
546
+ @domains_stub.call_rpc :retrieve_transfer_parameters, request, options: options do |response, operation|
547
+ yield response, operation if block_given?
548
+ return response
549
+ end
550
+ rescue ::GRPC::BadStatus => e
551
+ raise ::Google::Cloud::Error.from_error(e)
552
+ end
553
+
554
+ ##
555
+ # Transfers a domain name from another registrar to Cloud Domains. For
556
+ # domains managed by Google Domains, transferring to Cloud Domains is not
557
+ # supported.
558
+ #
559
+ #
560
+ # Before calling this method, go to the domain's current registrar to unlock
561
+ # the domain for transfer and retrieve the domain's transfer authorization
562
+ # code. Then call `RetrieveTransferParameters` to confirm that the domain is
563
+ # unlocked and to get values needed to build a call to this method.
564
+ #
565
+ # A successful call creates a `Registration` resource in state
566
+ # `TRANSFER_PENDING`. It can take several days to complete the transfer
567
+ # process. The registrant can often speed up this process by approving the
568
+ # transfer through the current registrar, either by clicking a link in an
569
+ # email from the registrar or by visiting the registrar's website.
570
+ #
571
+ # A few minutes after transfer approval, the resource transitions to state
572
+ # `ACTIVE`, indicating that the transfer was successful. If the transfer is
573
+ # rejected or the request expires without being approved, the resource can
574
+ # end up in state `TRANSFER_FAILED`. If transfer fails, you can safely delete
575
+ # the resource and retry the transfer.
576
+ #
577
+ # @overload transfer_domain(request, options = nil)
578
+ # Pass arguments to `transfer_domain` via a request object, either of type
579
+ # {::Google::Cloud::Domains::V1::TransferDomainRequest} or an equivalent Hash.
580
+ #
581
+ # @param request [::Google::Cloud::Domains::V1::TransferDomainRequest, ::Hash]
582
+ # A request object representing the call parameters. Required. To specify no
583
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
584
+ # @param options [::Gapic::CallOptions, ::Hash]
585
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
586
+ #
587
+ # @overload transfer_domain(parent: nil, registration: nil, contact_notices: nil, yearly_price: nil, authorization_code: nil, validate_only: nil)
588
+ # Pass arguments to `transfer_domain` via keyword arguments. Note that at
589
+ # least one keyword argument is required. To specify no parameters, or to keep all
590
+ # the default parameter values, pass an empty Hash as a request object (see above).
591
+ #
592
+ # @param parent [::String]
593
+ # Required. The parent resource of the `Registration`. Must be in the
594
+ # format `projects/*/locations/*`.
595
+ # @param registration [::Google::Cloud::Domains::V1::Registration, ::Hash]
596
+ # Required. The complete `Registration` resource to be created.
597
+ #
598
+ # You can leave `registration.dns_settings` unset to import the
599
+ # domain's current DNS configuration from its current registrar. Use this
600
+ # option only if you are sure that the domain's current DNS service
601
+ # does not cease upon transfer, as is often the case for DNS services
602
+ # provided for free by the registrar.
603
+ # @param contact_notices [::Array<::Google::Cloud::Domains::V1::ContactNotice>]
604
+ # The list of contact notices that you acknowledge. The notices
605
+ # needed here depend on the values specified in
606
+ # `registration.contact_settings`.
607
+ # @param yearly_price [::Google::Type::Money, ::Hash]
608
+ # Required. Acknowledgement of the price to transfer or renew the domain for one year.
609
+ # Call `RetrieveTransferParameters` to obtain the price, which you must
610
+ # acknowledge.
611
+ # @param authorization_code [::Google::Cloud::Domains::V1::AuthorizationCode, ::Hash]
612
+ # The domain's transfer authorization code. You can obtain this from the
613
+ # domain's current registrar.
614
+ # @param validate_only [::Boolean]
615
+ # Validate the request without actually transferring the domain.
616
+ #
617
+ # @yield [response, operation] Access the result along with the RPC operation
618
+ # @yieldparam response [::Gapic::Operation]
619
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
620
+ #
621
+ # @return [::Gapic::Operation]
622
+ #
623
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
624
+ #
625
+ # @example Basic example
626
+ # require "google/cloud/domains/v1"
627
+ #
628
+ # # Create a client object. The client can be reused for multiple calls.
629
+ # client = Google::Cloud::Domains::V1::Domains::Client.new
630
+ #
631
+ # # Create a request. To set request fields, pass in keyword arguments.
632
+ # request = Google::Cloud::Domains::V1::TransferDomainRequest.new
633
+ #
634
+ # # Call the transfer_domain method.
635
+ # result = client.transfer_domain request
636
+ #
637
+ # # The returned object is of type Gapic::Operation. You can use this
638
+ # # object to check the status of an operation, cancel it, or wait
639
+ # # for results. Here is how to block until completion:
640
+ # result.wait_until_done! timeout: 60
641
+ # if result.response?
642
+ # p result.response
643
+ # else
644
+ # puts "Error!"
645
+ # end
646
+ #
647
+ def transfer_domain request, options = nil
648
+ raise ::ArgumentError, "request must be provided" if request.nil?
649
+
650
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Domains::V1::TransferDomainRequest
651
+
652
+ # Converts hash and nil to an options object
653
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
654
+
655
+ # Customize the options with defaults
656
+ metadata = @config.rpcs.transfer_domain.metadata.to_h
657
+
658
+ # Set x-goog-api-client and x-goog-user-project headers
659
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
660
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
661
+ gapic_version: ::Google::Cloud::Domains::V1::VERSION
662
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
663
+
664
+ header_params = {}
665
+ if request.parent
666
+ header_params["parent"] = request.parent
667
+ end
668
+
669
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
670
+ metadata[:"x-goog-request-params"] ||= request_params_header
671
+
672
+ options.apply_defaults timeout: @config.rpcs.transfer_domain.timeout,
673
+ metadata: metadata,
674
+ retry_policy: @config.rpcs.transfer_domain.retry_policy
675
+
676
+ options.apply_defaults timeout: @config.timeout,
677
+ metadata: @config.metadata,
678
+ retry_policy: @config.retry_policy
679
+
680
+ @domains_stub.call_rpc :transfer_domain, request, options: options do |response, operation|
681
+ response = ::Gapic::Operation.new response, @operations_client, options: options
682
+ yield response, operation if block_given?
683
+ return response
684
+ end
685
+ rescue ::GRPC::BadStatus => e
686
+ raise ::Google::Cloud::Error.from_error(e)
687
+ end
688
+
689
+ ##
690
+ # Lists the `Registration` resources in a project.
691
+ #
692
+ # @overload list_registrations(request, options = nil)
693
+ # Pass arguments to `list_registrations` via a request object, either of type
694
+ # {::Google::Cloud::Domains::V1::ListRegistrationsRequest} or an equivalent Hash.
695
+ #
696
+ # @param request [::Google::Cloud::Domains::V1::ListRegistrationsRequest, ::Hash]
697
+ # A request object representing the call parameters. Required. To specify no
698
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
699
+ # @param options [::Gapic::CallOptions, ::Hash]
700
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
701
+ #
702
+ # @overload list_registrations(parent: nil, page_size: nil, page_token: nil, filter: nil)
703
+ # Pass arguments to `list_registrations` via keyword arguments. Note that at
704
+ # least one keyword argument is required. To specify no parameters, or to keep all
705
+ # the default parameter values, pass an empty Hash as a request object (see above).
706
+ #
707
+ # @param parent [::String]
708
+ # Required. The project and location from which to list `Registration`s, specified in
709
+ # the format `projects/*/locations/*`.
710
+ # @param page_size [::Integer]
711
+ # Maximum number of results to return.
712
+ # @param page_token [::String]
713
+ # When set to the `next_page_token` from a prior response, provides the next
714
+ # page of results.
715
+ # @param filter [::String]
716
+ # Filter expression to restrict the `Registration`s returned.
717
+ #
718
+ # The expression must specify the field name, a comparison operator, and the
719
+ # value that you want to use for filtering. The value must be a string, a
720
+ # number, a boolean, or an enum value. The comparison operator should be one
721
+ # of =, !=, >, <, >=, <=, or : for prefix or wildcard matches.
722
+ #
723
+ # For example, to filter to a specific domain name, use an expression like
724
+ # `domainName="example.com"`. You can also check for the existence of a
725
+ # field; for example, to find domains using custom DNS settings, use an
726
+ # expression like `dnsSettings.customDns:*`.
727
+ #
728
+ # You can also create compound filters by combining expressions with the
729
+ # `AND` and `OR` operators. For example, to find domains that are suspended
730
+ # or have specific issues flagged, use an expression like
731
+ # `(state=SUSPENDED) OR (issue:*)`.
732
+ #
733
+ # @yield [response, operation] Access the result along with the RPC operation
734
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Domains::V1::Registration>]
735
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
736
+ #
737
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Domains::V1::Registration>]
738
+ #
739
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
740
+ #
741
+ # @example Basic example
742
+ # require "google/cloud/domains/v1"
743
+ #
744
+ # # Create a client object. The client can be reused for multiple calls.
745
+ # client = Google::Cloud::Domains::V1::Domains::Client.new
746
+ #
747
+ # # Create a request. To set request fields, pass in keyword arguments.
748
+ # request = Google::Cloud::Domains::V1::ListRegistrationsRequest.new
749
+ #
750
+ # # Call the list_registrations method.
751
+ # result = client.list_registrations request
752
+ #
753
+ # # The returned object is of type Gapic::PagedEnumerable. You can
754
+ # # iterate over all elements by calling #each, and the enumerable
755
+ # # will lazily make API calls to fetch subsequent pages. Other
756
+ # # methods are also available for managing paging directly.
757
+ # result.each do |response|
758
+ # # Each element is of type ::Google::Cloud::Domains::V1::Registration.
759
+ # p response
760
+ # end
761
+ #
762
+ def list_registrations request, options = nil
763
+ raise ::ArgumentError, "request must be provided" if request.nil?
764
+
765
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Domains::V1::ListRegistrationsRequest
766
+
767
+ # Converts hash and nil to an options object
768
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
769
+
770
+ # Customize the options with defaults
771
+ metadata = @config.rpcs.list_registrations.metadata.to_h
772
+
773
+ # Set x-goog-api-client and x-goog-user-project headers
774
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
775
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
776
+ gapic_version: ::Google::Cloud::Domains::V1::VERSION
777
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
778
+
779
+ header_params = {}
780
+ if request.parent
781
+ header_params["parent"] = request.parent
782
+ end
783
+
784
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
785
+ metadata[:"x-goog-request-params"] ||= request_params_header
786
+
787
+ options.apply_defaults timeout: @config.rpcs.list_registrations.timeout,
788
+ metadata: metadata,
789
+ retry_policy: @config.rpcs.list_registrations.retry_policy
790
+
791
+ options.apply_defaults timeout: @config.timeout,
792
+ metadata: @config.metadata,
793
+ retry_policy: @config.retry_policy
794
+
795
+ @domains_stub.call_rpc :list_registrations, request, options: options do |response, operation|
796
+ response = ::Gapic::PagedEnumerable.new @domains_stub, :list_registrations, request, response, operation, options
797
+ yield response, operation if block_given?
798
+ return response
799
+ end
800
+ rescue ::GRPC::BadStatus => e
801
+ raise ::Google::Cloud::Error.from_error(e)
802
+ end
803
+
804
+ ##
805
+ # Gets the details of a `Registration` resource.
806
+ #
807
+ # @overload get_registration(request, options = nil)
808
+ # Pass arguments to `get_registration` via a request object, either of type
809
+ # {::Google::Cloud::Domains::V1::GetRegistrationRequest} or an equivalent Hash.
810
+ #
811
+ # @param request [::Google::Cloud::Domains::V1::GetRegistrationRequest, ::Hash]
812
+ # A request object representing the call parameters. Required. To specify no
813
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
814
+ # @param options [::Gapic::CallOptions, ::Hash]
815
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
816
+ #
817
+ # @overload get_registration(name: nil)
818
+ # Pass arguments to `get_registration` via keyword arguments. Note that at
819
+ # least one keyword argument is required. To specify no parameters, or to keep all
820
+ # the default parameter values, pass an empty Hash as a request object (see above).
821
+ #
822
+ # @param name [::String]
823
+ # Required. The name of the `Registration` to get, in the format
824
+ # `projects/*/locations/*/registrations/*`.
825
+ #
826
+ # @yield [response, operation] Access the result along with the RPC operation
827
+ # @yieldparam response [::Google::Cloud::Domains::V1::Registration]
828
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
829
+ #
830
+ # @return [::Google::Cloud::Domains::V1::Registration]
831
+ #
832
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
833
+ #
834
+ # @example Basic example
835
+ # require "google/cloud/domains/v1"
836
+ #
837
+ # # Create a client object. The client can be reused for multiple calls.
838
+ # client = Google::Cloud::Domains::V1::Domains::Client.new
839
+ #
840
+ # # Create a request. To set request fields, pass in keyword arguments.
841
+ # request = Google::Cloud::Domains::V1::GetRegistrationRequest.new
842
+ #
843
+ # # Call the get_registration method.
844
+ # result = client.get_registration request
845
+ #
846
+ # # The returned object is of type Google::Cloud::Domains::V1::Registration.
847
+ # p result
848
+ #
849
+ def get_registration request, options = nil
850
+ raise ::ArgumentError, "request must be provided" if request.nil?
851
+
852
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Domains::V1::GetRegistrationRequest
853
+
854
+ # Converts hash and nil to an options object
855
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
856
+
857
+ # Customize the options with defaults
858
+ metadata = @config.rpcs.get_registration.metadata.to_h
859
+
860
+ # Set x-goog-api-client and x-goog-user-project headers
861
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
862
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
863
+ gapic_version: ::Google::Cloud::Domains::V1::VERSION
864
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
865
+
866
+ header_params = {}
867
+ if request.name
868
+ header_params["name"] = request.name
869
+ end
870
+
871
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
872
+ metadata[:"x-goog-request-params"] ||= request_params_header
873
+
874
+ options.apply_defaults timeout: @config.rpcs.get_registration.timeout,
875
+ metadata: metadata,
876
+ retry_policy: @config.rpcs.get_registration.retry_policy
877
+
878
+ options.apply_defaults timeout: @config.timeout,
879
+ metadata: @config.metadata,
880
+ retry_policy: @config.retry_policy
881
+
882
+ @domains_stub.call_rpc :get_registration, request, options: options do |response, operation|
883
+ yield response, operation if block_given?
884
+ return response
885
+ end
886
+ rescue ::GRPC::BadStatus => e
887
+ raise ::Google::Cloud::Error.from_error(e)
888
+ end
889
+
890
+ ##
891
+ # Updates select fields of a `Registration` resource, notably `labels`. To
892
+ # update other fields, use the appropriate custom update method:
893
+ #
894
+ # * To update management settings, see `ConfigureManagementSettings`
895
+ # * To update DNS configuration, see `ConfigureDnsSettings`
896
+ # * To update contact information, see `ConfigureContactSettings`
897
+ #
898
+ # @overload update_registration(request, options = nil)
899
+ # Pass arguments to `update_registration` via a request object, either of type
900
+ # {::Google::Cloud::Domains::V1::UpdateRegistrationRequest} or an equivalent Hash.
901
+ #
902
+ # @param request [::Google::Cloud::Domains::V1::UpdateRegistrationRequest, ::Hash]
903
+ # A request object representing the call parameters. Required. To specify no
904
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
905
+ # @param options [::Gapic::CallOptions, ::Hash]
906
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
907
+ #
908
+ # @overload update_registration(registration: nil, update_mask: nil)
909
+ # Pass arguments to `update_registration` via keyword arguments. Note that at
910
+ # least one keyword argument is required. To specify no parameters, or to keep all
911
+ # the default parameter values, pass an empty Hash as a request object (see above).
912
+ #
913
+ # @param registration [::Google::Cloud::Domains::V1::Registration, ::Hash]
914
+ # Fields of the `Registration` to update.
915
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
916
+ # Required. The field mask describing which fields to update as a comma-separated list.
917
+ # For example, if only the labels are being updated, the `update_mask` is
918
+ # `"labels"`.
919
+ #
920
+ # @yield [response, operation] Access the result along with the RPC operation
921
+ # @yieldparam response [::Gapic::Operation]
922
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
923
+ #
924
+ # @return [::Gapic::Operation]
925
+ #
926
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
927
+ #
928
+ # @example Basic example
929
+ # require "google/cloud/domains/v1"
930
+ #
931
+ # # Create a client object. The client can be reused for multiple calls.
932
+ # client = Google::Cloud::Domains::V1::Domains::Client.new
933
+ #
934
+ # # Create a request. To set request fields, pass in keyword arguments.
935
+ # request = Google::Cloud::Domains::V1::UpdateRegistrationRequest.new
936
+ #
937
+ # # Call the update_registration method.
938
+ # result = client.update_registration request
939
+ #
940
+ # # The returned object is of type Gapic::Operation. You can use this
941
+ # # object to check the status of an operation, cancel it, or wait
942
+ # # for results. Here is how to block until completion:
943
+ # result.wait_until_done! timeout: 60
944
+ # if result.response?
945
+ # p result.response
946
+ # else
947
+ # puts "Error!"
948
+ # end
949
+ #
950
+ def update_registration request, options = nil
951
+ raise ::ArgumentError, "request must be provided" if request.nil?
952
+
953
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Domains::V1::UpdateRegistrationRequest
954
+
955
+ # Converts hash and nil to an options object
956
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
957
+
958
+ # Customize the options with defaults
959
+ metadata = @config.rpcs.update_registration.metadata.to_h
960
+
961
+ # Set x-goog-api-client and x-goog-user-project headers
962
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
963
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
964
+ gapic_version: ::Google::Cloud::Domains::V1::VERSION
965
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
966
+
967
+ header_params = {}
968
+ if request.registration&.name
969
+ header_params["registration.name"] = request.registration.name
970
+ end
971
+
972
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
973
+ metadata[:"x-goog-request-params"] ||= request_params_header
974
+
975
+ options.apply_defaults timeout: @config.rpcs.update_registration.timeout,
976
+ metadata: metadata,
977
+ retry_policy: @config.rpcs.update_registration.retry_policy
978
+
979
+ options.apply_defaults timeout: @config.timeout,
980
+ metadata: @config.metadata,
981
+ retry_policy: @config.retry_policy
982
+
983
+ @domains_stub.call_rpc :update_registration, request, options: options do |response, operation|
984
+ response = ::Gapic::Operation.new response, @operations_client, options: options
985
+ yield response, operation if block_given?
986
+ return response
987
+ end
988
+ rescue ::GRPC::BadStatus => e
989
+ raise ::Google::Cloud::Error.from_error(e)
990
+ end
991
+
992
+ ##
993
+ # Updates a `Registration`'s management settings.
994
+ #
995
+ # @overload configure_management_settings(request, options = nil)
996
+ # Pass arguments to `configure_management_settings` via a request object, either of type
997
+ # {::Google::Cloud::Domains::V1::ConfigureManagementSettingsRequest} or an equivalent Hash.
998
+ #
999
+ # @param request [::Google::Cloud::Domains::V1::ConfigureManagementSettingsRequest, ::Hash]
1000
+ # A request object representing the call parameters. Required. To specify no
1001
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1002
+ # @param options [::Gapic::CallOptions, ::Hash]
1003
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1004
+ #
1005
+ # @overload configure_management_settings(registration: nil, management_settings: nil, update_mask: nil)
1006
+ # Pass arguments to `configure_management_settings` via keyword arguments. Note that at
1007
+ # least one keyword argument is required. To specify no parameters, or to keep all
1008
+ # the default parameter values, pass an empty Hash as a request object (see above).
1009
+ #
1010
+ # @param registration [::String]
1011
+ # Required. The name of the `Registration` whose management settings are being updated,
1012
+ # in the format `projects/*/locations/*/registrations/*`.
1013
+ # @param management_settings [::Google::Cloud::Domains::V1::ManagementSettings, ::Hash]
1014
+ # Fields of the `ManagementSettings` to update.
1015
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1016
+ # Required. The field mask describing which fields to update as a comma-separated list.
1017
+ # For example, if only the transfer lock is being updated, the `update_mask`
1018
+ # is `"transfer_lock_state"`.
1019
+ #
1020
+ # @yield [response, operation] Access the result along with the RPC operation
1021
+ # @yieldparam response [::Gapic::Operation]
1022
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1023
+ #
1024
+ # @return [::Gapic::Operation]
1025
+ #
1026
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1027
+ #
1028
+ # @example Basic example
1029
+ # require "google/cloud/domains/v1"
1030
+ #
1031
+ # # Create a client object. The client can be reused for multiple calls.
1032
+ # client = Google::Cloud::Domains::V1::Domains::Client.new
1033
+ #
1034
+ # # Create a request. To set request fields, pass in keyword arguments.
1035
+ # request = Google::Cloud::Domains::V1::ConfigureManagementSettingsRequest.new
1036
+ #
1037
+ # # Call the configure_management_settings method.
1038
+ # result = client.configure_management_settings request
1039
+ #
1040
+ # # The returned object is of type Gapic::Operation. You can use this
1041
+ # # object to check the status of an operation, cancel it, or wait
1042
+ # # for results. Here is how to block until completion:
1043
+ # result.wait_until_done! timeout: 60
1044
+ # if result.response?
1045
+ # p result.response
1046
+ # else
1047
+ # puts "Error!"
1048
+ # end
1049
+ #
1050
+ def configure_management_settings request, options = nil
1051
+ raise ::ArgumentError, "request must be provided" if request.nil?
1052
+
1053
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Domains::V1::ConfigureManagementSettingsRequest
1054
+
1055
+ # Converts hash and nil to an options object
1056
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1057
+
1058
+ # Customize the options with defaults
1059
+ metadata = @config.rpcs.configure_management_settings.metadata.to_h
1060
+
1061
+ # Set x-goog-api-client and x-goog-user-project headers
1062
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1063
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1064
+ gapic_version: ::Google::Cloud::Domains::V1::VERSION
1065
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1066
+
1067
+ header_params = {}
1068
+ if request.registration
1069
+ header_params["registration"] = request.registration
1070
+ end
1071
+
1072
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1073
+ metadata[:"x-goog-request-params"] ||= request_params_header
1074
+
1075
+ options.apply_defaults timeout: @config.rpcs.configure_management_settings.timeout,
1076
+ metadata: metadata,
1077
+ retry_policy: @config.rpcs.configure_management_settings.retry_policy
1078
+
1079
+ options.apply_defaults timeout: @config.timeout,
1080
+ metadata: @config.metadata,
1081
+ retry_policy: @config.retry_policy
1082
+
1083
+ @domains_stub.call_rpc :configure_management_settings, request, options: options do |response, operation|
1084
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1085
+ yield response, operation if block_given?
1086
+ return response
1087
+ end
1088
+ rescue ::GRPC::BadStatus => e
1089
+ raise ::Google::Cloud::Error.from_error(e)
1090
+ end
1091
+
1092
+ ##
1093
+ # Updates a `Registration`'s DNS settings.
1094
+ #
1095
+ # @overload configure_dns_settings(request, options = nil)
1096
+ # Pass arguments to `configure_dns_settings` via a request object, either of type
1097
+ # {::Google::Cloud::Domains::V1::ConfigureDnsSettingsRequest} or an equivalent Hash.
1098
+ #
1099
+ # @param request [::Google::Cloud::Domains::V1::ConfigureDnsSettingsRequest, ::Hash]
1100
+ # A request object representing the call parameters. Required. To specify no
1101
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1102
+ # @param options [::Gapic::CallOptions, ::Hash]
1103
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1104
+ #
1105
+ # @overload configure_dns_settings(registration: nil, dns_settings: nil, update_mask: nil, validate_only: nil)
1106
+ # Pass arguments to `configure_dns_settings` via keyword arguments. Note that at
1107
+ # least one keyword argument is required. To specify no parameters, or to keep all
1108
+ # the default parameter values, pass an empty Hash as a request object (see above).
1109
+ #
1110
+ # @param registration [::String]
1111
+ # Required. The name of the `Registration` whose DNS settings are being updated,
1112
+ # in the format `projects/*/locations/*/registrations/*`.
1113
+ # @param dns_settings [::Google::Cloud::Domains::V1::DnsSettings, ::Hash]
1114
+ # Fields of the `DnsSettings` to update.
1115
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1116
+ # Required. The field mask describing which fields to update as a comma-separated list.
1117
+ # For example, if only the name servers are being updated for an existing
1118
+ # Custom DNS configuration, the `update_mask` is
1119
+ # `"custom_dns.name_servers"`.
1120
+ #
1121
+ # When changing the DNS provider from one type to another, pass the new
1122
+ # provider's field name as part of the field mask. For example, when changing
1123
+ # from a Google Domains DNS configuration to a Custom DNS configuration, the
1124
+ # `update_mask` is `"custom_dns"`. //
1125
+ # @param validate_only [::Boolean]
1126
+ # Validate the request without actually updating the DNS settings.
1127
+ #
1128
+ # @yield [response, operation] Access the result along with the RPC operation
1129
+ # @yieldparam response [::Gapic::Operation]
1130
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1131
+ #
1132
+ # @return [::Gapic::Operation]
1133
+ #
1134
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1135
+ #
1136
+ # @example Basic example
1137
+ # require "google/cloud/domains/v1"
1138
+ #
1139
+ # # Create a client object. The client can be reused for multiple calls.
1140
+ # client = Google::Cloud::Domains::V1::Domains::Client.new
1141
+ #
1142
+ # # Create a request. To set request fields, pass in keyword arguments.
1143
+ # request = Google::Cloud::Domains::V1::ConfigureDnsSettingsRequest.new
1144
+ #
1145
+ # # Call the configure_dns_settings method.
1146
+ # result = client.configure_dns_settings request
1147
+ #
1148
+ # # The returned object is of type Gapic::Operation. You can use this
1149
+ # # object to check the status of an operation, cancel it, or wait
1150
+ # # for results. Here is how to block until completion:
1151
+ # result.wait_until_done! timeout: 60
1152
+ # if result.response?
1153
+ # p result.response
1154
+ # else
1155
+ # puts "Error!"
1156
+ # end
1157
+ #
1158
+ def configure_dns_settings request, options = nil
1159
+ raise ::ArgumentError, "request must be provided" if request.nil?
1160
+
1161
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Domains::V1::ConfigureDnsSettingsRequest
1162
+
1163
+ # Converts hash and nil to an options object
1164
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1165
+
1166
+ # Customize the options with defaults
1167
+ metadata = @config.rpcs.configure_dns_settings.metadata.to_h
1168
+
1169
+ # Set x-goog-api-client and x-goog-user-project headers
1170
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1171
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1172
+ gapic_version: ::Google::Cloud::Domains::V1::VERSION
1173
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1174
+
1175
+ header_params = {}
1176
+ if request.registration
1177
+ header_params["registration"] = request.registration
1178
+ end
1179
+
1180
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1181
+ metadata[:"x-goog-request-params"] ||= request_params_header
1182
+
1183
+ options.apply_defaults timeout: @config.rpcs.configure_dns_settings.timeout,
1184
+ metadata: metadata,
1185
+ retry_policy: @config.rpcs.configure_dns_settings.retry_policy
1186
+
1187
+ options.apply_defaults timeout: @config.timeout,
1188
+ metadata: @config.metadata,
1189
+ retry_policy: @config.retry_policy
1190
+
1191
+ @domains_stub.call_rpc :configure_dns_settings, request, options: options do |response, operation|
1192
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1193
+ yield response, operation if block_given?
1194
+ return response
1195
+ end
1196
+ rescue ::GRPC::BadStatus => e
1197
+ raise ::Google::Cloud::Error.from_error(e)
1198
+ end
1199
+
1200
+ ##
1201
+ # Updates a `Registration`'s contact settings. Some changes require
1202
+ # confirmation by the domain's registrant contact .
1203
+ #
1204
+ # @overload configure_contact_settings(request, options = nil)
1205
+ # Pass arguments to `configure_contact_settings` via a request object, either of type
1206
+ # {::Google::Cloud::Domains::V1::ConfigureContactSettingsRequest} or an equivalent Hash.
1207
+ #
1208
+ # @param request [::Google::Cloud::Domains::V1::ConfigureContactSettingsRequest, ::Hash]
1209
+ # A request object representing the call parameters. Required. To specify no
1210
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1211
+ # @param options [::Gapic::CallOptions, ::Hash]
1212
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1213
+ #
1214
+ # @overload configure_contact_settings(registration: nil, contact_settings: nil, update_mask: nil, contact_notices: nil, validate_only: nil)
1215
+ # Pass arguments to `configure_contact_settings` via keyword arguments. Note that at
1216
+ # least one keyword argument is required. To specify no parameters, or to keep all
1217
+ # the default parameter values, pass an empty Hash as a request object (see above).
1218
+ #
1219
+ # @param registration [::String]
1220
+ # Required. The name of the `Registration` whose contact settings are being updated,
1221
+ # in the format `projects/*/locations/*/registrations/*`.
1222
+ # @param contact_settings [::Google::Cloud::Domains::V1::ContactSettings, ::Hash]
1223
+ # Fields of the `ContactSettings` to update.
1224
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1225
+ # Required. The field mask describing which fields to update as a comma-separated list.
1226
+ # For example, if only the registrant contact is being updated, the
1227
+ # `update_mask` is `"registrant_contact"`.
1228
+ # @param contact_notices [::Array<::Google::Cloud::Domains::V1::ContactNotice>]
1229
+ # The list of contact notices that the caller acknowledges. The notices
1230
+ # needed here depend on the values specified in `contact_settings`.
1231
+ # @param validate_only [::Boolean]
1232
+ # Validate the request without actually updating the contact settings.
1233
+ #
1234
+ # @yield [response, operation] Access the result along with the RPC operation
1235
+ # @yieldparam response [::Gapic::Operation]
1236
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1237
+ #
1238
+ # @return [::Gapic::Operation]
1239
+ #
1240
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1241
+ #
1242
+ # @example Basic example
1243
+ # require "google/cloud/domains/v1"
1244
+ #
1245
+ # # Create a client object. The client can be reused for multiple calls.
1246
+ # client = Google::Cloud::Domains::V1::Domains::Client.new
1247
+ #
1248
+ # # Create a request. To set request fields, pass in keyword arguments.
1249
+ # request = Google::Cloud::Domains::V1::ConfigureContactSettingsRequest.new
1250
+ #
1251
+ # # Call the configure_contact_settings method.
1252
+ # result = client.configure_contact_settings request
1253
+ #
1254
+ # # The returned object is of type Gapic::Operation. You can use this
1255
+ # # object to check the status of an operation, cancel it, or wait
1256
+ # # for results. Here is how to block until completion:
1257
+ # result.wait_until_done! timeout: 60
1258
+ # if result.response?
1259
+ # p result.response
1260
+ # else
1261
+ # puts "Error!"
1262
+ # end
1263
+ #
1264
+ def configure_contact_settings request, options = nil
1265
+ raise ::ArgumentError, "request must be provided" if request.nil?
1266
+
1267
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Domains::V1::ConfigureContactSettingsRequest
1268
+
1269
+ # Converts hash and nil to an options object
1270
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1271
+
1272
+ # Customize the options with defaults
1273
+ metadata = @config.rpcs.configure_contact_settings.metadata.to_h
1274
+
1275
+ # Set x-goog-api-client and x-goog-user-project headers
1276
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1277
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1278
+ gapic_version: ::Google::Cloud::Domains::V1::VERSION
1279
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1280
+
1281
+ header_params = {}
1282
+ if request.registration
1283
+ header_params["registration"] = request.registration
1284
+ end
1285
+
1286
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1287
+ metadata[:"x-goog-request-params"] ||= request_params_header
1288
+
1289
+ options.apply_defaults timeout: @config.rpcs.configure_contact_settings.timeout,
1290
+ metadata: metadata,
1291
+ retry_policy: @config.rpcs.configure_contact_settings.retry_policy
1292
+
1293
+ options.apply_defaults timeout: @config.timeout,
1294
+ metadata: @config.metadata,
1295
+ retry_policy: @config.retry_policy
1296
+
1297
+ @domains_stub.call_rpc :configure_contact_settings, request, options: options do |response, operation|
1298
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1299
+ yield response, operation if block_given?
1300
+ return response
1301
+ end
1302
+ rescue ::GRPC::BadStatus => e
1303
+ raise ::Google::Cloud::Error.from_error(e)
1304
+ end
1305
+
1306
+ ##
1307
+ # Exports a `Registration` resource, such that it is no longer managed by
1308
+ # Cloud Domains.
1309
+ #
1310
+ # When an active domain is successfully exported, you can continue to use the
1311
+ # domain in [Google Domains](https://domains.google/) until it expires. The
1312
+ # calling user becomes the domain's sole owner in Google Domains, and
1313
+ # permissions for the domain are subsequently managed there. The domain does
1314
+ # not renew automatically unless the new owner sets up billing in Google
1315
+ # Domains.
1316
+ #
1317
+ # @overload export_registration(request, options = nil)
1318
+ # Pass arguments to `export_registration` via a request object, either of type
1319
+ # {::Google::Cloud::Domains::V1::ExportRegistrationRequest} or an equivalent Hash.
1320
+ #
1321
+ # @param request [::Google::Cloud::Domains::V1::ExportRegistrationRequest, ::Hash]
1322
+ # A request object representing the call parameters. Required. To specify no
1323
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1324
+ # @param options [::Gapic::CallOptions, ::Hash]
1325
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1326
+ #
1327
+ # @overload export_registration(name: nil)
1328
+ # Pass arguments to `export_registration` via keyword arguments. Note that at
1329
+ # least one keyword argument is required. To specify no parameters, or to keep all
1330
+ # the default parameter values, pass an empty Hash as a request object (see above).
1331
+ #
1332
+ # @param name [::String]
1333
+ # Required. The name of the `Registration` to export,
1334
+ # in the format `projects/*/locations/*/registrations/*`.
1335
+ #
1336
+ # @yield [response, operation] Access the result along with the RPC operation
1337
+ # @yieldparam response [::Gapic::Operation]
1338
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1339
+ #
1340
+ # @return [::Gapic::Operation]
1341
+ #
1342
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1343
+ #
1344
+ # @example Basic example
1345
+ # require "google/cloud/domains/v1"
1346
+ #
1347
+ # # Create a client object. The client can be reused for multiple calls.
1348
+ # client = Google::Cloud::Domains::V1::Domains::Client.new
1349
+ #
1350
+ # # Create a request. To set request fields, pass in keyword arguments.
1351
+ # request = Google::Cloud::Domains::V1::ExportRegistrationRequest.new
1352
+ #
1353
+ # # Call the export_registration method.
1354
+ # result = client.export_registration request
1355
+ #
1356
+ # # The returned object is of type Gapic::Operation. You can use this
1357
+ # # object to check the status of an operation, cancel it, or wait
1358
+ # # for results. Here is how to block until completion:
1359
+ # result.wait_until_done! timeout: 60
1360
+ # if result.response?
1361
+ # p result.response
1362
+ # else
1363
+ # puts "Error!"
1364
+ # end
1365
+ #
1366
+ def export_registration request, options = nil
1367
+ raise ::ArgumentError, "request must be provided" if request.nil?
1368
+
1369
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Domains::V1::ExportRegistrationRequest
1370
+
1371
+ # Converts hash and nil to an options object
1372
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1373
+
1374
+ # Customize the options with defaults
1375
+ metadata = @config.rpcs.export_registration.metadata.to_h
1376
+
1377
+ # Set x-goog-api-client and x-goog-user-project headers
1378
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1379
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1380
+ gapic_version: ::Google::Cloud::Domains::V1::VERSION
1381
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1382
+
1383
+ header_params = {}
1384
+ if request.name
1385
+ header_params["name"] = request.name
1386
+ end
1387
+
1388
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1389
+ metadata[:"x-goog-request-params"] ||= request_params_header
1390
+
1391
+ options.apply_defaults timeout: @config.rpcs.export_registration.timeout,
1392
+ metadata: metadata,
1393
+ retry_policy: @config.rpcs.export_registration.retry_policy
1394
+
1395
+ options.apply_defaults timeout: @config.timeout,
1396
+ metadata: @config.metadata,
1397
+ retry_policy: @config.retry_policy
1398
+
1399
+ @domains_stub.call_rpc :export_registration, request, options: options do |response, operation|
1400
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1401
+ yield response, operation if block_given?
1402
+ return response
1403
+ end
1404
+ rescue ::GRPC::BadStatus => e
1405
+ raise ::Google::Cloud::Error.from_error(e)
1406
+ end
1407
+
1408
+ ##
1409
+ # Deletes a `Registration` resource.
1410
+ #
1411
+ # This method works on any `Registration` resource using [Subscription or
1412
+ # Commitment billing](/domains/pricing#billing-models), provided that the
1413
+ # resource was created at least 1 day in the past.
1414
+ #
1415
+ # For `Registration` resources using
1416
+ # [Monthly billing](/domains/pricing#billing-models), this method works if:
1417
+ #
1418
+ # * `state` is `EXPORTED` with `expire_time` in the past
1419
+ # * `state` is `REGISTRATION_FAILED`
1420
+ # * `state` is `TRANSFER_FAILED`
1421
+ #
1422
+ # When an active registration is successfully deleted, you can continue to
1423
+ # use the domain in [Google Domains](https://domains.google/) until it
1424
+ # expires. The calling user becomes the domain's sole owner in Google
1425
+ # Domains, and permissions for the domain are subsequently managed there. The
1426
+ # domain does not renew automatically unless the new owner sets up billing in
1427
+ # Google Domains.
1428
+ #
1429
+ # @overload delete_registration(request, options = nil)
1430
+ # Pass arguments to `delete_registration` via a request object, either of type
1431
+ # {::Google::Cloud::Domains::V1::DeleteRegistrationRequest} or an equivalent Hash.
1432
+ #
1433
+ # @param request [::Google::Cloud::Domains::V1::DeleteRegistrationRequest, ::Hash]
1434
+ # A request object representing the call parameters. Required. To specify no
1435
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1436
+ # @param options [::Gapic::CallOptions, ::Hash]
1437
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1438
+ #
1439
+ # @overload delete_registration(name: nil)
1440
+ # Pass arguments to `delete_registration` via keyword arguments. Note that at
1441
+ # least one keyword argument is required. To specify no parameters, or to keep all
1442
+ # the default parameter values, pass an empty Hash as a request object (see above).
1443
+ #
1444
+ # @param name [::String]
1445
+ # Required. The name of the `Registration` to delete,
1446
+ # in the format `projects/*/locations/*/registrations/*`.
1447
+ #
1448
+ # @yield [response, operation] Access the result along with the RPC operation
1449
+ # @yieldparam response [::Gapic::Operation]
1450
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1451
+ #
1452
+ # @return [::Gapic::Operation]
1453
+ #
1454
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1455
+ #
1456
+ # @example Basic example
1457
+ # require "google/cloud/domains/v1"
1458
+ #
1459
+ # # Create a client object. The client can be reused for multiple calls.
1460
+ # client = Google::Cloud::Domains::V1::Domains::Client.new
1461
+ #
1462
+ # # Create a request. To set request fields, pass in keyword arguments.
1463
+ # request = Google::Cloud::Domains::V1::DeleteRegistrationRequest.new
1464
+ #
1465
+ # # Call the delete_registration method.
1466
+ # result = client.delete_registration request
1467
+ #
1468
+ # # The returned object is of type Gapic::Operation. You can use this
1469
+ # # object to check the status of an operation, cancel it, or wait
1470
+ # # for results. Here is how to block until completion:
1471
+ # result.wait_until_done! timeout: 60
1472
+ # if result.response?
1473
+ # p result.response
1474
+ # else
1475
+ # puts "Error!"
1476
+ # end
1477
+ #
1478
+ def delete_registration request, options = nil
1479
+ raise ::ArgumentError, "request must be provided" if request.nil?
1480
+
1481
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Domains::V1::DeleteRegistrationRequest
1482
+
1483
+ # Converts hash and nil to an options object
1484
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1485
+
1486
+ # Customize the options with defaults
1487
+ metadata = @config.rpcs.delete_registration.metadata.to_h
1488
+
1489
+ # Set x-goog-api-client and x-goog-user-project headers
1490
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1491
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1492
+ gapic_version: ::Google::Cloud::Domains::V1::VERSION
1493
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1494
+
1495
+ header_params = {}
1496
+ if request.name
1497
+ header_params["name"] = request.name
1498
+ end
1499
+
1500
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1501
+ metadata[:"x-goog-request-params"] ||= request_params_header
1502
+
1503
+ options.apply_defaults timeout: @config.rpcs.delete_registration.timeout,
1504
+ metadata: metadata,
1505
+ retry_policy: @config.rpcs.delete_registration.retry_policy
1506
+
1507
+ options.apply_defaults timeout: @config.timeout,
1508
+ metadata: @config.metadata,
1509
+ retry_policy: @config.retry_policy
1510
+
1511
+ @domains_stub.call_rpc :delete_registration, request, options: options do |response, operation|
1512
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1513
+ yield response, operation if block_given?
1514
+ return response
1515
+ end
1516
+ rescue ::GRPC::BadStatus => e
1517
+ raise ::Google::Cloud::Error.from_error(e)
1518
+ end
1519
+
1520
+ ##
1521
+ # Gets the authorization code of the `Registration` for the purpose of
1522
+ # transferring the domain to another registrar.
1523
+ #
1524
+ # You can call this method only after 60 days have elapsed since the initial
1525
+ # domain registration.
1526
+ #
1527
+ # @overload retrieve_authorization_code(request, options = nil)
1528
+ # Pass arguments to `retrieve_authorization_code` via a request object, either of type
1529
+ # {::Google::Cloud::Domains::V1::RetrieveAuthorizationCodeRequest} or an equivalent Hash.
1530
+ #
1531
+ # @param request [::Google::Cloud::Domains::V1::RetrieveAuthorizationCodeRequest, ::Hash]
1532
+ # A request object representing the call parameters. Required. To specify no
1533
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1534
+ # @param options [::Gapic::CallOptions, ::Hash]
1535
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1536
+ #
1537
+ # @overload retrieve_authorization_code(registration: nil)
1538
+ # Pass arguments to `retrieve_authorization_code` via keyword arguments. Note that at
1539
+ # least one keyword argument is required. To specify no parameters, or to keep all
1540
+ # the default parameter values, pass an empty Hash as a request object (see above).
1541
+ #
1542
+ # @param registration [::String]
1543
+ # Required. The name of the `Registration` whose authorization code is being retrieved,
1544
+ # in the format `projects/*/locations/*/registrations/*`.
1545
+ #
1546
+ # @yield [response, operation] Access the result along with the RPC operation
1547
+ # @yieldparam response [::Google::Cloud::Domains::V1::AuthorizationCode]
1548
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1549
+ #
1550
+ # @return [::Google::Cloud::Domains::V1::AuthorizationCode]
1551
+ #
1552
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1553
+ #
1554
+ # @example Basic example
1555
+ # require "google/cloud/domains/v1"
1556
+ #
1557
+ # # Create a client object. The client can be reused for multiple calls.
1558
+ # client = Google::Cloud::Domains::V1::Domains::Client.new
1559
+ #
1560
+ # # Create a request. To set request fields, pass in keyword arguments.
1561
+ # request = Google::Cloud::Domains::V1::RetrieveAuthorizationCodeRequest.new
1562
+ #
1563
+ # # Call the retrieve_authorization_code method.
1564
+ # result = client.retrieve_authorization_code request
1565
+ #
1566
+ # # The returned object is of type Google::Cloud::Domains::V1::AuthorizationCode.
1567
+ # p result
1568
+ #
1569
+ def retrieve_authorization_code request, options = nil
1570
+ raise ::ArgumentError, "request must be provided" if request.nil?
1571
+
1572
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Domains::V1::RetrieveAuthorizationCodeRequest
1573
+
1574
+ # Converts hash and nil to an options object
1575
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1576
+
1577
+ # Customize the options with defaults
1578
+ metadata = @config.rpcs.retrieve_authorization_code.metadata.to_h
1579
+
1580
+ # Set x-goog-api-client and x-goog-user-project headers
1581
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1582
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1583
+ gapic_version: ::Google::Cloud::Domains::V1::VERSION
1584
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1585
+
1586
+ header_params = {}
1587
+ if request.registration
1588
+ header_params["registration"] = request.registration
1589
+ end
1590
+
1591
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1592
+ metadata[:"x-goog-request-params"] ||= request_params_header
1593
+
1594
+ options.apply_defaults timeout: @config.rpcs.retrieve_authorization_code.timeout,
1595
+ metadata: metadata,
1596
+ retry_policy: @config.rpcs.retrieve_authorization_code.retry_policy
1597
+
1598
+ options.apply_defaults timeout: @config.timeout,
1599
+ metadata: @config.metadata,
1600
+ retry_policy: @config.retry_policy
1601
+
1602
+ @domains_stub.call_rpc :retrieve_authorization_code, request, options: options do |response, operation|
1603
+ yield response, operation if block_given?
1604
+ return response
1605
+ end
1606
+ rescue ::GRPC::BadStatus => e
1607
+ raise ::Google::Cloud::Error.from_error(e)
1608
+ end
1609
+
1610
+ ##
1611
+ # Resets the authorization code of the `Registration` to a new random string.
1612
+ #
1613
+ # You can call this method only after 60 days have elapsed since the initial
1614
+ # domain registration.
1615
+ #
1616
+ # @overload reset_authorization_code(request, options = nil)
1617
+ # Pass arguments to `reset_authorization_code` via a request object, either of type
1618
+ # {::Google::Cloud::Domains::V1::ResetAuthorizationCodeRequest} or an equivalent Hash.
1619
+ #
1620
+ # @param request [::Google::Cloud::Domains::V1::ResetAuthorizationCodeRequest, ::Hash]
1621
+ # A request object representing the call parameters. Required. To specify no
1622
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1623
+ # @param options [::Gapic::CallOptions, ::Hash]
1624
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1625
+ #
1626
+ # @overload reset_authorization_code(registration: nil)
1627
+ # Pass arguments to `reset_authorization_code` via keyword arguments. Note that at
1628
+ # least one keyword argument is required. To specify no parameters, or to keep all
1629
+ # the default parameter values, pass an empty Hash as a request object (see above).
1630
+ #
1631
+ # @param registration [::String]
1632
+ # Required. The name of the `Registration` whose authorization code is being reset,
1633
+ # in the format `projects/*/locations/*/registrations/*`.
1634
+ #
1635
+ # @yield [response, operation] Access the result along with the RPC operation
1636
+ # @yieldparam response [::Google::Cloud::Domains::V1::AuthorizationCode]
1637
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1638
+ #
1639
+ # @return [::Google::Cloud::Domains::V1::AuthorizationCode]
1640
+ #
1641
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1642
+ #
1643
+ # @example Basic example
1644
+ # require "google/cloud/domains/v1"
1645
+ #
1646
+ # # Create a client object. The client can be reused for multiple calls.
1647
+ # client = Google::Cloud::Domains::V1::Domains::Client.new
1648
+ #
1649
+ # # Create a request. To set request fields, pass in keyword arguments.
1650
+ # request = Google::Cloud::Domains::V1::ResetAuthorizationCodeRequest.new
1651
+ #
1652
+ # # Call the reset_authorization_code method.
1653
+ # result = client.reset_authorization_code request
1654
+ #
1655
+ # # The returned object is of type Google::Cloud::Domains::V1::AuthorizationCode.
1656
+ # p result
1657
+ #
1658
+ def reset_authorization_code request, options = nil
1659
+ raise ::ArgumentError, "request must be provided" if request.nil?
1660
+
1661
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Domains::V1::ResetAuthorizationCodeRequest
1662
+
1663
+ # Converts hash and nil to an options object
1664
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1665
+
1666
+ # Customize the options with defaults
1667
+ metadata = @config.rpcs.reset_authorization_code.metadata.to_h
1668
+
1669
+ # Set x-goog-api-client and x-goog-user-project headers
1670
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1671
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1672
+ gapic_version: ::Google::Cloud::Domains::V1::VERSION
1673
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1674
+
1675
+ header_params = {}
1676
+ if request.registration
1677
+ header_params["registration"] = request.registration
1678
+ end
1679
+
1680
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1681
+ metadata[:"x-goog-request-params"] ||= request_params_header
1682
+
1683
+ options.apply_defaults timeout: @config.rpcs.reset_authorization_code.timeout,
1684
+ metadata: metadata,
1685
+ retry_policy: @config.rpcs.reset_authorization_code.retry_policy
1686
+
1687
+ options.apply_defaults timeout: @config.timeout,
1688
+ metadata: @config.metadata,
1689
+ retry_policy: @config.retry_policy
1690
+
1691
+ @domains_stub.call_rpc :reset_authorization_code, request, options: options do |response, operation|
1692
+ yield response, operation if block_given?
1693
+ return response
1694
+ end
1695
+ rescue ::GRPC::BadStatus => e
1696
+ raise ::Google::Cloud::Error.from_error(e)
1697
+ end
1698
+
1699
+ ##
1700
+ # Configuration class for the Domains API.
1701
+ #
1702
+ # This class represents the configuration for Domains,
1703
+ # providing control over timeouts, retry behavior, logging, transport
1704
+ # parameters, and other low-level controls. Certain parameters can also be
1705
+ # applied individually to specific RPCs. See
1706
+ # {::Google::Cloud::Domains::V1::Domains::Client::Configuration::Rpcs}
1707
+ # for a list of RPCs that can be configured independently.
1708
+ #
1709
+ # Configuration can be applied globally to all clients, or to a single client
1710
+ # on construction.
1711
+ #
1712
+ # @example
1713
+ #
1714
+ # # Modify the global config, setting the timeout for
1715
+ # # search_domains to 20 seconds,
1716
+ # # and all remaining timeouts to 10 seconds.
1717
+ # ::Google::Cloud::Domains::V1::Domains::Client.configure do |config|
1718
+ # config.timeout = 10.0
1719
+ # config.rpcs.search_domains.timeout = 20.0
1720
+ # end
1721
+ #
1722
+ # # Apply the above configuration only to a new client.
1723
+ # client = ::Google::Cloud::Domains::V1::Domains::Client.new do |config|
1724
+ # config.timeout = 10.0
1725
+ # config.rpcs.search_domains.timeout = 20.0
1726
+ # end
1727
+ #
1728
+ # @!attribute [rw] endpoint
1729
+ # The hostname or hostname:port of the service endpoint.
1730
+ # Defaults to `"domains.googleapis.com"`.
1731
+ # @return [::String]
1732
+ # @!attribute [rw] credentials
1733
+ # Credentials to send with calls. You may provide any of the following types:
1734
+ # * (`String`) The path to a service account key file in JSON format
1735
+ # * (`Hash`) A service account key as a Hash
1736
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
1737
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
1738
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1739
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
1740
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
1741
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
1742
+ # * (`nil`) indicating no credentials
1743
+ # @return [::Object]
1744
+ # @!attribute [rw] scope
1745
+ # The OAuth scopes
1746
+ # @return [::Array<::String>]
1747
+ # @!attribute [rw] lib_name
1748
+ # The library name as recorded in instrumentation and logging
1749
+ # @return [::String]
1750
+ # @!attribute [rw] lib_version
1751
+ # The library version as recorded in instrumentation and logging
1752
+ # @return [::String]
1753
+ # @!attribute [rw] channel_args
1754
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
1755
+ # `GRPC::Core::Channel` object is provided as the credential.
1756
+ # @return [::Hash]
1757
+ # @!attribute [rw] interceptors
1758
+ # An array of interceptors that are run before calls are executed.
1759
+ # @return [::Array<::GRPC::ClientInterceptor>]
1760
+ # @!attribute [rw] timeout
1761
+ # The call timeout in seconds.
1762
+ # @return [::Numeric]
1763
+ # @!attribute [rw] metadata
1764
+ # Additional gRPC headers to be sent with the call.
1765
+ # @return [::Hash{::Symbol=>::String}]
1766
+ # @!attribute [rw] retry_policy
1767
+ # The retry policy. The value is a hash with the following keys:
1768
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1769
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1770
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1771
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1772
+ # trigger a retry.
1773
+ # @return [::Hash]
1774
+ # @!attribute [rw] quota_project
1775
+ # A separate project against which to charge quota.
1776
+ # @return [::String]
1777
+ #
1778
+ class Configuration
1779
+ extend ::Gapic::Config
1780
+
1781
+ config_attr :endpoint, "domains.googleapis.com", ::String
1782
+ config_attr :credentials, nil do |value|
1783
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1784
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
1785
+ allowed.any? { |klass| klass === value }
1786
+ end
1787
+ config_attr :scope, nil, ::String, ::Array, nil
1788
+ config_attr :lib_name, nil, ::String, nil
1789
+ config_attr :lib_version, nil, ::String, nil
1790
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
1791
+ config_attr :interceptors, nil, ::Array, nil
1792
+ config_attr :timeout, nil, ::Numeric, nil
1793
+ config_attr :metadata, nil, ::Hash, nil
1794
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1795
+ config_attr :quota_project, nil, ::String, nil
1796
+
1797
+ # @private
1798
+ def initialize parent_config = nil
1799
+ @parent_config = parent_config unless parent_config.nil?
1800
+
1801
+ yield self if block_given?
1802
+ end
1803
+
1804
+ ##
1805
+ # Configurations for individual RPCs
1806
+ # @return [Rpcs]
1807
+ #
1808
+ def rpcs
1809
+ @rpcs ||= begin
1810
+ parent_rpcs = nil
1811
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1812
+ Rpcs.new parent_rpcs
1813
+ end
1814
+ end
1815
+
1816
+ ##
1817
+ # Configuration RPC class for the Domains API.
1818
+ #
1819
+ # Includes fields providing the configuration for each RPC in this service.
1820
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1821
+ # the following configuration fields:
1822
+ #
1823
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1824
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
1825
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1826
+ # include the following keys:
1827
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1828
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1829
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1830
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1831
+ # trigger a retry.
1832
+ #
1833
+ class Rpcs
1834
+ ##
1835
+ # RPC-specific configuration for `search_domains`
1836
+ # @return [::Gapic::Config::Method]
1837
+ #
1838
+ attr_reader :search_domains
1839
+ ##
1840
+ # RPC-specific configuration for `retrieve_register_parameters`
1841
+ # @return [::Gapic::Config::Method]
1842
+ #
1843
+ attr_reader :retrieve_register_parameters
1844
+ ##
1845
+ # RPC-specific configuration for `register_domain`
1846
+ # @return [::Gapic::Config::Method]
1847
+ #
1848
+ attr_reader :register_domain
1849
+ ##
1850
+ # RPC-specific configuration for `retrieve_transfer_parameters`
1851
+ # @return [::Gapic::Config::Method]
1852
+ #
1853
+ attr_reader :retrieve_transfer_parameters
1854
+ ##
1855
+ # RPC-specific configuration for `transfer_domain`
1856
+ # @return [::Gapic::Config::Method]
1857
+ #
1858
+ attr_reader :transfer_domain
1859
+ ##
1860
+ # RPC-specific configuration for `list_registrations`
1861
+ # @return [::Gapic::Config::Method]
1862
+ #
1863
+ attr_reader :list_registrations
1864
+ ##
1865
+ # RPC-specific configuration for `get_registration`
1866
+ # @return [::Gapic::Config::Method]
1867
+ #
1868
+ attr_reader :get_registration
1869
+ ##
1870
+ # RPC-specific configuration for `update_registration`
1871
+ # @return [::Gapic::Config::Method]
1872
+ #
1873
+ attr_reader :update_registration
1874
+ ##
1875
+ # RPC-specific configuration for `configure_management_settings`
1876
+ # @return [::Gapic::Config::Method]
1877
+ #
1878
+ attr_reader :configure_management_settings
1879
+ ##
1880
+ # RPC-specific configuration for `configure_dns_settings`
1881
+ # @return [::Gapic::Config::Method]
1882
+ #
1883
+ attr_reader :configure_dns_settings
1884
+ ##
1885
+ # RPC-specific configuration for `configure_contact_settings`
1886
+ # @return [::Gapic::Config::Method]
1887
+ #
1888
+ attr_reader :configure_contact_settings
1889
+ ##
1890
+ # RPC-specific configuration for `export_registration`
1891
+ # @return [::Gapic::Config::Method]
1892
+ #
1893
+ attr_reader :export_registration
1894
+ ##
1895
+ # RPC-specific configuration for `delete_registration`
1896
+ # @return [::Gapic::Config::Method]
1897
+ #
1898
+ attr_reader :delete_registration
1899
+ ##
1900
+ # RPC-specific configuration for `retrieve_authorization_code`
1901
+ # @return [::Gapic::Config::Method]
1902
+ #
1903
+ attr_reader :retrieve_authorization_code
1904
+ ##
1905
+ # RPC-specific configuration for `reset_authorization_code`
1906
+ # @return [::Gapic::Config::Method]
1907
+ #
1908
+ attr_reader :reset_authorization_code
1909
+
1910
+ # @private
1911
+ def initialize parent_rpcs = nil
1912
+ search_domains_config = parent_rpcs.search_domains if parent_rpcs.respond_to? :search_domains
1913
+ @search_domains = ::Gapic::Config::Method.new search_domains_config
1914
+ retrieve_register_parameters_config = parent_rpcs.retrieve_register_parameters if parent_rpcs.respond_to? :retrieve_register_parameters
1915
+ @retrieve_register_parameters = ::Gapic::Config::Method.new retrieve_register_parameters_config
1916
+ register_domain_config = parent_rpcs.register_domain if parent_rpcs.respond_to? :register_domain
1917
+ @register_domain = ::Gapic::Config::Method.new register_domain_config
1918
+ retrieve_transfer_parameters_config = parent_rpcs.retrieve_transfer_parameters if parent_rpcs.respond_to? :retrieve_transfer_parameters
1919
+ @retrieve_transfer_parameters = ::Gapic::Config::Method.new retrieve_transfer_parameters_config
1920
+ transfer_domain_config = parent_rpcs.transfer_domain if parent_rpcs.respond_to? :transfer_domain
1921
+ @transfer_domain = ::Gapic::Config::Method.new transfer_domain_config
1922
+ list_registrations_config = parent_rpcs.list_registrations if parent_rpcs.respond_to? :list_registrations
1923
+ @list_registrations = ::Gapic::Config::Method.new list_registrations_config
1924
+ get_registration_config = parent_rpcs.get_registration if parent_rpcs.respond_to? :get_registration
1925
+ @get_registration = ::Gapic::Config::Method.new get_registration_config
1926
+ update_registration_config = parent_rpcs.update_registration if parent_rpcs.respond_to? :update_registration
1927
+ @update_registration = ::Gapic::Config::Method.new update_registration_config
1928
+ configure_management_settings_config = parent_rpcs.configure_management_settings if parent_rpcs.respond_to? :configure_management_settings
1929
+ @configure_management_settings = ::Gapic::Config::Method.new configure_management_settings_config
1930
+ configure_dns_settings_config = parent_rpcs.configure_dns_settings if parent_rpcs.respond_to? :configure_dns_settings
1931
+ @configure_dns_settings = ::Gapic::Config::Method.new configure_dns_settings_config
1932
+ configure_contact_settings_config = parent_rpcs.configure_contact_settings if parent_rpcs.respond_to? :configure_contact_settings
1933
+ @configure_contact_settings = ::Gapic::Config::Method.new configure_contact_settings_config
1934
+ export_registration_config = parent_rpcs.export_registration if parent_rpcs.respond_to? :export_registration
1935
+ @export_registration = ::Gapic::Config::Method.new export_registration_config
1936
+ delete_registration_config = parent_rpcs.delete_registration if parent_rpcs.respond_to? :delete_registration
1937
+ @delete_registration = ::Gapic::Config::Method.new delete_registration_config
1938
+ retrieve_authorization_code_config = parent_rpcs.retrieve_authorization_code if parent_rpcs.respond_to? :retrieve_authorization_code
1939
+ @retrieve_authorization_code = ::Gapic::Config::Method.new retrieve_authorization_code_config
1940
+ reset_authorization_code_config = parent_rpcs.reset_authorization_code if parent_rpcs.respond_to? :reset_authorization_code
1941
+ @reset_authorization_code = ::Gapic::Config::Method.new reset_authorization_code_config
1942
+
1943
+ yield self if block_given?
1944
+ end
1945
+ end
1946
+ end
1947
+ end
1948
+ end
1949
+ end
1950
+ end
1951
+ end
1952
+ end