Class: SDM::IdentitySetsHistory

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

Overview

IdentitySetsHistory records all changes to the state of a IdentitySet.

See IdentitySetHistory.

Instance Method Summary collapse

Constructor Details

#initialize(channel, parent) ⇒ IdentitySetsHistory

Returns a new instance of IdentitySetsHistory.



4142
4143
4144
4145
4146
4147
4148
4149
# File 'lib/svc.rb', line 4142

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

Instance Method Details

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

List gets a list of IdentitySetHistory records matching a given set of criteria.



4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
# File 'lib/svc.rb', line 4152

def list(
  filter,
  *args,
  deadline: nil
)
  req = V1::IdentitySetHistoryListRequest.new()
  req.meta = V1::.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.("IdentitySetsHistory.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.history.each do |plumbing_item|
        g.yield Plumbing::convert_identity_set_history_to_porcelain(plumbing_item)
      end
      break if plumbing_response.meta.next_cursor == ""
      req.meta.cursor = plumbing_response.meta.next_cursor
    end
  }
  resp
end