google-cloud-app_engine-v1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
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,28 @@
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
+
20
+ module Google
21
+ module Cloud
22
+ module AppEngine
23
+ module V1
24
+ VERSION = "0.1.0"
25
+ end
26
+ end
27
+ end
28
+ end
@@ -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/versions/credentials"
26
+ require "google/cloud/app_engine/v1/versions/operations"
27
+ require "google/cloud/app_engine/v1/versions/client"
28
+
29
+ module Google
30
+ module Cloud
31
+ module AppEngine
32
+ module V1
33
+ ##
34
+ # Manages versions of a service.
35
+ #
36
+ # To load this service and instantiate a client:
37
+ #
38
+ # require "google/cloud/app_engine/v1/versions"
39
+ # client = ::Google::Cloud::AppEngine::V1::Versions::Client.new
40
+ #
41
+ module Versions
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
47
+
48
+ helper_path = ::File.join __dir__, "versions", "helpers.rb"
49
+ require "google/cloud/app_engine/v1/versions/helpers" if ::File.file? helper_path
@@ -0,0 +1,738 @@
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 Versions
27
+ ##
28
+ # Client for the Versions service.
29
+ #
30
+ # Manages versions of a service.
31
+ #
32
+ class Client
33
+ # @private
34
+ attr_reader :versions_stub
35
+
36
+ ##
37
+ # Configure the Versions Client class.
38
+ #
39
+ # See {::Google::Cloud::AppEngine::V1::Versions::Client::Configuration}
40
+ # for a description of the configuration fields.
41
+ #
42
+ # ## Example
43
+ #
44
+ # To modify the configuration for all Versions clients:
45
+ #
46
+ # ::Google::Cloud::AppEngine::V1::Versions::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 Versions 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::Versions::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 Versions client object.
94
+ #
95
+ # ## Examples
96
+ #
97
+ # To create a new Versions client with the default
98
+ # configuration:
99
+ #
100
+ # client = ::Google::Cloud::AppEngine::V1::Versions::Client.new
101
+ #
102
+ # To create a new Versions client with a custom
103
+ # configuration:
104
+ #
105
+ # client = ::Google::Cloud::AppEngine::V1::Versions::Client.new do |config|
106
+ # config.timeout = 10.0
107
+ # end
108
+ #
109
+ # @yield [config] Configure the Versions 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
+ @versions_stub = ::Gapic::ServiceStub.new(
146
+ ::Google::Cloud::AppEngine::V1::Versions::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::Versions::Operations]
158
+ #
159
+ attr_reader :operations_client
160
+
161
+ # Service calls
162
+
163
+ ##
164
+ # Lists the versions of a service.
165
+ #
166
+ # @overload list_versions(request, options = nil)
167
+ # Pass arguments to `list_versions` via a request object, either of type
168
+ # {::Google::Cloud::AppEngine::V1::ListVersionsRequest} or an equivalent Hash.
169
+ #
170
+ # @param request [::Google::Cloud::AppEngine::V1::ListVersionsRequest, ::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_versions(parent: nil, view: nil, page_size: nil, page_token: nil)
177
+ # Pass arguments to `list_versions` 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 Service resource. Example:
183
+ # `apps/myapp/services/default`.
184
+ # @param view [::Google::Cloud::AppEngine::V1::VersionView]
185
+ # Controls the set of fields returned in the `List` response.
186
+ # @param page_size [::Integer]
187
+ # Maximum results to return per page.
188
+ # @param page_token [::String]
189
+ # Continuation token for fetching the next page of results.
190
+ #
191
+ # @yield [response, operation] Access the result along with the RPC operation
192
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AppEngine::V1::Version>]
193
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
194
+ #
195
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::AppEngine::V1::Version>]
196
+ #
197
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
198
+ #
199
+ def list_versions request, options = nil
200
+ raise ::ArgumentError, "request must be provided" if request.nil?
201
+
202
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AppEngine::V1::ListVersionsRequest
203
+
204
+ # Converts hash and nil to an options object
205
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
206
+
207
+ # Customize the options with defaults
208
+ metadata = @config.rpcs.list_versions.metadata.to_h
209
+
210
+ # Set x-goog-api-client and x-goog-user-project headers
211
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
212
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
213
+ gapic_version: ::Google::Cloud::AppEngine::V1::VERSION
214
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
215
+
216
+ header_params = {
217
+ "parent" => request.parent
218
+ }
219
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
220
+ metadata[:"x-goog-request-params"] ||= request_params_header
221
+
222
+ options.apply_defaults timeout: @config.rpcs.list_versions.timeout,
223
+ metadata: metadata,
224
+ retry_policy: @config.rpcs.list_versions.retry_policy
225
+ options.apply_defaults metadata: @config.metadata,
226
+ retry_policy: @config.retry_policy
227
+
228
+ @versions_stub.call_rpc :list_versions, request, options: options do |response, operation|
229
+ response = ::Gapic::PagedEnumerable.new @versions_stub, :list_versions, request, response, operation, options
230
+ yield response, operation if block_given?
231
+ return response
232
+ end
233
+ rescue ::GRPC::BadStatus => e
234
+ raise ::Google::Cloud::Error.from_error(e)
235
+ end
236
+
237
+ ##
238
+ # Gets the specified Version resource.
239
+ # By default, only a `BASIC_VIEW` will be returned.
240
+ # Specify the `FULL_VIEW` parameter to get the full resource.
241
+ #
242
+ # @overload get_version(request, options = nil)
243
+ # Pass arguments to `get_version` via a request object, either of type
244
+ # {::Google::Cloud::AppEngine::V1::GetVersionRequest} or an equivalent Hash.
245
+ #
246
+ # @param request [::Google::Cloud::AppEngine::V1::GetVersionRequest, ::Hash]
247
+ # A request object representing the call parameters. Required. To specify no
248
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
249
+ # @param options [::Gapic::CallOptions, ::Hash]
250
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
251
+ #
252
+ # @overload get_version(name: nil, view: nil)
253
+ # Pass arguments to `get_version` via keyword arguments. Note that at
254
+ # least one keyword argument is required. To specify no parameters, or to keep all
255
+ # the default parameter values, pass an empty Hash as a request object (see above).
256
+ #
257
+ # @param name [::String]
258
+ # Name of the resource requested. Example:
259
+ # `apps/myapp/services/default/versions/v1`.
260
+ # @param view [::Google::Cloud::AppEngine::V1::VersionView]
261
+ # Controls the set of fields returned in the `Get` response.
262
+ #
263
+ # @yield [response, operation] Access the result along with the RPC operation
264
+ # @yieldparam response [::Google::Cloud::AppEngine::V1::Version]
265
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
266
+ #
267
+ # @return [::Google::Cloud::AppEngine::V1::Version]
268
+ #
269
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
270
+ #
271
+ def get_version request, options = nil
272
+ raise ::ArgumentError, "request must be provided" if request.nil?
273
+
274
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AppEngine::V1::GetVersionRequest
275
+
276
+ # Converts hash and nil to an options object
277
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
278
+
279
+ # Customize the options with defaults
280
+ metadata = @config.rpcs.get_version.metadata.to_h
281
+
282
+ # Set x-goog-api-client and x-goog-user-project headers
283
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
284
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
285
+ gapic_version: ::Google::Cloud::AppEngine::V1::VERSION
286
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
287
+
288
+ header_params = {
289
+ "name" => request.name
290
+ }
291
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
292
+ metadata[:"x-goog-request-params"] ||= request_params_header
293
+
294
+ options.apply_defaults timeout: @config.rpcs.get_version.timeout,
295
+ metadata: metadata,
296
+ retry_policy: @config.rpcs.get_version.retry_policy
297
+ options.apply_defaults metadata: @config.metadata,
298
+ retry_policy: @config.retry_policy
299
+
300
+ @versions_stub.call_rpc :get_version, request, options: options do |response, operation|
301
+ yield response, operation if block_given?
302
+ return response
303
+ end
304
+ rescue ::GRPC::BadStatus => e
305
+ raise ::Google::Cloud::Error.from_error(e)
306
+ end
307
+
308
+ ##
309
+ # Deploys code and resource files to a new version.
310
+ #
311
+ # @overload create_version(request, options = nil)
312
+ # Pass arguments to `create_version` via a request object, either of type
313
+ # {::Google::Cloud::AppEngine::V1::CreateVersionRequest} or an equivalent Hash.
314
+ #
315
+ # @param request [::Google::Cloud::AppEngine::V1::CreateVersionRequest, ::Hash]
316
+ # A request object representing the call parameters. Required. To specify no
317
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
318
+ # @param options [::Gapic::CallOptions, ::Hash]
319
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
320
+ #
321
+ # @overload create_version(parent: nil, version: nil)
322
+ # Pass arguments to `create_version` via keyword arguments. Note that at
323
+ # least one keyword argument is required. To specify no parameters, or to keep all
324
+ # the default parameter values, pass an empty Hash as a request object (see above).
325
+ #
326
+ # @param parent [::String]
327
+ # Name of the parent resource to create this version under. Example:
328
+ # `apps/myapp/services/default`.
329
+ # @param version [::Google::Cloud::AppEngine::V1::Version, ::Hash]
330
+ # Application deployment configuration.
331
+ #
332
+ # @yield [response, operation] Access the result along with the RPC operation
333
+ # @yieldparam response [::Gapic::Operation]
334
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
335
+ #
336
+ # @return [::Gapic::Operation]
337
+ #
338
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
339
+ #
340
+ def create_version request, options = nil
341
+ raise ::ArgumentError, "request must be provided" if request.nil?
342
+
343
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AppEngine::V1::CreateVersionRequest
344
+
345
+ # Converts hash and nil to an options object
346
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
347
+
348
+ # Customize the options with defaults
349
+ metadata = @config.rpcs.create_version.metadata.to_h
350
+
351
+ # Set x-goog-api-client and x-goog-user-project headers
352
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
353
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
354
+ gapic_version: ::Google::Cloud::AppEngine::V1::VERSION
355
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
356
+
357
+ header_params = {
358
+ "parent" => request.parent
359
+ }
360
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
361
+ metadata[:"x-goog-request-params"] ||= request_params_header
362
+
363
+ options.apply_defaults timeout: @config.rpcs.create_version.timeout,
364
+ metadata: metadata,
365
+ retry_policy: @config.rpcs.create_version.retry_policy
366
+ options.apply_defaults metadata: @config.metadata,
367
+ retry_policy: @config.retry_policy
368
+
369
+ @versions_stub.call_rpc :create_version, request, options: options do |response, operation|
370
+ response = ::Gapic::Operation.new response, @operations_client, options: options
371
+ yield response, operation if block_given?
372
+ return response
373
+ end
374
+ rescue ::GRPC::BadStatus => e
375
+ raise ::Google::Cloud::Error.from_error(e)
376
+ end
377
+
378
+ ##
379
+ # Updates the specified Version resource.
380
+ # You can specify the following fields depending on the App Engine
381
+ # environment and type of scaling that the version resource uses:
382
+ #
383
+ # **Standard environment**
384
+ #
385
+ # * [`instance_class`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.instance_class)
386
+ #
387
+ # *automatic scaling* in the standard environment:
388
+ #
389
+ # * [`automatic_scaling.min_idle_instances`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling)
390
+ # * [`automatic_scaling.max_idle_instances`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling)
391
+ # * [`automaticScaling.standard_scheduler_settings.max_instances`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#StandardSchedulerSettings)
392
+ # * [`automaticScaling.standard_scheduler_settings.min_instances`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#StandardSchedulerSettings)
393
+ # * [`automaticScaling.standard_scheduler_settings.target_cpu_utilization`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#StandardSchedulerSettings)
394
+ # * [`automaticScaling.standard_scheduler_settings.target_throughput_utilization`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#StandardSchedulerSettings)
395
+ #
396
+ # *basic scaling* or *manual scaling* in the standard environment:
397
+ #
398
+ # * [`serving_status`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.serving_status)
399
+ # * [`manual_scaling.instances`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#manualscaling)
400
+ #
401
+ # **Flexible environment**
402
+ #
403
+ # * [`serving_status`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.serving_status)
404
+ #
405
+ # *automatic scaling* in the flexible environment:
406
+ #
407
+ # * [`automatic_scaling.min_total_instances`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling)
408
+ # * [`automatic_scaling.max_total_instances`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling)
409
+ # * [`automatic_scaling.cool_down_period_sec`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling)
410
+ # * [`automatic_scaling.cpu_utilization.target_utilization`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling)
411
+ #
412
+ # *manual scaling* in the flexible environment:
413
+ #
414
+ # * [`manual_scaling.instances`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#manualscaling)
415
+ #
416
+ # @overload update_version(request, options = nil)
417
+ # Pass arguments to `update_version` via a request object, either of type
418
+ # {::Google::Cloud::AppEngine::V1::UpdateVersionRequest} or an equivalent Hash.
419
+ #
420
+ # @param request [::Google::Cloud::AppEngine::V1::UpdateVersionRequest, ::Hash]
421
+ # A request object representing the call parameters. Required. To specify no
422
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
423
+ # @param options [::Gapic::CallOptions, ::Hash]
424
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
425
+ #
426
+ # @overload update_version(name: nil, version: nil, update_mask: nil)
427
+ # Pass arguments to `update_version` via keyword arguments. Note that at
428
+ # least one keyword argument is required. To specify no parameters, or to keep all
429
+ # the default parameter values, pass an empty Hash as a request object (see above).
430
+ #
431
+ # @param name [::String]
432
+ # Name of the resource to update. Example:
433
+ # `apps/myapp/services/default/versions/1`.
434
+ # @param version [::Google::Cloud::AppEngine::V1::Version, ::Hash]
435
+ # A Version containing the updated resource. Only fields set in the field
436
+ # mask will be updated.
437
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
438
+ # Standard field mask for the set of fields to be updated.
439
+ #
440
+ # @yield [response, operation] Access the result along with the RPC operation
441
+ # @yieldparam response [::Gapic::Operation]
442
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
443
+ #
444
+ # @return [::Gapic::Operation]
445
+ #
446
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
447
+ #
448
+ def update_version request, options = nil
449
+ raise ::ArgumentError, "request must be provided" if request.nil?
450
+
451
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AppEngine::V1::UpdateVersionRequest
452
+
453
+ # Converts hash and nil to an options object
454
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
455
+
456
+ # Customize the options with defaults
457
+ metadata = @config.rpcs.update_version.metadata.to_h
458
+
459
+ # Set x-goog-api-client and x-goog-user-project headers
460
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
461
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
462
+ gapic_version: ::Google::Cloud::AppEngine::V1::VERSION
463
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
464
+
465
+ header_params = {
466
+ "name" => request.name
467
+ }
468
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
469
+ metadata[:"x-goog-request-params"] ||= request_params_header
470
+
471
+ options.apply_defaults timeout: @config.rpcs.update_version.timeout,
472
+ metadata: metadata,
473
+ retry_policy: @config.rpcs.update_version.retry_policy
474
+ options.apply_defaults metadata: @config.metadata,
475
+ retry_policy: @config.retry_policy
476
+
477
+ @versions_stub.call_rpc :update_version, request, options: options do |response, operation|
478
+ response = ::Gapic::Operation.new response, @operations_client, options: options
479
+ yield response, operation if block_given?
480
+ return response
481
+ end
482
+ rescue ::GRPC::BadStatus => e
483
+ raise ::Google::Cloud::Error.from_error(e)
484
+ end
485
+
486
+ ##
487
+ # Deletes an existing Version resource.
488
+ #
489
+ # @overload delete_version(request, options = nil)
490
+ # Pass arguments to `delete_version` via a request object, either of type
491
+ # {::Google::Cloud::AppEngine::V1::DeleteVersionRequest} or an equivalent Hash.
492
+ #
493
+ # @param request [::Google::Cloud::AppEngine::V1::DeleteVersionRequest, ::Hash]
494
+ # A request object representing the call parameters. Required. To specify no
495
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
496
+ # @param options [::Gapic::CallOptions, ::Hash]
497
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
498
+ #
499
+ # @overload delete_version(name: nil)
500
+ # Pass arguments to `delete_version` via keyword arguments. Note that at
501
+ # least one keyword argument is required. To specify no parameters, or to keep all
502
+ # the default parameter values, pass an empty Hash as a request object (see above).
503
+ #
504
+ # @param name [::String]
505
+ # Name of the resource requested. Example:
506
+ # `apps/myapp/services/default/versions/v1`.
507
+ #
508
+ # @yield [response, operation] Access the result along with the RPC operation
509
+ # @yieldparam response [::Gapic::Operation]
510
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
511
+ #
512
+ # @return [::Gapic::Operation]
513
+ #
514
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
515
+ #
516
+ def delete_version request, options = nil
517
+ raise ::ArgumentError, "request must be provided" if request.nil?
518
+
519
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AppEngine::V1::DeleteVersionRequest
520
+
521
+ # Converts hash and nil to an options object
522
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
523
+
524
+ # Customize the options with defaults
525
+ metadata = @config.rpcs.delete_version.metadata.to_h
526
+
527
+ # Set x-goog-api-client and x-goog-user-project headers
528
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
529
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
530
+ gapic_version: ::Google::Cloud::AppEngine::V1::VERSION
531
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
532
+
533
+ header_params = {
534
+ "name" => request.name
535
+ }
536
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
537
+ metadata[:"x-goog-request-params"] ||= request_params_header
538
+
539
+ options.apply_defaults timeout: @config.rpcs.delete_version.timeout,
540
+ metadata: metadata,
541
+ retry_policy: @config.rpcs.delete_version.retry_policy
542
+ options.apply_defaults metadata: @config.metadata,
543
+ retry_policy: @config.retry_policy
544
+
545
+ @versions_stub.call_rpc :delete_version, request, options: options do |response, operation|
546
+ response = ::Gapic::Operation.new response, @operations_client, options: options
547
+ yield response, operation if block_given?
548
+ return response
549
+ end
550
+ rescue ::GRPC::BadStatus => e
551
+ raise ::Google::Cloud::Error.from_error(e)
552
+ end
553
+
554
+ ##
555
+ # Configuration class for the Versions API.
556
+ #
557
+ # This class represents the configuration for Versions,
558
+ # providing control over timeouts, retry behavior, logging, transport
559
+ # parameters, and other low-level controls. Certain parameters can also be
560
+ # applied individually to specific RPCs. See
561
+ # {::Google::Cloud::AppEngine::V1::Versions::Client::Configuration::Rpcs}
562
+ # for a list of RPCs that can be configured independently.
563
+ #
564
+ # Configuration can be applied globally to all clients, or to a single client
565
+ # on construction.
566
+ #
567
+ # # Examples
568
+ #
569
+ # To modify the global config, setting the timeout for list_versions
570
+ # to 20 seconds, and all remaining timeouts to 10 seconds:
571
+ #
572
+ # ::Google::Cloud::AppEngine::V1::Versions::Client.configure do |config|
573
+ # config.timeout = 10.0
574
+ # config.rpcs.list_versions.timeout = 20.0
575
+ # end
576
+ #
577
+ # To apply the above configuration only to a new client:
578
+ #
579
+ # client = ::Google::Cloud::AppEngine::V1::Versions::Client.new do |config|
580
+ # config.timeout = 10.0
581
+ # config.rpcs.list_versions.timeout = 20.0
582
+ # end
583
+ #
584
+ # @!attribute [rw] endpoint
585
+ # The hostname or hostname:port of the service endpoint.
586
+ # Defaults to `"appengine.googleapis.com"`.
587
+ # @return [::String]
588
+ # @!attribute [rw] credentials
589
+ # Credentials to send with calls. You may provide any of the following types:
590
+ # * (`String`) The path to a service account key file in JSON format
591
+ # * (`Hash`) A service account key as a Hash
592
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
593
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
594
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
595
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
596
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
597
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
598
+ # * (`nil`) indicating no credentials
599
+ # @return [::Object]
600
+ # @!attribute [rw] scope
601
+ # The OAuth scopes
602
+ # @return [::Array<::String>]
603
+ # @!attribute [rw] lib_name
604
+ # The library name as recorded in instrumentation and logging
605
+ # @return [::String]
606
+ # @!attribute [rw] lib_version
607
+ # The library version as recorded in instrumentation and logging
608
+ # @return [::String]
609
+ # @!attribute [rw] channel_args
610
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
611
+ # `GRPC::Core::Channel` object is provided as the credential.
612
+ # @return [::Hash]
613
+ # @!attribute [rw] interceptors
614
+ # An array of interceptors that are run before calls are executed.
615
+ # @return [::Array<::GRPC::ClientInterceptor>]
616
+ # @!attribute [rw] timeout
617
+ # The call timeout in seconds.
618
+ # @return [::Numeric]
619
+ # @!attribute [rw] metadata
620
+ # Additional gRPC headers to be sent with the call.
621
+ # @return [::Hash{::Symbol=>::String}]
622
+ # @!attribute [rw] retry_policy
623
+ # The retry policy. The value is a hash with the following keys:
624
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
625
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
626
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
627
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
628
+ # trigger a retry.
629
+ # @return [::Hash]
630
+ # @!attribute [rw] quota_project
631
+ # A separate project against which to charge quota.
632
+ # @return [::String]
633
+ #
634
+ class Configuration
635
+ extend ::Gapic::Config
636
+
637
+ config_attr :endpoint, "appengine.googleapis.com", ::String
638
+ config_attr :credentials, nil do |value|
639
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
640
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
641
+ allowed.any? { |klass| klass === value }
642
+ end
643
+ config_attr :scope, nil, ::String, ::Array, nil
644
+ config_attr :lib_name, nil, ::String, nil
645
+ config_attr :lib_version, nil, ::String, nil
646
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
647
+ config_attr :interceptors, nil, ::Array, nil
648
+ config_attr :timeout, nil, ::Numeric, nil
649
+ config_attr :metadata, nil, ::Hash, nil
650
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
651
+ config_attr :quota_project, nil, ::String, nil
652
+
653
+ # @private
654
+ def initialize parent_config = nil
655
+ @parent_config = parent_config unless parent_config.nil?
656
+
657
+ yield self if block_given?
658
+ end
659
+
660
+ ##
661
+ # Configurations for individual RPCs
662
+ # @return [Rpcs]
663
+ #
664
+ def rpcs
665
+ @rpcs ||= begin
666
+ parent_rpcs = nil
667
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config&.respond_to?(:rpcs)
668
+ Rpcs.new parent_rpcs
669
+ end
670
+ end
671
+
672
+ ##
673
+ # Configuration RPC class for the Versions API.
674
+ #
675
+ # Includes fields providing the configuration for each RPC in this service.
676
+ # Each configuration object is of type `Gapic::Config::Method` and includes
677
+ # the following configuration fields:
678
+ #
679
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
680
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
681
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
682
+ # include the following keys:
683
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
684
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
685
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
686
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
687
+ # trigger a retry.
688
+ #
689
+ class Rpcs
690
+ ##
691
+ # RPC-specific configuration for `list_versions`
692
+ # @return [::Gapic::Config::Method]
693
+ #
694
+ attr_reader :list_versions
695
+ ##
696
+ # RPC-specific configuration for `get_version`
697
+ # @return [::Gapic::Config::Method]
698
+ #
699
+ attr_reader :get_version
700
+ ##
701
+ # RPC-specific configuration for `create_version`
702
+ # @return [::Gapic::Config::Method]
703
+ #
704
+ attr_reader :create_version
705
+ ##
706
+ # RPC-specific configuration for `update_version`
707
+ # @return [::Gapic::Config::Method]
708
+ #
709
+ attr_reader :update_version
710
+ ##
711
+ # RPC-specific configuration for `delete_version`
712
+ # @return [::Gapic::Config::Method]
713
+ #
714
+ attr_reader :delete_version
715
+
716
+ # @private
717
+ def initialize parent_rpcs = nil
718
+ list_versions_config = parent_rpcs&.list_versions if parent_rpcs&.respond_to? :list_versions
719
+ @list_versions = ::Gapic::Config::Method.new list_versions_config
720
+ get_version_config = parent_rpcs&.get_version if parent_rpcs&.respond_to? :get_version
721
+ @get_version = ::Gapic::Config::Method.new get_version_config
722
+ create_version_config = parent_rpcs&.create_version if parent_rpcs&.respond_to? :create_version
723
+ @create_version = ::Gapic::Config::Method.new create_version_config
724
+ update_version_config = parent_rpcs&.update_version if parent_rpcs&.respond_to? :update_version
725
+ @update_version = ::Gapic::Config::Method.new update_version_config
726
+ delete_version_config = parent_rpcs&.delete_version if parent_rpcs&.respond_to? :delete_version
727
+ @delete_version = ::Gapic::Config::Method.new delete_version_config
728
+
729
+ yield self if block_given?
730
+ end
731
+ end
732
+ end
733
+ end
734
+ end
735
+ end
736
+ end
737
+ end
738
+ end