google-cloud-app_engine-v1 0.5.0 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +1 -1
  3. data/README.md +3 -3
  4. data/lib/google/appengine/v1/appengine_pb.rb +0 -1
  5. data/lib/google/cloud/app_engine/v1/applications/client.rb +14 -14
  6. data/lib/google/cloud/app_engine/v1/applications/operations.rb +14 -16
  7. data/lib/google/cloud/app_engine/v1/applications/rest/client.rb +589 -0
  8. data/lib/google/cloud/app_engine/v1/applications/rest/operations.rb +793 -0
  9. data/lib/google/cloud/app_engine/v1/applications/rest/service_stub.rb +285 -0
  10. data/lib/google/cloud/app_engine/v1/applications/rest.rb +52 -0
  11. data/lib/google/cloud/app_engine/v1/applications.rb +7 -1
  12. data/lib/google/cloud/app_engine/v1/authorized_certificates/client.rb +6 -8
  13. data/lib/google/cloud/app_engine/v1/authorized_certificates/rest/client.rb +643 -0
  14. data/lib/google/cloud/app_engine/v1/authorized_certificates/rest/service_stub.rb +345 -0
  15. data/lib/google/cloud/app_engine/v1/authorized_certificates/rest.rb +52 -0
  16. data/lib/google/cloud/app_engine/v1/authorized_certificates.rb +7 -1
  17. data/lib/google/cloud/app_engine/v1/authorized_domains/client.rb +6 -8
  18. data/lib/google/cloud/app_engine/v1/authorized_domains/rest/client.rb +349 -0
  19. data/lib/google/cloud/app_engine/v1/authorized_domains/rest/service_stub.rb +107 -0
  20. data/lib/google/cloud/app_engine/v1/authorized_domains/rest.rb +53 -0
  21. data/lib/google/cloud/app_engine/v1/authorized_domains.rb +7 -1
  22. data/lib/google/cloud/app_engine/v1/domain_mappings/client.rb +18 -20
  23. data/lib/google/cloud/app_engine/v1/domain_mappings/operations.rb +14 -16
  24. data/lib/google/cloud/app_engine/v1/domain_mappings/rest/client.rb +659 -0
  25. data/lib/google/cloud/app_engine/v1/domain_mappings/rest/operations.rb +793 -0
  26. data/lib/google/cloud/app_engine/v1/domain_mappings/rest/service_stub.rb +345 -0
  27. data/lib/google/cloud/app_engine/v1/domain_mappings/rest.rb +52 -0
  28. data/lib/google/cloud/app_engine/v1/domain_mappings.rb +7 -1
  29. data/lib/google/cloud/app_engine/v1/firewall/client.rb +6 -8
  30. data/lib/google/cloud/app_engine/v1/firewall/rest/client.rb +732 -0
  31. data/lib/google/cloud/app_engine/v1/firewall/rest/service_stub.rb +405 -0
  32. data/lib/google/cloud/app_engine/v1/firewall/rest.rb +60 -0
  33. data/lib/google/cloud/app_engine/v1/firewall.rb +7 -1
  34. data/lib/google/cloud/app_engine/v1/instances/client.rb +14 -16
  35. data/lib/google/cloud/app_engine/v1/instances/operations.rb +14 -16
  36. data/lib/google/cloud/app_engine/v1/instances/rest/client.rb +602 -0
  37. data/lib/google/cloud/app_engine/v1/instances/rest/operations.rb +793 -0
  38. data/lib/google/cloud/app_engine/v1/instances/rest/service_stub.rb +285 -0
  39. data/lib/google/cloud/app_engine/v1/instances/rest.rb +52 -0
  40. data/lib/google/cloud/app_engine/v1/instances.rb +7 -1
  41. data/lib/google/cloud/app_engine/v1/rest.rb +44 -0
  42. data/lib/google/cloud/app_engine/v1/services/client.rb +14 -16
  43. data/lib/google/cloud/app_engine/v1/services/operations.rb +14 -16
  44. data/lib/google/cloud/app_engine/v1/services/rest/client.rb +587 -0
  45. data/lib/google/cloud/app_engine/v1/services/rest/operations.rb +793 -0
  46. data/lib/google/cloud/app_engine/v1/services/rest/service_stub.rb +285 -0
  47. data/lib/google/cloud/app_engine/v1/services/rest.rb +52 -0
  48. data/lib/google/cloud/app_engine/v1/services.rb +7 -1
  49. data/lib/google/cloud/app_engine/v1/version.rb +1 -1
  50. data/lib/google/cloud/app_engine/v1/versions/client.rb +18 -20
  51. data/lib/google/cloud/app_engine/v1/versions/operations.rb +14 -16
  52. data/lib/google/cloud/app_engine/v1/versions/rest/client.rb +692 -0
  53. data/lib/google/cloud/app_engine/v1/versions/rest/operations.rb +793 -0
  54. data/lib/google/cloud/app_engine/v1/versions/rest/service_stub.rb +345 -0
  55. data/lib/google/cloud/app_engine/v1/versions/rest.rb +52 -0
  56. data/lib/google/cloud/app_engine/v1/versions.rb +7 -1
  57. data/lib/google/cloud/app_engine/v1.rb +7 -2
  58. data/proto_docs/google/api/client.rb +372 -0
  59. data/proto_docs/google/api/launch_stage.rb +71 -0
  60. data/proto_docs/google/appengine/v1/domain.rb +1 -1
  61. data/proto_docs/google/protobuf/empty.rb +0 -2
  62. data/proto_docs/google/rpc/status.rb +4 -2
  63. metadata +40 -8
@@ -0,0 +1,659 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 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/appengine/v1/appengine_pb"
21
+ require "google/cloud/app_engine/v1/domain_mappings/rest/service_stub"
22
+
23
+ module Google
24
+ module Cloud
25
+ module AppEngine
26
+ module V1
27
+ module DomainMappings
28
+ module Rest
29
+ ##
30
+ # REST client for the DomainMappings service.
31
+ #
32
+ # Manages domains serving an application.
33
+ #
34
+ class Client
35
+ # @private
36
+ attr_reader :domain_mappings_stub
37
+
38
+ ##
39
+ # Configure the DomainMappings Client class.
40
+ #
41
+ # See {::Google::Cloud::AppEngine::V1::DomainMappings::Rest::Client::Configuration}
42
+ # for a description of the configuration fields.
43
+ #
44
+ # @example
45
+ #
46
+ # # Modify the configuration for all DomainMappings clients
47
+ # ::Google::Cloud::AppEngine::V1::DomainMappings::Rest::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", "AppEngine", "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 DomainMappings 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::AppEngine::V1::DomainMappings::Rest::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 DomainMappings REST client object.
95
+ #
96
+ # @example
97
+ #
98
+ # # Create a client using the default configuration
99
+ # client = ::Google::Cloud::AppEngine::V1::DomainMappings::Rest::Client.new
100
+ #
101
+ # # Create a client using a custom configuration
102
+ # client = ::Google::Cloud::AppEngine::V1::DomainMappings::Rest::Client.new do |config|
103
+ # config.timeout = 10.0
104
+ # end
105
+ #
106
+ # @yield [config] Configure the DomainMappings client.
107
+ # @yieldparam config [Client::Configuration]
108
+ #
109
+ def initialize
110
+ # Create the configuration object
111
+ @config = Configuration.new Client.configure
112
+
113
+ # Yield the configuration if needed
114
+ yield @config if block_given?
115
+
116
+ # Create credentials
117
+ credentials = @config.credentials
118
+ # Use self-signed JWT if the endpoint is unchanged from default,
119
+ # but only if the default endpoint does not have a region prefix.
120
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
121
+ !@config.endpoint.split(".").first.include?("-")
122
+ credentials ||= Credentials.default scope: @config.scope,
123
+ enable_self_signed_jwt: enable_self_signed_jwt
124
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
125
+ credentials = Credentials.new credentials, scope: @config.scope
126
+ end
127
+
128
+ @quota_project_id = @config.quota_project
129
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
130
+
131
+ @operations_client = ::Google::Cloud::AppEngine::V1::DomainMappings::Rest::Operations.new do |config|
132
+ config.credentials = credentials
133
+ config.quota_project = @quota_project_id
134
+ config.endpoint = @config.endpoint
135
+ end
136
+
137
+ @domain_mappings_stub = ::Google::Cloud::AppEngine::V1::DomainMappings::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
138
+ end
139
+
140
+ ##
141
+ # Get the associated client for long-running operations.
142
+ #
143
+ # @return [::Google::Cloud::AppEngine::V1::DomainMappings::Rest::Operations]
144
+ #
145
+ attr_reader :operations_client
146
+
147
+ # Service calls
148
+
149
+ ##
150
+ # Lists the domain mappings on an application.
151
+ #
152
+ # @overload list_domain_mappings(request, options = nil)
153
+ # Pass arguments to `list_domain_mappings` via a request object, either of type
154
+ # {::Google::Cloud::AppEngine::V1::ListDomainMappingsRequest} or an equivalent Hash.
155
+ #
156
+ # @param request [::Google::Cloud::AppEngine::V1::ListDomainMappingsRequest, ::Hash]
157
+ # A request object representing the call parameters. Required. To specify no
158
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
159
+ # @param options [::Gapic::CallOptions, ::Hash]
160
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
161
+ #
162
+ # @overload list_domain_mappings(parent: nil, page_size: nil, page_token: nil)
163
+ # Pass arguments to `list_domain_mappings` via keyword arguments. Note that at
164
+ # least one keyword argument is required. To specify no parameters, or to keep all
165
+ # the default parameter values, pass an empty Hash as a request object (see above).
166
+ #
167
+ # @param parent [::String]
168
+ # Name of the parent Application resource. Example: `apps/myapp`.
169
+ # @param page_size [::Integer]
170
+ # Maximum results to return per page.
171
+ # @param page_token [::String]
172
+ # Continuation token for fetching the next page of results.
173
+ # @yield [result, operation] Access the result along with the TransportOperation object
174
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AppEngine::V1::DomainMapping>]
175
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
176
+ #
177
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AppEngine::V1::DomainMapping>]
178
+ #
179
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
180
+ def list_domain_mappings request, options = nil
181
+ raise ::ArgumentError, "request must be provided" if request.nil?
182
+
183
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AppEngine::V1::ListDomainMappingsRequest
184
+
185
+ # Converts hash and nil to an options object
186
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
187
+
188
+ # Customize the options with defaults
189
+ call_metadata = @config.rpcs.list_domain_mappings.metadata.to_h
190
+
191
+ # Set x-goog-api-client and x-goog-user-project headers
192
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
193
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
194
+ gapic_version: ::Google::Cloud::AppEngine::V1::VERSION,
195
+ transports_version_send: [:rest]
196
+
197
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
198
+
199
+ options.apply_defaults timeout: @config.rpcs.list_domain_mappings.timeout,
200
+ metadata: call_metadata,
201
+ retry_policy: @config.rpcs.list_domain_mappings.retry_policy
202
+
203
+ options.apply_defaults timeout: @config.timeout,
204
+ metadata: @config.metadata,
205
+ retry_policy: @config.retry_policy
206
+
207
+ @domain_mappings_stub.list_domain_mappings request, options do |result, operation|
208
+ result = ::Gapic::Rest::PagedEnumerable.new @domain_mappings_stub, :list_domain_mappings, "domain_mappings", request, result, options
209
+ yield result, operation if block_given?
210
+ return result
211
+ end
212
+ rescue ::Gapic::Rest::Error => e
213
+ raise ::Google::Cloud::Error.from_error(e)
214
+ end
215
+
216
+ ##
217
+ # Gets the specified domain mapping.
218
+ #
219
+ # @overload get_domain_mapping(request, options = nil)
220
+ # Pass arguments to `get_domain_mapping` via a request object, either of type
221
+ # {::Google::Cloud::AppEngine::V1::GetDomainMappingRequest} or an equivalent Hash.
222
+ #
223
+ # @param request [::Google::Cloud::AppEngine::V1::GetDomainMappingRequest, ::Hash]
224
+ # A request object representing the call parameters. Required. To specify no
225
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
226
+ # @param options [::Gapic::CallOptions, ::Hash]
227
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
228
+ #
229
+ # @overload get_domain_mapping(name: nil)
230
+ # Pass arguments to `get_domain_mapping` via keyword arguments. Note that at
231
+ # least one keyword argument is required. To specify no parameters, or to keep all
232
+ # the default parameter values, pass an empty Hash as a request object (see above).
233
+ #
234
+ # @param name [::String]
235
+ # Name of the resource requested. Example:
236
+ # `apps/myapp/domainMappings/example.com`.
237
+ # @yield [result, operation] Access the result along with the TransportOperation object
238
+ # @yieldparam result [::Google::Cloud::AppEngine::V1::DomainMapping]
239
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
240
+ #
241
+ # @return [::Google::Cloud::AppEngine::V1::DomainMapping]
242
+ #
243
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
244
+ def get_domain_mapping request, options = nil
245
+ raise ::ArgumentError, "request must be provided" if request.nil?
246
+
247
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AppEngine::V1::GetDomainMappingRequest
248
+
249
+ # Converts hash and nil to an options object
250
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
251
+
252
+ # Customize the options with defaults
253
+ call_metadata = @config.rpcs.get_domain_mapping.metadata.to_h
254
+
255
+ # Set x-goog-api-client and x-goog-user-project headers
256
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
257
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
258
+ gapic_version: ::Google::Cloud::AppEngine::V1::VERSION,
259
+ transports_version_send: [:rest]
260
+
261
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
262
+
263
+ options.apply_defaults timeout: @config.rpcs.get_domain_mapping.timeout,
264
+ metadata: call_metadata,
265
+ retry_policy: @config.rpcs.get_domain_mapping.retry_policy
266
+
267
+ options.apply_defaults timeout: @config.timeout,
268
+ metadata: @config.metadata,
269
+ retry_policy: @config.retry_policy
270
+
271
+ @domain_mappings_stub.get_domain_mapping request, options do |result, operation|
272
+ yield result, operation if block_given?
273
+ return result
274
+ end
275
+ rescue ::Gapic::Rest::Error => e
276
+ raise ::Google::Cloud::Error.from_error(e)
277
+ end
278
+
279
+ ##
280
+ # Maps a domain to an application. A user must be authorized to administer a
281
+ # domain in order to map it to an application. For a list of available
282
+ # authorized domains, see [`AuthorizedDomains.ListAuthorizedDomains`]().
283
+ #
284
+ # @overload create_domain_mapping(request, options = nil)
285
+ # Pass arguments to `create_domain_mapping` via a request object, either of type
286
+ # {::Google::Cloud::AppEngine::V1::CreateDomainMappingRequest} or an equivalent Hash.
287
+ #
288
+ # @param request [::Google::Cloud::AppEngine::V1::CreateDomainMappingRequest, ::Hash]
289
+ # A request object representing the call parameters. Required. To specify no
290
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
291
+ # @param options [::Gapic::CallOptions, ::Hash]
292
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
293
+ #
294
+ # @overload create_domain_mapping(parent: nil, domain_mapping: nil, override_strategy: nil)
295
+ # Pass arguments to `create_domain_mapping` via keyword arguments. Note that at
296
+ # least one keyword argument is required. To specify no parameters, or to keep all
297
+ # the default parameter values, pass an empty Hash as a request object (see above).
298
+ #
299
+ # @param parent [::String]
300
+ # Name of the parent Application resource. Example: `apps/myapp`.
301
+ # @param domain_mapping [::Google::Cloud::AppEngine::V1::DomainMapping, ::Hash]
302
+ # Domain mapping configuration.
303
+ # @param override_strategy [::Google::Cloud::AppEngine::V1::DomainOverrideStrategy]
304
+ # Whether the domain creation should override any existing mappings for this
305
+ # domain. By default, overrides are rejected.
306
+ # @yield [result, operation] Access the result along with the TransportOperation object
307
+ # @yieldparam result [::Gapic::Operation]
308
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
309
+ #
310
+ # @return [::Gapic::Operation]
311
+ #
312
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
313
+ def create_domain_mapping request, options = nil
314
+ raise ::ArgumentError, "request must be provided" if request.nil?
315
+
316
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AppEngine::V1::CreateDomainMappingRequest
317
+
318
+ # Converts hash and nil to an options object
319
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
320
+
321
+ # Customize the options with defaults
322
+ call_metadata = @config.rpcs.create_domain_mapping.metadata.to_h
323
+
324
+ # Set x-goog-api-client and x-goog-user-project headers
325
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
326
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
327
+ gapic_version: ::Google::Cloud::AppEngine::V1::VERSION,
328
+ transports_version_send: [:rest]
329
+
330
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
331
+
332
+ options.apply_defaults timeout: @config.rpcs.create_domain_mapping.timeout,
333
+ metadata: call_metadata,
334
+ retry_policy: @config.rpcs.create_domain_mapping.retry_policy
335
+
336
+ options.apply_defaults timeout: @config.timeout,
337
+ metadata: @config.metadata,
338
+ retry_policy: @config.retry_policy
339
+
340
+ @domain_mappings_stub.create_domain_mapping request, options do |result, operation|
341
+ result = ::Gapic::Operation.new result, @operations_client, options: options
342
+ yield result, operation if block_given?
343
+ return result
344
+ end
345
+ rescue ::Gapic::Rest::Error => e
346
+ raise ::Google::Cloud::Error.from_error(e)
347
+ end
348
+
349
+ ##
350
+ # Updates the specified domain mapping. To map an SSL certificate to a
351
+ # domain mapping, update `certificate_id` to point to an `AuthorizedCertificate`
352
+ # resource. A user must be authorized to administer the associated domain
353
+ # in order to update a `DomainMapping` resource.
354
+ #
355
+ # @overload update_domain_mapping(request, options = nil)
356
+ # Pass arguments to `update_domain_mapping` via a request object, either of type
357
+ # {::Google::Cloud::AppEngine::V1::UpdateDomainMappingRequest} or an equivalent Hash.
358
+ #
359
+ # @param request [::Google::Cloud::AppEngine::V1::UpdateDomainMappingRequest, ::Hash]
360
+ # A request object representing the call parameters. Required. To specify no
361
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
362
+ # @param options [::Gapic::CallOptions, ::Hash]
363
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
364
+ #
365
+ # @overload update_domain_mapping(name: nil, domain_mapping: nil, update_mask: nil)
366
+ # Pass arguments to `update_domain_mapping` via keyword arguments. Note that at
367
+ # least one keyword argument is required. To specify no parameters, or to keep all
368
+ # the default parameter values, pass an empty Hash as a request object (see above).
369
+ #
370
+ # @param name [::String]
371
+ # Name of the resource to update. Example:
372
+ # `apps/myapp/domainMappings/example.com`.
373
+ # @param domain_mapping [::Google::Cloud::AppEngine::V1::DomainMapping, ::Hash]
374
+ # A domain mapping containing the updated resource. Only fields set
375
+ # in the field mask will be updated.
376
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
377
+ # Required. Standard field mask for the set of fields to be updated.
378
+ # @yield [result, operation] Access the result along with the TransportOperation object
379
+ # @yieldparam result [::Gapic::Operation]
380
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
381
+ #
382
+ # @return [::Gapic::Operation]
383
+ #
384
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
385
+ def update_domain_mapping request, options = nil
386
+ raise ::ArgumentError, "request must be provided" if request.nil?
387
+
388
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AppEngine::V1::UpdateDomainMappingRequest
389
+
390
+ # Converts hash and nil to an options object
391
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
392
+
393
+ # Customize the options with defaults
394
+ call_metadata = @config.rpcs.update_domain_mapping.metadata.to_h
395
+
396
+ # Set x-goog-api-client and x-goog-user-project headers
397
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
398
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
399
+ gapic_version: ::Google::Cloud::AppEngine::V1::VERSION,
400
+ transports_version_send: [:rest]
401
+
402
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
403
+
404
+ options.apply_defaults timeout: @config.rpcs.update_domain_mapping.timeout,
405
+ metadata: call_metadata,
406
+ retry_policy: @config.rpcs.update_domain_mapping.retry_policy
407
+
408
+ options.apply_defaults timeout: @config.timeout,
409
+ metadata: @config.metadata,
410
+ retry_policy: @config.retry_policy
411
+
412
+ @domain_mappings_stub.update_domain_mapping request, options do |result, operation|
413
+ result = ::Gapic::Operation.new result, @operations_client, options: options
414
+ yield result, operation if block_given?
415
+ return result
416
+ end
417
+ rescue ::Gapic::Rest::Error => e
418
+ raise ::Google::Cloud::Error.from_error(e)
419
+ end
420
+
421
+ ##
422
+ # Deletes the specified domain mapping. A user must be authorized to
423
+ # administer the associated domain in order to delete a `DomainMapping`
424
+ # resource.
425
+ #
426
+ # @overload delete_domain_mapping(request, options = nil)
427
+ # Pass arguments to `delete_domain_mapping` via a request object, either of type
428
+ # {::Google::Cloud::AppEngine::V1::DeleteDomainMappingRequest} or an equivalent Hash.
429
+ #
430
+ # @param request [::Google::Cloud::AppEngine::V1::DeleteDomainMappingRequest, ::Hash]
431
+ # A request object representing the call parameters. Required. To specify no
432
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
433
+ # @param options [::Gapic::CallOptions, ::Hash]
434
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
435
+ #
436
+ # @overload delete_domain_mapping(name: nil)
437
+ # Pass arguments to `delete_domain_mapping` via keyword arguments. Note that at
438
+ # least one keyword argument is required. To specify no parameters, or to keep all
439
+ # the default parameter values, pass an empty Hash as a request object (see above).
440
+ #
441
+ # @param name [::String]
442
+ # Name of the resource to delete. Example:
443
+ # `apps/myapp/domainMappings/example.com`.
444
+ # @yield [result, operation] Access the result along with the TransportOperation object
445
+ # @yieldparam result [::Gapic::Operation]
446
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
447
+ #
448
+ # @return [::Gapic::Operation]
449
+ #
450
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
451
+ def delete_domain_mapping request, options = nil
452
+ raise ::ArgumentError, "request must be provided" if request.nil?
453
+
454
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AppEngine::V1::DeleteDomainMappingRequest
455
+
456
+ # Converts hash and nil to an options object
457
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
458
+
459
+ # Customize the options with defaults
460
+ call_metadata = @config.rpcs.delete_domain_mapping.metadata.to_h
461
+
462
+ # Set x-goog-api-client and x-goog-user-project headers
463
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
464
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
465
+ gapic_version: ::Google::Cloud::AppEngine::V1::VERSION,
466
+ transports_version_send: [:rest]
467
+
468
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
469
+
470
+ options.apply_defaults timeout: @config.rpcs.delete_domain_mapping.timeout,
471
+ metadata: call_metadata,
472
+ retry_policy: @config.rpcs.delete_domain_mapping.retry_policy
473
+
474
+ options.apply_defaults timeout: @config.timeout,
475
+ metadata: @config.metadata,
476
+ retry_policy: @config.retry_policy
477
+
478
+ @domain_mappings_stub.delete_domain_mapping request, options do |result, operation|
479
+ result = ::Gapic::Operation.new result, @operations_client, options: options
480
+ yield result, operation if block_given?
481
+ return result
482
+ end
483
+ rescue ::Gapic::Rest::Error => e
484
+ raise ::Google::Cloud::Error.from_error(e)
485
+ end
486
+
487
+ ##
488
+ # Configuration class for the DomainMappings REST API.
489
+ #
490
+ # This class represents the configuration for DomainMappings REST,
491
+ # providing control over timeouts, retry behavior, logging, transport
492
+ # parameters, and other low-level controls. Certain parameters can also be
493
+ # applied individually to specific RPCs. See
494
+ # {::Google::Cloud::AppEngine::V1::DomainMappings::Rest::Client::Configuration::Rpcs}
495
+ # for a list of RPCs that can be configured independently.
496
+ #
497
+ # Configuration can be applied globally to all clients, or to a single client
498
+ # on construction.
499
+ #
500
+ # @example
501
+ #
502
+ # # Modify the global config, setting the timeout for
503
+ # # list_domain_mappings to 20 seconds,
504
+ # # and all remaining timeouts to 10 seconds.
505
+ # ::Google::Cloud::AppEngine::V1::DomainMappings::Rest::Client.configure do |config|
506
+ # config.timeout = 10.0
507
+ # config.rpcs.list_domain_mappings.timeout = 20.0
508
+ # end
509
+ #
510
+ # # Apply the above configuration only to a new client.
511
+ # client = ::Google::Cloud::AppEngine::V1::DomainMappings::Rest::Client.new do |config|
512
+ # config.timeout = 10.0
513
+ # config.rpcs.list_domain_mappings.timeout = 20.0
514
+ # end
515
+ #
516
+ # @!attribute [rw] endpoint
517
+ # The hostname or hostname:port of the service endpoint.
518
+ # Defaults to `"appengine.googleapis.com"`.
519
+ # @return [::String]
520
+ # @!attribute [rw] credentials
521
+ # Credentials to send with calls. You may provide any of the following types:
522
+ # * (`String`) The path to a service account key file in JSON format
523
+ # * (`Hash`) A service account key as a Hash
524
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
525
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
526
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
527
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
528
+ # * (`nil`) indicating no credentials
529
+ # @return [::Object]
530
+ # @!attribute [rw] scope
531
+ # The OAuth scopes
532
+ # @return [::Array<::String>]
533
+ # @!attribute [rw] lib_name
534
+ # The library name as recorded in instrumentation and logging
535
+ # @return [::String]
536
+ # @!attribute [rw] lib_version
537
+ # The library version as recorded in instrumentation and logging
538
+ # @return [::String]
539
+ # @!attribute [rw] timeout
540
+ # The call timeout in seconds.
541
+ # @return [::Numeric]
542
+ # @!attribute [rw] metadata
543
+ # Additional headers to be sent with the call.
544
+ # @return [::Hash{::Symbol=>::String}]
545
+ # @!attribute [rw] retry_policy
546
+ # The retry policy. The value is a hash with the following keys:
547
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
548
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
549
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
550
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
551
+ # trigger a retry.
552
+ # @return [::Hash]
553
+ # @!attribute [rw] quota_project
554
+ # A separate project against which to charge quota.
555
+ # @return [::String]
556
+ #
557
+ class Configuration
558
+ extend ::Gapic::Config
559
+
560
+ config_attr :endpoint, "appengine.googleapis.com", ::String
561
+ config_attr :credentials, nil do |value|
562
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
563
+ allowed.any? { |klass| klass === value }
564
+ end
565
+ config_attr :scope, nil, ::String, ::Array, nil
566
+ config_attr :lib_name, nil, ::String, nil
567
+ config_attr :lib_version, nil, ::String, nil
568
+ config_attr :timeout, nil, ::Numeric, nil
569
+ config_attr :metadata, nil, ::Hash, nil
570
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
571
+ config_attr :quota_project, nil, ::String, nil
572
+
573
+ # @private
574
+ def initialize parent_config = nil
575
+ @parent_config = parent_config unless parent_config.nil?
576
+
577
+ yield self if block_given?
578
+ end
579
+
580
+ ##
581
+ # Configurations for individual RPCs
582
+ # @return [Rpcs]
583
+ #
584
+ def rpcs
585
+ @rpcs ||= begin
586
+ parent_rpcs = nil
587
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
588
+ Rpcs.new parent_rpcs
589
+ end
590
+ end
591
+
592
+ ##
593
+ # Configuration RPC class for the DomainMappings API.
594
+ #
595
+ # Includes fields providing the configuration for each RPC in this service.
596
+ # Each configuration object is of type `Gapic::Config::Method` and includes
597
+ # the following configuration fields:
598
+ #
599
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
600
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
601
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
602
+ # include the following keys:
603
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
604
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
605
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
606
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
607
+ # trigger a retry.
608
+ #
609
+ class Rpcs
610
+ ##
611
+ # RPC-specific configuration for `list_domain_mappings`
612
+ # @return [::Gapic::Config::Method]
613
+ #
614
+ attr_reader :list_domain_mappings
615
+ ##
616
+ # RPC-specific configuration for `get_domain_mapping`
617
+ # @return [::Gapic::Config::Method]
618
+ #
619
+ attr_reader :get_domain_mapping
620
+ ##
621
+ # RPC-specific configuration for `create_domain_mapping`
622
+ # @return [::Gapic::Config::Method]
623
+ #
624
+ attr_reader :create_domain_mapping
625
+ ##
626
+ # RPC-specific configuration for `update_domain_mapping`
627
+ # @return [::Gapic::Config::Method]
628
+ #
629
+ attr_reader :update_domain_mapping
630
+ ##
631
+ # RPC-specific configuration for `delete_domain_mapping`
632
+ # @return [::Gapic::Config::Method]
633
+ #
634
+ attr_reader :delete_domain_mapping
635
+
636
+ # @private
637
+ def initialize parent_rpcs = nil
638
+ list_domain_mappings_config = parent_rpcs.list_domain_mappings if parent_rpcs.respond_to? :list_domain_mappings
639
+ @list_domain_mappings = ::Gapic::Config::Method.new list_domain_mappings_config
640
+ get_domain_mapping_config = parent_rpcs.get_domain_mapping if parent_rpcs.respond_to? :get_domain_mapping
641
+ @get_domain_mapping = ::Gapic::Config::Method.new get_domain_mapping_config
642
+ create_domain_mapping_config = parent_rpcs.create_domain_mapping if parent_rpcs.respond_to? :create_domain_mapping
643
+ @create_domain_mapping = ::Gapic::Config::Method.new create_domain_mapping_config
644
+ update_domain_mapping_config = parent_rpcs.update_domain_mapping if parent_rpcs.respond_to? :update_domain_mapping
645
+ @update_domain_mapping = ::Gapic::Config::Method.new update_domain_mapping_config
646
+ delete_domain_mapping_config = parent_rpcs.delete_domain_mapping if parent_rpcs.respond_to? :delete_domain_mapping
647
+ @delete_domain_mapping = ::Gapic::Config::Method.new delete_domain_mapping_config
648
+
649
+ yield self if block_given?
650
+ end
651
+ end
652
+ end
653
+ end
654
+ end
655
+ end
656
+ end
657
+ end
658
+ end
659
+ end