Class: SDM::RequestableAccountEntitlements
- Inherits:
-
Object
- Object
- SDM::RequestableAccountEntitlements
- Extended by:
- Gem::Deprecate
- Defined in:
- lib/svc.rb
Overview
RequestableAccountEntitlements enumerates the resources that an account is permitted to request access to. The RequestableAccountEntitlements service is read-only.
Instance Method Summary collapse
-
#initialize(channel, parent) ⇒ RequestableAccountEntitlements
constructor
A new instance of RequestableAccountEntitlements.
-
#list(account_id, filter, *args, deadline: nil) ⇒ Object
List gets a list of RequestableAccountEntitlement records matching a given set of criteria.
Constructor Details
#initialize(channel, parent) ⇒ RequestableAccountEntitlements
Returns a new instance of RequestableAccountEntitlements.
7096 7097 7098 7099 7100 7101 7102 7103 |
# File 'lib/svc.rb', line 7096 def initialize(channel, parent) begin @stub = V1::RequestableAccountEntitlements::Stub.new(nil, nil, channel_override: channel) rescue => exception raise Plumbing::convert_error_to_porcelain(exception) end @parent = parent end |
Instance Method Details
#list(account_id, filter, *args, deadline: nil) ⇒ Object
List gets a list of RequestableAccountEntitlement records matching a given set of criteria.
7106 7107 7108 7109 7110 7111 7112 7113 7114 7115 7116 7117 7118 7119 7120 7121 7122 7123 7124 7125 7126 7127 7128 7129 7130 7131 7132 7133 7134 7135 7136 7137 7138 7139 7140 7141 7142 7143 7144 |
# File 'lib/svc.rb', line 7106 def list( account_id, filter, *args, deadline: nil ) req = V1::RequestableAccountEntitlementListRequest.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.account_id = (account_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.("RequestableAccountEntitlements.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_account_entitlements.each do |plumbing_item| g.yield Plumbing::convert_requestable_account_entitlement_to_porcelain(plumbing_item) end break if plumbing_response..next_cursor == "" req..cursor = plumbing_response..next_cursor end } resp end |