Sha256: 74e7c525301549286c0dbaaf38275654d4703aade049cb3377b0dc3572c69b02

Contents?: true

Size: 706 Bytes

Versions: 3

Compression:

Stored size: 706 Bytes

Contents

require 'aws-sdk'

Aws.use_bundled_cert!

module AwsLogCleaner

  # Class responsible for interacting with the Aws
  # ApiGatewayClient
  class ApiGateway

    def initialize(credentials)
      @api_client = Aws::APIGateway::Client.new(
        region: credentials.region,
        credentials: credentials.credentials
      )
    end

    def list_all_apis
      Enumerator.new do |enum|
        request = { limit: 25 }
        loop do
          response = @api_client.get_rest_apis(request)
          response.items.each do |item|
            enum.yield item
          end
          break if response.position.nil?
          request[:position] = response.position
        end
      end
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
aws_log_cleaner-0.1.7 lib/aws_log_cleaner/api_gateway.rb
aws_log_cleaner-0.1.6 lib/aws_log_cleaner/api_gateway.rb
aws_log_cleaner-0.1.5 lib/aws_log_cleaner/api_gateway.rb