Class: SDM::RemoteIdentityGroups

Inherits:
Object
  • Object
show all
Extended by:
Gem::Deprecate
Defined in:
lib/svc.rb

Overview

A RemoteIdentityGroup is a named grouping of Remote Identities for Accounts. An Account's relationship to a RemoteIdentityGroup is defined via RemoteIdentity objects.

See RemoteIdentityGroup.

Instance Method Summary collapse

Constructor Details

#initialize(channel, parent) ⇒ RemoteIdentityGroups

Returns a new instance of RemoteIdentityGroups.



4997
4998
4999
5000
5001
5002
5003
5004
# File 'lib/svc.rb', line 4997

def initialize(channel, parent)
  begin
    @stub = V1::RemoteIdentityGroups::Stub.new(nil, nil, channel_override: channel)
  rescue => exception
    raise Plumbing::convert_error_to_porcelain(exception)
  end
  @parent = parent
end

Instance Method Details

#get(id, deadline: nil) ⇒ Object

Get reads one RemoteIdentityGroup by ID.



5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
# File 'lib/svc.rb', line 5007

def get(
  id,
  deadline: nil
)
  req = V1::RemoteIdentityGroupGetRequest.new()
  if not @parent.snapshot_time.nil?
    req.meta = V1::GetRequestMetadata.new()
    req.meta.snapshot_at = @parent.snapshot_time
  end

  req.id = (id)
  tries = 0
  plumbing_response = nil
  loop do
    begin
      plumbing_response = @stub.get(req, metadata: @parent.("RemoteIdentityGroups.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

  resp = RemoteIdentityGroupGetResponse.new()
  resp.meta = Plumbing::(plumbing_response.meta)
  resp.rate_limit = Plumbing::(plumbing_response.rate_limit)
  resp.remote_identity_group = Plumbing::convert_remote_identity_group_to_porcelain(plumbing_response.remote_identity_group)
  resp
end

#list(filter, *args, deadline: nil) ⇒ Object

List gets a list of RemoteIdentityGroups matching a given set of criteria.



5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
# File 'lib/svc.rb', line 5041

def list(
  filter,
  *args,
  deadline: nil
)
  req = V1::RemoteIdentityGroupListRequest.new()
  req.meta = V1::ListRequestMetadata.new()
  if not @parent.page_limit.nil?
    req.meta.limit = @parent.page_limit
  end
  if not @parent.snapshot_time.nil?
    req.meta.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.("RemoteIdentityGroups.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.remote_identity_groups.each do |plumbing_item|
        g.yield Plumbing::convert_remote_identity_group_to_porcelain(plumbing_item)
      end
      break if plumbing_response.meta.next_cursor == ""
      req.meta.cursor = plumbing_response.meta.next_cursor
    end
  }
  resp
end