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.
6976 6977 6978 6979 6980 6981 6982 6983 |
# File 'lib/svc.rb', line 6976 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.
6986 6987 6988 6989 6990 6991 6992 6993 6994 6995 6996 6997 6998 6999 7000 7001 7002 7003 7004 7005 7006 7007 7008 7009 7010 7011 7012 7013 7014 7015 7016 7017 7018 7019 7020 7021 7022 7023 7024 |
# File 'lib/svc.rb', line 6986 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 |