Method: SDM::RoleGrants#get

Defined in:
lib/svc.rb

#get(id, deadline: nil) ⇒ Object

Get reads one RoleGrant by ID.

Deprecated: use Role access rules instead.



1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
# File 'lib/svc.rb', line 1540

def get(
  id,
  deadline: nil
)
  req = V1::RoleGrantGetRequest.new()

  req.id = (id)
  tries = 0
  plumbing_response = nil
  loop do
    begin
      plumbing_response = @stub.get(req, metadata: @parent.("RoleGrants.Get", req), deadline: deadline)
    rescue => exception
      if (@parent.shouldRetry(tries, exception))
        tries + +@parent.jitterSleep(tries)
        next
      end
      raise Plumbing::convert_error_to_porcelain(exception)
    end
    break
  end

  resp = RoleGrantGetResponse.new()
  resp.meta = Plumbing::(plumbing_response.meta)
  resp.rate_limit = Plumbing::(plumbing_response.rate_limit)
  resp.role_grant = Plumbing::convert_role_grant_to_porcelain(plumbing_response.role_grant)
  resp
end