def each &block
next_token = nil
groups = {}
begin
client_opts = {}
client_opts[:next_token] = next_token if next_token
client_opts[:auto_scaling_group_names] = [@group.name] if @group
resp = client.describe_notification_configurations(client_opts)
resp.notification_configurations.each do |c|
group_name = c.auto_scaling_group_name
groups[group_name] ||= {}
groups[group_name][c.topic_arn] ||= []
groups[group_name][c.topic_arn] << c.notification_type
end
next_token = resp.respond_to?(:next_token) ? resp.next_token : nil
end while next_token
groups.each_pair do |group_name, topics|
topics.each_pair do |topic_arn, types|
notification_config = NotificationConfiguration.new(
Group.new(group_name, :config => config), topic_arn, types)
yield(notification_config)
end
end
end