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.
3622 3623 3624 3625 3626 3627 3628 3629 |
# File 'lib/svc.rb', line 3622 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.
3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 |
# File 'lib/svc.rb', line 3632 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.
3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 |
# File 'lib/svc.rb', line 3741 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.
3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 |
# File 'lib/svc.rb', line 3667 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.
3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 |
# File 'lib/svc.rb', line 3775 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.
3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 |
# File 'lib/svc.rb', line 3706 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 |