google-cloud-app_engine-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.
Files changed (78) hide show
  1. checksums.yaml +7 -0
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +169 -0
  4. data/LICENSE.md +201 -0
  5. data/README.md +139 -0
  6. data/lib/google-cloud-app_engine-v1.rb +21 -0
  7. data/lib/google/appengine/v1/app_yaml_pb.rb +137 -0
  8. data/lib/google/appengine/v1/appengine_pb.rb +261 -0
  9. data/lib/google/appengine/v1/appengine_services_pb.rb +313 -0
  10. data/lib/google/appengine/v1/application_pb.rb +69 -0
  11. data/lib/google/appengine/v1/audit_data_pb.rb +35 -0
  12. data/lib/google/appengine/v1/certificate_pb.rb +52 -0
  13. data/lib/google/appengine/v1/deploy_pb.rb +47 -0
  14. data/lib/google/appengine/v1/deployed_files_pb.rb +19 -0
  15. data/lib/google/appengine/v1/domain_mapping_pb.rb +51 -0
  16. data/lib/google/appengine/v1/domain_pb.rb +24 -0
  17. data/lib/google/appengine/v1/firewall_pb.rb +32 -0
  18. data/lib/google/appengine/v1/instance_pb.rb +45 -0
  19. data/lib/google/appengine/v1/location_pb.rb +24 -0
  20. data/lib/google/appengine/v1/network_settings_pb.rb +19 -0
  21. data/lib/google/appengine/v1/operation_pb.rb +37 -0
  22. data/lib/google/appengine/v1/service_pb.rb +37 -0
  23. data/lib/google/appengine/v1/version_pb.rb +183 -0
  24. data/lib/google/cloud/app_engine/v1.rb +45 -0
  25. data/lib/google/cloud/app_engine/v1/applications.rb +49 -0
  26. data/lib/google/cloud/app_engine/v1/applications/client.rb +624 -0
  27. data/lib/google/cloud/app_engine/v1/applications/credentials.rb +53 -0
  28. data/lib/google/cloud/app_engine/v1/applications/operations.rb +655 -0
  29. data/lib/google/cloud/app_engine/v1/authorized_certificates.rb +49 -0
  30. data/lib/google/cloud/app_engine/v1/authorized_certificates/client.rb +690 -0
  31. data/lib/google/cloud/app_engine/v1/authorized_certificates/credentials.rb +53 -0
  32. data/lib/google/cloud/app_engine/v1/authorized_domains.rb +50 -0
  33. data/lib/google/cloud/app_engine/v1/authorized_domains/client.rb +380 -0
  34. data/lib/google/cloud/app_engine/v1/authorized_domains/credentials.rb +53 -0
  35. data/lib/google/cloud/app_engine/v1/domain_mappings.rb +49 -0
  36. data/lib/google/cloud/app_engine/v1/domain_mappings/client.rb +705 -0
  37. data/lib/google/cloud/app_engine/v1/domain_mappings/credentials.rb +53 -0
  38. data/lib/google/cloud/app_engine/v1/domain_mappings/operations.rb +655 -0
  39. data/lib/google/cloud/app_engine/v1/firewall.rb +57 -0
  40. data/lib/google/cloud/app_engine/v1/firewall/client.rb +783 -0
  41. data/lib/google/cloud/app_engine/v1/firewall/credentials.rb +53 -0
  42. data/lib/google/cloud/app_engine/v1/instances.rb +49 -0
  43. data/lib/google/cloud/app_engine/v1/instances/client.rb +644 -0
  44. data/lib/google/cloud/app_engine/v1/instances/credentials.rb +53 -0
  45. data/lib/google/cloud/app_engine/v1/instances/operations.rb +655 -0
  46. data/lib/google/cloud/app_engine/v1/services.rb +49 -0
  47. data/lib/google/cloud/app_engine/v1/services/client.rb +629 -0
  48. data/lib/google/cloud/app_engine/v1/services/credentials.rb +53 -0
  49. data/lib/google/cloud/app_engine/v1/services/operations.rb +655 -0
  50. data/lib/google/cloud/app_engine/v1/version.rb +28 -0
  51. data/lib/google/cloud/app_engine/v1/versions.rb +49 -0
  52. data/lib/google/cloud/app_engine/v1/versions/client.rb +738 -0
  53. data/lib/google/cloud/app_engine/v1/versions/credentials.rb +53 -0
  54. data/lib/google/cloud/app_engine/v1/versions/operations.rb +655 -0
  55. data/proto_docs/README.md +4 -0
  56. data/proto_docs/google/api/resource.rb +283 -0
  57. data/proto_docs/google/appengine/v1/app_yaml.rb +379 -0
  58. data/proto_docs/google/appengine/v1/appengine.rb +639 -0
  59. data/proto_docs/google/appengine/v1/application.rb +192 -0
  60. data/proto_docs/google/appengine/v1/audit_data.rb +56 -0
  61. data/proto_docs/google/appengine/v1/certificate.rb +161 -0
  62. data/proto_docs/google/appengine/v1/deploy.rb +130 -0
  63. data/proto_docs/google/appengine/v1/domain.rb +42 -0
  64. data/proto_docs/google/appengine/v1/domain_mapping.rb +127 -0
  65. data/proto_docs/google/appengine/v1/firewall.rb +72 -0
  66. data/proto_docs/google/appengine/v1/instance.rb +98 -0
  67. data/proto_docs/google/appengine/v1/location.rb +38 -0
  68. data/proto_docs/google/appengine/v1/operation.rb +67 -0
  69. data/proto_docs/google/appengine/v1/service.rb +100 -0
  70. data/proto_docs/google/appengine/v1/version.rb +597 -0
  71. data/proto_docs/google/longrunning/operations.rb +164 -0
  72. data/proto_docs/google/protobuf/any.rb +141 -0
  73. data/proto_docs/google/protobuf/duration.rb +98 -0
  74. data/proto_docs/google/protobuf/empty.rb +36 -0
  75. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  76. data/proto_docs/google/protobuf/timestamp.rb +129 -0
  77. data/proto_docs/google/rpc/status.rb +46 -0
  78. metadata +261 -0
@@ -0,0 +1,49 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 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 "gapic/common"
20
+ require "gapic/config"
21
+ require "gapic/config/method"
22
+
23
+ require "google/cloud/app_engine/v1/version"
24
+
25
+ require "google/cloud/app_engine/v1/services/credentials"
26
+ require "google/cloud/app_engine/v1/services/operations"
27
+ require "google/cloud/app_engine/v1/services/client"
28
+
29
+ module Google
30
+ module Cloud
31
+ module AppEngine
32
+ module V1
33
+ ##
34
+ # Manages services of an application.
35
+ #
36
+ # To load this service and instantiate a client:
37
+ #
38
+ # require "google/cloud/app_engine/v1/services"
39
+ # client = ::Google::Cloud::AppEngine::V1::Services::Client.new
40
+ #
41
+ module Services
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
47
+
48
+ helper_path = ::File.join __dir__, "services", "helpers.rb"
49
+ require "google/cloud/app_engine/v1/services/helpers" if ::File.file? helper_path
@@ -0,0 +1,629 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 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
+
22
+ module Google
23
+ module Cloud
24
+ module AppEngine
25
+ module V1
26
+ module Services
27
+ ##
28
+ # Client for the Services service.
29
+ #
30
+ # Manages services of an application.
31
+ #
32
+ class Client
33
+ # @private
34
+ attr_reader :services_stub
35
+
36
+ ##
37
+ # Configure the Services Client class.
38
+ #
39
+ # See {::Google::Cloud::AppEngine::V1::Services::Client::Configuration}
40
+ # for a description of the configuration fields.
41
+ #
42
+ # ## Example
43
+ #
44
+ # To modify the configuration for all Services clients:
45
+ #
46
+ # ::Google::Cloud::AppEngine::V1::Services::Client.configure do |config|
47
+ # config.timeout = 10.0
48
+ # end
49
+ #
50
+ # @yield [config] Configure the Client client.
51
+ # @yieldparam config [Client::Configuration]
52
+ #
53
+ # @return [Client::Configuration]
54
+ #
55
+ def self.configure
56
+ @configure ||= begin
57
+ namespace = ["Google", "Cloud", "AppEngine", "V1"]
58
+ parent_config = while namespace.any?
59
+ parent_name = namespace.join "::"
60
+ parent_const = const_get parent_name
61
+ break parent_const.configure if parent_const&.respond_to? :configure
62
+ namespace.pop
63
+ end
64
+ default_config = Client::Configuration.new parent_config
65
+
66
+ default_config
67
+ end
68
+ yield @configure if block_given?
69
+ @configure
70
+ end
71
+
72
+ ##
73
+ # Configure the Services Client instance.
74
+ #
75
+ # The configuration is set to the derived mode, meaning that values can be changed,
76
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
77
+ # should be made on {Client.configure}.
78
+ #
79
+ # See {::Google::Cloud::AppEngine::V1::Services::Client::Configuration}
80
+ # for a description of the configuration fields.
81
+ #
82
+ # @yield [config] Configure the Client client.
83
+ # @yieldparam config [Client::Configuration]
84
+ #
85
+ # @return [Client::Configuration]
86
+ #
87
+ def configure
88
+ yield @config if block_given?
89
+ @config
90
+ end
91
+
92
+ ##
93
+ # Create a new Services client object.
94
+ #
95
+ # ## Examples
96
+ #
97
+ # To create a new Services client with the default
98
+ # configuration:
99
+ #
100
+ # client = ::Google::Cloud::AppEngine::V1::Services::Client.new
101
+ #
102
+ # To create a new Services client with a custom
103
+ # configuration:
104
+ #
105
+ # client = ::Google::Cloud::AppEngine::V1::Services::Client.new do |config|
106
+ # config.timeout = 10.0
107
+ # end
108
+ #
109
+ # @yield [config] Configure the Services client.
110
+ # @yieldparam config [Client::Configuration]
111
+ #
112
+ def initialize
113
+ # These require statements are intentionally placed here to initialize
114
+ # the gRPC module only when it's required.
115
+ # See https://github.com/googleapis/toolkit/issues/446
116
+ require "gapic/grpc"
117
+ require "google/appengine/v1/appengine_services_pb"
118
+
119
+ # Create the configuration object
120
+ @config = Configuration.new Client.configure
121
+
122
+ # Yield the configuration if needed
123
+ yield @config if block_given?
124
+
125
+ # Create credentials
126
+ credentials = @config.credentials
127
+ # Use self-signed JWT if the scope and endpoint are unchanged from default,
128
+ # but only if the default endpoint does not have a region prefix.
129
+ enable_self_signed_jwt = @config.scope == Client.configure.scope &&
130
+ @config.endpoint == Client.configure.endpoint &&
131
+ !@config.endpoint.split(".").first.include?("-")
132
+ credentials ||= Credentials.default scope: @config.scope,
133
+ enable_self_signed_jwt: enable_self_signed_jwt
134
+ if credentials.is_a?(String) || credentials.is_a?(Hash)
135
+ credentials = Credentials.new credentials, scope: @config.scope
136
+ end
137
+ @quota_project_id = @config.quota_project
138
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
139
+
140
+ @operations_client = Operations.new do |config|
141
+ config.credentials = credentials
142
+ config.endpoint = @config.endpoint
143
+ end
144
+
145
+ @services_stub = ::Gapic::ServiceStub.new(
146
+ ::Google::Cloud::AppEngine::V1::Services::Stub,
147
+ credentials: credentials,
148
+ endpoint: @config.endpoint,
149
+ channel_args: @config.channel_args,
150
+ interceptors: @config.interceptors
151
+ )
152
+ end
153
+
154
+ ##
155
+ # Get the associated client for long-running operations.
156
+ #
157
+ # @return [::Google::Cloud::AppEngine::V1::Services::Operations]
158
+ #
159
+ attr_reader :operations_client
160
+
161
+ # Service calls
162
+
163
+ ##
164
+ # Lists all the services in the application.
165
+ #
166
+ # @overload list_services(request, options = nil)
167
+ # Pass arguments to `list_services` via a request object, either of type
168
+ # {::Google::Cloud::AppEngine::V1::ListServicesRequest} or an equivalent Hash.
169
+ #
170
+ # @param request [::Google::Cloud::AppEngine::V1::ListServicesRequest, ::Hash]
171
+ # A request object representing the call parameters. Required. To specify no
172
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
173
+ # @param options [::Gapic::CallOptions, ::Hash]
174
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
175
+ #
176
+ # @overload list_services(parent: nil, page_size: nil, page_token: nil)
177
+ # Pass arguments to `list_services` via keyword arguments. Note that at
178
+ # least one keyword argument is required. To specify no parameters, or to keep all
179
+ # the default parameter values, pass an empty Hash as a request object (see above).
180
+ #
181
+ # @param parent [::String]
182
+ # Name of the parent Application resource. Example: `apps/myapp`.
183
+ # @param page_size [::Integer]
184
+ # Maximum results to return per page.
185
+ # @param page_token [::String]
186
+ # Continuation token for fetching the next page of results.
187
+ #
188
+ # @yield [response, operation] Access the result along with the RPC operation
189
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AppEngine::V1::Service>]
190
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
191
+ #
192
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::AppEngine::V1::Service>]
193
+ #
194
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
195
+ #
196
+ def list_services request, options = nil
197
+ raise ::ArgumentError, "request must be provided" if request.nil?
198
+
199
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AppEngine::V1::ListServicesRequest
200
+
201
+ # Converts hash and nil to an options object
202
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
203
+
204
+ # Customize the options with defaults
205
+ metadata = @config.rpcs.list_services.metadata.to_h
206
+
207
+ # Set x-goog-api-client and x-goog-user-project headers
208
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
209
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
210
+ gapic_version: ::Google::Cloud::AppEngine::V1::VERSION
211
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
212
+
213
+ header_params = {
214
+ "parent" => request.parent
215
+ }
216
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
217
+ metadata[:"x-goog-request-params"] ||= request_params_header
218
+
219
+ options.apply_defaults timeout: @config.rpcs.list_services.timeout,
220
+ metadata: metadata,
221
+ retry_policy: @config.rpcs.list_services.retry_policy
222
+ options.apply_defaults metadata: @config.metadata,
223
+ retry_policy: @config.retry_policy
224
+
225
+ @services_stub.call_rpc :list_services, request, options: options do |response, operation|
226
+ response = ::Gapic::PagedEnumerable.new @services_stub, :list_services, request, response, operation, options
227
+ yield response, operation if block_given?
228
+ return response
229
+ end
230
+ rescue ::GRPC::BadStatus => e
231
+ raise ::Google::Cloud::Error.from_error(e)
232
+ end
233
+
234
+ ##
235
+ # Gets the current configuration of the specified service.
236
+ #
237
+ # @overload get_service(request, options = nil)
238
+ # Pass arguments to `get_service` via a request object, either of type
239
+ # {::Google::Cloud::AppEngine::V1::GetServiceRequest} or an equivalent Hash.
240
+ #
241
+ # @param request [::Google::Cloud::AppEngine::V1::GetServiceRequest, ::Hash]
242
+ # A request object representing the call parameters. Required. To specify no
243
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
244
+ # @param options [::Gapic::CallOptions, ::Hash]
245
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
246
+ #
247
+ # @overload get_service(name: nil)
248
+ # Pass arguments to `get_service` via keyword arguments. Note that at
249
+ # least one keyword argument is required. To specify no parameters, or to keep all
250
+ # the default parameter values, pass an empty Hash as a request object (see above).
251
+ #
252
+ # @param name [::String]
253
+ # Name of the resource requested. Example: `apps/myapp/services/default`.
254
+ #
255
+ # @yield [response, operation] Access the result along with the RPC operation
256
+ # @yieldparam response [::Google::Cloud::AppEngine::V1::Service]
257
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
258
+ #
259
+ # @return [::Google::Cloud::AppEngine::V1::Service]
260
+ #
261
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
262
+ #
263
+ def get_service request, options = nil
264
+ raise ::ArgumentError, "request must be provided" if request.nil?
265
+
266
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AppEngine::V1::GetServiceRequest
267
+
268
+ # Converts hash and nil to an options object
269
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
270
+
271
+ # Customize the options with defaults
272
+ metadata = @config.rpcs.get_service.metadata.to_h
273
+
274
+ # Set x-goog-api-client and x-goog-user-project headers
275
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
276
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
277
+ gapic_version: ::Google::Cloud::AppEngine::V1::VERSION
278
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
279
+
280
+ header_params = {
281
+ "name" => request.name
282
+ }
283
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
284
+ metadata[:"x-goog-request-params"] ||= request_params_header
285
+
286
+ options.apply_defaults timeout: @config.rpcs.get_service.timeout,
287
+ metadata: metadata,
288
+ retry_policy: @config.rpcs.get_service.retry_policy
289
+ options.apply_defaults metadata: @config.metadata,
290
+ retry_policy: @config.retry_policy
291
+
292
+ @services_stub.call_rpc :get_service, request, options: options do |response, operation|
293
+ yield response, operation if block_given?
294
+ return response
295
+ end
296
+ rescue ::GRPC::BadStatus => e
297
+ raise ::Google::Cloud::Error.from_error(e)
298
+ end
299
+
300
+ ##
301
+ # Updates the configuration of the specified service.
302
+ #
303
+ # @overload update_service(request, options = nil)
304
+ # Pass arguments to `update_service` via a request object, either of type
305
+ # {::Google::Cloud::AppEngine::V1::UpdateServiceRequest} or an equivalent Hash.
306
+ #
307
+ # @param request [::Google::Cloud::AppEngine::V1::UpdateServiceRequest, ::Hash]
308
+ # A request object representing the call parameters. Required. To specify no
309
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
310
+ # @param options [::Gapic::CallOptions, ::Hash]
311
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
312
+ #
313
+ # @overload update_service(name: nil, service: nil, update_mask: nil, migrate_traffic: nil)
314
+ # Pass arguments to `update_service` via keyword arguments. Note that at
315
+ # least one keyword argument is required. To specify no parameters, or to keep all
316
+ # the default parameter values, pass an empty Hash as a request object (see above).
317
+ #
318
+ # @param name [::String]
319
+ # Name of the resource to update. Example: `apps/myapp/services/default`.
320
+ # @param service [::Google::Cloud::AppEngine::V1::Service, ::Hash]
321
+ # A Service resource containing the updated service. Only fields set in the
322
+ # field mask will be updated.
323
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
324
+ # Standard field mask for the set of fields to be updated.
325
+ # @param migrate_traffic [::Boolean]
326
+ # Set to `true` to gradually shift traffic to one or more versions that you
327
+ # specify. By default, traffic is shifted immediately.
328
+ # For gradual traffic migration, the target versions
329
+ # must be located within instances that are configured for both
330
+ # [warmup requests](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#InboundServiceType)
331
+ # and
332
+ # [automatic scaling](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#AutomaticScaling).
333
+ # You must specify the
334
+ # [`shardBy`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services#ShardBy)
335
+ # field in the Service resource. Gradual traffic migration is not
336
+ # supported in the App Engine flexible environment. For examples, see
337
+ # [Migrating and Splitting Traffic](https://cloud.google.com/appengine/docs/admin-api/migrating-splitting-traffic).
338
+ #
339
+ # @yield [response, operation] Access the result along with the RPC operation
340
+ # @yieldparam response [::Gapic::Operation]
341
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
342
+ #
343
+ # @return [::Gapic::Operation]
344
+ #
345
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
346
+ #
347
+ def update_service request, options = nil
348
+ raise ::ArgumentError, "request must be provided" if request.nil?
349
+
350
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AppEngine::V1::UpdateServiceRequest
351
+
352
+ # Converts hash and nil to an options object
353
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
354
+
355
+ # Customize the options with defaults
356
+ metadata = @config.rpcs.update_service.metadata.to_h
357
+
358
+ # Set x-goog-api-client and x-goog-user-project headers
359
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
360
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
361
+ gapic_version: ::Google::Cloud::AppEngine::V1::VERSION
362
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
363
+
364
+ header_params = {
365
+ "name" => request.name
366
+ }
367
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
368
+ metadata[:"x-goog-request-params"] ||= request_params_header
369
+
370
+ options.apply_defaults timeout: @config.rpcs.update_service.timeout,
371
+ metadata: metadata,
372
+ retry_policy: @config.rpcs.update_service.retry_policy
373
+ options.apply_defaults metadata: @config.metadata,
374
+ retry_policy: @config.retry_policy
375
+
376
+ @services_stub.call_rpc :update_service, request, options: options do |response, operation|
377
+ response = ::Gapic::Operation.new response, @operations_client, options: options
378
+ yield response, operation if block_given?
379
+ return response
380
+ end
381
+ rescue ::GRPC::BadStatus => e
382
+ raise ::Google::Cloud::Error.from_error(e)
383
+ end
384
+
385
+ ##
386
+ # Deletes the specified service and all enclosed versions.
387
+ #
388
+ # @overload delete_service(request, options = nil)
389
+ # Pass arguments to `delete_service` via a request object, either of type
390
+ # {::Google::Cloud::AppEngine::V1::DeleteServiceRequest} or an equivalent Hash.
391
+ #
392
+ # @param request [::Google::Cloud::AppEngine::V1::DeleteServiceRequest, ::Hash]
393
+ # A request object representing the call parameters. Required. To specify no
394
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
395
+ # @param options [::Gapic::CallOptions, ::Hash]
396
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
397
+ #
398
+ # @overload delete_service(name: nil)
399
+ # Pass arguments to `delete_service` via keyword arguments. Note that at
400
+ # least one keyword argument is required. To specify no parameters, or to keep all
401
+ # the default parameter values, pass an empty Hash as a request object (see above).
402
+ #
403
+ # @param name [::String]
404
+ # Name of the resource requested. Example: `apps/myapp/services/default`.
405
+ #
406
+ # @yield [response, operation] Access the result along with the RPC operation
407
+ # @yieldparam response [::Gapic::Operation]
408
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
409
+ #
410
+ # @return [::Gapic::Operation]
411
+ #
412
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
413
+ #
414
+ def delete_service request, options = nil
415
+ raise ::ArgumentError, "request must be provided" if request.nil?
416
+
417
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AppEngine::V1::DeleteServiceRequest
418
+
419
+ # Converts hash and nil to an options object
420
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
421
+
422
+ # Customize the options with defaults
423
+ metadata = @config.rpcs.delete_service.metadata.to_h
424
+
425
+ # Set x-goog-api-client and x-goog-user-project headers
426
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
427
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
428
+ gapic_version: ::Google::Cloud::AppEngine::V1::VERSION
429
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
430
+
431
+ header_params = {
432
+ "name" => request.name
433
+ }
434
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
435
+ metadata[:"x-goog-request-params"] ||= request_params_header
436
+
437
+ options.apply_defaults timeout: @config.rpcs.delete_service.timeout,
438
+ metadata: metadata,
439
+ retry_policy: @config.rpcs.delete_service.retry_policy
440
+ options.apply_defaults metadata: @config.metadata,
441
+ retry_policy: @config.retry_policy
442
+
443
+ @services_stub.call_rpc :delete_service, request, options: options do |response, operation|
444
+ response = ::Gapic::Operation.new response, @operations_client, options: options
445
+ yield response, operation if block_given?
446
+ return response
447
+ end
448
+ rescue ::GRPC::BadStatus => e
449
+ raise ::Google::Cloud::Error.from_error(e)
450
+ end
451
+
452
+ ##
453
+ # Configuration class for the Services API.
454
+ #
455
+ # This class represents the configuration for Services,
456
+ # providing control over timeouts, retry behavior, logging, transport
457
+ # parameters, and other low-level controls. Certain parameters can also be
458
+ # applied individually to specific RPCs. See
459
+ # {::Google::Cloud::AppEngine::V1::Services::Client::Configuration::Rpcs}
460
+ # for a list of RPCs that can be configured independently.
461
+ #
462
+ # Configuration can be applied globally to all clients, or to a single client
463
+ # on construction.
464
+ #
465
+ # # Examples
466
+ #
467
+ # To modify the global config, setting the timeout for list_services
468
+ # to 20 seconds, and all remaining timeouts to 10 seconds:
469
+ #
470
+ # ::Google::Cloud::AppEngine::V1::Services::Client.configure do |config|
471
+ # config.timeout = 10.0
472
+ # config.rpcs.list_services.timeout = 20.0
473
+ # end
474
+ #
475
+ # To apply the above configuration only to a new client:
476
+ #
477
+ # client = ::Google::Cloud::AppEngine::V1::Services::Client.new do |config|
478
+ # config.timeout = 10.0
479
+ # config.rpcs.list_services.timeout = 20.0
480
+ # end
481
+ #
482
+ # @!attribute [rw] endpoint
483
+ # The hostname or hostname:port of the service endpoint.
484
+ # Defaults to `"appengine.googleapis.com"`.
485
+ # @return [::String]
486
+ # @!attribute [rw] credentials
487
+ # Credentials to send with calls. You may provide any of the following types:
488
+ # * (`String`) The path to a service account key file in JSON format
489
+ # * (`Hash`) A service account key as a Hash
490
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
491
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
492
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
493
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
494
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
495
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
496
+ # * (`nil`) indicating no credentials
497
+ # @return [::Object]
498
+ # @!attribute [rw] scope
499
+ # The OAuth scopes
500
+ # @return [::Array<::String>]
501
+ # @!attribute [rw] lib_name
502
+ # The library name as recorded in instrumentation and logging
503
+ # @return [::String]
504
+ # @!attribute [rw] lib_version
505
+ # The library version as recorded in instrumentation and logging
506
+ # @return [::String]
507
+ # @!attribute [rw] channel_args
508
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
509
+ # `GRPC::Core::Channel` object is provided as the credential.
510
+ # @return [::Hash]
511
+ # @!attribute [rw] interceptors
512
+ # An array of interceptors that are run before calls are executed.
513
+ # @return [::Array<::GRPC::ClientInterceptor>]
514
+ # @!attribute [rw] timeout
515
+ # The call timeout in seconds.
516
+ # @return [::Numeric]
517
+ # @!attribute [rw] metadata
518
+ # Additional gRPC headers to be sent with the call.
519
+ # @return [::Hash{::Symbol=>::String}]
520
+ # @!attribute [rw] retry_policy
521
+ # The retry policy. The value is a hash with the following keys:
522
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
523
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
524
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
525
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
526
+ # trigger a retry.
527
+ # @return [::Hash]
528
+ # @!attribute [rw] quota_project
529
+ # A separate project against which to charge quota.
530
+ # @return [::String]
531
+ #
532
+ class Configuration
533
+ extend ::Gapic::Config
534
+
535
+ config_attr :endpoint, "appengine.googleapis.com", ::String
536
+ config_attr :credentials, nil do |value|
537
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
538
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
539
+ allowed.any? { |klass| klass === value }
540
+ end
541
+ config_attr :scope, nil, ::String, ::Array, nil
542
+ config_attr :lib_name, nil, ::String, nil
543
+ config_attr :lib_version, nil, ::String, nil
544
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
545
+ config_attr :interceptors, nil, ::Array, nil
546
+ config_attr :timeout, nil, ::Numeric, nil
547
+ config_attr :metadata, nil, ::Hash, nil
548
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
549
+ config_attr :quota_project, nil, ::String, nil
550
+
551
+ # @private
552
+ def initialize parent_config = nil
553
+ @parent_config = parent_config unless parent_config.nil?
554
+
555
+ yield self if block_given?
556
+ end
557
+
558
+ ##
559
+ # Configurations for individual RPCs
560
+ # @return [Rpcs]
561
+ #
562
+ def rpcs
563
+ @rpcs ||= begin
564
+ parent_rpcs = nil
565
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config&.respond_to?(:rpcs)
566
+ Rpcs.new parent_rpcs
567
+ end
568
+ end
569
+
570
+ ##
571
+ # Configuration RPC class for the Services API.
572
+ #
573
+ # Includes fields providing the configuration for each RPC in this service.
574
+ # Each configuration object is of type `Gapic::Config::Method` and includes
575
+ # the following configuration fields:
576
+ #
577
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
578
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
579
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
580
+ # include the following keys:
581
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
582
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
583
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
584
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
585
+ # trigger a retry.
586
+ #
587
+ class Rpcs
588
+ ##
589
+ # RPC-specific configuration for `list_services`
590
+ # @return [::Gapic::Config::Method]
591
+ #
592
+ attr_reader :list_services
593
+ ##
594
+ # RPC-specific configuration for `get_service`
595
+ # @return [::Gapic::Config::Method]
596
+ #
597
+ attr_reader :get_service
598
+ ##
599
+ # RPC-specific configuration for `update_service`
600
+ # @return [::Gapic::Config::Method]
601
+ #
602
+ attr_reader :update_service
603
+ ##
604
+ # RPC-specific configuration for `delete_service`
605
+ # @return [::Gapic::Config::Method]
606
+ #
607
+ attr_reader :delete_service
608
+
609
+ # @private
610
+ def initialize parent_rpcs = nil
611
+ list_services_config = parent_rpcs&.list_services if parent_rpcs&.respond_to? :list_services
612
+ @list_services = ::Gapic::Config::Method.new list_services_config
613
+ get_service_config = parent_rpcs&.get_service if parent_rpcs&.respond_to? :get_service
614
+ @get_service = ::Gapic::Config::Method.new get_service_config
615
+ update_service_config = parent_rpcs&.update_service if parent_rpcs&.respond_to? :update_service
616
+ @update_service = ::Gapic::Config::Method.new update_service_config
617
+ delete_service_config = parent_rpcs&.delete_service if parent_rpcs&.respond_to? :delete_service
618
+ @delete_service = ::Gapic::Config::Method.new delete_service_config
619
+
620
+ yield self if block_given?
621
+ end
622
+ end
623
+ end
624
+ end
625
+ end
626
+ end
627
+ end
628
+ end
629
+ end