Class: SDM::GrantedRoleEntitlements
- Inherits:
-
Object
- Object
- SDM::GrantedRoleEntitlements
- Extended by:
- Gem::Deprecate
- Defined in:
- lib/svc.rb
Overview
GrantedRoleEntitlements enumerates the resources to which a role grants access. The GrantedRoleEntitlements service is read-only.
Instance Method Summary collapse
-
#initialize(channel, parent) ⇒ GrantedRoleEntitlements
constructor
A new instance of GrantedRoleEntitlements.
-
#list(role_id, filter, *args, deadline: nil) ⇒ Object
List gets a list of GrantedRoleEntitlement records matching a given set of criteria.
Constructor Details
#initialize(channel, parent) ⇒ GrantedRoleEntitlements
Returns a new instance of GrantedRoleEntitlements.
2926 2927 2928 2929 2930 2931 2932 2933 |
# File 'lib/svc.rb', line 2926 def initialize(channel, parent) begin @stub = V1::GrantedRoleEntitlements::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 GrantedRoleEntitlement records matching a given set of criteria.
2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 |
# File 'lib/svc.rb', line 2936 def list( role_id, filter, *args, deadline: nil ) req = V1::GrantedRoleEntitlementListRequest.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.("GrantedRoleEntitlements.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.granted_role_entitlements.each do |plumbing_item| g.yield Plumbing::convert_granted_role_entitlement_to_porcelain(plumbing_item) end break if plumbing_response..next_cursor == "" req..cursor = plumbing_response..next_cursor end } resp end |