Sha256: 30335c8c7e6dfb30972d48a4f76e822c46696db3295a25fcafdd838d846e12c4

Contents?: true

Size: 760 Bytes

Versions: 9

Compression:

Stored size: 760 Bytes

Contents

class Organizations < Mapper
  #
  # Returns an array of resources.
  #
  def collect
    resources = []

    #
    # describe_organization
    #
    @client.describe_organization.each do |response|
      log(response.context.operation_name)

      struct = OpenStruct.new(response.organization.to_h)
      struct.type = 'organization'

      resources.push(struct.to_h)
    end

    #
    # list_handshakes_for_account
    #
    @client.list_handshakes_for_account.each_with_index do |response, page|
      log(response.context.operation_name, page)

      response.handshakes.each do |handshake|
        struct = OpenStruct.new(handshake.to_h)
        struct.type = 'handshake'

        resources.push(struct.to_h)
      end
    end

    resources
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
aws_recon-0.2.9 lib/aws_recon/collectors/organizations.rb
aws_recon-0.2.8 lib/aws_recon/collectors/organizations.rb
aws_recon-0.2.7 lib/aws_recon/collectors/organizations.rb
aws_recon-0.2.6 lib/aws_recon/collectors/organizations.rb
aws_recon-0.2.5 lib/aws_recon/collectors/organizations.rb
aws_recon-0.2.4 lib/aws_recon/collectors/organizations.rb
aws_recon-0.2.3 lib/aws_recon/collectors/organizations.rb
aws_recon-0.2.2 lib/aws_recon/collectors/organizations.rb
aws_recon-0.2.1 lib/aws_recon/collectors/organizations.rb