google-cloud-privileged_access_manager-v1 0.1.2 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5af72b67ce278f858409b499027af9be8eeee753196db1cdc218acfdf4aa5a6f
4
- data.tar.gz: d6f449b023b816f464687d9b03d26b9e7ce5cb0de7ac8830af7d8bfdd8bb91e2
3
+ metadata.gz: a645feb4920bf9eb871e9d200984f10d028e828654422f2f04b99bb153b7e315
4
+ data.tar.gz: 5e4754af883ccd9586d32c1be8184e7997602a0cf5eaf31904c1e5534c74bafa
5
5
  SHA512:
6
- metadata.gz: 7e8c911e5f22d342557815414f878295bd4b65ba7e4e662063531bdc2052a5a63b5cb4a6bddff6907f0ede96e05cee79a597fffd09231a96a559060d3e1e40f5
7
- data.tar.gz: 24eef800756105ae0c93d91a5154650824ae7501b9d986adcd87ce16c0a1fe7791bf3d0eea71330bdf8b11d3cf29ac6718d8314e8ce986c4aabff276733d3888
6
+ metadata.gz: d3d892c1f067230d407bf231b78733cc84adc4e0a7fbddea7454a3a2718f22764e81098858edf04090e752ccf6a976075470c391baaa43d1f6b9509fe357800f
7
+ data.tar.gz: e9237958ededadee73311c30f4ba37aac4208ec66fdc7e8bb3f7b839e93e3f81acc5fa221589ceacbb674ec52083d71a9978f0636b6bfddf909329633ecaf40b
data/README.md CHANGED
@@ -90,33 +90,43 @@ for class and method documentation.
90
90
  See also the [Product Documentation](https://cloud.google.com/iam/docs/pam-overview)
91
91
  for general usage information.
92
92
 
93
- ## Enabling Logging
94
-
95
- To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
96
- The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below,
97
- or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest)
98
- that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
99
- and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
100
-
101
- Configuring a Ruby stdlib logger:
93
+ ## Debug Logging
94
+
95
+ This library comes with opt-in Debug Logging that can help you troubleshoot
96
+ your application's integration with the API. When logging is activated, key
97
+ events such as requests and responses, along with data payloads and metadata
98
+ such as headers and client configuration, are logged to the standard error
99
+ stream.
100
+
101
+ **WARNING:** Client Library Debug Logging includes your data payloads in
102
+ plaintext, which could include sensitive data such as PII for yourself or your
103
+ customers, private keys, or other security data that could be compromising if
104
+ leaked. Always practice good data hygiene with your application logs, and follow
105
+ the principle of least access. Google also recommends that Client Library Debug
106
+ Logging be enabled only temporarily during active debugging, and not used
107
+ permanently in production.
108
+
109
+ To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
110
+ to the value `all`. Alternatively, you can set the value to a comma-delimited
111
+ list of client library gem names. This will select the default logging behavior,
112
+ which writes logs to the standard error stream. On a local workstation, this may
113
+ result in logs appearing on the console. When running on a Google Cloud hosting
114
+ service such as [Google Cloud Run](https://cloud.google.com/run), this generally
115
+ results in logs appearing alongside your application logs in the
116
+ [Google Cloud Logging](https://cloud.google.com/logging/) service.
117
+
118
+ You can customize logging by modifying the `logger` configuration when
119
+ constructing a client object. For example:
102
120
 
103
121
  ```ruby
122
+ require "google/cloud/privileged_access_manager/v1"
104
123
  require "logger"
105
124
 
106
- module MyLogger
107
- LOGGER = Logger.new $stderr, level: Logger::WARN
108
- def logger
109
- LOGGER
110
- end
111
- end
112
-
113
- # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
114
- module GRPC
115
- extend MyLogger
125
+ client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new do |config|
126
+ config.logger = Logger.new "my-app.log"
116
127
  end
117
128
  ```
118
129
 
119
-
120
130
  ## Google Cloud Samples
121
131
 
122
132
  To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples).
@@ -184,14 +184,26 @@ module Google
184
184
  universe_domain: @config.universe_domain,
185
185
  channel_args: @config.channel_args,
186
186
  interceptors: @config.interceptors,
187
- channel_pool_config: @config.channel_pool
187
+ channel_pool_config: @config.channel_pool,
188
+ logger: @config.logger
188
189
  )
189
190
 
191
+ @privileged_access_manager_stub.stub_logger&.info do |entry|
192
+ entry.set_system_name
193
+ entry.set_service
194
+ entry.message = "Created client for #{entry.service}"
195
+ entry.set_credentials_fields credentials
196
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
197
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
198
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
199
+ end
200
+
190
201
  @location_client = Google::Cloud::Location::Locations::Client.new do |config|
191
202
  config.credentials = credentials
192
203
  config.quota_project = @quota_project_id
193
204
  config.endpoint = @privileged_access_manager_stub.endpoint
194
205
  config.universe_domain = @privileged_access_manager_stub.universe_domain
206
+ config.logger = @privileged_access_manager_stub.logger if config.respond_to? :logger=
195
207
  end
196
208
  end
197
209
 
@@ -209,10 +221,19 @@ module Google
209
221
  #
210
222
  attr_reader :location_client
211
223
 
224
+ ##
225
+ # The logger used for request/response debug logging.
226
+ #
227
+ # @return [Logger]
228
+ #
229
+ def logger
230
+ @privileged_access_manager_stub.logger
231
+ end
232
+
212
233
  # Service calls
213
234
 
214
235
  ##
215
- # CheckOnboardingStatus reports the onboarding status for a
236
+ # `CheckOnboardingStatus` reports the onboarding status for a
216
237
  # project/folder/organization. Any findings reported by this API need to be
217
238
  # fixed before PAM can be used on the resource.
218
239
  #
@@ -298,7 +319,6 @@ module Google
298
319
 
299
320
  @privileged_access_manager_stub.call_rpc :check_onboarding_status, request, options: options do |response, operation|
300
321
  yield response, operation if block_given?
301
- return response
302
322
  end
303
323
  rescue ::GRPC::BadStatus => e
304
324
  raise ::Google::Cloud::Error.from_error(e)
@@ -398,7 +418,7 @@ module Google
398
418
  @privileged_access_manager_stub.call_rpc :list_entitlements, request, options: options do |response, operation|
399
419
  response = ::Gapic::PagedEnumerable.new @privileged_access_manager_stub, :list_entitlements, request, response, operation, options
400
420
  yield response, operation if block_given?
401
- return response
421
+ throw :response, response
402
422
  end
403
423
  rescue ::GRPC::BadStatus => e
404
424
  raise ::Google::Cloud::Error.from_error(e)
@@ -501,7 +521,7 @@ module Google
501
521
  @privileged_access_manager_stub.call_rpc :search_entitlements, request, options: options do |response, operation|
502
522
  response = ::Gapic::PagedEnumerable.new @privileged_access_manager_stub, :search_entitlements, request, response, operation, options
503
523
  yield response, operation if block_given?
504
- return response
524
+ throw :response, response
505
525
  end
506
526
  rescue ::GRPC::BadStatus => e
507
527
  raise ::Google::Cloud::Error.from_error(e)
@@ -587,7 +607,6 @@ module Google
587
607
 
588
608
  @privileged_access_manager_stub.call_rpc :get_entitlement, request, options: options do |response, operation|
589
609
  yield response, operation if block_given?
590
- return response
591
610
  end
592
611
  rescue ::GRPC::BadStatus => e
593
612
  raise ::Google::Cloud::Error.from_error(e)
@@ -641,7 +660,7 @@ module Google
641
660
  # ID, the server can check if original operation with the same request ID
642
661
  # was received, and if so, ignores the second request and returns the
643
662
  # previous operation's response. This prevents clients from accidentally
644
- # creating duplicate commitments.
663
+ # creating duplicate entitlements.
645
664
  #
646
665
  # The request ID must be a valid UUID with the exception that zero UUID is
647
666
  # not supported (00000000-0000-0000-0000-000000000000).
@@ -713,7 +732,7 @@ module Google
713
732
  @privileged_access_manager_stub.call_rpc :create_entitlement, request, options: options do |response, operation|
714
733
  response = ::Gapic::Operation.new response, @operations_client, options: options
715
734
  yield response, operation if block_given?
716
- return response
735
+ throw :response, response
717
736
  end
718
737
  rescue ::GRPC::BadStatus => e
719
738
  raise ::Google::Cloud::Error.from_error(e)
@@ -721,7 +740,7 @@ module Google
721
740
 
722
741
  ##
723
742
  # Deletes a single entitlement. This method can only be called when there
724
- # are no in-progress (ACTIVE/ACTIVATING/REVOKING) grants under the
743
+ # are no in-progress (`ACTIVE`/`ACTIVATING`/`REVOKING`) grants under the
725
744
  # entitlement.
726
745
  #
727
746
  # @overload delete_entitlement(request, options = nil)
@@ -750,8 +769,7 @@ module Google
750
769
  # For example, consider a situation where you make an initial request and the
751
770
  # request times out. If you make the request again with the same request
752
771
  # ID, the server can check if original operation with the same request ID
753
- # was received, and if so, ignores the second request. This prevents
754
- # clients from accidentally creating duplicate commitments.
772
+ # was received, and if so, ignores the second request.
755
773
  #
756
774
  # The request ID must be a valid UUID with the exception that zero UUID is
757
775
  # not supported (00000000-0000-0000-0000-000000000000).
@@ -827,7 +845,7 @@ module Google
827
845
  @privileged_access_manager_stub.call_rpc :delete_entitlement, request, options: options do |response, operation|
828
846
  response = ::Gapic::Operation.new response, @operations_client, options: options
829
847
  yield response, operation if block_given?
830
- return response
848
+ throw :response, response
831
849
  end
832
850
  rescue ::GRPC::BadStatus => e
833
851
  raise ::Google::Cloud::Error.from_error(e)
@@ -950,7 +968,7 @@ module Google
950
968
  @privileged_access_manager_stub.call_rpc :update_entitlement, request, options: options do |response, operation|
951
969
  response = ::Gapic::Operation.new response, @operations_client, options: options
952
970
  yield response, operation if block_given?
953
- return response
971
+ throw :response, response
954
972
  end
955
973
  rescue ::GRPC::BadStatus => e
956
974
  raise ::Google::Cloud::Error.from_error(e)
@@ -1050,7 +1068,7 @@ module Google
1050
1068
  @privileged_access_manager_stub.call_rpc :list_grants, request, options: options do |response, operation|
1051
1069
  response = ::Gapic::PagedEnumerable.new @privileged_access_manager_stub, :list_grants, request, response, operation, options
1052
1070
  yield response, operation if block_given?
1053
- return response
1071
+ throw :response, response
1054
1072
  end
1055
1073
  rescue ::GRPC::BadStatus => e
1056
1074
  raise ::Google::Cloud::Error.from_error(e)
@@ -1152,7 +1170,7 @@ module Google
1152
1170
  @privileged_access_manager_stub.call_rpc :search_grants, request, options: options do |response, operation|
1153
1171
  response = ::Gapic::PagedEnumerable.new @privileged_access_manager_stub, :search_grants, request, response, operation, options
1154
1172
  yield response, operation if block_given?
1155
- return response
1173
+ throw :response, response
1156
1174
  end
1157
1175
  rescue ::GRPC::BadStatus => e
1158
1176
  raise ::Google::Cloud::Error.from_error(e)
@@ -1238,14 +1256,14 @@ module Google
1238
1256
 
1239
1257
  @privileged_access_manager_stub.call_rpc :get_grant, request, options: options do |response, operation|
1240
1258
  yield response, operation if block_given?
1241
- return response
1242
1259
  end
1243
1260
  rescue ::GRPC::BadStatus => e
1244
1261
  raise ::Google::Cloud::Error.from_error(e)
1245
1262
  end
1246
1263
 
1247
1264
  ##
1248
- # Creates a new grant in a given project and location.
1265
+ # Creates a new grant in a given project/folder/organization and
1266
+ # location.
1249
1267
  #
1250
1268
  # @overload create_grant(request, options = nil)
1251
1269
  # Pass arguments to `create_grant` via a request object, either of type
@@ -1277,7 +1295,7 @@ module Google
1277
1295
  # request times out. If you make the request again with the same request
1278
1296
  # ID, the server can check if original operation with the same request ID
1279
1297
  # was received, and if so, ignores the second request. This prevents
1280
- # clients from accidentally creating duplicate commitments.
1298
+ # clients from accidentally creating duplicate grants.
1281
1299
  #
1282
1300
  # The request ID must be a valid UUID with the exception that zero UUID is
1283
1301
  # not supported (00000000-0000-0000-0000-000000000000).
@@ -1341,7 +1359,6 @@ module Google
1341
1359
 
1342
1360
  @privileged_access_manager_stub.call_rpc :create_grant, request, options: options do |response, operation|
1343
1361
  yield response, operation if block_given?
1344
- return response
1345
1362
  end
1346
1363
  rescue ::GRPC::BadStatus => e
1347
1364
  raise ::Google::Cloud::Error.from_error(e)
@@ -1433,7 +1450,6 @@ module Google
1433
1450
 
1434
1451
  @privileged_access_manager_stub.call_rpc :approve_grant, request, options: options do |response, operation|
1435
1452
  yield response, operation if block_given?
1436
- return response
1437
1453
  end
1438
1454
  rescue ::GRPC::BadStatus => e
1439
1455
  raise ::Google::Cloud::Error.from_error(e)
@@ -1525,7 +1541,6 @@ module Google
1525
1541
 
1526
1542
  @privileged_access_manager_stub.call_rpc :deny_grant, request, options: options do |response, operation|
1527
1543
  yield response, operation if block_given?
1528
- return response
1529
1544
  end
1530
1545
  rescue ::GRPC::BadStatus => e
1531
1546
  raise ::Google::Cloud::Error.from_error(e)
@@ -1622,7 +1637,7 @@ module Google
1622
1637
  @privileged_access_manager_stub.call_rpc :revoke_grant, request, options: options do |response, operation|
1623
1638
  response = ::Gapic::Operation.new response, @operations_client, options: options
1624
1639
  yield response, operation if block_given?
1625
- return response
1640
+ throw :response, response
1626
1641
  end
1627
1642
  rescue ::GRPC::BadStatus => e
1628
1643
  raise ::Google::Cloud::Error.from_error(e)
@@ -1711,6 +1726,11 @@ module Google
1711
1726
  # default endpoint URL. The default value of nil uses the environment
1712
1727
  # universe (usually the default "googleapis.com" universe).
1713
1728
  # @return [::String,nil]
1729
+ # @!attribute [rw] logger
1730
+ # A custom logger to use for request/response debug logging, or the value
1731
+ # `:default` (the default) to construct a default logger, or `nil` to
1732
+ # explicitly disable logging.
1733
+ # @return [::Logger,:default,nil]
1714
1734
  #
1715
1735
  class Configuration
1716
1736
  extend ::Gapic::Config
@@ -1735,6 +1755,7 @@ module Google
1735
1755
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1736
1756
  config_attr :quota_project, nil, ::String, nil
1737
1757
  config_attr :universe_domain, nil, ::String, nil
1758
+ config_attr :logger, :default, ::Logger, nil, :default
1738
1759
 
1739
1760
  # @private
1740
1761
  def initialize parent_config = nil
@@ -124,14 +124,6 @@ module Google
124
124
  # Lists operations that match the specified filter in the request. If the
125
125
  # server doesn't support this method, it returns `UNIMPLEMENTED`.
126
126
  #
127
- # NOTE: the `name` binding allows API services to override the binding
128
- # to use different resource name schemes, such as `users/*/operations`. To
129
- # override the binding, API services can add a binding such as
130
- # `"/v1/{name=users/*}/operations"` to their service configuration.
131
- # For backwards compatibility, the default name includes the operations
132
- # collection id, however overriding users must ensure the name binding
133
- # is the parent resource, without the operations collection id.
134
- #
135
127
  # @overload list_operations(request, options = nil)
136
128
  # Pass arguments to `list_operations` via a request object, either of type
137
129
  # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash.
@@ -221,7 +213,7 @@ module Google
221
213
  wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client }
222
214
  response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation
223
215
  yield response, operation if block_given?
224
- return response
216
+ throw :response, response
225
217
  end
226
218
  rescue ::GRPC::BadStatus => e
227
219
  raise ::Google::Cloud::Error.from_error(e)
@@ -317,7 +309,7 @@ module Google
317
309
  @operations_stub.call_rpc :get_operation, request, options: options do |response, operation|
318
310
  response = ::Gapic::Operation.new response, @operations_client, options: options
319
311
  yield response, operation if block_given?
320
- return response
312
+ throw :response, response
321
313
  end
322
314
  rescue ::GRPC::BadStatus => e
323
315
  raise ::Google::Cloud::Error.from_error(e)
@@ -406,7 +398,6 @@ module Google
406
398
 
407
399
  @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation|
408
400
  yield response, operation if block_given?
409
- return response
410
401
  end
411
402
  rescue ::GRPC::BadStatus => e
412
403
  raise ::Google::Cloud::Error.from_error(e)
@@ -421,8 +412,9 @@ module Google
421
412
  # other methods to check whether the cancellation succeeded or whether the
422
413
  # operation completed despite cancellation. On successful cancellation,
423
414
  # the operation is not deleted; instead, it becomes an operation with
424
- # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1,
425
- # corresponding to `Code.CANCELLED`.
415
+ # an {::Google::Longrunning::Operation#error Operation.error} value with a
416
+ # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to
417
+ # `Code.CANCELLED`.
426
418
  #
427
419
  # @overload cancel_operation(request, options = nil)
428
420
  # Pass arguments to `cancel_operation` via a request object, either of type
@@ -501,7 +493,6 @@ module Google
501
493
 
502
494
  @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation|
503
495
  yield response, operation if block_given?
504
- return response
505
496
  end
506
497
  rescue ::GRPC::BadStatus => e
507
498
  raise ::Google::Cloud::Error.from_error(e)
@@ -599,7 +590,7 @@ module Google
599
590
  @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation|
600
591
  response = ::Gapic::Operation.new response, @operations_client, options: options
601
592
  yield response, operation if block_given?
602
- return response
593
+ throw :response, response
603
594
  end
604
595
  rescue ::GRPC::BadStatus => e
605
596
  raise ::Google::Cloud::Error.from_error(e)
@@ -688,6 +679,11 @@ module Google
688
679
  # default endpoint URL. The default value of nil uses the environment
689
680
  # universe (usually the default "googleapis.com" universe).
690
681
  # @return [::String,nil]
682
+ # @!attribute [rw] logger
683
+ # A custom logger to use for request/response debug logging, or the value
684
+ # `:default` (the default) to construct a default logger, or `nil` to
685
+ # explicitly disable logging.
686
+ # @return [::Logger,:default,nil]
691
687
  #
692
688
  class Configuration
693
689
  extend ::Gapic::Config
@@ -712,6 +708,7 @@ module Google
712
708
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
713
709
  config_attr :quota_project, nil, ::String, nil
714
710
  config_attr :universe_domain, nil, ::String, nil
711
+ config_attr :logger, :default, ::Logger, nil, :default
715
712
 
716
713
  # @private
717
714
  def initialize parent_config = nil
@@ -177,15 +177,27 @@ module Google
177
177
  endpoint: @config.endpoint,
178
178
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
179
179
  universe_domain: @config.universe_domain,
180
- credentials: credentials
180
+ credentials: credentials,
181
+ logger: @config.logger
181
182
  )
182
183
 
184
+ @privileged_access_manager_stub.logger(stub: true)&.info do |entry|
185
+ entry.set_system_name
186
+ entry.set_service
187
+ entry.message = "Created client for #{entry.service}"
188
+ entry.set_credentials_fields credentials
189
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
190
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
191
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
192
+ end
193
+
183
194
  @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
184
195
  config.credentials = credentials
185
196
  config.quota_project = @quota_project_id
186
197
  config.endpoint = @privileged_access_manager_stub.endpoint
187
198
  config.universe_domain = @privileged_access_manager_stub.universe_domain
188
199
  config.bindings_override = @config.bindings_override
200
+ config.logger = @privileged_access_manager_stub.logger if config.respond_to? :logger=
189
201
  end
190
202
  end
191
203
 
@@ -203,10 +215,19 @@ module Google
203
215
  #
204
216
  attr_reader :location_client
205
217
 
218
+ ##
219
+ # The logger used for request/response debug logging.
220
+ #
221
+ # @return [Logger]
222
+ #
223
+ def logger
224
+ @privileged_access_manager_stub.logger
225
+ end
226
+
206
227
  # Service calls
207
228
 
208
229
  ##
209
- # CheckOnboardingStatus reports the onboarding status for a
230
+ # `CheckOnboardingStatus` reports the onboarding status for a
210
231
  # project/folder/organization. Any findings reported by this API need to be
211
232
  # fixed before PAM can be used on the resource.
212
233
  #
@@ -285,7 +306,6 @@ module Google
285
306
 
286
307
  @privileged_access_manager_stub.check_onboarding_status request, options do |result, operation|
287
308
  yield result, operation if block_given?
288
- return result
289
309
  end
290
310
  rescue ::Gapic::Rest::Error => e
291
311
  raise ::Google::Cloud::Error.from_error(e)
@@ -377,7 +397,6 @@ module Google
377
397
 
378
398
  @privileged_access_manager_stub.list_entitlements request, options do |result, operation|
379
399
  yield result, operation if block_given?
380
- return result
381
400
  end
382
401
  rescue ::Gapic::Rest::Error => e
383
402
  raise ::Google::Cloud::Error.from_error(e)
@@ -473,7 +492,7 @@ module Google
473
492
  @privileged_access_manager_stub.search_entitlements request, options do |result, operation|
474
493
  result = ::Gapic::Rest::PagedEnumerable.new @privileged_access_manager_stub, :search_entitlements, "entitlements", request, result, options
475
494
  yield result, operation if block_given?
476
- return result
495
+ throw :response, result
477
496
  end
478
497
  rescue ::Gapic::Rest::Error => e
479
498
  raise ::Google::Cloud::Error.from_error(e)
@@ -552,7 +571,6 @@ module Google
552
571
 
553
572
  @privileged_access_manager_stub.get_entitlement request, options do |result, operation|
554
573
  yield result, operation if block_given?
555
- return result
556
574
  end
557
575
  rescue ::Gapic::Rest::Error => e
558
576
  raise ::Google::Cloud::Error.from_error(e)
@@ -606,7 +624,7 @@ module Google
606
624
  # ID, the server can check if original operation with the same request ID
607
625
  # was received, and if so, ignores the second request and returns the
608
626
  # previous operation's response. This prevents clients from accidentally
609
- # creating duplicate commitments.
627
+ # creating duplicate entitlements.
610
628
  #
611
629
  # The request ID must be a valid UUID with the exception that zero UUID is
612
630
  # not supported (00000000-0000-0000-0000-000000000000).
@@ -671,7 +689,7 @@ module Google
671
689
  @privileged_access_manager_stub.create_entitlement request, options do |result, operation|
672
690
  result = ::Gapic::Operation.new result, @operations_client, options: options
673
691
  yield result, operation if block_given?
674
- return result
692
+ throw :response, result
675
693
  end
676
694
  rescue ::Gapic::Rest::Error => e
677
695
  raise ::Google::Cloud::Error.from_error(e)
@@ -679,7 +697,7 @@ module Google
679
697
 
680
698
  ##
681
699
  # Deletes a single entitlement. This method can only be called when there
682
- # are no in-progress (ACTIVE/ACTIVATING/REVOKING) grants under the
700
+ # are no in-progress (`ACTIVE`/`ACTIVATING`/`REVOKING`) grants under the
683
701
  # entitlement.
684
702
  #
685
703
  # @overload delete_entitlement(request, options = nil)
@@ -708,8 +726,7 @@ module Google
708
726
  # For example, consider a situation where you make an initial request and the
709
727
  # request times out. If you make the request again with the same request
710
728
  # ID, the server can check if original operation with the same request ID
711
- # was received, and if so, ignores the second request. This prevents
712
- # clients from accidentally creating duplicate commitments.
729
+ # was received, and if so, ignores the second request.
713
730
  #
714
731
  # The request ID must be a valid UUID with the exception that zero UUID is
715
732
  # not supported (00000000-0000-0000-0000-000000000000).
@@ -778,7 +795,7 @@ module Google
778
795
  @privileged_access_manager_stub.delete_entitlement request, options do |result, operation|
779
796
  result = ::Gapic::Operation.new result, @operations_client, options: options
780
797
  yield result, operation if block_given?
781
- return result
798
+ throw :response, result
782
799
  end
783
800
  rescue ::Gapic::Rest::Error => e
784
801
  raise ::Google::Cloud::Error.from_error(e)
@@ -894,7 +911,7 @@ module Google
894
911
  @privileged_access_manager_stub.update_entitlement request, options do |result, operation|
895
912
  result = ::Gapic::Operation.new result, @operations_client, options: options
896
913
  yield result, operation if block_given?
897
- return result
914
+ throw :response, result
898
915
  end
899
916
  rescue ::Gapic::Rest::Error => e
900
917
  raise ::Google::Cloud::Error.from_error(e)
@@ -986,7 +1003,6 @@ module Google
986
1003
 
987
1004
  @privileged_access_manager_stub.list_grants request, options do |result, operation|
988
1005
  yield result, operation if block_given?
989
- return result
990
1006
  end
991
1007
  rescue ::Gapic::Rest::Error => e
992
1008
  raise ::Google::Cloud::Error.from_error(e)
@@ -1081,7 +1097,7 @@ module Google
1081
1097
  @privileged_access_manager_stub.search_grants request, options do |result, operation|
1082
1098
  result = ::Gapic::Rest::PagedEnumerable.new @privileged_access_manager_stub, :search_grants, "grants", request, result, options
1083
1099
  yield result, operation if block_given?
1084
- return result
1100
+ throw :response, result
1085
1101
  end
1086
1102
  rescue ::Gapic::Rest::Error => e
1087
1103
  raise ::Google::Cloud::Error.from_error(e)
@@ -1160,14 +1176,14 @@ module Google
1160
1176
 
1161
1177
  @privileged_access_manager_stub.get_grant request, options do |result, operation|
1162
1178
  yield result, operation if block_given?
1163
- return result
1164
1179
  end
1165
1180
  rescue ::Gapic::Rest::Error => e
1166
1181
  raise ::Google::Cloud::Error.from_error(e)
1167
1182
  end
1168
1183
 
1169
1184
  ##
1170
- # Creates a new grant in a given project and location.
1185
+ # Creates a new grant in a given project/folder/organization and
1186
+ # location.
1171
1187
  #
1172
1188
  # @overload create_grant(request, options = nil)
1173
1189
  # Pass arguments to `create_grant` via a request object, either of type
@@ -1199,7 +1215,7 @@ module Google
1199
1215
  # request times out. If you make the request again with the same request
1200
1216
  # ID, the server can check if original operation with the same request ID
1201
1217
  # was received, and if so, ignores the second request. This prevents
1202
- # clients from accidentally creating duplicate commitments.
1218
+ # clients from accidentally creating duplicate grants.
1203
1219
  #
1204
1220
  # The request ID must be a valid UUID with the exception that zero UUID is
1205
1221
  # not supported (00000000-0000-0000-0000-000000000000).
@@ -1256,7 +1272,6 @@ module Google
1256
1272
 
1257
1273
  @privileged_access_manager_stub.create_grant request, options do |result, operation|
1258
1274
  yield result, operation if block_given?
1259
- return result
1260
1275
  end
1261
1276
  rescue ::Gapic::Rest::Error => e
1262
1277
  raise ::Google::Cloud::Error.from_error(e)
@@ -1341,7 +1356,6 @@ module Google
1341
1356
 
1342
1357
  @privileged_access_manager_stub.approve_grant request, options do |result, operation|
1343
1358
  yield result, operation if block_given?
1344
- return result
1345
1359
  end
1346
1360
  rescue ::Gapic::Rest::Error => e
1347
1361
  raise ::Google::Cloud::Error.from_error(e)
@@ -1426,7 +1440,6 @@ module Google
1426
1440
 
1427
1441
  @privileged_access_manager_stub.deny_grant request, options do |result, operation|
1428
1442
  yield result, operation if block_given?
1429
- return result
1430
1443
  end
1431
1444
  rescue ::Gapic::Rest::Error => e
1432
1445
  raise ::Google::Cloud::Error.from_error(e)
@@ -1516,7 +1529,7 @@ module Google
1516
1529
  @privileged_access_manager_stub.revoke_grant request, options do |result, operation|
1517
1530
  result = ::Gapic::Operation.new result, @operations_client, options: options
1518
1531
  yield result, operation if block_given?
1519
- return result
1532
+ throw :response, result
1520
1533
  end
1521
1534
  rescue ::Gapic::Rest::Error => e
1522
1535
  raise ::Google::Cloud::Error.from_error(e)
@@ -1596,6 +1609,11 @@ module Google
1596
1609
  # default endpoint URL. The default value of nil uses the environment
1597
1610
  # universe (usually the default "googleapis.com" universe).
1598
1611
  # @return [::String,nil]
1612
+ # @!attribute [rw] logger
1613
+ # A custom logger to use for request/response debug logging, or the value
1614
+ # `:default` (the default) to construct a default logger, or `nil` to
1615
+ # explicitly disable logging.
1616
+ # @return [::Logger,:default,nil]
1599
1617
  #
1600
1618
  class Configuration
1601
1619
  extend ::Gapic::Config
@@ -1624,6 +1642,7 @@ module Google
1624
1642
  # by the host service.
1625
1643
  # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
1626
1644
  config_attr :bindings_override, {}, ::Hash, nil
1645
+ config_attr :logger, :default, ::Logger, nil, :default
1627
1646
 
1628
1647
  # @private
1629
1648
  def initialize parent_config = nil