strongdm 2.6.4 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -655,17 +655,15 @@ module SDM
655
655
 
656
656
  # AccountGrants connect a resource directly to an account, giving the account the permission to connect to that resource.
657
657
  class AccountGrant
658
- # The account id of this AccountGrant.
658
+ # The account ID of this AccountGrant.
659
659
  attr_accessor :account_id
660
660
  # Unique identifier of the AccountGrant.
661
661
  attr_accessor :id
662
- # The resource id of this AccountGrant.
662
+ # The resource ID of this AccountGrant.
663
663
  attr_accessor :resource_id
664
- # The timestamp when the resource will be granted. Optional. Both start_at
665
- # and end_at must be defined together, or not defined at all.
664
+ # The timestamp when the resource will be granted. When creating an AccountGrant, if this field is not specified, it will default to the current time.
666
665
  attr_accessor :start_from
667
- # The timestamp when the resource grant will expire. Optional. Both
668
- # start_at and end_at must be defined together, or not defined at all.
666
+ # The timestamp when the resource grant will expire.
669
667
  attr_accessor :valid_until
670
668
 
671
669
  def initialize(
@@ -5318,11 +5316,6 @@ module SDM
5318
5316
  class Role
5319
5317
  # AccessRules is a list of access rules defining the resources this Role has access to.
5320
5318
  attr_accessor :access_rules
5321
- # Composite is true if the Role is a composite role.
5322
- #
5323
- # Deprecated: composite roles are deprecated, use multi-role via
5324
- # AccountAttachments instead.
5325
- attr_accessor :composite
5326
5319
  # Unique identifier of the Role.
5327
5320
  attr_accessor :id
5328
5321
  # Unique human-readable name of the Role.
@@ -5332,13 +5325,11 @@ module SDM
5332
5325
 
5333
5326
  def initialize(
5334
5327
  access_rules: nil,
5335
- composite: nil,
5336
5328
  id: nil,
5337
5329
  name: nil,
5338
5330
  tags: nil
5339
5331
  )
5340
5332
  @access_rules = access_rules == nil ? SDM::_porcelain_zero_value_access_rules() : access_rules
5341
- @composite = composite == nil ? false : composite
5342
5333
  @id = id == nil ? "" : id
5343
5334
  @name = name == nil ? "" : name
5344
5335
  @tags = tags == nil ? SDM::_porcelain_zero_value_tags() : tags
@@ -5353,122 +5344,6 @@ module SDM
5353
5344
  end
5354
5345
  end
5355
5346
 
5356
- # A RoleAttachment assigns a role to a composite role.
5357
- #
5358
- # Deprecated: use multi-role via AccountAttachments instead.
5359
- class RoleAttachment
5360
- # The id of the attached role of this RoleAttachment.
5361
- attr_accessor :attached_role_id
5362
- # The id of the composite role of this RoleAttachment.
5363
- attr_accessor :composite_role_id
5364
- # Unique identifier of the RoleAttachment.
5365
- attr_accessor :id
5366
-
5367
- def initialize(
5368
- attached_role_id: nil,
5369
- composite_role_id: nil,
5370
- id: nil
5371
- )
5372
- @attached_role_id = attached_role_id == nil ? "" : attached_role_id
5373
- @composite_role_id = composite_role_id == nil ? "" : composite_role_id
5374
- @id = id == nil ? "" : id
5375
- end
5376
-
5377
- def to_json(options = {})
5378
- hash = {}
5379
- self.instance_variables.each do |var|
5380
- hash[var.id2name.delete_prefix("@")] = self.instance_variable_get var
5381
- end
5382
- hash.to_json
5383
- end
5384
- end
5385
-
5386
- # RoleAttachmentCreateResponse reports how the RoleAttachments were created in the system.
5387
- #
5388
- # Deprecated: use multi-role via AccountAttachments instead.
5389
- class RoleAttachmentCreateResponse
5390
- # Reserved for future use.
5391
- attr_accessor :meta
5392
- # Rate limit information.
5393
- attr_accessor :rate_limit
5394
- # The created RoleAttachment.
5395
- attr_accessor :role_attachment
5396
-
5397
- def initialize(
5398
- meta: nil,
5399
- rate_limit: nil,
5400
- role_attachment: nil
5401
- )
5402
- @meta = meta == nil ? nil : meta
5403
- @rate_limit = rate_limit == nil ? nil : rate_limit
5404
- @role_attachment = role_attachment == nil ? nil : role_attachment
5405
- end
5406
-
5407
- def to_json(options = {})
5408
- hash = {}
5409
- self.instance_variables.each do |var|
5410
- hash[var.id2name.delete_prefix("@")] = self.instance_variable_get var
5411
- end
5412
- hash.to_json
5413
- end
5414
- end
5415
-
5416
- # RoleAttachmentDeleteResponse returns information about a RoleAttachment that was deleted.
5417
- #
5418
- # Deprecated: use multi-role via AccountAttachments instead.
5419
- class RoleAttachmentDeleteResponse
5420
- # Reserved for future use.
5421
- attr_accessor :meta
5422
- # Rate limit information.
5423
- attr_accessor :rate_limit
5424
-
5425
- def initialize(
5426
- meta: nil,
5427
- rate_limit: nil
5428
- )
5429
- @meta = meta == nil ? nil : meta
5430
- @rate_limit = rate_limit == nil ? nil : rate_limit
5431
- end
5432
-
5433
- def to_json(options = {})
5434
- hash = {}
5435
- self.instance_variables.each do |var|
5436
- hash[var.id2name.delete_prefix("@")] = self.instance_variable_get var
5437
- end
5438
- hash.to_json
5439
- end
5440
- end
5441
-
5442
- # RoleAttachmentGetResponse returns a requested RoleAttachment.
5443
- #
5444
- # Deprecated: use multi-role via AccountAttachments instead.
5445
- class RoleAttachmentGetResponse
5446
- # Reserved for future use.
5447
- attr_accessor :meta
5448
- # Rate limit information.
5449
- attr_accessor :rate_limit
5450
- # The requested RoleAttachment.
5451
- attr_accessor :role_attachment
5452
-
5453
- def initialize(
5454
- meta: nil,
5455
- rate_limit: nil,
5456
- role_attachment: nil
5457
- )
5458
- @meta = meta == nil ? nil : meta
5459
- @rate_limit = rate_limit == nil ? nil : rate_limit
5460
- @role_attachment = role_attachment == nil ? nil : role_attachment
5461
- end
5462
-
5463
- def to_json(options = {})
5464
- hash = {}
5465
- self.instance_variables.each do |var|
5466
- hash[var.id2name.delete_prefix("@")] = self.instance_variable_get var
5467
- end
5468
- hash.to_json
5469
- end
5470
- end
5471
-
5472
5347
  # RoleCreateResponse reports how the Roles were created in the system. It can
5473
5348
  # communicate partial successes or failures.
5474
5349
  class RoleCreateResponse
@@ -5550,122 +5425,6 @@ module SDM
5550
5425
  end
5551
5426
  end
5552
5427
 
5553
- # A RoleGrant connects a resource to a role, granting members of the role access to that resource.
5554
- #
5555
- # Deprecated: use Role access rules instead.
5556
- class RoleGrant
5557
- # Unique identifier of the RoleGrant.
5558
- attr_accessor :id
5559
- # The id of the resource of this RoleGrant.
5560
- attr_accessor :resource_id
5561
- # The id of the attached role of this RoleGrant.
5562
- attr_accessor :role_id
5563
-
5564
- def initialize(
5565
- id: nil,
5566
- resource_id: nil,
5567
- role_id: nil
5568
- )
5569
- @id = id == nil ? "" : id
5570
- @resource_id = resource_id == nil ? "" : resource_id
5571
- @role_id = role_id == nil ? "" : role_id
5572
- end
5573
-
5574
- def to_json(options = {})
5575
- hash = {}
5576
- self.instance_variables.each do |var|
5577
- hash[var.id2name.delete_prefix("@")] = self.instance_variable_get var
5578
- end
5579
- hash.to_json
5580
- end
5581
- end
5582
-
5583
- # RoleGrantCreateResponse reports how the RoleGrants were created in the system.
5584
- #
5585
- # Deprecated: use Role access rules instead.
5586
- class RoleGrantCreateResponse
5587
- # Reserved for future use.
5588
- attr_accessor :meta
5589
- # Rate limit information.
5590
- attr_accessor :rate_limit
5591
- # The created RoleGrant.
5592
- attr_accessor :role_grant
5593
-
5594
- def initialize(
5595
- meta: nil,
5596
- rate_limit: nil,
5597
- role_grant: nil
5598
- )
5599
- @meta = meta == nil ? nil : meta
5600
- @rate_limit = rate_limit == nil ? nil : rate_limit
5601
- @role_grant = role_grant == nil ? nil : role_grant
5602
- end
5603
-
5604
- def to_json(options = {})
5605
- hash = {}
5606
- self.instance_variables.each do |var|
5607
- hash[var.id2name.delete_prefix("@")] = self.instance_variable_get var
5608
- end
5609
- hash.to_json
5610
- end
5611
- end
5612
-
5613
- # RoleGrantDeleteResponse returns information about a RoleGrant that was deleted.
5614
- #
5615
- # Deprecated: use Role access rules instead.
5616
- class RoleGrantDeleteResponse
5617
- # Reserved for future use.
5618
- attr_accessor :meta
5619
- # Rate limit information.
5620
- attr_accessor :rate_limit
5621
-
5622
- def initialize(
5623
- meta: nil,
5624
- rate_limit: nil
5625
- )
5626
- @meta = meta == nil ? nil : meta
5627
- @rate_limit = rate_limit == nil ? nil : rate_limit
5628
- end
5629
-
5630
- def to_json(options = {})
5631
- hash = {}
5632
- self.instance_variables.each do |var|
5633
- hash[var.id2name.delete_prefix("@")] = self.instance_variable_get var
5634
- end
5635
- hash.to_json
5636
- end
5637
- end
5638
-
5639
- # RoleGrantGetResponse returns a requested RoleGrant.
5640
- #
5641
- # Deprecated: use Role access rules instead.
5642
- class RoleGrantGetResponse
5643
- # Reserved for future use.
5644
- attr_accessor :meta
5645
- # Rate limit information.
5646
- attr_accessor :rate_limit
5647
- # The requested RoleGrant.
5648
- attr_accessor :role_grant
5649
-
5650
- def initialize(
5651
- meta: nil,
5652
- rate_limit: nil,
5653
- role_grant: nil
5654
- )
5655
- @meta = meta == nil ? nil : meta
5656
- @rate_limit = rate_limit == nil ? nil : rate_limit
5657
- @role_grant = role_grant == nil ? nil : role_grant
5658
- end
5659
-
5660
- def to_json(options = {})
5661
- hash = {}
5662
- self.instance_variables.each do |var|
5663
- hash[var.id2name.delete_prefix("@")] = self.instance_variable_get var
5664
- end
5665
- hash.to_json
5666
- end
5667
- end
5668
-
5669
5428
  # RoleUpdateResponse returns the fields of a Role after it has been updated by
5670
5429
  # a RoleUpdateRequest.
5671
5430
  class RoleUpdateResponse
@@ -6650,9 +6409,11 @@ module SDM
6650
6409
  end
6651
6410
  end
6652
6411
 
6412
+ # @private
6653
6413
  def self._porcelain_zero_value_tags()
6654
6414
  {}
6655
6415
  end
6416
+ # @private
6656
6417
  def self._porcelain_zero_value_access_rules()
6657
6418
  []
6658
6419
  end
data/lib/strongdm.rb CHANGED
@@ -28,7 +28,7 @@ module SDM #:nodoc:
28
28
  DEFAULT_BASE_RETRY_DELAY = 0.0030 # 30 ms
29
29
  DEFAULT_MAX_RETRY_DELAY = 300 # 300 seconds
30
30
  API_VERSION = "2021-08-23"
31
- USER_AGENT = "strongdm-sdk-ruby/2.6.4"
31
+ USER_AGENT = "strongdm-sdk-ruby/3.0.0"
32
32
  private_constant :DEFAULT_MAX_RETRIES, :DEFAULT_BASE_RETRY_DELAY, :DEFAULT_MAX_RETRY_DELAY, :API_VERSION, :USER_AGENT
33
33
 
34
34
  # Creates a new strongDM API client.
@@ -50,13 +50,12 @@ module SDM #:nodoc:
50
50
  @remote_identities = RemoteIdentities.new(host, insecure, self)
51
51
  @remote_identity_groups = RemoteIdentityGroups.new(host, insecure, self)
52
52
  @resources = Resources.new(host, insecure, self)
53
- @role_attachments = RoleAttachments.new(host, insecure, self)
54
- @role_grants = RoleGrants.new(host, insecure, self)
55
53
  @roles = Roles.new(host, insecure, self)
56
54
  @secret_stores = SecretStores.new(host, insecure, self)
57
55
  @_test_options = Hash.new
58
56
  end
59
57
 
58
+ # @private
60
59
  def get_metadata(method_name, req)
61
60
  return {
62
61
  'x-sdm-authentication': @api_access_key,
@@ -82,6 +81,7 @@ module SDM #:nodoc:
82
81
  return Base64.strict_encode64(OpenSSL::HMAC.digest(OpenSSL::Digest::SHA256.new, signing_key, request_hash))
83
82
  end
84
83
 
84
+ # @private
85
85
  def jitterSleep(iter)
86
86
  dur_max = @base_retry_delay * 2 ** iter
87
87
  if (dur_max > @max_retry_delay)
@@ -91,6 +91,7 @@ module SDM #:nodoc:
91
91
  sleep(dur)
92
92
  end
93
93
 
94
+ # @private
94
95
  def shouldRetry(iter, err)
95
96
  if (iter >= @max_retries - 1)
96
97
  return false
@@ -156,24 +157,6 @@ module SDM #:nodoc:
156
157
  #
157
158
  # See {Resources}.
158
159
  attr_reader :resources
159
- # RoleAttachments represent relationships between composite roles and the roles
160
- # that make up those composite roles. When a composite role is attached to another
161
- # role, the permissions granted to members of the composite role are augmented to
162
- # include the permissions granted to members of the attached role.
163
- #
164
- # Deprecated: use multi-role via AccountAttachments instead.
165
- #
166
- # See {RoleAttachments}.
167
- attr_reader :role_attachments
168
- # RoleGrants represent relationships between composite roles and the roles
169
- # that make up those composite roles. When a composite role is attached to another
170
- # role, the permissions granted to members of the composite role are augmented to
171
- # include the permissions granted to members of the attached role.
172
- #
173
- # Deprecated: use Role access rules instead.
174
- #
175
- # See {RoleGrants}.
176
- attr_reader :role_grants
177
160
  # A Role has a list of access rules which determine which Resources the members
178
161
  # of the Role have access to. An Account can be a member of multiple Roles via
179
162
  # AccountAttachments.
@@ -184,6 +167,7 @@ module SDM #:nodoc:
184
167
  #
185
168
  # See {SecretStores}.
186
169
  attr_reader :secret_stores
170
+ # @private
187
171
  attr_reader :_test_options
188
172
  end
189
173
  end
data/lib/svc.rb CHANGED
@@ -1311,336 +1311,6 @@ module SDM #:nodoc:
1311
1311
  end
1312
1312
  end
1313
1313
 
1314
- # RoleAttachments represent relationships between composite roles and the roles
1315
- # that make up those composite roles. When a composite role is attached to another
1316
- # role, the permissions granted to members of the composite role are augmented to
1317
- # include the permissions granted to members of the attached role.
1318
- #
1319
- # Deprecated: use multi-role via AccountAttachments instead.
1320
- #
1321
- # See {RoleAttachment}.
1322
- class RoleAttachments
1323
- extend Gem::Deprecate
1324
-
1325
- def initialize(host, insecure, parent)
1326
- begin
1327
- if insecure
1328
- @stub = V1::RoleAttachments::Stub.new(host, :this_channel_is_insecure)
1329
- else
1330
- cred = GRPC::Core::ChannelCredentials.new()
1331
- @stub = V1::RoleAttachments::Stub.new(host, cred)
1332
- end
1333
- rescue => exception
1334
- raise Plumbing::convert_error_to_porcelain(exception)
1335
- end
1336
- @parent = parent
1337
- end
1338
-
1339
- # Create registers a new RoleAttachment.
1340
- #
1341
- # Deprecated: use multi-role via AccountAttachments instead.
1342
- def create(
1343
- role_attachment,
1344
- deadline: nil
1345
- )
1346
- req = V1::RoleAttachmentCreateRequest.new()
1347
-
1348
- req.role_attachment = Plumbing::convert_role_attachment_to_plumbing(role_attachment)
1349
- tries = 0
1350
- plumbing_response = nil
1351
- loop do
1352
- begin
1353
- plumbing_response = @stub.create(req, metadata: @parent.get_metadata("RoleAttachments.Create", req), deadline: deadline)
1354
- rescue => exception
1355
- if (@parent.shouldRetry(tries, exception))
1356
- tries + +@parent.jitterSleep(tries)
1357
- next
1358
- end
1359
- raise Plumbing::convert_error_to_porcelain(exception)
1360
- end
1361
- break
1362
- end
1363
-
1364
- resp = RoleAttachmentCreateResponse.new()
1365
- resp.meta = Plumbing::convert_create_response_metadata_to_porcelain(plumbing_response.meta)
1366
- resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1367
- resp.role_attachment = Plumbing::convert_role_attachment_to_porcelain(plumbing_response.role_attachment)
1368
- resp
1369
- end
1370
-
1371
- deprecate :create, :none, 2022, 6
1372
- # Get reads one RoleAttachment by ID.
1373
- #
1374
- # Deprecated: use multi-role via AccountAttachments instead.
1375
- def get(
1376
- id,
1377
- deadline: nil
1378
- )
1379
- req = V1::RoleAttachmentGetRequest.new()
1380
-
1381
- req.id = (id)
1382
- tries = 0
1383
- plumbing_response = nil
1384
- loop do
1385
- begin
1386
- plumbing_response = @stub.get(req, metadata: @parent.get_metadata("RoleAttachments.Get", req), deadline: deadline)
1387
- rescue => exception
1388
- if (@parent.shouldRetry(tries, exception))
1389
- tries + +@parent.jitterSleep(tries)
1390
- next
1391
- end
1392
- raise Plumbing::convert_error_to_porcelain(exception)
1393
- end
1394
- break
1395
- end
1396
-
1397
- resp = RoleAttachmentGetResponse.new()
1398
- resp.meta = Plumbing::convert_get_response_metadata_to_porcelain(plumbing_response.meta)
1399
- resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1400
- resp.role_attachment = Plumbing::convert_role_attachment_to_porcelain(plumbing_response.role_attachment)
1401
- resp
1402
- end
1403
-
1404
- deprecate :get, :none, 2022, 6
1405
- # Delete removes a RoleAttachment by ID.
1406
- #
1407
- # Deprecated: use multi-role via AccountAttachments instead.
1408
- def delete(
1409
- id,
1410
- deadline: nil
1411
- )
1412
- req = V1::RoleAttachmentDeleteRequest.new()
1413
-
1414
- req.id = (id)
1415
- tries = 0
1416
- plumbing_response = nil
1417
- loop do
1418
- begin
1419
- plumbing_response = @stub.delete(req, metadata: @parent.get_metadata("RoleAttachments.Delete", req), deadline: deadline)
1420
- rescue => exception
1421
- if (@parent.shouldRetry(tries, exception))
1422
- tries + +@parent.jitterSleep(tries)
1423
- next
1424
- end
1425
- raise Plumbing::convert_error_to_porcelain(exception)
1426
- end
1427
- break
1428
- end
1429
-
1430
- resp = RoleAttachmentDeleteResponse.new()
1431
- resp.meta = Plumbing::convert_delete_response_metadata_to_porcelain(plumbing_response.meta)
1432
- resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1433
- resp
1434
- end
1435
-
1436
- deprecate :delete, :none, 2022, 6
1437
- # List gets a list of RoleAttachments matching a given set of criteria.
1438
- #
1439
- # Deprecated: use multi-role via AccountAttachments instead.
1440
- def list(
1441
- filter,
1442
- *args,
1443
- deadline: nil
1444
- )
1445
- req = V1::RoleAttachmentListRequest.new()
1446
- req.meta = V1::ListRequestMetadata.new()
1447
- page_size_option = @parent._test_options["PageSize"]
1448
- if page_size_option.is_a? Integer
1449
- req.meta.limit = page_size_option
1450
- end
1451
-
1452
- req.filter = Plumbing::quote_filter_args(filter, *args)
1453
- resp = Enumerator::Generator.new { |g|
1454
- tries = 0
1455
- loop do
1456
- begin
1457
- plumbing_response = @stub.list(req, metadata: @parent.get_metadata("RoleAttachments.List", req), deadline: deadline)
1458
- rescue => exception
1459
- if (@parent.shouldRetry(tries, exception))
1460
- tries + +@parent.jitterSleep(tries)
1461
- next
1462
- end
1463
- raise Plumbing::convert_error_to_porcelain(exception)
1464
- end
1465
- tries = 0
1466
- plumbing_response.role_attachments.each do |plumbing_item|
1467
- g.yield Plumbing::convert_role_attachment_to_porcelain(plumbing_item)
1468
- end
1469
- break if plumbing_response.meta.next_cursor == ""
1470
- req.meta.cursor = plumbing_response.meta.next_cursor
1471
- end
1472
- }
1473
- resp
1474
- end
1475
-
1476
- deprecate :list, :none, 2022, 6
1477
- end
1478
-
1479
- # RoleGrants represent relationships between composite roles and the roles
1480
- # that make up those composite roles. When a composite role is attached to another
1481
- # role, the permissions granted to members of the composite role are augmented to
1482
- # include the permissions granted to members of the attached role.
1483
- #
1484
- # Deprecated: use Role access rules instead.
1485
- #
1486
- # See {RoleGrant}.
1487
- class RoleGrants
1488
- extend Gem::Deprecate
1489
-
1490
- def initialize(host, insecure, parent)
1491
- begin
1492
- if insecure
1493
- @stub = V1::RoleGrants::Stub.new(host, :this_channel_is_insecure)
1494
- else
1495
- cred = GRPC::Core::ChannelCredentials.new()
1496
- @stub = V1::RoleGrants::Stub.new(host, cred)
1497
- end
1498
- rescue => exception
1499
- raise Plumbing::convert_error_to_porcelain(exception)
1500
- end
1501
- @parent = parent
1502
- end
1503
-
1504
- # Create registers a new RoleGrant.
1505
- #
1506
- # Deprecated: use Role access rules instead.
1507
- def create(
1508
- role_grant,
1509
- deadline: nil
1510
- )
1511
- req = V1::RoleGrantCreateRequest.new()
1512
-
1513
- req.role_grant = Plumbing::convert_role_grant_to_plumbing(role_grant)
1514
- tries = 0
1515
- plumbing_response = nil
1516
- loop do
1517
- begin
1518
- plumbing_response = @stub.create(req, metadata: @parent.get_metadata("RoleGrants.Create", req), deadline: deadline)
1519
- rescue => exception
1520
- if (@parent.shouldRetry(tries, exception))
1521
- tries + +@parent.jitterSleep(tries)
1522
- next
1523
- end
1524
- raise Plumbing::convert_error_to_porcelain(exception)
1525
- end
1526
- break
1527
- end
1528
-
1529
- resp = RoleGrantCreateResponse.new()
1530
- resp.meta = Plumbing::convert_create_response_metadata_to_porcelain(plumbing_response.meta)
1531
- resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1532
- resp.role_grant = Plumbing::convert_role_grant_to_porcelain(plumbing_response.role_grant)
1533
- resp
1534
- end
1535
-
1536
- deprecate :create, :none, 2022, 6
1537
- # Get reads one RoleGrant by ID.
1538
- #
1539
- # Deprecated: use Role access rules instead.
1540
- def get(
1541
- id,
1542
- deadline: nil
1543
- )
1544
- req = V1::RoleGrantGetRequest.new()
1545
-
1546
- req.id = (id)
1547
- tries = 0
1548
- plumbing_response = nil
1549
- loop do
1550
- begin
1551
- plumbing_response = @stub.get(req, metadata: @parent.get_metadata("RoleGrants.Get", req), deadline: deadline)
1552
- rescue => exception
1553
- if (@parent.shouldRetry(tries, exception))
1554
- tries + +@parent.jitterSleep(tries)
1555
- next
1556
- end
1557
- raise Plumbing::convert_error_to_porcelain(exception)
1558
- end
1559
- break
1560
- end
1561
-
1562
- resp = RoleGrantGetResponse.new()
1563
- resp.meta = Plumbing::convert_get_response_metadata_to_porcelain(plumbing_response.meta)
1564
- resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1565
- resp.role_grant = Plumbing::convert_role_grant_to_porcelain(plumbing_response.role_grant)
1566
- resp
1567
- end
1568
-
1569
- deprecate :get, :none, 2022, 6
1570
- # Delete removes a RoleGrant by ID.
1571
- #
1572
- # Deprecated: use Role access rules instead.
1573
- def delete(
1574
- id,
1575
- deadline: nil
1576
- )
1577
- req = V1::RoleGrantDeleteRequest.new()
1578
-
1579
- req.id = (id)
1580
- tries = 0
1581
- plumbing_response = nil
1582
- loop do
1583
- begin
1584
- plumbing_response = @stub.delete(req, metadata: @parent.get_metadata("RoleGrants.Delete", req), deadline: deadline)
1585
- rescue => exception
1586
- if (@parent.shouldRetry(tries, exception))
1587
- tries + +@parent.jitterSleep(tries)
1588
- next
1589
- end
1590
- raise Plumbing::convert_error_to_porcelain(exception)
1591
- end
1592
- break
1593
- end
1594
-
1595
- resp = RoleGrantDeleteResponse.new()
1596
- resp.meta = Plumbing::convert_delete_response_metadata_to_porcelain(plumbing_response.meta)
1597
- resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1598
- resp
1599
- end
1600
-
1601
- deprecate :delete, :none, 2022, 6
1602
- # List gets a list of RoleGrants matching a given set of criteria.
1603
- #
1604
- # Deprecated: use Role access rules instead.
1605
- def list(
1606
- filter,
1607
- *args,
1608
- deadline: nil
1609
- )
1610
- req = V1::RoleGrantListRequest.new()
1611
- req.meta = V1::ListRequestMetadata.new()
1612
- page_size_option = @parent._test_options["PageSize"]
1613
- if page_size_option.is_a? Integer
1614
- req.meta.limit = page_size_option
1615
- end
1616
-
1617
- req.filter = Plumbing::quote_filter_args(filter, *args)
1618
- resp = Enumerator::Generator.new { |g|
1619
- tries = 0
1620
- loop do
1621
- begin
1622
- plumbing_response = @stub.list(req, metadata: @parent.get_metadata("RoleGrants.List", req), deadline: deadline)
1623
- rescue => exception
1624
- if (@parent.shouldRetry(tries, exception))
1625
- tries + +@parent.jitterSleep(tries)
1626
- next
1627
- end
1628
- raise Plumbing::convert_error_to_porcelain(exception)
1629
- end
1630
- tries = 0
1631
- plumbing_response.role_grants.each do |plumbing_item|
1632
- g.yield Plumbing::convert_role_grant_to_porcelain(plumbing_item)
1633
- end
1634
- break if plumbing_response.meta.next_cursor == ""
1635
- req.meta.cursor = plumbing_response.meta.next_cursor
1636
- end
1637
- }
1638
- resp
1639
- end
1640
-
1641
- deprecate :list, :none, 2022, 6
1642
- end
1643
-
1644
1314
  # A Role has a list of access rules which determine which Resources the members
1645
1315
  # of the Role have access to. An Account can be a member of multiple Roles via
1646
1316
  # AccountAttachments.