google-cloud-app_engine-v1 1.0.1 → 1.2.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 (43) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +31 -21
  3. data/lib/google/cloud/app_engine/v1/applications/client.rb +37 -5
  4. data/lib/google/cloud/app_engine/v1/applications/operations.rb +19 -15
  5. data/lib/google/cloud/app_engine/v1/applications/rest/client.rb +37 -5
  6. data/lib/google/cloud/app_engine/v1/applications/rest/operations.rb +50 -38
  7. data/lib/google/cloud/app_engine/v1/applications/rest/service_stub.rb +46 -26
  8. data/lib/google/cloud/app_engine/v1/authorized_certificates/client.rb +35 -6
  9. data/lib/google/cloud/app_engine/v1/authorized_certificates/rest/client.rb +35 -6
  10. data/lib/google/cloud/app_engine/v1/authorized_certificates/rest/service_stub.rb +54 -32
  11. data/lib/google/cloud/app_engine/v1/authorized_domains/client.rb +35 -2
  12. data/lib/google/cloud/app_engine/v1/authorized_domains/rest/client.rb +35 -2
  13. data/lib/google/cloud/app_engine/v1/authorized_domains/rest/service_stub.rb +22 -8
  14. data/lib/google/cloud/app_engine/v1/domain_mappings/client.rb +38 -6
  15. data/lib/google/cloud/app_engine/v1/domain_mappings/operations.rb +19 -15
  16. data/lib/google/cloud/app_engine/v1/domain_mappings/rest/client.rb +38 -6
  17. data/lib/google/cloud/app_engine/v1/domain_mappings/rest/operations.rb +50 -38
  18. data/lib/google/cloud/app_engine/v1/domain_mappings/rest/service_stub.rb +54 -32
  19. data/lib/google/cloud/app_engine/v1/firewall/client.rb +35 -7
  20. data/lib/google/cloud/app_engine/v1/firewall/rest/client.rb +35 -7
  21. data/lib/google/cloud/app_engine/v1/firewall/rest/service_stub.rb +62 -38
  22. data/lib/google/cloud/app_engine/v1/instances/client.rb +37 -5
  23. data/lib/google/cloud/app_engine/v1/instances/operations.rb +19 -15
  24. data/lib/google/cloud/app_engine/v1/instances/rest/client.rb +37 -5
  25. data/lib/google/cloud/app_engine/v1/instances/rest/operations.rb +50 -38
  26. data/lib/google/cloud/app_engine/v1/instances/rest/service_stub.rb +46 -26
  27. data/lib/google/cloud/app_engine/v1/services/client.rb +37 -5
  28. data/lib/google/cloud/app_engine/v1/services/operations.rb +19 -15
  29. data/lib/google/cloud/app_engine/v1/services/rest/client.rb +37 -5
  30. data/lib/google/cloud/app_engine/v1/services/rest/operations.rb +50 -38
  31. data/lib/google/cloud/app_engine/v1/services/rest/service_stub.rb +46 -26
  32. data/lib/google/cloud/app_engine/v1/version.rb +1 -1
  33. data/lib/google/cloud/app_engine/v1/versions/client.rb +38 -6
  34. data/lib/google/cloud/app_engine/v1/versions/operations.rb +19 -15
  35. data/lib/google/cloud/app_engine/v1/versions/rest/client.rb +38 -6
  36. data/lib/google/cloud/app_engine/v1/versions/rest/operations.rb +50 -38
  37. data/lib/google/cloud/app_engine/v1/versions/rest/service_stub.rb +54 -32
  38. data/proto_docs/google/api/client.rb +39 -0
  39. data/proto_docs/google/appengine/v1/app_yaml.rb +6 -0
  40. data/proto_docs/google/appengine/v1/audit_data.rb +4 -0
  41. data/proto_docs/google/appengine/v1/version.rb +6 -0
  42. data/proto_docs/google/longrunning/operations.rb +23 -14
  43. metadata +6 -9
@@ -30,7 +30,8 @@ module Google
30
30
  # including transcoding, making the REST call, and deserialing the response.
31
31
  #
32
32
  class ServiceStub
33
- def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
33
+ # @private
34
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger:
34
35
  # These require statements are intentionally placed here to initialize
35
36
  # the REST modules only when it's required.
36
37
  require "gapic/rest"
@@ -40,7 +41,9 @@ module Google
40
41
  universe_domain: universe_domain,
41
42
  credentials: credentials,
42
43
  numeric_enums: true,
43
- raise_faraday_errors: false
44
+ service_name: self.class,
45
+ raise_faraday_errors: false,
46
+ logger: logger
44
47
  end
45
48
 
46
49
  ##
@@ -61,6 +64,15 @@ module Google
61
64
  @client_stub.endpoint
62
65
  end
63
66
 
67
+ ##
68
+ # The logger used for request/response debug logging.
69
+ #
70
+ # @return [Logger]
71
+ #
72
+ def logger stub: false
73
+ stub ? @client_stub.stub_logger : @client_stub.logger
74
+ end
75
+
64
76
  ##
65
77
  # Baseline implementation for the list_domain_mappings REST call
66
78
  #
@@ -87,16 +99,18 @@ module Google
87
99
 
88
100
  response = @client_stub.make_http_request(
89
101
  verb,
90
- uri: uri,
91
- body: body || "",
92
- params: query_string_params,
102
+ uri: uri,
103
+ body: body || "",
104
+ params: query_string_params,
105
+ method_name: "list_domain_mappings",
93
106
  options: options
94
107
  )
95
108
  operation = ::Gapic::Rest::TransportOperation.new response
96
109
  result = ::Google::Cloud::AppEngine::V1::ListDomainMappingsResponse.decode_json response.body, ignore_unknown_fields: true
97
-
98
- yield result, operation if block_given?
99
- result
110
+ catch :response do
111
+ yield result, operation if block_given?
112
+ result
113
+ end
100
114
  end
101
115
 
102
116
  ##
@@ -125,16 +139,18 @@ module Google
125
139
 
126
140
  response = @client_stub.make_http_request(
127
141
  verb,
128
- uri: uri,
129
- body: body || "",
130
- params: query_string_params,
142
+ uri: uri,
143
+ body: body || "",
144
+ params: query_string_params,
145
+ method_name: "get_domain_mapping",
131
146
  options: options
132
147
  )
133
148
  operation = ::Gapic::Rest::TransportOperation.new response
134
149
  result = ::Google::Cloud::AppEngine::V1::DomainMapping.decode_json response.body, ignore_unknown_fields: true
135
-
136
- yield result, operation if block_given?
137
- result
150
+ catch :response do
151
+ yield result, operation if block_given?
152
+ result
153
+ end
138
154
  end
139
155
 
140
156
  ##
@@ -163,16 +179,18 @@ module Google
163
179
 
164
180
  response = @client_stub.make_http_request(
165
181
  verb,
166
- uri: uri,
167
- body: body || "",
168
- params: query_string_params,
182
+ uri: uri,
183
+ body: body || "",
184
+ params: query_string_params,
185
+ method_name: "create_domain_mapping",
169
186
  options: options
170
187
  )
171
188
  operation = ::Gapic::Rest::TransportOperation.new response
172
189
  result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
173
-
174
- yield result, operation if block_given?
175
- result
190
+ catch :response do
191
+ yield result, operation if block_given?
192
+ result
193
+ end
176
194
  end
177
195
 
178
196
  ##
@@ -201,16 +219,18 @@ module Google
201
219
 
202
220
  response = @client_stub.make_http_request(
203
221
  verb,
204
- uri: uri,
205
- body: body || "",
206
- params: query_string_params,
222
+ uri: uri,
223
+ body: body || "",
224
+ params: query_string_params,
225
+ method_name: "update_domain_mapping",
207
226
  options: options
208
227
  )
209
228
  operation = ::Gapic::Rest::TransportOperation.new response
210
229
  result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
211
-
212
- yield result, operation if block_given?
213
- result
230
+ catch :response do
231
+ yield result, operation if block_given?
232
+ result
233
+ end
214
234
  end
215
235
 
216
236
  ##
@@ -239,16 +259,18 @@ module Google
239
259
 
240
260
  response = @client_stub.make_http_request(
241
261
  verb,
242
- uri: uri,
243
- body: body || "",
244
- params: query_string_params,
262
+ uri: uri,
263
+ body: body || "",
264
+ params: query_string_params,
265
+ method_name: "delete_domain_mapping",
245
266
  options: options
246
267
  )
247
268
  operation = ::Gapic::Rest::TransportOperation.new response
248
269
  result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
249
-
250
- yield result, operation if block_given?
251
- result
270
+ catch :response do
271
+ yield result, operation if block_given?
272
+ result
273
+ end
252
274
  end
253
275
 
254
276
  ##
@@ -164,8 +164,28 @@ module Google
164
164
  universe_domain: @config.universe_domain,
165
165
  channel_args: @config.channel_args,
166
166
  interceptors: @config.interceptors,
167
- channel_pool_config: @config.channel_pool
167
+ channel_pool_config: @config.channel_pool,
168
+ logger: @config.logger
168
169
  )
170
+
171
+ @firewall_stub.stub_logger&.info do |entry|
172
+ entry.set_system_name
173
+ entry.set_service
174
+ entry.message = "Created client for #{entry.service}"
175
+ entry.set_credentials_fields credentials
176
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
177
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
178
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
179
+ end
180
+ end
181
+
182
+ ##
183
+ # The logger used for request/response debug logging.
184
+ #
185
+ # @return [Logger]
186
+ #
187
+ def logger
188
+ @firewall_stub.logger
169
189
  end
170
190
 
171
191
  # Service calls
@@ -264,7 +284,7 @@ module Google
264
284
  @firewall_stub.call_rpc :list_ingress_rules, request, options: options do |response, operation|
265
285
  response = ::Gapic::PagedEnumerable.new @firewall_stub, :list_ingress_rules, request, response, operation, options
266
286
  yield response, operation if block_given?
267
- return response
287
+ throw :response, response
268
288
  end
269
289
  rescue ::GRPC::BadStatus => e
270
290
  raise ::Google::Cloud::Error.from_error(e)
@@ -357,7 +377,6 @@ module Google
357
377
 
358
378
  @firewall_stub.call_rpc :batch_update_ingress_rules, request, options: options do |response, operation|
359
379
  yield response, operation if block_given?
360
- return response
361
380
  end
362
381
  rescue ::GRPC::BadStatus => e
363
382
  raise ::Google::Cloud::Error.from_error(e)
@@ -455,7 +474,6 @@ module Google
455
474
 
456
475
  @firewall_stub.call_rpc :create_ingress_rule, request, options: options do |response, operation|
457
476
  yield response, operation if block_given?
458
- return response
459
477
  end
460
478
  rescue ::GRPC::BadStatus => e
461
479
  raise ::Google::Cloud::Error.from_error(e)
@@ -542,7 +560,6 @@ module Google
542
560
 
543
561
  @firewall_stub.call_rpc :get_ingress_rule, request, options: options do |response, operation|
544
562
  yield response, operation if block_given?
545
- return response
546
563
  end
547
564
  rescue ::GRPC::BadStatus => e
548
565
  raise ::Google::Cloud::Error.from_error(e)
@@ -633,7 +650,6 @@ module Google
633
650
 
634
651
  @firewall_stub.call_rpc :update_ingress_rule, request, options: options do |response, operation|
635
652
  yield response, operation if block_given?
636
- return response
637
653
  end
638
654
  rescue ::GRPC::BadStatus => e
639
655
  raise ::Google::Cloud::Error.from_error(e)
@@ -720,7 +736,6 @@ module Google
720
736
 
721
737
  @firewall_stub.call_rpc :delete_ingress_rule, request, options: options do |response, operation|
722
738
  yield response, operation if block_given?
723
- return response
724
739
  end
725
740
  rescue ::GRPC::BadStatus => e
726
741
  raise ::Google::Cloud::Error.from_error(e)
@@ -770,6 +785,13 @@ module Google
770
785
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
771
786
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
772
787
  # * (`nil`) indicating no credentials
788
+ #
789
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
790
+ # external source for authentication to Google Cloud, you must validate it before
791
+ # providing it to a Google API client library. Providing an unvalidated credential
792
+ # configuration to Google APIs can compromise the security of your systems and data.
793
+ # For more information, refer to [Validate credential configurations from external
794
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
773
795
  # @return [::Object]
774
796
  # @!attribute [rw] scope
775
797
  # The OAuth scopes
@@ -809,6 +831,11 @@ module Google
809
831
  # default endpoint URL. The default value of nil uses the environment
810
832
  # universe (usually the default "googleapis.com" universe).
811
833
  # @return [::String,nil]
834
+ # @!attribute [rw] logger
835
+ # A custom logger to use for request/response debug logging, or the value
836
+ # `:default` (the default) to construct a default logger, or `nil` to
837
+ # explicitly disable logging.
838
+ # @return [::Logger,:default,nil]
812
839
  #
813
840
  class Configuration
814
841
  extend ::Gapic::Config
@@ -833,6 +860,7 @@ module Google
833
860
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
834
861
  config_attr :quota_project, nil, ::String, nil
835
862
  config_attr :universe_domain, nil, ::String, nil
863
+ config_attr :logger, :default, ::Logger, nil, :default
836
864
 
837
865
  # @private
838
866
  def initialize parent_config = nil
@@ -157,8 +157,28 @@ module Google
157
157
  endpoint: @config.endpoint,
158
158
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
159
159
  universe_domain: @config.universe_domain,
160
- credentials: credentials
160
+ credentials: credentials,
161
+ logger: @config.logger
161
162
  )
163
+
164
+ @firewall_stub.logger(stub: true)&.info do |entry|
165
+ entry.set_system_name
166
+ entry.set_service
167
+ entry.message = "Created client for #{entry.service}"
168
+ entry.set_credentials_fields credentials
169
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
170
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
171
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
172
+ end
173
+ end
174
+
175
+ ##
176
+ # The logger used for request/response debug logging.
177
+ #
178
+ # @return [Logger]
179
+ #
180
+ def logger
181
+ @firewall_stub.logger
162
182
  end
163
183
 
164
184
  # Service calls
@@ -250,7 +270,7 @@ module Google
250
270
  @firewall_stub.list_ingress_rules request, options do |result, operation|
251
271
  result = ::Gapic::Rest::PagedEnumerable.new @firewall_stub, :list_ingress_rules, "ingress_rules", request, result, options
252
272
  yield result, operation if block_given?
253
- return result
273
+ throw :response, result
254
274
  end
255
275
  rescue ::Gapic::Rest::Error => e
256
276
  raise ::Google::Cloud::Error.from_error(e)
@@ -336,7 +356,6 @@ module Google
336
356
 
337
357
  @firewall_stub.batch_update_ingress_rules request, options do |result, operation|
338
358
  yield result, operation if block_given?
339
- return result
340
359
  end
341
360
  rescue ::Gapic::Rest::Error => e
342
361
  raise ::Google::Cloud::Error.from_error(e)
@@ -427,7 +446,6 @@ module Google
427
446
 
428
447
  @firewall_stub.create_ingress_rule request, options do |result, operation|
429
448
  yield result, operation if block_given?
430
- return result
431
449
  end
432
450
  rescue ::Gapic::Rest::Error => e
433
451
  raise ::Google::Cloud::Error.from_error(e)
@@ -507,7 +525,6 @@ module Google
507
525
 
508
526
  @firewall_stub.get_ingress_rule request, options do |result, operation|
509
527
  yield result, operation if block_given?
510
- return result
511
528
  end
512
529
  rescue ::Gapic::Rest::Error => e
513
530
  raise ::Google::Cloud::Error.from_error(e)
@@ -591,7 +608,6 @@ module Google
591
608
 
592
609
  @firewall_stub.update_ingress_rule request, options do |result, operation|
593
610
  yield result, operation if block_given?
594
- return result
595
611
  end
596
612
  rescue ::Gapic::Rest::Error => e
597
613
  raise ::Google::Cloud::Error.from_error(e)
@@ -671,7 +687,6 @@ module Google
671
687
 
672
688
  @firewall_stub.delete_ingress_rule request, options do |result, operation|
673
689
  yield result, operation if block_given?
674
- return result
675
690
  end
676
691
  rescue ::Gapic::Rest::Error => e
677
692
  raise ::Google::Cloud::Error.from_error(e)
@@ -719,6 +734,13 @@ module Google
719
734
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
720
735
  # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
721
736
  # * (`nil`) indicating no credentials
737
+ #
738
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
739
+ # external source for authentication to Google Cloud, you must validate it before
740
+ # providing it to a Google API client library. Providing an unvalidated credential
741
+ # configuration to Google APIs can compromise the security of your systems and data.
742
+ # For more information, refer to [Validate credential configurations from external
743
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
722
744
  # @return [::Object]
723
745
  # @!attribute [rw] scope
724
746
  # The OAuth scopes
@@ -751,6 +773,11 @@ module Google
751
773
  # default endpoint URL. The default value of nil uses the environment
752
774
  # universe (usually the default "googleapis.com" universe).
753
775
  # @return [::String,nil]
776
+ # @!attribute [rw] logger
777
+ # A custom logger to use for request/response debug logging, or the value
778
+ # `:default` (the default) to construct a default logger, or `nil` to
779
+ # explicitly disable logging.
780
+ # @return [::Logger,:default,nil]
754
781
  #
755
782
  class Configuration
756
783
  extend ::Gapic::Config
@@ -772,6 +799,7 @@ module Google
772
799
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
773
800
  config_attr :quota_project, nil, ::String, nil
774
801
  config_attr :universe_domain, nil, ::String, nil
802
+ config_attr :logger, :default, ::Logger, nil, :default
775
803
 
776
804
  # @private
777
805
  def initialize parent_config = nil
@@ -30,7 +30,8 @@ module Google
30
30
  # including transcoding, making the REST call, and deserialing the response.
31
31
  #
32
32
  class ServiceStub
33
- def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
33
+ # @private
34
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger:
34
35
  # These require statements are intentionally placed here to initialize
35
36
  # the REST modules only when it's required.
36
37
  require "gapic/rest"
@@ -40,7 +41,9 @@ module Google
40
41
  universe_domain: universe_domain,
41
42
  credentials: credentials,
42
43
  numeric_enums: true,
43
- raise_faraday_errors: false
44
+ service_name: self.class,
45
+ raise_faraday_errors: false,
46
+ logger: logger
44
47
  end
45
48
 
46
49
  ##
@@ -61,6 +64,15 @@ module Google
61
64
  @client_stub.endpoint
62
65
  end
63
66
 
67
+ ##
68
+ # The logger used for request/response debug logging.
69
+ #
70
+ # @return [Logger]
71
+ #
72
+ def logger stub: false
73
+ stub ? @client_stub.stub_logger : @client_stub.logger
74
+ end
75
+
64
76
  ##
65
77
  # Baseline implementation for the list_ingress_rules REST call
66
78
  #
@@ -87,16 +99,18 @@ module Google
87
99
 
88
100
  response = @client_stub.make_http_request(
89
101
  verb,
90
- uri: uri,
91
- body: body || "",
92
- params: query_string_params,
102
+ uri: uri,
103
+ body: body || "",
104
+ params: query_string_params,
105
+ method_name: "list_ingress_rules",
93
106
  options: options
94
107
  )
95
108
  operation = ::Gapic::Rest::TransportOperation.new response
96
109
  result = ::Google::Cloud::AppEngine::V1::ListIngressRulesResponse.decode_json response.body, ignore_unknown_fields: true
97
-
98
- yield result, operation if block_given?
99
- result
110
+ catch :response do
111
+ yield result, operation if block_given?
112
+ result
113
+ end
100
114
  end
101
115
 
102
116
  ##
@@ -125,16 +139,18 @@ module Google
125
139
 
126
140
  response = @client_stub.make_http_request(
127
141
  verb,
128
- uri: uri,
129
- body: body || "",
130
- params: query_string_params,
142
+ uri: uri,
143
+ body: body || "",
144
+ params: query_string_params,
145
+ method_name: "batch_update_ingress_rules",
131
146
  options: options
132
147
  )
133
148
  operation = ::Gapic::Rest::TransportOperation.new response
134
149
  result = ::Google::Cloud::AppEngine::V1::BatchUpdateIngressRulesResponse.decode_json response.body, ignore_unknown_fields: true
135
-
136
- yield result, operation if block_given?
137
- result
150
+ catch :response do
151
+ yield result, operation if block_given?
152
+ result
153
+ end
138
154
  end
139
155
 
140
156
  ##
@@ -163,16 +179,18 @@ module Google
163
179
 
164
180
  response = @client_stub.make_http_request(
165
181
  verb,
166
- uri: uri,
167
- body: body || "",
168
- params: query_string_params,
182
+ uri: uri,
183
+ body: body || "",
184
+ params: query_string_params,
185
+ method_name: "create_ingress_rule",
169
186
  options: options
170
187
  )
171
188
  operation = ::Gapic::Rest::TransportOperation.new response
172
189
  result = ::Google::Cloud::AppEngine::V1::FirewallRule.decode_json response.body, ignore_unknown_fields: true
173
-
174
- yield result, operation if block_given?
175
- result
190
+ catch :response do
191
+ yield result, operation if block_given?
192
+ result
193
+ end
176
194
  end
177
195
 
178
196
  ##
@@ -201,16 +219,18 @@ module Google
201
219
 
202
220
  response = @client_stub.make_http_request(
203
221
  verb,
204
- uri: uri,
205
- body: body || "",
206
- params: query_string_params,
222
+ uri: uri,
223
+ body: body || "",
224
+ params: query_string_params,
225
+ method_name: "get_ingress_rule",
207
226
  options: options
208
227
  )
209
228
  operation = ::Gapic::Rest::TransportOperation.new response
210
229
  result = ::Google::Cloud::AppEngine::V1::FirewallRule.decode_json response.body, ignore_unknown_fields: true
211
-
212
- yield result, operation if block_given?
213
- result
230
+ catch :response do
231
+ yield result, operation if block_given?
232
+ result
233
+ end
214
234
  end
215
235
 
216
236
  ##
@@ -239,16 +259,18 @@ module Google
239
259
 
240
260
  response = @client_stub.make_http_request(
241
261
  verb,
242
- uri: uri,
243
- body: body || "",
244
- params: query_string_params,
262
+ uri: uri,
263
+ body: body || "",
264
+ params: query_string_params,
265
+ method_name: "update_ingress_rule",
245
266
  options: options
246
267
  )
247
268
  operation = ::Gapic::Rest::TransportOperation.new response
248
269
  result = ::Google::Cloud::AppEngine::V1::FirewallRule.decode_json response.body, ignore_unknown_fields: true
249
-
250
- yield result, operation if block_given?
251
- result
270
+ catch :response do
271
+ yield result, operation if block_given?
272
+ result
273
+ end
252
274
  end
253
275
 
254
276
  ##
@@ -277,16 +299,18 @@ module Google
277
299
 
278
300
  response = @client_stub.make_http_request(
279
301
  verb,
280
- uri: uri,
281
- body: body || "",
282
- params: query_string_params,
302
+ uri: uri,
303
+ body: body || "",
304
+ params: query_string_params,
305
+ method_name: "delete_ingress_rule",
283
306
  options: options
284
307
  )
285
308
  operation = ::Gapic::Rest::TransportOperation.new response
286
309
  result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
287
-
288
- yield result, operation if block_given?
289
- result
310
+ catch :response do
311
+ yield result, operation if block_given?
312
+ result
313
+ end
290
314
  end
291
315
 
292
316
  ##
@@ -162,8 +162,19 @@ module Google
162
162
  universe_domain: @config.universe_domain,
163
163
  channel_args: @config.channel_args,
164
164
  interceptors: @config.interceptors,
165
- channel_pool_config: @config.channel_pool
165
+ channel_pool_config: @config.channel_pool,
166
+ logger: @config.logger
166
167
  )
168
+
169
+ @instances_stub.stub_logger&.info do |entry|
170
+ entry.set_system_name
171
+ entry.set_service
172
+ entry.message = "Created client for #{entry.service}"
173
+ entry.set_credentials_fields credentials
174
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
175
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
176
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
177
+ end
167
178
  end
168
179
 
169
180
  ##
@@ -173,6 +184,15 @@ module Google
173
184
  #
174
185
  attr_reader :operations_client
175
186
 
187
+ ##
188
+ # The logger used for request/response debug logging.
189
+ #
190
+ # @return [Logger]
191
+ #
192
+ def logger
193
+ @instances_stub.logger
194
+ end
195
+
176
196
  # Service calls
177
197
 
178
198
  ##
@@ -268,7 +288,7 @@ module Google
268
288
  @instances_stub.call_rpc :list_instances, request, options: options do |response, operation|
269
289
  response = ::Gapic::PagedEnumerable.new @instances_stub, :list_instances, request, response, operation, options
270
290
  yield response, operation if block_given?
271
- return response
291
+ throw :response, response
272
292
  end
273
293
  rescue ::GRPC::BadStatus => e
274
294
  raise ::Google::Cloud::Error.from_error(e)
@@ -355,7 +375,6 @@ module Google
355
375
 
356
376
  @instances_stub.call_rpc :get_instance, request, options: options do |response, operation|
357
377
  yield response, operation if block_given?
358
- return response
359
378
  end
360
379
  rescue ::GRPC::BadStatus => e
361
380
  raise ::Google::Cloud::Error.from_error(e)
@@ -461,7 +480,7 @@ module Google
461
480
  @instances_stub.call_rpc :delete_instance, request, options: options do |response, operation|
462
481
  response = ::Gapic::Operation.new response, @operations_client, options: options
463
482
  yield response, operation if block_given?
464
- return response
483
+ throw :response, response
465
484
  end
466
485
  rescue ::GRPC::BadStatus => e
467
486
  raise ::Google::Cloud::Error.from_error(e)
@@ -571,7 +590,7 @@ module Google
571
590
  @instances_stub.call_rpc :debug_instance, request, options: options do |response, operation|
572
591
  response = ::Gapic::Operation.new response, @operations_client, options: options
573
592
  yield response, operation if block_given?
574
- return response
593
+ throw :response, response
575
594
  end
576
595
  rescue ::GRPC::BadStatus => e
577
596
  raise ::Google::Cloud::Error.from_error(e)
@@ -621,6 +640,13 @@ module Google
621
640
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
622
641
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
623
642
  # * (`nil`) indicating no credentials
643
+ #
644
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
645
+ # external source for authentication to Google Cloud, you must validate it before
646
+ # providing it to a Google API client library. Providing an unvalidated credential
647
+ # configuration to Google APIs can compromise the security of your systems and data.
648
+ # For more information, refer to [Validate credential configurations from external
649
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
624
650
  # @return [::Object]
625
651
  # @!attribute [rw] scope
626
652
  # The OAuth scopes
@@ -660,6 +686,11 @@ module Google
660
686
  # default endpoint URL. The default value of nil uses the environment
661
687
  # universe (usually the default "googleapis.com" universe).
662
688
  # @return [::String,nil]
689
+ # @!attribute [rw] logger
690
+ # A custom logger to use for request/response debug logging, or the value
691
+ # `:default` (the default) to construct a default logger, or `nil` to
692
+ # explicitly disable logging.
693
+ # @return [::Logger,:default,nil]
663
694
  #
664
695
  class Configuration
665
696
  extend ::Gapic::Config
@@ -684,6 +715,7 @@ module Google
684
715
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
685
716
  config_attr :quota_project, nil, ::String, nil
686
717
  config_attr :universe_domain, nil, ::String, nil
718
+ config_attr :logger, :default, ::Logger, nil, :default
687
719
 
688
720
  # @private
689
721
  def initialize parent_config = nil