Class: SDM::IdentityAliases
- Inherits:
-
Object
- Object
- SDM::IdentityAliases
- Extended by:
- Gem::Deprecate
- Defined in:
- lib/svc.rb
Overview
IdentityAliases assign an alias to an account within an IdentitySet. The alias is used as the username when connecting to a identity supported resource.
See IdentityAlias.
Instance Method Summary collapse
-
#create(identity_alias, deadline: nil) ⇒ Object
Create registers a new IdentityAlias.
-
#delete(id, deadline: nil) ⇒ Object
Delete removes a IdentityAlias by ID.
-
#get(id, deadline: nil) ⇒ Object
Get reads one IdentityAlias by ID.
-
#initialize(channel, parent) ⇒ IdentityAliases
constructor
A new instance of IdentityAliases.
-
#list(filter, *args, deadline: nil) ⇒ Object
List gets a list of IdentityAliases matching a given set of criteria.
-
#update(identity_alias, deadline: nil) ⇒ Object
Update replaces all the fields of a IdentityAlias by ID.
Constructor Details
#initialize(channel, parent) ⇒ IdentityAliases
Returns a new instance of IdentityAliases.
3871 3872 3873 3874 3875 3876 3877 3878 |
# File 'lib/svc.rb', line 3871 def initialize(channel, parent) begin @stub = V1::IdentityAliases::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_alias, deadline: nil) ⇒ Object
Create registers a new IdentityAlias.
3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 |
# File 'lib/svc.rb', line 3881 def create( identity_alias, deadline: nil ) req = V1::IdentityAliasCreateRequest.new() req.identity_alias = Plumbing::convert_identity_alias_to_plumbing(identity_alias) # Execute before interceptor hooks req = @parent.interceptor.execute_before("IdentityAliases.Create", self, req) tries = 0 plumbing_response = nil loop do begin plumbing_response = @stub.create(req, metadata: @parent.("IdentityAliases.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("IdentityAliases.Create", self, req, plumbing_response) resp = IdentityAliasCreateResponse.new() resp.identity_alias = Plumbing::convert_identity_alias_to_porcelain(plumbing_response.identity_alias) resp. = Plumbing::(plumbing_response.) resp.rate_limit = Plumbing::(plumbing_response.rate_limit) resp end |
#delete(id, deadline: nil) ⇒ Object
Delete removes a IdentityAlias by ID.
3990 3991 3992 3993 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 |
# File 'lib/svc.rb', line 3990 def delete( id, deadline: nil ) req = V1::IdentityAliasDeleteRequest.new() req.id = (id) # Execute before interceptor hooks req = @parent.interceptor.execute_before("IdentityAliases.Delete", self, req) tries = 0 plumbing_response = nil loop do begin plumbing_response = @stub.delete(req, metadata: @parent.("IdentityAliases.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("IdentityAliases.Delete", self, req, plumbing_response) resp = IdentityAliasDeleteResponse.new() resp. = Plumbing::(plumbing_response.) resp.rate_limit = Plumbing::(plumbing_response.rate_limit) resp end |
#get(id, deadline: nil) ⇒ Object
Get reads one IdentityAlias by ID.
3916 3917 3918 3919 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 3916 def get( id, deadline: nil ) req = V1::IdentityAliasGetRequest.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("IdentityAliases.Get", self, req) tries = 0 plumbing_response = nil loop do begin plumbing_response = @stub.get(req, metadata: @parent.("IdentityAliases.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("IdentityAliases.Get", self, req, plumbing_response) resp = IdentityAliasGetResponse.new() resp.identity_alias = Plumbing::convert_identity_alias_to_porcelain(plumbing_response.identity_alias) 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 IdentityAliases matching a given set of criteria.
4024 4025 4026 4027 4028 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 4024 def list( filter, *args, deadline: nil ) req = V1::IdentityAliasListRequest.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.("IdentityAliases.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_aliases.each do |plumbing_item| g.yield Plumbing::convert_identity_alias_to_porcelain(plumbing_item) end break if plumbing_response..next_cursor == "" req..cursor = plumbing_response..next_cursor end } resp end |
#update(identity_alias, deadline: nil) ⇒ Object
Update replaces all the fields of a IdentityAlias 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 |
# File 'lib/svc.rb', line 3955 def update( identity_alias, deadline: nil ) req = V1::IdentityAliasUpdateRequest.new() req.identity_alias = Plumbing::convert_identity_alias_to_plumbing(identity_alias) # Execute before interceptor hooks req = @parent.interceptor.execute_before("IdentityAliases.Update", self, req) tries = 0 plumbing_response = nil loop do begin plumbing_response = @stub.update(req, metadata: @parent.("IdentityAliases.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("IdentityAliases.Update", self, req, plumbing_response) resp = IdentityAliasUpdateResponse.new() resp.identity_alias = Plumbing::convert_identity_alias_to_porcelain(plumbing_response.identity_alias) resp. = Plumbing::(plumbing_response.) resp.rate_limit = Plumbing::(plumbing_response.rate_limit) resp end |