Sha256: 8777897f658a8487768f4f344e9e02ce43e8fa2c1c73959b1ecf12c0ec4680b4
Contents?: true
Size: 1.23 KB
Versions: 27
Compression:
Stored size: 1.23 KB
Contents
class APIGateway < Mapper # # Returns an array of resources. # def collect resources = [] # # get_rest_apis # @client.get_rest_apis.each_with_index do |response, page| log(response.context.operation_name, page) response.items.each do |api| struct = OpenStruct.new(api.to_h) struct.type = 'api' struct.arn = api.id # get_authorizers struct.authorizers = @client.get_authorizers({ rest_api_id: api.id }).items.map(&:to_h) # get_stages struct.stages = @client.get_stages({ rest_api_id: api.id }).item.map(&:to_h) # get_models struct.models = @client.get_models({ rest_api_id: api.id }).items.map(&:to_h) # get_resources struct.resources = @client.get_resources({ rest_api_id: api.id }).items.map(&:to_h) resources.push(struct.to_h) end end # get_domain_names @client.get_domain_names.each_with_index do |response, page| log(response.context.operation_name, page) response.items.each do |domain| struct = OpenStruct.new(domain.to_h) struct.type = 'domain' struct.arn = domain.domain_name resources.push(struct.to_h) end end resources end end
Version data entries
27 entries across 27 versions & 1 rubygems