Class: SDM::AccountsGroupsHistory
- Inherits:
-
Object
- Object
- SDM::AccountsGroupsHistory
- Extended by:
- Gem::Deprecate
- Defined in:
- lib/svc.rb
Overview
AccountsGroupsHistory records all changes to the state of an AccountGroup.
See AccountGroupHistory.
Instance Method Summary collapse
-
#initialize(channel, parent) ⇒ AccountsGroupsHistory
constructor
A new instance of AccountsGroupsHistory.
-
#list(filter, *args, deadline: nil) ⇒ Object
List gets a list of AccountGroupHistory records matching a given set of criteria.
Constructor Details
#initialize(channel, parent) ⇒ AccountsGroupsHistory
Returns a new instance of AccountsGroupsHistory.
1311 1312 1313 1314 1315 1316 1317 1318 |
# File 'lib/svc.rb', line 1311 def initialize(channel, parent) begin @stub = V1::AccountsGroupsHistory::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 AccountGroupHistory records matching a given set of criteria.
1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 |
# File 'lib/svc.rb', line 1321 def list( filter, *args, deadline: nil ) req = V1::AccountGroupHistoryListRequest.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.("AccountsGroupsHistory.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_account_group_history_to_porcelain(plumbing_item) end break if plumbing_response..next_cursor == "" req..cursor = plumbing_response..next_cursor end } resp end |