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.
7142 7143 7144 7145 7146 7147 7148 7149 |
# File 'lib/svc.rb', line 7142 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.
7152 7153 7154 7155 7156 7157 7158 7159 7160 7161 7162 7163 7164 7165 7166 7167 7168 7169 7170 7171 7172 7173 7174 7175 7176 7177 7178 7179 7180 7181 7182 7183 7184 7185 7186 7187 7188 7189 7190 |
# File 'lib/svc.rb', line 7152 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 |