Class: SDM::RequestableRoleEntitlements
- Inherits:
-
Object
- Object
- SDM::RequestableRoleEntitlements
- Extended by:
- Gem::Deprecate
- Defined in:
- lib/svc.rb
Overview
RequestableRoleEntitlements enumerates the resources that a role permits its members to request access to. The RequestableRoleEntitlements service is read-only.
Instance Method Summary collapse
-
#initialize(channel, parent) ⇒ RequestableRoleEntitlements
constructor
A new instance of RequestableRoleEntitlements.
-
#list(role_id, filter, *args, deadline: nil) ⇒ Object
List gets a list of RequestableRoleEntitlement records matching a given set of criteria.
Constructor Details
#initialize(channel, parent) ⇒ RequestableRoleEntitlements
Returns a new instance of RequestableRoleEntitlements.
7262 7263 7264 7265 7266 7267 7268 7269 |
# File 'lib/svc.rb', line 7262 def initialize(channel, parent) begin @stub = V1::RequestableRoleEntitlements::Stub.new(nil, nil, channel_override: channel) rescue => exception raise Plumbing::convert_error_to_porcelain(exception) end @parent = parent end |
Instance Method Details
#list(role_id, filter, *args, deadline: nil) ⇒ Object
List gets a list of RequestableRoleEntitlement records matching a given set of criteria.
7272 7273 7274 7275 7276 7277 7278 7279 7280 7281 7282 7283 7284 7285 7286 7287 7288 7289 7290 7291 7292 7293 7294 7295 7296 7297 7298 7299 7300 7301 7302 7303 7304 7305 7306 7307 7308 7309 7310 |
# File 'lib/svc.rb', line 7272 def list( role_id, filter, *args, deadline: nil ) req = V1::RequestableRoleEntitlementListRequest.new() req. = V1::ListRequestMetadata.new() if not @parent.page_limit.nil? req..limit = @parent.page_limit end if not @parent.snapshot_time.nil? req..snapshot_at = @parent.snapshot_time end req.role_id = (role_id) req.filter = Plumbing::quote_filter_args(filter, *args) resp = Enumerator::Generator.new { |g| tries = 0 loop do begin plumbing_response = @stub.list(req, metadata: @parent.("RequestableRoleEntitlements.List", req), deadline: deadline) rescue => exception if (@parent.shouldRetry(tries, exception, deadline)) tries + +sleep(@parent.exponentialBackoff(tries, deadline)) next end raise Plumbing::convert_error_to_porcelain(exception) end tries = 0 plumbing_response.requestable_role_entitlements.each do |plumbing_item| g.yield Plumbing::convert_requestable_role_entitlement_to_porcelain(plumbing_item) end break if plumbing_response..next_cursor == "" req..cursor = plumbing_response..next_cursor end } resp end |