aws-sdk-resources 2.2.17 → 2.2.18

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4ca346437adbba14cbe3f671c46d11166916d51f
4
- data.tar.gz: 851fa4fdf1fda01edd5326c7d5868aa3a3e70cc4
3
+ metadata.gz: a2b0c9d403800e2881f1458b000a0dcf9cb2f7d5
4
+ data.tar.gz: 304c297f7371407c4b33d29fa576f244861860bc
5
5
  SHA512:
6
- metadata.gz: fa4002b6883ff035c94939f9101749160f7fa6e9730afff40526550d5e5043202fcc0f87c69ce452c19ae121e6a194c7f8ec303a260f42364e19dd592830bf92
7
- data.tar.gz: e972a07dd20f32bad54c435bdf02324ad838a6a6a65b00071e94f8c1726c6bb958801c7ce19b5f25f2874f4e15ded458c72ea73d68749ce40b6adf85dffebd72
6
+ metadata.gz: 8312bf9c47d49cc61c5b85710bf3d97e690873372aef2eeb76a232c31b0cd104bfc1aaba1813ce693a9d72fc9d95d41e4db04ad328fff5b6ee931a93e6f96885
7
+ data.tar.gz: 0635adafeaf67b59b10cdface630b26428f380a564c9bda682013e13357140863f2bd9a471f89a53cdb0d119455d3e8e45499b82381ba5414e4cdb3049a28dc3
@@ -85,6 +85,17 @@ module Aws
85
85
  end
86
86
 
87
87
  end
88
+
89
+ # Supplies a string literal.
90
+ class StringLiteral
91
+
92
+ include Source
93
+
94
+ def extract(options)
95
+ @source
96
+ end
97
+
98
+ end
88
99
  end
89
100
  end
90
101
  end
@@ -290,6 +290,13 @@ module Aws
290
290
  })
291
291
  end
292
292
 
293
+ def string_builder_source(definition)
294
+ BuilderSources::ResponsePath.new({
295
+ source: underscore(definition['value']),
296
+ target: underscore(definition['target']),
297
+ })
298
+ end
299
+
293
300
  def svc_definition
294
301
  @source['service'] || {}
295
302
  end
@@ -124,8 +124,13 @@ module Aws
124
124
  private
125
125
 
126
126
  def all_batches(options, &block)
127
- @request.call(options).each do |response|
128
- yield(@builder.build(options.merge(response:response)))
127
+ resp = @request.call(options)
128
+ if resp.respond_to?(:each)
129
+ resp.each do |response|
130
+ yield(@builder.build(options.merge(response:response)))
131
+ end
132
+ else
133
+ yield(@builder.build(options.merge(response:resp)))
129
134
  end
130
135
  end
131
136
 
@@ -1,5 +1,6 @@
1
1
  require 'pathname'
2
2
  require 'thread'
3
+ require 'set'
3
4
 
4
5
  module Aws
5
6
  module S3
@@ -14,6 +15,14 @@ module Aws
14
15
 
15
16
  THREAD_COUNT = 10
16
17
 
18
+ # @api private
19
+ CREATE_OPTIONS =
20
+ Set.new(Client.api.operation(:upload_part).input.shape.member_names)
21
+
22
+ # @api private
23
+ UPLOAD_PART_OPTIONS =
24
+ Set.new(Client.api.operation(:upload_part).input.shape.member_names)
25
+
17
26
  # @option options [Client] :client
18
27
  def initialize(options = {})
19
28
  @client = options[:client] || Client.new
@@ -40,7 +49,7 @@ module Aws
40
49
  private
41
50
 
42
51
  def initiate_upload(options)
43
- @client.create_multipart_upload(options).upload_id
52
+ @client.create_multipart_upload(create_opts(options)).upload_id
44
53
  end
45
54
 
46
55
  def complete_upload(upload_id, parts, options)
@@ -84,9 +93,7 @@ module Aws
84
93
  part_number = 1
85
94
  parts = []
86
95
  while offset < size
87
- parts << {
88
- bucket: options[:bucket],
89
- key: options[:key],
96
+ parts << upload_part_opts(options).merge({
90
97
  upload_id: upload_id,
91
98
  part_number: part_number,
92
99
  body: FilePart.new(
@@ -94,13 +101,27 @@ module Aws
94
101
  offset: offset,
95
102
  size: part_size(size, default_part_size, offset)
96
103
  )
97
- }
104
+ })
98
105
  part_number += 1
99
106
  offset += default_part_size
100
107
  end
101
108
  parts
102
109
  end
103
110
 
111
+ def create_opts(options)
112
+ CREATE_OPTIONS.inject({}) do |hash, key|
113
+ hash[key] = options[key] if options.key?(key)
114
+ hash
115
+ end
116
+ end
117
+
118
+ def upload_part_opts(options)
119
+ UPLOAD_PART_OPTIONS.inject({}) do |hash, key|
120
+ hash[key] = options[key] if options.key?(key)
121
+ hash
122
+ end
123
+ end
124
+
104
125
  def upload_in_threads(pending, completed)
105
126
  threads = []
106
127
  @thread_count.times do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-sdk-resources
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.17
4
+ version: 2.2.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Amazon Web Services
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-16 00:00:00.000000000 Z
11
+ date: 2016-02-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-core
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 2.2.17
19
+ version: 2.2.18
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 2.2.17
26
+ version: 2.2.18
27
27
  description: Provides resource oriented interfaces and other higher-level abstractions
28
28
  for many AWS services. This gem is part of the official AWS SDK for Ruby.
29
29
  email: