Sha256: 9be099dee3e996dcb9ccaa81dc36c6193f6bcd4aa300194b7ad5a784f2c15d15
Contents?: true
Size: 1.3 KB
Versions: 56
Compression:
Stored size: 1.3 KB
Contents
# frozen_string_literal: true # # Collect API Gateway resources # 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
56 entries across 56 versions & 1 rubygems