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,587 @@
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/services/rest/service_stub"
22
+
23
+ module Google
24
+ module Cloud
25
+ module AppEngine
26
+ module V1
27
+ module Services
28
+ module Rest
29
+ ##
30
+ # REST client for the Services service.
31
+ #
32
+ # Manages services of an application.
33
+ #
34
+ class Client
35
+ # @private
36
+ attr_reader :services_stub
37
+
38
+ ##
39
+ # Configure the Services Client class.
40
+ #
41
+ # See {::Google::Cloud::AppEngine::V1::Services::Rest::Client::Configuration}
42
+ # for a description of the configuration fields.
43
+ #
44
+ # @example
45
+ #
46
+ # # Modify the configuration for all Services clients
47
+ # ::Google::Cloud::AppEngine::V1::Services::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 Services 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::Services::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 Services REST client object.
95
+ #
96
+ # @example
97
+ #
98
+ # # Create a client using the default configuration
99
+ # client = ::Google::Cloud::AppEngine::V1::Services::Rest::Client.new
100
+ #
101
+ # # Create a client using a custom configuration
102
+ # client = ::Google::Cloud::AppEngine::V1::Services::Rest::Client.new do |config|
103
+ # config.timeout = 10.0
104
+ # end
105
+ #
106
+ # @yield [config] Configure the Services 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::Services::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
+ @services_stub = ::Google::Cloud::AppEngine::V1::Services::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::Services::Rest::Operations]
144
+ #
145
+ attr_reader :operations_client
146
+
147
+ # Service calls
148
+
149
+ ##
150
+ # Lists all the services in the application.
151
+ #
152
+ # @overload list_services(request, options = nil)
153
+ # Pass arguments to `list_services` via a request object, either of type
154
+ # {::Google::Cloud::AppEngine::V1::ListServicesRequest} or an equivalent Hash.
155
+ #
156
+ # @param request [::Google::Cloud::AppEngine::V1::ListServicesRequest, ::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_services(parent: nil, page_size: nil, page_token: nil)
163
+ # Pass arguments to `list_services` 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::Service>]
175
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
176
+ #
177
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AppEngine::V1::Service>]
178
+ #
179
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
180
+ def list_services 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::ListServicesRequest
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_services.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_services.timeout,
200
+ metadata: call_metadata,
201
+ retry_policy: @config.rpcs.list_services.retry_policy
202
+
203
+ options.apply_defaults timeout: @config.timeout,
204
+ metadata: @config.metadata,
205
+ retry_policy: @config.retry_policy
206
+
207
+ @services_stub.list_services request, options do |result, operation|
208
+ result = ::Gapic::Rest::PagedEnumerable.new @services_stub, :list_services, "services", 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 current configuration of the specified service.
218
+ #
219
+ # @overload get_service(request, options = nil)
220
+ # Pass arguments to `get_service` via a request object, either of type
221
+ # {::Google::Cloud::AppEngine::V1::GetServiceRequest} or an equivalent Hash.
222
+ #
223
+ # @param request [::Google::Cloud::AppEngine::V1::GetServiceRequest, ::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_service(name: nil)
230
+ # Pass arguments to `get_service` 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: `apps/myapp/services/default`.
236
+ # @yield [result, operation] Access the result along with the TransportOperation object
237
+ # @yieldparam result [::Google::Cloud::AppEngine::V1::Service]
238
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
239
+ #
240
+ # @return [::Google::Cloud::AppEngine::V1::Service]
241
+ #
242
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
243
+ def get_service request, options = nil
244
+ raise ::ArgumentError, "request must be provided" if request.nil?
245
+
246
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AppEngine::V1::GetServiceRequest
247
+
248
+ # Converts hash and nil to an options object
249
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
250
+
251
+ # Customize the options with defaults
252
+ call_metadata = @config.rpcs.get_service.metadata.to_h
253
+
254
+ # Set x-goog-api-client and x-goog-user-project headers
255
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
256
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
257
+ gapic_version: ::Google::Cloud::AppEngine::V1::VERSION,
258
+ transports_version_send: [:rest]
259
+
260
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
261
+
262
+ options.apply_defaults timeout: @config.rpcs.get_service.timeout,
263
+ metadata: call_metadata,
264
+ retry_policy: @config.rpcs.get_service.retry_policy
265
+
266
+ options.apply_defaults timeout: @config.timeout,
267
+ metadata: @config.metadata,
268
+ retry_policy: @config.retry_policy
269
+
270
+ @services_stub.get_service request, options do |result, operation|
271
+ yield result, operation if block_given?
272
+ return result
273
+ end
274
+ rescue ::Gapic::Rest::Error => e
275
+ raise ::Google::Cloud::Error.from_error(e)
276
+ end
277
+
278
+ ##
279
+ # Updates the configuration of the specified service.
280
+ #
281
+ # @overload update_service(request, options = nil)
282
+ # Pass arguments to `update_service` via a request object, either of type
283
+ # {::Google::Cloud::AppEngine::V1::UpdateServiceRequest} or an equivalent Hash.
284
+ #
285
+ # @param request [::Google::Cloud::AppEngine::V1::UpdateServiceRequest, ::Hash]
286
+ # A request object representing the call parameters. Required. To specify no
287
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
288
+ # @param options [::Gapic::CallOptions, ::Hash]
289
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
290
+ #
291
+ # @overload update_service(name: nil, service: nil, update_mask: nil, migrate_traffic: nil)
292
+ # Pass arguments to `update_service` via keyword arguments. Note that at
293
+ # least one keyword argument is required. To specify no parameters, or to keep all
294
+ # the default parameter values, pass an empty Hash as a request object (see above).
295
+ #
296
+ # @param name [::String]
297
+ # Name of the resource to update. Example: `apps/myapp/services/default`.
298
+ # @param service [::Google::Cloud::AppEngine::V1::Service, ::Hash]
299
+ # A Service resource containing the updated service. Only fields set in the
300
+ # field mask will be updated.
301
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
302
+ # Required. Standard field mask for the set of fields to be updated.
303
+ # @param migrate_traffic [::Boolean]
304
+ # Set to `true` to gradually shift traffic to one or more versions that you
305
+ # specify. By default, traffic is shifted immediately.
306
+ # For gradual traffic migration, the target versions
307
+ # must be located within instances that are configured for both
308
+ # [warmup requests](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#InboundServiceType)
309
+ # and
310
+ # [automatic scaling](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#AutomaticScaling).
311
+ # You must specify the
312
+ # [`shardBy`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services#ShardBy)
313
+ # field in the Service resource. Gradual traffic migration is not
314
+ # supported in the App Engine flexible environment. For examples, see
315
+ # [Migrating and Splitting Traffic](https://cloud.google.com/appengine/docs/admin-api/migrating-splitting-traffic).
316
+ # @yield [result, operation] Access the result along with the TransportOperation object
317
+ # @yieldparam result [::Gapic::Operation]
318
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
319
+ #
320
+ # @return [::Gapic::Operation]
321
+ #
322
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
323
+ def update_service request, options = nil
324
+ raise ::ArgumentError, "request must be provided" if request.nil?
325
+
326
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AppEngine::V1::UpdateServiceRequest
327
+
328
+ # Converts hash and nil to an options object
329
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
330
+
331
+ # Customize the options with defaults
332
+ call_metadata = @config.rpcs.update_service.metadata.to_h
333
+
334
+ # Set x-goog-api-client and x-goog-user-project headers
335
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
336
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
337
+ gapic_version: ::Google::Cloud::AppEngine::V1::VERSION,
338
+ transports_version_send: [:rest]
339
+
340
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
341
+
342
+ options.apply_defaults timeout: @config.rpcs.update_service.timeout,
343
+ metadata: call_metadata,
344
+ retry_policy: @config.rpcs.update_service.retry_policy
345
+
346
+ options.apply_defaults timeout: @config.timeout,
347
+ metadata: @config.metadata,
348
+ retry_policy: @config.retry_policy
349
+
350
+ @services_stub.update_service request, options do |result, operation|
351
+ result = ::Gapic::Operation.new result, @operations_client, options: options
352
+ yield result, operation if block_given?
353
+ return result
354
+ end
355
+ rescue ::Gapic::Rest::Error => e
356
+ raise ::Google::Cloud::Error.from_error(e)
357
+ end
358
+
359
+ ##
360
+ # Deletes the specified service and all enclosed versions.
361
+ #
362
+ # @overload delete_service(request, options = nil)
363
+ # Pass arguments to `delete_service` via a request object, either of type
364
+ # {::Google::Cloud::AppEngine::V1::DeleteServiceRequest} or an equivalent Hash.
365
+ #
366
+ # @param request [::Google::Cloud::AppEngine::V1::DeleteServiceRequest, ::Hash]
367
+ # A request object representing the call parameters. Required. To specify no
368
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
369
+ # @param options [::Gapic::CallOptions, ::Hash]
370
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
371
+ #
372
+ # @overload delete_service(name: nil)
373
+ # Pass arguments to `delete_service` via keyword arguments. Note that at
374
+ # least one keyword argument is required. To specify no parameters, or to keep all
375
+ # the default parameter values, pass an empty Hash as a request object (see above).
376
+ #
377
+ # @param name [::String]
378
+ # Name of the resource requested. Example: `apps/myapp/services/default`.
379
+ # @yield [result, operation] Access the result along with the TransportOperation object
380
+ # @yieldparam result [::Gapic::Operation]
381
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
382
+ #
383
+ # @return [::Gapic::Operation]
384
+ #
385
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
386
+ def delete_service request, options = nil
387
+ raise ::ArgumentError, "request must be provided" if request.nil?
388
+
389
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AppEngine::V1::DeleteServiceRequest
390
+
391
+ # Converts hash and nil to an options object
392
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
393
+
394
+ # Customize the options with defaults
395
+ call_metadata = @config.rpcs.delete_service.metadata.to_h
396
+
397
+ # Set x-goog-api-client and x-goog-user-project headers
398
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
399
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
400
+ gapic_version: ::Google::Cloud::AppEngine::V1::VERSION,
401
+ transports_version_send: [:rest]
402
+
403
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
404
+
405
+ options.apply_defaults timeout: @config.rpcs.delete_service.timeout,
406
+ metadata: call_metadata,
407
+ retry_policy: @config.rpcs.delete_service.retry_policy
408
+
409
+ options.apply_defaults timeout: @config.timeout,
410
+ metadata: @config.metadata,
411
+ retry_policy: @config.retry_policy
412
+
413
+ @services_stub.delete_service request, options do |result, operation|
414
+ result = ::Gapic::Operation.new result, @operations_client, options: options
415
+ yield result, operation if block_given?
416
+ return result
417
+ end
418
+ rescue ::Gapic::Rest::Error => e
419
+ raise ::Google::Cloud::Error.from_error(e)
420
+ end
421
+
422
+ ##
423
+ # Configuration class for the Services REST API.
424
+ #
425
+ # This class represents the configuration for Services REST,
426
+ # providing control over timeouts, retry behavior, logging, transport
427
+ # parameters, and other low-level controls. Certain parameters can also be
428
+ # applied individually to specific RPCs. See
429
+ # {::Google::Cloud::AppEngine::V1::Services::Rest::Client::Configuration::Rpcs}
430
+ # for a list of RPCs that can be configured independently.
431
+ #
432
+ # Configuration can be applied globally to all clients, or to a single client
433
+ # on construction.
434
+ #
435
+ # @example
436
+ #
437
+ # # Modify the global config, setting the timeout for
438
+ # # list_services to 20 seconds,
439
+ # # and all remaining timeouts to 10 seconds.
440
+ # ::Google::Cloud::AppEngine::V1::Services::Rest::Client.configure do |config|
441
+ # config.timeout = 10.0
442
+ # config.rpcs.list_services.timeout = 20.0
443
+ # end
444
+ #
445
+ # # Apply the above configuration only to a new client.
446
+ # client = ::Google::Cloud::AppEngine::V1::Services::Rest::Client.new do |config|
447
+ # config.timeout = 10.0
448
+ # config.rpcs.list_services.timeout = 20.0
449
+ # end
450
+ #
451
+ # @!attribute [rw] endpoint
452
+ # The hostname or hostname:port of the service endpoint.
453
+ # Defaults to `"appengine.googleapis.com"`.
454
+ # @return [::String]
455
+ # @!attribute [rw] credentials
456
+ # Credentials to send with calls. You may provide any of the following types:
457
+ # * (`String`) The path to a service account key file in JSON format
458
+ # * (`Hash`) A service account key as a Hash
459
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
460
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
461
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
462
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
463
+ # * (`nil`) indicating no credentials
464
+ # @return [::Object]
465
+ # @!attribute [rw] scope
466
+ # The OAuth scopes
467
+ # @return [::Array<::String>]
468
+ # @!attribute [rw] lib_name
469
+ # The library name as recorded in instrumentation and logging
470
+ # @return [::String]
471
+ # @!attribute [rw] lib_version
472
+ # The library version as recorded in instrumentation and logging
473
+ # @return [::String]
474
+ # @!attribute [rw] timeout
475
+ # The call timeout in seconds.
476
+ # @return [::Numeric]
477
+ # @!attribute [rw] metadata
478
+ # Additional headers to be sent with the call.
479
+ # @return [::Hash{::Symbol=>::String}]
480
+ # @!attribute [rw] retry_policy
481
+ # The retry policy. The value is a hash with the following keys:
482
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
483
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
484
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
485
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
486
+ # trigger a retry.
487
+ # @return [::Hash]
488
+ # @!attribute [rw] quota_project
489
+ # A separate project against which to charge quota.
490
+ # @return [::String]
491
+ #
492
+ class Configuration
493
+ extend ::Gapic::Config
494
+
495
+ config_attr :endpoint, "appengine.googleapis.com", ::String
496
+ config_attr :credentials, nil do |value|
497
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
498
+ allowed.any? { |klass| klass === value }
499
+ end
500
+ config_attr :scope, nil, ::String, ::Array, nil
501
+ config_attr :lib_name, nil, ::String, nil
502
+ config_attr :lib_version, nil, ::String, nil
503
+ config_attr :timeout, nil, ::Numeric, nil
504
+ config_attr :metadata, nil, ::Hash, nil
505
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
506
+ config_attr :quota_project, nil, ::String, nil
507
+
508
+ # @private
509
+ def initialize parent_config = nil
510
+ @parent_config = parent_config unless parent_config.nil?
511
+
512
+ yield self if block_given?
513
+ end
514
+
515
+ ##
516
+ # Configurations for individual RPCs
517
+ # @return [Rpcs]
518
+ #
519
+ def rpcs
520
+ @rpcs ||= begin
521
+ parent_rpcs = nil
522
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
523
+ Rpcs.new parent_rpcs
524
+ end
525
+ end
526
+
527
+ ##
528
+ # Configuration RPC class for the Services API.
529
+ #
530
+ # Includes fields providing the configuration for each RPC in this service.
531
+ # Each configuration object is of type `Gapic::Config::Method` and includes
532
+ # the following configuration fields:
533
+ #
534
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
535
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
536
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
537
+ # include the following keys:
538
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
539
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
540
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
541
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
542
+ # trigger a retry.
543
+ #
544
+ class Rpcs
545
+ ##
546
+ # RPC-specific configuration for `list_services`
547
+ # @return [::Gapic::Config::Method]
548
+ #
549
+ attr_reader :list_services
550
+ ##
551
+ # RPC-specific configuration for `get_service`
552
+ # @return [::Gapic::Config::Method]
553
+ #
554
+ attr_reader :get_service
555
+ ##
556
+ # RPC-specific configuration for `update_service`
557
+ # @return [::Gapic::Config::Method]
558
+ #
559
+ attr_reader :update_service
560
+ ##
561
+ # RPC-specific configuration for `delete_service`
562
+ # @return [::Gapic::Config::Method]
563
+ #
564
+ attr_reader :delete_service
565
+
566
+ # @private
567
+ def initialize parent_rpcs = nil
568
+ list_services_config = parent_rpcs.list_services if parent_rpcs.respond_to? :list_services
569
+ @list_services = ::Gapic::Config::Method.new list_services_config
570
+ get_service_config = parent_rpcs.get_service if parent_rpcs.respond_to? :get_service
571
+ @get_service = ::Gapic::Config::Method.new get_service_config
572
+ update_service_config = parent_rpcs.update_service if parent_rpcs.respond_to? :update_service
573
+ @update_service = ::Gapic::Config::Method.new update_service_config
574
+ delete_service_config = parent_rpcs.delete_service if parent_rpcs.respond_to? :delete_service
575
+ @delete_service = ::Gapic::Config::Method.new delete_service_config
576
+
577
+ yield self if block_given?
578
+ end
579
+ end
580
+ end
581
+ end
582
+ end
583
+ end
584
+ end
585
+ end
586
+ end
587
+ end