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,57 @@
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/firewall/credentials"
26
+ require "google/cloud/app_engine/v1/firewall/client"
27
+
28
+ module Google
29
+ module Cloud
30
+ module AppEngine
31
+ module V1
32
+ ##
33
+ # Firewall resources are used to define a collection of access control rules
34
+ # for an Application. Each rule is defined with a position which specifies
35
+ # the rule's order in the sequence of rules, an IP range to be matched against
36
+ # requests, and an action to take upon matching requests.
37
+ #
38
+ # Every request is evaluated against the Firewall rules in priority order.
39
+ # Processesing stops at the first rule which matches the request's IP address.
40
+ # A final rule always specifies an action that applies to all remaining
41
+ # IP addresses. The default final rule for a newly-created application will be
42
+ # set to "allow" if not otherwise specified by the user.
43
+ #
44
+ # To load this service and instantiate a client:
45
+ #
46
+ # require "google/cloud/app_engine/v1/firewall"
47
+ # client = ::Google::Cloud::AppEngine::V1::Firewall::Client.new
48
+ #
49
+ module Firewall
50
+ end
51
+ end
52
+ end
53
+ end
54
+ end
55
+
56
+ helper_path = ::File.join __dir__, "firewall", "helpers.rb"
57
+ require "google/cloud/app_engine/v1/firewall/helpers" if ::File.file? helper_path
@@ -0,0 +1,783 @@
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 Firewall
27
+ ##
28
+ # Client for the Firewall service.
29
+ #
30
+ # Firewall resources are used to define a collection of access control rules
31
+ # for an Application. Each rule is defined with a position which specifies
32
+ # the rule's order in the sequence of rules, an IP range to be matched against
33
+ # requests, and an action to take upon matching requests.
34
+ #
35
+ # Every request is evaluated against the Firewall rules in priority order.
36
+ # Processesing stops at the first rule which matches the request's IP address.
37
+ # A final rule always specifies an action that applies to all remaining
38
+ # IP addresses. The default final rule for a newly-created application will be
39
+ # set to "allow" if not otherwise specified by the user.
40
+ #
41
+ class Client
42
+ # @private
43
+ attr_reader :firewall_stub
44
+
45
+ ##
46
+ # Configure the Firewall Client class.
47
+ #
48
+ # See {::Google::Cloud::AppEngine::V1::Firewall::Client::Configuration}
49
+ # for a description of the configuration fields.
50
+ #
51
+ # ## Example
52
+ #
53
+ # To modify the configuration for all Firewall clients:
54
+ #
55
+ # ::Google::Cloud::AppEngine::V1::Firewall::Client.configure do |config|
56
+ # config.timeout = 10.0
57
+ # end
58
+ #
59
+ # @yield [config] Configure the Client client.
60
+ # @yieldparam config [Client::Configuration]
61
+ #
62
+ # @return [Client::Configuration]
63
+ #
64
+ def self.configure
65
+ @configure ||= begin
66
+ namespace = ["Google", "Cloud", "AppEngine", "V1"]
67
+ parent_config = while namespace.any?
68
+ parent_name = namespace.join "::"
69
+ parent_const = const_get parent_name
70
+ break parent_const.configure if parent_const&.respond_to? :configure
71
+ namespace.pop
72
+ end
73
+ default_config = Client::Configuration.new parent_config
74
+
75
+ default_config
76
+ end
77
+ yield @configure if block_given?
78
+ @configure
79
+ end
80
+
81
+ ##
82
+ # Configure the Firewall Client instance.
83
+ #
84
+ # The configuration is set to the derived mode, meaning that values can be changed,
85
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
86
+ # should be made on {Client.configure}.
87
+ #
88
+ # See {::Google::Cloud::AppEngine::V1::Firewall::Client::Configuration}
89
+ # for a description of the configuration fields.
90
+ #
91
+ # @yield [config] Configure the Client client.
92
+ # @yieldparam config [Client::Configuration]
93
+ #
94
+ # @return [Client::Configuration]
95
+ #
96
+ def configure
97
+ yield @config if block_given?
98
+ @config
99
+ end
100
+
101
+ ##
102
+ # Create a new Firewall client object.
103
+ #
104
+ # ## Examples
105
+ #
106
+ # To create a new Firewall client with the default
107
+ # configuration:
108
+ #
109
+ # client = ::Google::Cloud::AppEngine::V1::Firewall::Client.new
110
+ #
111
+ # To create a new Firewall client with a custom
112
+ # configuration:
113
+ #
114
+ # client = ::Google::Cloud::AppEngine::V1::Firewall::Client.new do |config|
115
+ # config.timeout = 10.0
116
+ # end
117
+ #
118
+ # @yield [config] Configure the Firewall client.
119
+ # @yieldparam config [Client::Configuration]
120
+ #
121
+ def initialize
122
+ # These require statements are intentionally placed here to initialize
123
+ # the gRPC module only when it's required.
124
+ # See https://github.com/googleapis/toolkit/issues/446
125
+ require "gapic/grpc"
126
+ require "google/appengine/v1/appengine_services_pb"
127
+
128
+ # Create the configuration object
129
+ @config = Configuration.new Client.configure
130
+
131
+ # Yield the configuration if needed
132
+ yield @config if block_given?
133
+
134
+ # Create credentials
135
+ credentials = @config.credentials
136
+ # Use self-signed JWT if the scope and endpoint are unchanged from default,
137
+ # but only if the default endpoint does not have a region prefix.
138
+ enable_self_signed_jwt = @config.scope == Client.configure.scope &&
139
+ @config.endpoint == Client.configure.endpoint &&
140
+ !@config.endpoint.split(".").first.include?("-")
141
+ credentials ||= Credentials.default scope: @config.scope,
142
+ enable_self_signed_jwt: enable_self_signed_jwt
143
+ if credentials.is_a?(String) || credentials.is_a?(Hash)
144
+ credentials = Credentials.new credentials, scope: @config.scope
145
+ end
146
+ @quota_project_id = @config.quota_project
147
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
148
+
149
+ @firewall_stub = ::Gapic::ServiceStub.new(
150
+ ::Google::Cloud::AppEngine::V1::Firewall::Stub,
151
+ credentials: credentials,
152
+ endpoint: @config.endpoint,
153
+ channel_args: @config.channel_args,
154
+ interceptors: @config.interceptors
155
+ )
156
+ end
157
+
158
+ # Service calls
159
+
160
+ ##
161
+ # Lists the firewall rules of an application.
162
+ #
163
+ # @overload list_ingress_rules(request, options = nil)
164
+ # Pass arguments to `list_ingress_rules` via a request object, either of type
165
+ # {::Google::Cloud::AppEngine::V1::ListIngressRulesRequest} or an equivalent Hash.
166
+ #
167
+ # @param request [::Google::Cloud::AppEngine::V1::ListIngressRulesRequest, ::Hash]
168
+ # A request object representing the call parameters. Required. To specify no
169
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
170
+ # @param options [::Gapic::CallOptions, ::Hash]
171
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
172
+ #
173
+ # @overload list_ingress_rules(parent: nil, page_size: nil, page_token: nil, matching_address: nil)
174
+ # Pass arguments to `list_ingress_rules` via keyword arguments. Note that at
175
+ # least one keyword argument is required. To specify no parameters, or to keep all
176
+ # the default parameter values, pass an empty Hash as a request object (see above).
177
+ #
178
+ # @param parent [::String]
179
+ # Name of the Firewall collection to retrieve.
180
+ # Example: `apps/myapp/firewall/ingressRules`.
181
+ # @param page_size [::Integer]
182
+ # Maximum results to return per page.
183
+ # @param page_token [::String]
184
+ # Continuation token for fetching the next page of results.
185
+ # @param matching_address [::String]
186
+ # A valid IP Address. If set, only rules matching this address will be
187
+ # returned. The first returned rule will be the rule that fires on requests
188
+ # from this IP.
189
+ #
190
+ # @yield [response, operation] Access the result along with the RPC operation
191
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AppEngine::V1::FirewallRule>]
192
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
193
+ #
194
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::AppEngine::V1::FirewallRule>]
195
+ #
196
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
197
+ #
198
+ def list_ingress_rules request, options = nil
199
+ raise ::ArgumentError, "request must be provided" if request.nil?
200
+
201
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AppEngine::V1::ListIngressRulesRequest
202
+
203
+ # Converts hash and nil to an options object
204
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
205
+
206
+ # Customize the options with defaults
207
+ metadata = @config.rpcs.list_ingress_rules.metadata.to_h
208
+
209
+ # Set x-goog-api-client and x-goog-user-project headers
210
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
211
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
212
+ gapic_version: ::Google::Cloud::AppEngine::V1::VERSION
213
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
214
+
215
+ header_params = {
216
+ "parent" => request.parent
217
+ }
218
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
219
+ metadata[:"x-goog-request-params"] ||= request_params_header
220
+
221
+ options.apply_defaults timeout: @config.rpcs.list_ingress_rules.timeout,
222
+ metadata: metadata,
223
+ retry_policy: @config.rpcs.list_ingress_rules.retry_policy
224
+ options.apply_defaults metadata: @config.metadata,
225
+ retry_policy: @config.retry_policy
226
+
227
+ @firewall_stub.call_rpc :list_ingress_rules, request, options: options do |response, operation|
228
+ response = ::Gapic::PagedEnumerable.new @firewall_stub, :list_ingress_rules, request, response, operation, options
229
+ yield response, operation if block_given?
230
+ return response
231
+ end
232
+ rescue ::GRPC::BadStatus => e
233
+ raise ::Google::Cloud::Error.from_error(e)
234
+ end
235
+
236
+ ##
237
+ # Replaces the entire firewall ruleset in one bulk operation. This overrides
238
+ # and replaces the rules of an existing firewall with the new rules.
239
+ #
240
+ # If the final rule does not match traffic with the '*' wildcard IP range,
241
+ # then an "allow all" rule is explicitly added to the end of the list.
242
+ #
243
+ # @overload batch_update_ingress_rules(request, options = nil)
244
+ # Pass arguments to `batch_update_ingress_rules` via a request object, either of type
245
+ # {::Google::Cloud::AppEngine::V1::BatchUpdateIngressRulesRequest} or an equivalent Hash.
246
+ #
247
+ # @param request [::Google::Cloud::AppEngine::V1::BatchUpdateIngressRulesRequest, ::Hash]
248
+ # A request object representing the call parameters. Required. To specify no
249
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
250
+ # @param options [::Gapic::CallOptions, ::Hash]
251
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
252
+ #
253
+ # @overload batch_update_ingress_rules(name: nil, ingress_rules: nil)
254
+ # Pass arguments to `batch_update_ingress_rules` via keyword arguments. Note that at
255
+ # least one keyword argument is required. To specify no parameters, or to keep all
256
+ # the default parameter values, pass an empty Hash as a request object (see above).
257
+ #
258
+ # @param name [::String]
259
+ # Name of the Firewall collection to set.
260
+ # Example: `apps/myapp/firewall/ingressRules`.
261
+ # @param ingress_rules [::Array<::Google::Cloud::AppEngine::V1::FirewallRule, ::Hash>]
262
+ # A list of FirewallRules to replace the existing set.
263
+ #
264
+ # @yield [response, operation] Access the result along with the RPC operation
265
+ # @yieldparam response [::Google::Cloud::AppEngine::V1::BatchUpdateIngressRulesResponse]
266
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
267
+ #
268
+ # @return [::Google::Cloud::AppEngine::V1::BatchUpdateIngressRulesResponse]
269
+ #
270
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
271
+ #
272
+ def batch_update_ingress_rules request, options = nil
273
+ raise ::ArgumentError, "request must be provided" if request.nil?
274
+
275
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AppEngine::V1::BatchUpdateIngressRulesRequest
276
+
277
+ # Converts hash and nil to an options object
278
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
279
+
280
+ # Customize the options with defaults
281
+ metadata = @config.rpcs.batch_update_ingress_rules.metadata.to_h
282
+
283
+ # Set x-goog-api-client and x-goog-user-project headers
284
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
285
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
286
+ gapic_version: ::Google::Cloud::AppEngine::V1::VERSION
287
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
288
+
289
+ header_params = {
290
+ "name" => request.name
291
+ }
292
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
293
+ metadata[:"x-goog-request-params"] ||= request_params_header
294
+
295
+ options.apply_defaults timeout: @config.rpcs.batch_update_ingress_rules.timeout,
296
+ metadata: metadata,
297
+ retry_policy: @config.rpcs.batch_update_ingress_rules.retry_policy
298
+ options.apply_defaults metadata: @config.metadata,
299
+ retry_policy: @config.retry_policy
300
+
301
+ @firewall_stub.call_rpc :batch_update_ingress_rules, request, options: options do |response, operation|
302
+ yield response, operation if block_given?
303
+ return response
304
+ end
305
+ rescue ::GRPC::BadStatus => e
306
+ raise ::Google::Cloud::Error.from_error(e)
307
+ end
308
+
309
+ ##
310
+ # Creates a firewall rule for the application.
311
+ #
312
+ # @overload create_ingress_rule(request, options = nil)
313
+ # Pass arguments to `create_ingress_rule` via a request object, either of type
314
+ # {::Google::Cloud::AppEngine::V1::CreateIngressRuleRequest} or an equivalent Hash.
315
+ #
316
+ # @param request [::Google::Cloud::AppEngine::V1::CreateIngressRuleRequest, ::Hash]
317
+ # A request object representing the call parameters. Required. To specify no
318
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
319
+ # @param options [::Gapic::CallOptions, ::Hash]
320
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
321
+ #
322
+ # @overload create_ingress_rule(parent: nil, rule: nil)
323
+ # Pass arguments to `create_ingress_rule` via keyword arguments. Note that at
324
+ # least one keyword argument is required. To specify no parameters, or to keep all
325
+ # the default parameter values, pass an empty Hash as a request object (see above).
326
+ #
327
+ # @param parent [::String]
328
+ # Name of the parent Firewall collection in which to create a new rule.
329
+ # Example: `apps/myapp/firewall/ingressRules`.
330
+ # @param rule [::Google::Cloud::AppEngine::V1::FirewallRule, ::Hash]
331
+ # A FirewallRule containing the new resource.
332
+ #
333
+ # The user may optionally provide a position at which the new rule will be
334
+ # placed. The positions define a sequential list starting at 1. If a rule
335
+ # already exists at the given position, rules greater than the provided
336
+ # position will be moved forward by one.
337
+ #
338
+ # If no position is provided, the server will place the rule as the second to
339
+ # last rule in the sequence before the required default allow-all or deny-all
340
+ # rule.
341
+ #
342
+ # @yield [response, operation] Access the result along with the RPC operation
343
+ # @yieldparam response [::Google::Cloud::AppEngine::V1::FirewallRule]
344
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
345
+ #
346
+ # @return [::Google::Cloud::AppEngine::V1::FirewallRule]
347
+ #
348
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
349
+ #
350
+ def create_ingress_rule request, options = nil
351
+ raise ::ArgumentError, "request must be provided" if request.nil?
352
+
353
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AppEngine::V1::CreateIngressRuleRequest
354
+
355
+ # Converts hash and nil to an options object
356
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
357
+
358
+ # Customize the options with defaults
359
+ metadata = @config.rpcs.create_ingress_rule.metadata.to_h
360
+
361
+ # Set x-goog-api-client and x-goog-user-project headers
362
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
363
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
364
+ gapic_version: ::Google::Cloud::AppEngine::V1::VERSION
365
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
366
+
367
+ header_params = {
368
+ "parent" => request.parent
369
+ }
370
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
371
+ metadata[:"x-goog-request-params"] ||= request_params_header
372
+
373
+ options.apply_defaults timeout: @config.rpcs.create_ingress_rule.timeout,
374
+ metadata: metadata,
375
+ retry_policy: @config.rpcs.create_ingress_rule.retry_policy
376
+ options.apply_defaults metadata: @config.metadata,
377
+ retry_policy: @config.retry_policy
378
+
379
+ @firewall_stub.call_rpc :create_ingress_rule, request, options: options do |response, operation|
380
+ yield response, operation if block_given?
381
+ return response
382
+ end
383
+ rescue ::GRPC::BadStatus => e
384
+ raise ::Google::Cloud::Error.from_error(e)
385
+ end
386
+
387
+ ##
388
+ # Gets the specified firewall rule.
389
+ #
390
+ # @overload get_ingress_rule(request, options = nil)
391
+ # Pass arguments to `get_ingress_rule` via a request object, either of type
392
+ # {::Google::Cloud::AppEngine::V1::GetIngressRuleRequest} or an equivalent Hash.
393
+ #
394
+ # @param request [::Google::Cloud::AppEngine::V1::GetIngressRuleRequest, ::Hash]
395
+ # A request object representing the call parameters. Required. To specify no
396
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
397
+ # @param options [::Gapic::CallOptions, ::Hash]
398
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
399
+ #
400
+ # @overload get_ingress_rule(name: nil)
401
+ # Pass arguments to `get_ingress_rule` via keyword arguments. Note that at
402
+ # least one keyword argument is required. To specify no parameters, or to keep all
403
+ # the default parameter values, pass an empty Hash as a request object (see above).
404
+ #
405
+ # @param name [::String]
406
+ # Name of the Firewall resource to retrieve.
407
+ # Example: `apps/myapp/firewall/ingressRules/100`.
408
+ #
409
+ # @yield [response, operation] Access the result along with the RPC operation
410
+ # @yieldparam response [::Google::Cloud::AppEngine::V1::FirewallRule]
411
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
412
+ #
413
+ # @return [::Google::Cloud::AppEngine::V1::FirewallRule]
414
+ #
415
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
416
+ #
417
+ def get_ingress_rule request, options = nil
418
+ raise ::ArgumentError, "request must be provided" if request.nil?
419
+
420
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AppEngine::V1::GetIngressRuleRequest
421
+
422
+ # Converts hash and nil to an options object
423
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
424
+
425
+ # Customize the options with defaults
426
+ metadata = @config.rpcs.get_ingress_rule.metadata.to_h
427
+
428
+ # Set x-goog-api-client and x-goog-user-project headers
429
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
430
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
431
+ gapic_version: ::Google::Cloud::AppEngine::V1::VERSION
432
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
433
+
434
+ header_params = {
435
+ "name" => request.name
436
+ }
437
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
438
+ metadata[:"x-goog-request-params"] ||= request_params_header
439
+
440
+ options.apply_defaults timeout: @config.rpcs.get_ingress_rule.timeout,
441
+ metadata: metadata,
442
+ retry_policy: @config.rpcs.get_ingress_rule.retry_policy
443
+ options.apply_defaults metadata: @config.metadata,
444
+ retry_policy: @config.retry_policy
445
+
446
+ @firewall_stub.call_rpc :get_ingress_rule, request, options: options do |response, operation|
447
+ yield response, operation if block_given?
448
+ return response
449
+ end
450
+ rescue ::GRPC::BadStatus => e
451
+ raise ::Google::Cloud::Error.from_error(e)
452
+ end
453
+
454
+ ##
455
+ # Updates the specified firewall rule.
456
+ #
457
+ # @overload update_ingress_rule(request, options = nil)
458
+ # Pass arguments to `update_ingress_rule` via a request object, either of type
459
+ # {::Google::Cloud::AppEngine::V1::UpdateIngressRuleRequest} or an equivalent Hash.
460
+ #
461
+ # @param request [::Google::Cloud::AppEngine::V1::UpdateIngressRuleRequest, ::Hash]
462
+ # A request object representing the call parameters. Required. To specify no
463
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
464
+ # @param options [::Gapic::CallOptions, ::Hash]
465
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
466
+ #
467
+ # @overload update_ingress_rule(name: nil, rule: nil, update_mask: nil)
468
+ # Pass arguments to `update_ingress_rule` via keyword arguments. Note that at
469
+ # least one keyword argument is required. To specify no parameters, or to keep all
470
+ # the default parameter values, pass an empty Hash as a request object (see above).
471
+ #
472
+ # @param name [::String]
473
+ # Name of the Firewall resource to update.
474
+ # Example: `apps/myapp/firewall/ingressRules/100`.
475
+ # @param rule [::Google::Cloud::AppEngine::V1::FirewallRule, ::Hash]
476
+ # A FirewallRule containing the updated resource
477
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
478
+ # Standard field mask for the set of fields to be updated.
479
+ #
480
+ # @yield [response, operation] Access the result along with the RPC operation
481
+ # @yieldparam response [::Google::Cloud::AppEngine::V1::FirewallRule]
482
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
483
+ #
484
+ # @return [::Google::Cloud::AppEngine::V1::FirewallRule]
485
+ #
486
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
487
+ #
488
+ def update_ingress_rule request, options = nil
489
+ raise ::ArgumentError, "request must be provided" if request.nil?
490
+
491
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AppEngine::V1::UpdateIngressRuleRequest
492
+
493
+ # Converts hash and nil to an options object
494
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
495
+
496
+ # Customize the options with defaults
497
+ metadata = @config.rpcs.update_ingress_rule.metadata.to_h
498
+
499
+ # Set x-goog-api-client and x-goog-user-project headers
500
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
501
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
502
+ gapic_version: ::Google::Cloud::AppEngine::V1::VERSION
503
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
504
+
505
+ header_params = {
506
+ "name" => request.name
507
+ }
508
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
509
+ metadata[:"x-goog-request-params"] ||= request_params_header
510
+
511
+ options.apply_defaults timeout: @config.rpcs.update_ingress_rule.timeout,
512
+ metadata: metadata,
513
+ retry_policy: @config.rpcs.update_ingress_rule.retry_policy
514
+ options.apply_defaults metadata: @config.metadata,
515
+ retry_policy: @config.retry_policy
516
+
517
+ @firewall_stub.call_rpc :update_ingress_rule, request, options: options do |response, operation|
518
+ yield response, operation if block_given?
519
+ return response
520
+ end
521
+ rescue ::GRPC::BadStatus => e
522
+ raise ::Google::Cloud::Error.from_error(e)
523
+ end
524
+
525
+ ##
526
+ # Deletes the specified firewall rule.
527
+ #
528
+ # @overload delete_ingress_rule(request, options = nil)
529
+ # Pass arguments to `delete_ingress_rule` via a request object, either of type
530
+ # {::Google::Cloud::AppEngine::V1::DeleteIngressRuleRequest} or an equivalent Hash.
531
+ #
532
+ # @param request [::Google::Cloud::AppEngine::V1::DeleteIngressRuleRequest, ::Hash]
533
+ # A request object representing the call parameters. Required. To specify no
534
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
535
+ # @param options [::Gapic::CallOptions, ::Hash]
536
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
537
+ #
538
+ # @overload delete_ingress_rule(name: nil)
539
+ # Pass arguments to `delete_ingress_rule` via keyword arguments. Note that at
540
+ # least one keyword argument is required. To specify no parameters, or to keep all
541
+ # the default parameter values, pass an empty Hash as a request object (see above).
542
+ #
543
+ # @param name [::String]
544
+ # Name of the Firewall resource to delete.
545
+ # Example: `apps/myapp/firewall/ingressRules/100`.
546
+ #
547
+ # @yield [response, operation] Access the result along with the RPC operation
548
+ # @yieldparam response [::Google::Protobuf::Empty]
549
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
550
+ #
551
+ # @return [::Google::Protobuf::Empty]
552
+ #
553
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
554
+ #
555
+ def delete_ingress_rule request, options = nil
556
+ raise ::ArgumentError, "request must be provided" if request.nil?
557
+
558
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AppEngine::V1::DeleteIngressRuleRequest
559
+
560
+ # Converts hash and nil to an options object
561
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
562
+
563
+ # Customize the options with defaults
564
+ metadata = @config.rpcs.delete_ingress_rule.metadata.to_h
565
+
566
+ # Set x-goog-api-client and x-goog-user-project headers
567
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
568
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
569
+ gapic_version: ::Google::Cloud::AppEngine::V1::VERSION
570
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
571
+
572
+ header_params = {
573
+ "name" => request.name
574
+ }
575
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
576
+ metadata[:"x-goog-request-params"] ||= request_params_header
577
+
578
+ options.apply_defaults timeout: @config.rpcs.delete_ingress_rule.timeout,
579
+ metadata: metadata,
580
+ retry_policy: @config.rpcs.delete_ingress_rule.retry_policy
581
+ options.apply_defaults metadata: @config.metadata,
582
+ retry_policy: @config.retry_policy
583
+
584
+ @firewall_stub.call_rpc :delete_ingress_rule, request, options: options do |response, operation|
585
+ yield response, operation if block_given?
586
+ return response
587
+ end
588
+ rescue ::GRPC::BadStatus => e
589
+ raise ::Google::Cloud::Error.from_error(e)
590
+ end
591
+
592
+ ##
593
+ # Configuration class for the Firewall API.
594
+ #
595
+ # This class represents the configuration for Firewall,
596
+ # providing control over timeouts, retry behavior, logging, transport
597
+ # parameters, and other low-level controls. Certain parameters can also be
598
+ # applied individually to specific RPCs. See
599
+ # {::Google::Cloud::AppEngine::V1::Firewall::Client::Configuration::Rpcs}
600
+ # for a list of RPCs that can be configured independently.
601
+ #
602
+ # Configuration can be applied globally to all clients, or to a single client
603
+ # on construction.
604
+ #
605
+ # # Examples
606
+ #
607
+ # To modify the global config, setting the timeout for list_ingress_rules
608
+ # to 20 seconds, and all remaining timeouts to 10 seconds:
609
+ #
610
+ # ::Google::Cloud::AppEngine::V1::Firewall::Client.configure do |config|
611
+ # config.timeout = 10.0
612
+ # config.rpcs.list_ingress_rules.timeout = 20.0
613
+ # end
614
+ #
615
+ # To apply the above configuration only to a new client:
616
+ #
617
+ # client = ::Google::Cloud::AppEngine::V1::Firewall::Client.new do |config|
618
+ # config.timeout = 10.0
619
+ # config.rpcs.list_ingress_rules.timeout = 20.0
620
+ # end
621
+ #
622
+ # @!attribute [rw] endpoint
623
+ # The hostname or hostname:port of the service endpoint.
624
+ # Defaults to `"appengine.googleapis.com"`.
625
+ # @return [::String]
626
+ # @!attribute [rw] credentials
627
+ # Credentials to send with calls. You may provide any of the following types:
628
+ # * (`String`) The path to a service account key file in JSON format
629
+ # * (`Hash`) A service account key as a Hash
630
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
631
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
632
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
633
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
634
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
635
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
636
+ # * (`nil`) indicating no credentials
637
+ # @return [::Object]
638
+ # @!attribute [rw] scope
639
+ # The OAuth scopes
640
+ # @return [::Array<::String>]
641
+ # @!attribute [rw] lib_name
642
+ # The library name as recorded in instrumentation and logging
643
+ # @return [::String]
644
+ # @!attribute [rw] lib_version
645
+ # The library version as recorded in instrumentation and logging
646
+ # @return [::String]
647
+ # @!attribute [rw] channel_args
648
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
649
+ # `GRPC::Core::Channel` object is provided as the credential.
650
+ # @return [::Hash]
651
+ # @!attribute [rw] interceptors
652
+ # An array of interceptors that are run before calls are executed.
653
+ # @return [::Array<::GRPC::ClientInterceptor>]
654
+ # @!attribute [rw] timeout
655
+ # The call timeout in seconds.
656
+ # @return [::Numeric]
657
+ # @!attribute [rw] metadata
658
+ # Additional gRPC headers to be sent with the call.
659
+ # @return [::Hash{::Symbol=>::String}]
660
+ # @!attribute [rw] retry_policy
661
+ # The retry policy. The value is a hash with the following keys:
662
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
663
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
664
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
665
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
666
+ # trigger a retry.
667
+ # @return [::Hash]
668
+ # @!attribute [rw] quota_project
669
+ # A separate project against which to charge quota.
670
+ # @return [::String]
671
+ #
672
+ class Configuration
673
+ extend ::Gapic::Config
674
+
675
+ config_attr :endpoint, "appengine.googleapis.com", ::String
676
+ config_attr :credentials, nil do |value|
677
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
678
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
679
+ allowed.any? { |klass| klass === value }
680
+ end
681
+ config_attr :scope, nil, ::String, ::Array, nil
682
+ config_attr :lib_name, nil, ::String, nil
683
+ config_attr :lib_version, nil, ::String, nil
684
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
685
+ config_attr :interceptors, nil, ::Array, nil
686
+ config_attr :timeout, nil, ::Numeric, nil
687
+ config_attr :metadata, nil, ::Hash, nil
688
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
689
+ config_attr :quota_project, nil, ::String, nil
690
+
691
+ # @private
692
+ def initialize parent_config = nil
693
+ @parent_config = parent_config unless parent_config.nil?
694
+
695
+ yield self if block_given?
696
+ end
697
+
698
+ ##
699
+ # Configurations for individual RPCs
700
+ # @return [Rpcs]
701
+ #
702
+ def rpcs
703
+ @rpcs ||= begin
704
+ parent_rpcs = nil
705
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config&.respond_to?(:rpcs)
706
+ Rpcs.new parent_rpcs
707
+ end
708
+ end
709
+
710
+ ##
711
+ # Configuration RPC class for the Firewall API.
712
+ #
713
+ # Includes fields providing the configuration for each RPC in this service.
714
+ # Each configuration object is of type `Gapic::Config::Method` and includes
715
+ # the following configuration fields:
716
+ #
717
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
718
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
719
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
720
+ # include the following keys:
721
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
722
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
723
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
724
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
725
+ # trigger a retry.
726
+ #
727
+ class Rpcs
728
+ ##
729
+ # RPC-specific configuration for `list_ingress_rules`
730
+ # @return [::Gapic::Config::Method]
731
+ #
732
+ attr_reader :list_ingress_rules
733
+ ##
734
+ # RPC-specific configuration for `batch_update_ingress_rules`
735
+ # @return [::Gapic::Config::Method]
736
+ #
737
+ attr_reader :batch_update_ingress_rules
738
+ ##
739
+ # RPC-specific configuration for `create_ingress_rule`
740
+ # @return [::Gapic::Config::Method]
741
+ #
742
+ attr_reader :create_ingress_rule
743
+ ##
744
+ # RPC-specific configuration for `get_ingress_rule`
745
+ # @return [::Gapic::Config::Method]
746
+ #
747
+ attr_reader :get_ingress_rule
748
+ ##
749
+ # RPC-specific configuration for `update_ingress_rule`
750
+ # @return [::Gapic::Config::Method]
751
+ #
752
+ attr_reader :update_ingress_rule
753
+ ##
754
+ # RPC-specific configuration for `delete_ingress_rule`
755
+ # @return [::Gapic::Config::Method]
756
+ #
757
+ attr_reader :delete_ingress_rule
758
+
759
+ # @private
760
+ def initialize parent_rpcs = nil
761
+ list_ingress_rules_config = parent_rpcs&.list_ingress_rules if parent_rpcs&.respond_to? :list_ingress_rules
762
+ @list_ingress_rules = ::Gapic::Config::Method.new list_ingress_rules_config
763
+ batch_update_ingress_rules_config = parent_rpcs&.batch_update_ingress_rules if parent_rpcs&.respond_to? :batch_update_ingress_rules
764
+ @batch_update_ingress_rules = ::Gapic::Config::Method.new batch_update_ingress_rules_config
765
+ create_ingress_rule_config = parent_rpcs&.create_ingress_rule if parent_rpcs&.respond_to? :create_ingress_rule
766
+ @create_ingress_rule = ::Gapic::Config::Method.new create_ingress_rule_config
767
+ get_ingress_rule_config = parent_rpcs&.get_ingress_rule if parent_rpcs&.respond_to? :get_ingress_rule
768
+ @get_ingress_rule = ::Gapic::Config::Method.new get_ingress_rule_config
769
+ update_ingress_rule_config = parent_rpcs&.update_ingress_rule if parent_rpcs&.respond_to? :update_ingress_rule
770
+ @update_ingress_rule = ::Gapic::Config::Method.new update_ingress_rule_config
771
+ delete_ingress_rule_config = parent_rpcs&.delete_ingress_rule if parent_rpcs&.respond_to? :delete_ingress_rule
772
+ @delete_ingress_rule = ::Gapic::Config::Method.new delete_ingress_rule_config
773
+
774
+ yield self if block_given?
775
+ end
776
+ end
777
+ end
778
+ end
779
+ end
780
+ end
781
+ end
782
+ end
783
+ end