Class: SDM::GroupsRoles
- Inherits:
-
Object
- Object
- SDM::GroupsRoles
- Extended by:
- Gem::Deprecate
- Defined in:
- lib/svc.rb
Overview
A GroupRole is an assignment of a Group to a Role.
See GroupRole.
Instance Method Summary collapse
-
#create(group_role, deadline: nil) ⇒ Object
Create registers a new GroupRole.
-
#delete(id, deadline: nil) ⇒ Object
Delete removes a GroupRole by ID.
-
#get(id, deadline: nil) ⇒ Object
Get reads one GroupRole by ID.
-
#initialize(channel, parent) ⇒ GroupsRoles
constructor
A new instance of GroupsRoles.
-
#list(filter, *args, deadline: nil) ⇒ Object
List gets a list of GroupRoles matching a given set of criteria.
Constructor Details
#initialize(channel, parent) ⇒ GroupsRoles
3562 3563 3564 3565 3566 3567 3568 3569 |
# File 'lib/svc.rb', line 3562 def initialize(channel, parent) begin @stub = V1::GroupsRoles::Stub.new(nil, nil, channel_override: channel) rescue => exception raise Plumbing::convert_error_to_porcelain(exception) end @parent = parent end |
Instance Method Details
#create(group_role, deadline: nil) ⇒ Object
Create registers a new GroupRole.
3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 |
# File 'lib/svc.rb', line 3572 def create( group_role, deadline: nil ) req = V1::GroupRoleCreateRequest.new() req.group_role = Plumbing::convert_group_role_to_plumbing(group_role) # Execute before interceptor hooks req = @parent.interceptor.execute_before("GroupsRoles.Create", self, req) tries = 0 plumbing_response = nil loop do begin plumbing_response = @stub.create(req, metadata: @parent.("GroupsRoles.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("GroupsRoles.Create", self, req, plumbing_response) resp = GroupRoleCreateResponse.new() resp.group_role = Plumbing::convert_group_role_to_porcelain(plumbing_response.group_role) resp.rate_limit = Plumbing::(plumbing_response.rate_limit) resp end |
#delete(id, deadline: nil) ⇒ Object
Delete removes a GroupRole by ID.
3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 |
# File 'lib/svc.rb', line 3645 def delete( id, deadline: nil ) req = V1::GroupRoleDeleteRequest.new() req.id = (id) # Execute before interceptor hooks req = @parent.interceptor.execute_before("GroupsRoles.Delete", self, req) tries = 0 plumbing_response = nil loop do begin plumbing_response = @stub.delete(req, metadata: @parent.("GroupsRoles.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("GroupsRoles.Delete", self, req, plumbing_response) resp = GroupRoleDeleteResponse.new() resp.group_role = Plumbing::convert_group_role_to_porcelain(plumbing_response.group_role) resp. = Plumbing::(plumbing_response.) resp.rate_limit = Plumbing::(plumbing_response.rate_limit) resp end |
#get(id, deadline: nil) ⇒ Object
Get reads one GroupRole by ID.
3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 |
# File 'lib/svc.rb', line 3606 def get( id, deadline: nil ) req = V1::GroupRoleGetRequest.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("GroupsRoles.Get", self, req) tries = 0 plumbing_response = nil loop do begin plumbing_response = @stub.get(req, metadata: @parent.("GroupsRoles.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("GroupsRoles.Get", self, req, plumbing_response) resp = GroupRoleGetResponse.new() resp.group_role = Plumbing::convert_group_role_to_porcelain(plumbing_response.group_role) 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 GroupRoles matching a given set of criteria.
3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 |
# File 'lib/svc.rb', line 3680 def list( filter, *args, deadline: nil ) req = V1::GroupRoleListRequest.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.("GroupsRoles.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.groups_roles.each do |plumbing_item| g.yield Plumbing::convert_group_role_to_porcelain(plumbing_item) end break if plumbing_response..next_cursor == "" req..cursor = plumbing_response..next_cursor end } resp end |