aws-sdk-core 2.1.0 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/apis/ecs/2014-11-13/api-2.json +20 -2
- data/apis/iam/2010-05-08/paginators-1.json +32 -0
- data/apis/iam/2010-05-08/resources-1.json +8 -0
- data/apis/iam/2010-05-08/waiters-2.json +22 -0
- data/bin/aws.rb +6 -0
- data/lib/aws-sdk-core.rb +15 -7
- data/lib/aws-sdk-core/api/docs/builder.rb +3 -3
- data/lib/aws-sdk-core/credential_provider.rb +5 -7
- data/lib/aws-sdk-core/dynamodb/attribute_value.rb +2 -2
- data/lib/aws-sdk-core/eager_loader.rb +5 -6
- data/lib/aws-sdk-core/iam.rb +1 -0
- data/lib/aws-sdk-core/instance_profile_credentials.rb +1 -1
- data/lib/aws-sdk-core/json/handler.rb +4 -4
- data/lib/aws-sdk-core/pageable_response.rb +44 -34
- data/lib/aws-sdk-core/pager.rb +2 -3
- data/lib/aws-sdk-core/plugins/ec2_copy_encrypted_snapshot.rb +2 -1
- data/lib/aws-sdk-core/plugins/response_paging.rb +1 -0
- data/lib/aws-sdk-core/shared_credentials.rb +2 -2
- data/lib/aws-sdk-core/signers/s3.rb +31 -3
- data/lib/aws-sdk-core/stubbing/protocols/ec2.rb +3 -5
- data/lib/aws-sdk-core/stubbing/protocols/rest_xml.rb +0 -1
- data/lib/aws-sdk-core/version.rb +1 -1
- data/lib/aws-sdk-core/xml/parser.rb +4 -1
- data/lib/aws-sdk-core/xml/parser/engines/oga.rb +39 -0
- data/lib/seahorse/client/http/request.rb +1 -1
- data/lib/seahorse/client/http/response.rb +5 -3
- metadata +5 -13
- data/apis/config/2014-10-17/api-2.json +0 -694
- data/apis/config/2014-10-17/paginators-1.json +0 -10
- data/apis/ec2/2014-10-01/api-2.json +0 -10267
- data/apis/ec2/2014-10-01/paginators-1.json +0 -125
- data/apis/ec2/2014-10-01/resources-1.json +0 -2289
- data/apis/ec2/2014-10-01/waiters-2.json +0 -453
- data/apis/ec2/2015-03-01/api-2.json +0 -11245
- data/apis/ec2/2015-03-01/paginators-1.json +0 -125
- data/apis/ec2/2015-03-01/resources-1.json +0 -2479
- data/apis/ec2/2015-03-01/waiters-2.json +0 -458
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: e48a29b6d07bf2881c5ff4ed4192b67205f41c7b
         | 
| 4 | 
            +
              data.tar.gz: e2cec76e3ec2e6409e4767a97b986b58096368bc
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 352e29c1deb5889f65b286e20a97106a0dc36d59390f7ec8c8666883868bf0399daf06de1a3fb53a42a6c2d0f773897b119df79e689527ca2e387668beae3d9c
         | 
| 7 | 
            +
              data.tar.gz: b106dcab820a1d5f8c834784a732396941375167a24ba717b6f5704d7860ee24980e2fb2ec91e33f725d2c78b9fb48695d3aa79397e6fd42769cc7e5cbe883b0
         | 
| @@ -854,7 +854,8 @@ | |
| 854 854 | 
             
                  "type":"structure",
         | 
| 855 855 | 
             
                  "members":{
         | 
| 856 856 | 
             
                    "name":{"shape":"String"},
         | 
| 857 | 
            -
                    "command":{"shape":"StringList"}
         | 
| 857 | 
            +
                    "command":{"shape":"StringList"},
         | 
| 858 | 
            +
                    "environment":{"shape":"EnvironmentVariables"}
         | 
| 858 859 | 
             
                  }
         | 
| 859 860 | 
             
                },
         | 
| 860 861 | 
             
                "ContainerOverrides":{
         | 
| @@ -1164,6 +1165,8 @@ | |
| 1164 1165 | 
             
                  "type":"structure",
         | 
| 1165 1166 | 
             
                  "members":{
         | 
| 1166 1167 | 
             
                    "familyPrefix":{"shape":"String"},
         | 
| 1168 | 
            +
                    "status":{"shape":"TaskDefinitionStatus"},
         | 
| 1169 | 
            +
                    "sort":{"shape":"SortOrder"},
         | 
| 1167 1170 | 
             
                    "nextToken":{"shape":"String"},
         | 
| 1168 1171 | 
             
                    "maxResults":{"shape":"BoxedInteger"}
         | 
| 1169 1172 | 
             
                  }
         | 
| @@ -1377,6 +1380,13 @@ | |
| 1377 1380 | 
             
                  "type":"list",
         | 
| 1378 1381 | 
             
                  "member":{"shape":"Service"}
         | 
| 1379 1382 | 
             
                },
         | 
| 1383 | 
            +
                "SortOrder":{
         | 
| 1384 | 
            +
                  "type":"string",
         | 
| 1385 | 
            +
                  "enum":[
         | 
| 1386 | 
            +
                    "ASC",
         | 
| 1387 | 
            +
                    "DESC"
         | 
| 1388 | 
            +
                  ]
         | 
| 1389 | 
            +
                },
         | 
| 1380 1390 | 
             
                "StartTaskRequest":{
         | 
| 1381 1391 | 
             
                  "type":"structure",
         | 
| 1382 1392 | 
             
                  "required":[
         | 
| @@ -1471,9 +1481,17 @@ | |
| 1471 1481 | 
             
                    "containerDefinitions":{"shape":"ContainerDefinitions"},
         | 
| 1472 1482 | 
             
                    "family":{"shape":"String"},
         | 
| 1473 1483 | 
             
                    "revision":{"shape":"Integer"},
         | 
| 1474 | 
            -
                    "volumes":{"shape":"VolumeList"}
         | 
| 1484 | 
            +
                    "volumes":{"shape":"VolumeList"},
         | 
| 1485 | 
            +
                    "status":{"shape":"TaskDefinitionStatus"}
         | 
| 1475 1486 | 
             
                  }
         | 
| 1476 1487 | 
             
                },
         | 
| 1488 | 
            +
                "TaskDefinitionStatus":{
         | 
| 1489 | 
            +
                  "type":"string",
         | 
| 1490 | 
            +
                  "enum":[
         | 
| 1491 | 
            +
                    "ACTIVE",
         | 
| 1492 | 
            +
                    "INACTIVE"
         | 
| 1493 | 
            +
                  ]
         | 
| 1494 | 
            +
                },
         | 
| 1477 1495 | 
             
                "TaskOverride":{
         | 
| 1478 1496 | 
             
                  "type":"structure",
         | 
| 1479 1497 | 
             
                  "members":{
         | 
| @@ -21,6 +21,38 @@ | |
| 21 21 | 
             
                  "limit_key": "MaxItems",
         | 
| 22 22 | 
             
                  "result_key": "AccountAliases"
         | 
| 23 23 | 
             
                },
         | 
| 24 | 
            +
                "ListAttachedGroupPolicies": {
         | 
| 25 | 
            +
                  "input_token": "Marker",
         | 
| 26 | 
            +
                  "output_token": "Marker",
         | 
| 27 | 
            +
                  "more_results": "IsTruncated",
         | 
| 28 | 
            +
                  "limit_key": "MaxItems",
         | 
| 29 | 
            +
                  "result_key": "AttachedPolicies"
         | 
| 30 | 
            +
                },
         | 
| 31 | 
            +
                "ListAttachedRolePolicies": {
         | 
| 32 | 
            +
                  "input_token": "Marker",
         | 
| 33 | 
            +
                  "output_token": "Marker",
         | 
| 34 | 
            +
                  "more_results": "IsTruncated",
         | 
| 35 | 
            +
                  "limit_key": "MaxItems",
         | 
| 36 | 
            +
                  "result_key": "AttachedPolicies"
         | 
| 37 | 
            +
                },
         | 
| 38 | 
            +
                "ListAttachedUserPolicies": {
         | 
| 39 | 
            +
                  "input_token": "Marker",
         | 
| 40 | 
            +
                  "output_token": "Marker",
         | 
| 41 | 
            +
                  "more_results": "IsTruncated",
         | 
| 42 | 
            +
                  "limit_key": "MaxItems",
         | 
| 43 | 
            +
                  "result_key": "AttachedPolicies"
         | 
| 44 | 
            +
                },
         | 
| 45 | 
            +
                "ListEntitiesForPolicy": {
         | 
| 46 | 
            +
                  "input_token": "Marker",
         | 
| 47 | 
            +
                  "output_token": "Marker",
         | 
| 48 | 
            +
                  "more_results": "IsTruncated",
         | 
| 49 | 
            +
                  "limit_key": "MaxItems",
         | 
| 50 | 
            +
                  "result_key": [
         | 
| 51 | 
            +
                    "PolicyGroups",
         | 
| 52 | 
            +
                    "PolicyUsers",
         | 
| 53 | 
            +
                    "PolicyRoles"
         | 
| 54 | 
            +
                  ]
         | 
| 55 | 
            +
                },
         | 
| 24 56 | 
             
                "ListGroupPolicies": {
         | 
| 25 57 | 
             
                  "input_token": "Marker",
         | 
| 26 58 | 
             
                  "output_token": "Marker",
         | 
| @@ -1497,6 +1497,14 @@ | |
| 1497 1497 | 
             
                      }
         | 
| 1498 1498 | 
             
                    }
         | 
| 1499 1499 | 
             
                  },
         | 
| 1500 | 
            +
                  "waiters": {
         | 
| 1501 | 
            +
                    "Exists": {
         | 
| 1502 | 
            +
                      "waiterName": "UserExists",
         | 
| 1503 | 
            +
                      "params": [
         | 
| 1504 | 
            +
                        { "target": "UserName", "source": "identifier", "name": "Name" }
         | 
| 1505 | 
            +
                      ]
         | 
| 1506 | 
            +
                    }
         | 
| 1507 | 
            +
                  },
         | 
| 1500 1508 | 
             
                  "has": {
         | 
| 1501 1509 | 
             
                    "AccessKey": {
         | 
| 1502 1510 | 
             
                      "resource": {
         | 
| @@ -0,0 +1,22 @@ | |
| 1 | 
            +
            {
         | 
| 2 | 
            +
              "version": 2,
         | 
| 3 | 
            +
              "waiters": {
         | 
| 4 | 
            +
                "UserExists": {
         | 
| 5 | 
            +
                  "delay": 1,
         | 
| 6 | 
            +
                  "operation": "GetUser",
         | 
| 7 | 
            +
                  "maxAttempts": 20,
         | 
| 8 | 
            +
                  "acceptors": [
         | 
| 9 | 
            +
                    {
         | 
| 10 | 
            +
                      "state": "success",
         | 
| 11 | 
            +
                      "matcher": "status",
         | 
| 12 | 
            +
                      "expected": 200
         | 
| 13 | 
            +
                    },
         | 
| 14 | 
            +
                    {
         | 
| 15 | 
            +
                      "state": "retry",
         | 
| 16 | 
            +
                      "matcher": "error",
         | 
| 17 | 
            +
                      "expected": "NoSuchEntity"
         | 
| 18 | 
            +
                    }
         | 
| 19 | 
            +
                  ]
         | 
| 20 | 
            +
                }
         | 
| 21 | 
            +
              }
         | 
| 22 | 
            +
            }
         | 
    
        data/bin/aws.rb
    CHANGED
    
    
    
        data/lib/aws-sdk-core.rb
    CHANGED
    
    | @@ -191,7 +191,6 @@ module Aws | |
| 191 191 | 
             
              # @api private
         | 
| 192 192 | 
             
              module Signers
         | 
| 193 193 | 
             
                autoload :Base, 'aws-sdk-core/signers/base'
         | 
| 194 | 
            -
                autoload :Handler, 'aws-sdk-core/signers/handler'
         | 
| 195 194 | 
             
                autoload :S3, 'aws-sdk-core/signers/s3'
         | 
| 196 195 | 
             
                autoload :V2, 'aws-sdk-core/signers/v2'
         | 
| 197 196 | 
             
                autoload :V3, 'aws-sdk-core/signers/v3'
         | 
| @@ -285,16 +284,25 @@ module Aws | |
| 285 284 | 
             
                  eager_loader = EagerLoader.new
         | 
| 286 285 | 
             
                  eager_loader.load(JMESPath)
         | 
| 287 286 | 
             
                  eager_loader.load(Seahorse)
         | 
| 288 | 
            -
                  (options | 
| 289 | 
            -
                     | 
| 290 | 
            -
                      eager_loader.load(Aws.const_get(svc_name))
         | 
| 291 | 
            -
                    rescue NameError
         | 
| 292 | 
            -
                      raise ArgumentError, "invalid service Aws::#{svc_name}"
         | 
| 293 | 
            -
                    end
         | 
| 287 | 
            +
                  sub_modules(options).each do |module_or_class|
         | 
| 288 | 
            +
                    eager_loader.load(module_or_class)
         | 
| 294 289 | 
             
                  end
         | 
| 295 290 | 
             
                  eager_loader
         | 
| 296 291 | 
             
                end
         | 
| 297 292 |  | 
| 293 | 
            +
                def sub_modules(options = {})
         | 
| 294 | 
            +
                  constants = Aws.constants.map(&:to_s)
         | 
| 295 | 
            +
                  if options[:services]
         | 
| 296 | 
            +
                    constants -= SERVICE_MODULE_NAMES
         | 
| 297 | 
            +
                    constants += options[:services] || SERVICE_MODULE_NAMES
         | 
| 298 | 
            +
                  end
         | 
| 299 | 
            +
                  constants.inject([]) do |modules, const_name|
         | 
| 300 | 
            +
                    constant = Aws.const_get(const_name)
         | 
| 301 | 
            +
                    modules << constant if Module === constant
         | 
| 302 | 
            +
                    modules
         | 
| 303 | 
            +
                  end
         | 
| 304 | 
            +
                end
         | 
| 305 | 
            +
             | 
| 298 306 | 
             
                # Yields to the given block for each service that has already been
         | 
| 299 307 | 
             
                # defined via {add_service}. Also yields to the given block for
         | 
| 300 308 | 
             
                # each new service added after the callback is registered.
         | 
| @@ -38,7 +38,7 @@ module Aws | |
| 38 38 |  | 
| 39 39 | 
             
                    def service_docstring
         | 
| 40 40 | 
             
                      path = "doc-src/services/#{@svc_name}/service.md"
         | 
| 41 | 
            -
                      path = 'doc-src/services/default/service.md' unless File. | 
| 41 | 
            +
                      path = 'doc-src/services/default/service.md' unless File.exist?(path)
         | 
| 42 42 | 
             
                      template = read(path)
         | 
| 43 43 | 
             
                      svc_name = @svc_name
         | 
| 44 44 | 
             
                      api = @api
         | 
| @@ -62,7 +62,7 @@ module Aws | |
| 62 62 |  | 
| 63 63 | 
             
                    def errors_docstring
         | 
| 64 64 | 
             
                      path = "doc-src/services/#{@svc_name}/errors.md"
         | 
| 65 | 
            -
                      path = 'doc-src/services/default/errors.md' unless File. | 
| 65 | 
            +
                      path = 'doc-src/services/default/errors.md' unless File.exist?(path)
         | 
| 66 66 | 
             
                      template = read(path)
         | 
| 67 67 | 
             
                      svc_name = @svc_name
         | 
| 68 68 | 
             
                      api = @api
         | 
| @@ -90,7 +90,7 @@ module Aws | |
| 90 90 |  | 
| 91 91 | 
             
                    def client_docstring
         | 
| 92 92 | 
             
                      path = "doc-src/services/#{@svc_name}/client.md"
         | 
| 93 | 
            -
                      path = 'doc-src/services/default/client.md' unless File. | 
| 93 | 
            +
                      path = 'doc-src/services/default/client.md' unless File.exist?(path)
         | 
| 94 94 | 
             
                      render(path)
         | 
| 95 95 | 
             
                    end
         | 
| 96 96 |  | 
| @@ -4,13 +4,11 @@ module Aws | |
| 4 4 | 
             
                extend Deprecations
         | 
| 5 5 |  | 
| 6 6 | 
             
                # @return [Credentials]
         | 
| 7 | 
            -
                 | 
| 8 | 
            -
                  @credentials
         | 
| 9 | 
            -
                end
         | 
| 7 | 
            +
                attr_reader :credentials
         | 
| 10 8 |  | 
| 11 9 | 
             
                # @return [Boolean]
         | 
| 12 10 | 
             
                def set?
         | 
| 13 | 
            -
                   | 
| 11 | 
            +
                  !!credentials && credentials.set?
         | 
| 14 12 | 
             
                end
         | 
| 15 13 |  | 
| 16 14 | 
             
                # @deprecated Deprecated in 2.1.0. This method is subject to errors
         | 
| @@ -18,7 +16,7 @@ module Aws | |
| 18 16 | 
             
                #   objects. Will be removed in 2.2.0.
         | 
| 19 17 | 
             
                # @see #credentials
         | 
| 20 18 | 
             
                def access_key_id
         | 
| 21 | 
            -
                   | 
| 19 | 
            +
                  credentials ? credentials.access_key_id : nil
         | 
| 22 20 | 
             
                end
         | 
| 23 21 | 
             
                deprecated(:access_key_id, use: '#credentials')
         | 
| 24 22 |  | 
| @@ -27,7 +25,7 @@ module Aws | |
| 27 25 | 
             
                #   objects. Will be removed in 2.2.0.
         | 
| 28 26 | 
             
                # @see #credentials
         | 
| 29 27 | 
             
                def secret_access_key
         | 
| 30 | 
            -
                   | 
| 28 | 
            +
                  credentials ? credentials.secret_access_key : nil
         | 
| 31 29 | 
             
                end
         | 
| 32 30 | 
             
                deprecated(:secret_access_key, use: '#credentials')
         | 
| 33 31 |  | 
| @@ -36,7 +34,7 @@ module Aws | |
| 36 34 | 
             
                #   objects. Will be removed in 2.2.0.
         | 
| 37 35 | 
             
                # @see #credentials
         | 
| 38 36 | 
             
                def session_token
         | 
| 39 | 
            -
                   | 
| 37 | 
            +
                  credentials ? credentials.session_token : nil
         | 
| 40 38 | 
             
                end
         | 
| 41 39 | 
             
                deprecated(:session_token, use: '#credentials')
         | 
| 42 40 |  | 
| @@ -66,8 +66,8 @@ module Aws | |
| 66 66 | 
             
                      type, value = extract_type_and_value(obj)
         | 
| 67 67 | 
             
                      case type
         | 
| 68 68 | 
             
                      when :m
         | 
| 69 | 
            -
                        value.each.with_object({}) do |( | 
| 70 | 
            -
                          map[ | 
| 69 | 
            +
                        value.each.with_object({}) do |(k, v), map|
         | 
| 70 | 
            +
                          map[k] = format(v)
         | 
| 71 71 | 
             
                        end
         | 
| 72 72 | 
             
                      when :l then value.map { |v| format(v) }
         | 
| 73 73 | 
             
                      when :s then value
         | 
| @@ -17,12 +17,11 @@ module Aws | |
| 17 17 | 
             
                  @loaded << klass_or_module
         | 
| 18 18 | 
             
                  klass_or_module.constants.each do |const_name|
         | 
| 19 19 | 
             
                    path = klass_or_module.autoload?(const_name)
         | 
| 20 | 
            -
                     | 
| 21 | 
            -
             | 
| 22 | 
            -
             | 
| 23 | 
            -
                       | 
| 24 | 
            -
             | 
| 25 | 
            -
                      end
         | 
| 20 | 
            +
                    begin
         | 
| 21 | 
            +
                      require(path) if path
         | 
| 22 | 
            +
                      const = klass_or_module.const_get(const_name)
         | 
| 23 | 
            +
                      self.load(const) if Module === const && !@loaded.include?(const)
         | 
| 24 | 
            +
                    rescue LoadError
         | 
| 26 25 | 
             
                    end
         | 
| 27 26 | 
             
                  end
         | 
| 28 27 | 
             
                  self
         | 
    
        data/lib/aws-sdk-core/iam.rb
    CHANGED
    
    
| @@ -8,10 +8,10 @@ module Aws | |
| 8 8 | 
             
                  # @return [Seahorse::Client::Response]
         | 
| 9 9 | 
             
                  def call(context)
         | 
| 10 10 | 
             
                    build_request(context)
         | 
| 11 | 
            -
                     | 
| 12 | 
            -
                     | 
| 13 | 
            -
                     | 
| 14 | 
            -
                     | 
| 11 | 
            +
                    response = @handler.call(context)
         | 
| 12 | 
            +
                    response.on(200..299) { |resp| parse_response(resp) }
         | 
| 13 | 
            +
                    response.on(200..599) { |resp| apply_request_id(context) }
         | 
| 14 | 
            +
                    response
         | 
| 15 15 | 
             
                  end
         | 
| 16 16 |  | 
| 17 17 | 
             
                  private
         | 
| @@ -2,38 +2,39 @@ module Aws | |
| 2 2 |  | 
| 3 3 | 
             
              # Decorates a {Seahorse::Client::Response} with paging methods:
         | 
| 4 4 | 
             
              #
         | 
| 5 | 
            -
              #      | 
| 6 | 
            -
              #      | 
| 5 | 
            +
              #     resp = s3.list_objects(params)
         | 
| 6 | 
            +
              #     resp.last_page?
         | 
| 7 7 | 
             
              #     #=> false
         | 
| 8 8 | 
             
              #
         | 
| 9 9 | 
             
              #     # sends a request to receive the next response page
         | 
| 10 | 
            -
              #      | 
| 11 | 
            -
              #      | 
| 10 | 
            +
              #     resp = resp.next_page
         | 
| 11 | 
            +
              #     resp.last_page?
         | 
| 12 12 | 
             
              #     #=> true
         | 
| 13 13 | 
             
              #
         | 
| 14 | 
            -
              #      | 
| 14 | 
            +
              #     resp.next_page
         | 
| 15 15 | 
             
              #     #=> raises PageableResponse::LastPageError
         | 
| 16 16 | 
             
              #
         | 
| 17 17 | 
             
              # You can enumerate all response pages with a block
         | 
| 18 18 | 
             
              #
         | 
| 19 | 
            -
              #      | 
| 20 | 
            -
              #     page.each do |page|
         | 
| 19 | 
            +
              #     ec2.describe_instances(params).each do |page|
         | 
| 21 20 | 
             
              #       # yields once per page
         | 
| 21 | 
            +
              #       page.reservations.each do |r|
         | 
| 22 | 
            +
              #         # ...
         | 
| 23 | 
            +
              #       end
         | 
| 22 24 | 
             
              #     end
         | 
| 23 25 | 
             
              #
         | 
| 24 26 | 
             
              # Or using {#next_page} and {#last_page?}:
         | 
| 25 27 | 
             
              #
         | 
| 26 | 
            -
              #      | 
| 27 | 
            -
              #      | 
| 28 | 
            -
              #
         | 
| 29 | 
            -
              # @note Normally you should not need to construct a {PageableResponse}
         | 
| 30 | 
            -
              #   directly. The {Plugins::ResponsePaging} plugin automatically
         | 
| 31 | 
            -
              #   decorates all responses with a {PageableResponse}.
         | 
| 28 | 
            +
              #     resp.last_page?
         | 
| 29 | 
            +
              #     resp = resp.next_page until resp.last_page?
         | 
| 32 30 | 
             
              #
         | 
| 33 31 | 
             
              module PageableResponse
         | 
| 34 32 |  | 
| 35 | 
            -
                def self. | 
| 36 | 
            -
                  base.send(: | 
| 33 | 
            +
                def self.extended(base)
         | 
| 34 | 
            +
                  base.send(:extend, Enumerable)
         | 
| 35 | 
            +
                  base.send(:extend, UnsafeEnumerableMethods)
         | 
| 36 | 
            +
                  base.instance_variable_set("@last_page", nil)
         | 
| 37 | 
            +
                  base.instance_variable_set("@more_results", nil)
         | 
| 37 38 | 
             
                end
         | 
| 38 39 |  | 
| 39 40 | 
             
                # @return [Paging::Pager]
         | 
| @@ -79,24 +80,6 @@ module Aws | |
| 79 80 | 
             
                end
         | 
| 80 81 | 
             
                alias each_page each
         | 
| 81 82 |  | 
| 82 | 
            -
                # @api private
         | 
| 83 | 
            -
                def count
         | 
| 84 | 
            -
                  if respond_to?(:count)
         | 
| 85 | 
            -
                    data.count
         | 
| 86 | 
            -
                  else
         | 
| 87 | 
            -
                    raise NotImplementedError
         | 
| 88 | 
            -
                  end
         | 
| 89 | 
            -
                end
         | 
| 90 | 
            -
             | 
| 91 | 
            -
                # @api private
         | 
| 92 | 
            -
                def respond_to?(method_name, *args)
         | 
| 93 | 
            -
                  if method_name == :count
         | 
| 94 | 
            -
                    data.respond_to?(:count)
         | 
| 95 | 
            -
                  else
         | 
| 96 | 
            -
                    super
         | 
| 97 | 
            -
                  end
         | 
| 98 | 
            -
                end
         | 
| 99 | 
            -
             | 
| 100 83 | 
             
                private
         | 
| 101 84 |  | 
| 102 85 | 
             
                # @param [Hash] params A hash of additional request params to
         | 
| @@ -114,7 +97,7 @@ module Aws | |
| 114 97 | 
             
                # @return [Hash] Returns the hash of request parameters for the
         | 
| 115 98 | 
             
                #   next page, merging any given params.
         | 
| 116 99 | 
             
                def next_page_params(params)
         | 
| 117 | 
            -
                  context. | 
| 100 | 
            +
                  context[:original_params].merge(@pager.next_tokens(self).merge(params))
         | 
| 118 101 | 
             
                end
         | 
| 119 102 |  | 
| 120 103 | 
             
                # Raised when calling {PageableResponse#next_page} on a pager that
         | 
| @@ -133,5 +116,32 @@ module Aws | |
| 133 116 |  | 
| 134 117 | 
             
                end
         | 
| 135 118 |  | 
| 119 | 
            +
                # A handful of Enumerable methods, such as #count are not safe
         | 
| 120 | 
            +
                # to call on a pageable response, as this would trigger n api calls
         | 
| 121 | 
            +
                # simply to count the number of response pages, when likely what is
         | 
| 122 | 
            +
                # wanted is to access count on the data. Same for #to_h.
         | 
| 123 | 
            +
                module UnsafeEnumerableMethods
         | 
| 124 | 
            +
             | 
| 125 | 
            +
                  def count
         | 
| 126 | 
            +
                    if data.respond_to?(:count)
         | 
| 127 | 
            +
                      data.count
         | 
| 128 | 
            +
                    else
         | 
| 129 | 
            +
                      raise NoMethodError, "undefined method `count'"
         | 
| 130 | 
            +
                    end
         | 
| 131 | 
            +
                  end
         | 
| 132 | 
            +
             | 
| 133 | 
            +
                  def respond_to?(method_name, *args)
         | 
| 134 | 
            +
                    if method_name == :count
         | 
| 135 | 
            +
                      data.respond_to?(:count)
         | 
| 136 | 
            +
                    else
         | 
| 137 | 
            +
                      false
         | 
| 138 | 
            +
                    end
         | 
| 139 | 
            +
                  end
         | 
| 140 | 
            +
             | 
| 141 | 
            +
                  def to_h
         | 
| 142 | 
            +
                    data.to_h
         | 
| 143 | 
            +
                  end
         | 
| 144 | 
            +
             | 
| 145 | 
            +
                end
         | 
| 136 146 | 
             
              end
         | 
| 137 147 | 
             
            end
         |