Class: SDM::IdentitySets
- Inherits:
-
Object
- Object
- SDM::IdentitySets
- Extended by:
- Gem::Deprecate
- Defined in:
- lib/svc.rb
Overview
A IdentitySet is a named grouping of Identity Aliases for Accounts. An Account's relationship to a IdentitySet is defined via IdentityAlias objects.
See IdentitySet.
Instance Method Summary collapse
-
#create(identity_set, deadline: nil) ⇒ Object
Create registers a new IdentitySet.
-
#delete(id, deadline: nil) ⇒ Object
Delete removes a IdentitySet by ID.
-
#get(id, deadline: nil) ⇒ Object
Get reads one IdentitySet by ID.
-
#initialize(channel, parent) ⇒ IdentitySets
constructor
A new instance of IdentitySets.
-
#list(filter, *args, deadline: nil) ⇒ Object
List gets a list of IdentitySets matching a given set of criteria.
-
#update(identity_set, deadline: nil) ⇒ Object
Update replaces all the fields of a IdentitySet by ID.
Constructor Details
#initialize(channel, parent) ⇒ IdentitySets
Returns a new instance of IdentitySets.
3910 3911 3912 3913 3914 3915 3916 3917 |
# File 'lib/svc.rb', line 3910 def initialize(channel, parent) begin @stub = V1::IdentitySets::Stub.new(nil, nil, channel_override: channel) rescue => exception raise Plumbing::convert_error_to_porcelain(exception) end @parent = parent end |
Instance Method Details
#create(identity_set, deadline: nil) ⇒ Object
Create registers a new IdentitySet.
3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 |
# File 'lib/svc.rb', line 3920 def create( identity_set, deadline: nil ) req = V1::IdentitySetCreateRequest.new() req.identity_set = Plumbing::convert_identity_set_to_plumbing(identity_set) # Execute before interceptor hooks req = @parent.interceptor.execute_before("IdentitySets.Create", self, req) tries = 0 plumbing_response = nil loop do begin plumbing_response = @stub.create(req, metadata: @parent.("IdentitySets.Create", 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 break end # Execute after interceptor hooks plumbing_response = @parent.interceptor.execute_after("IdentitySets.Create", self, req, plumbing_response) resp = IdentitySetCreateResponse.new() resp.identity_set = Plumbing::convert_identity_set_to_porcelain(plumbing_response.identity_set) resp. = Plumbing::(plumbing_response.) resp.rate_limit = Plumbing::(plumbing_response.rate_limit) resp end |
#delete(id, deadline: nil) ⇒ Object
Delete removes a IdentitySet by ID.
4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 |
# File 'lib/svc.rb', line 4029 def delete( id, deadline: nil ) req = V1::IdentitySetDeleteRequest.new() req.id = (id) # Execute before interceptor hooks req = @parent.interceptor.execute_before("IdentitySets.Delete", self, req) tries = 0 plumbing_response = nil loop do begin plumbing_response = @stub.delete(req, metadata: @parent.("IdentitySets.Delete", 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 break end # Execute after interceptor hooks plumbing_response = @parent.interceptor.execute_after("IdentitySets.Delete", self, req, plumbing_response) resp = IdentitySetDeleteResponse.new() resp. = Plumbing::(plumbing_response.) resp.rate_limit = Plumbing::(plumbing_response.rate_limit) resp end |
#get(id, deadline: nil) ⇒ Object
Get reads one IdentitySet by ID.
3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 |
# File 'lib/svc.rb', line 3955 def get( id, deadline: nil ) req = V1::IdentitySetGetRequest.new() if not @parent.snapshot_time.nil? req. = V1::GetRequestMetadata.new() req..snapshot_at = @parent.snapshot_time end req.id = (id) # Execute before interceptor hooks req = @parent.interceptor.execute_before("IdentitySets.Get", self, req) tries = 0 plumbing_response = nil loop do begin plumbing_response = @stub.get(req, metadata: @parent.("IdentitySets.Get", 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 break end # Execute after interceptor hooks plumbing_response = @parent.interceptor.execute_after("IdentitySets.Get", self, req, plumbing_response) resp = IdentitySetGetResponse.new() resp.identity_set = Plumbing::convert_identity_set_to_porcelain(plumbing_response.identity_set) resp. = Plumbing::(plumbing_response.) resp.rate_limit = Plumbing::(plumbing_response.rate_limit) resp end |
#list(filter, *args, deadline: nil) ⇒ Object
List gets a list of IdentitySets matching a given set of criteria.
4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 |
# File 'lib/svc.rb', line 4063 def list( filter, *args, deadline: nil ) req = V1::IdentitySetListRequest.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.filter = Plumbing::quote_filter_args(filter, *args) resp = Enumerator::Generator.new { |g| tries = 0 loop do begin plumbing_response = @stub.list(req, metadata: @parent.("IdentitySets.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.identity_sets.each do |plumbing_item| g.yield Plumbing::convert_identity_set_to_porcelain(plumbing_item) end break if plumbing_response..next_cursor == "" req..cursor = plumbing_response..next_cursor end } resp end |
#update(identity_set, deadline: nil) ⇒ Object
Update replaces all the fields of a IdentitySet by ID.
3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 |
# File 'lib/svc.rb', line 3994 def update( identity_set, deadline: nil ) req = V1::IdentitySetUpdateRequest.new() req.identity_set = Plumbing::convert_identity_set_to_plumbing(identity_set) # Execute before interceptor hooks req = @parent.interceptor.execute_before("IdentitySets.Update", self, req) tries = 0 plumbing_response = nil loop do begin plumbing_response = @stub.update(req, metadata: @parent.("IdentitySets.Update", 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 break end # Execute after interceptor hooks plumbing_response = @parent.interceptor.execute_after("IdentitySets.Update", self, req, plumbing_response) resp = IdentitySetUpdateResponse.new() resp.identity_set = Plumbing::convert_identity_set_to_porcelain(plumbing_response.identity_set) resp. = Plumbing::(plumbing_response.) resp.rate_limit = Plumbing::(plumbing_response.rate_limit) resp end |