aws-sdk-core 3.22.1 → 3.23.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/aws-sdk-core/client_stubs.rb +31 -0
- data/lib/aws-sdk-core/json/builder.rb +4 -2
- data/lib/aws-sdk-core/query/ec2_param_builder.rb +9 -3
- data/lib/aws-sdk-core/query/param_builder.rb +9 -3
- data/lib/aws-sdk-core/rest/request/headers.rb +11 -1
- data/lib/aws-sdk-core/rest/request/querystring_builder.rb +11 -1
- data/lib/aws-sdk-core/rest/response/headers.rb +2 -0
- data/lib/aws-sdk-core/xml/builder.rb +9 -3
- data/lib/aws-sdk-sts.rb +1 -1
- data/lib/aws-sdk-sts/client.rb +1 -1
- data/lib/seahorse/util.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 863e0c2db542c1c5c45bb03309f1d01ed64d3f7d
|
4
|
+
data.tar.gz: db3a641dd73c9f2b5fcb6809314e7881da912602
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb7fd926f77db04fa0caacafba5cdfe44019efd2236862eedc1e80fab038bf42787007e60dc6b82d98993d4fd556dcc20b6e66c4a0ee76cedfa030cc5cda2470
|
7
|
+
data.tar.gz: 65ea0631d143d0d1c132c232feaa26e78d8e5d8339ec1888600871ae8c2a172f15f60f67d56c696bbb77664b53299dca9fa13d3f3ccb3f43cdd55188539e8441
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.
|
1
|
+
3.23.0
|
@@ -6,6 +6,9 @@ module Aws
|
|
6
6
|
# return when a client is using stubbed responses. Pass
|
7
7
|
# `:stub_responses => true` to a client constructor to enable this
|
8
8
|
# behavior.
|
9
|
+
#
|
10
|
+
# Also allows you to see the requests made by the client by reading the
|
11
|
+
# api_requests instance variable
|
9
12
|
module ClientStubs
|
10
13
|
|
11
14
|
# @api private
|
@@ -17,6 +20,19 @@ module Aws
|
|
17
20
|
apply_stubs(operation_name, Array === stubs ? stubs : [stubs])
|
18
21
|
end
|
19
22
|
end
|
23
|
+
|
24
|
+
# When a client is stubbed allow the user to access the requests made
|
25
|
+
@api_requests = []
|
26
|
+
|
27
|
+
requests = @api_requests
|
28
|
+
self.handle do |context|
|
29
|
+
requests << {
|
30
|
+
operation_name: context.operation_name,
|
31
|
+
params: context.params,
|
32
|
+
context: context
|
33
|
+
}
|
34
|
+
@handler.call(context)
|
35
|
+
end
|
20
36
|
end
|
21
37
|
|
22
38
|
# Configures what data / errors should be returned from the named operation
|
@@ -166,6 +182,21 @@ module Aws
|
|
166
182
|
end
|
167
183
|
end
|
168
184
|
|
185
|
+
# Allows you to access all of the requests that the stubbed client has made
|
186
|
+
#
|
187
|
+
# @return [Array] Returns an array of the api requests made, each request object contains the
|
188
|
+
# :operation_name, :params, and :context of the request.
|
189
|
+
# @raise [NotImplementedError] Raises `NotImplementedError` when the client is not stubbed
|
190
|
+
def api_requests
|
191
|
+
if config.stub_responses
|
192
|
+
@api_requests
|
193
|
+
else
|
194
|
+
msg = 'This method is only implemented for stubbed clients, and is '
|
195
|
+
msg << 'available when you enable stubbing in the constructor with `stub_responses: true`'
|
196
|
+
raise NotImplementedError.new(msg)
|
197
|
+
end
|
198
|
+
end
|
199
|
+
|
169
200
|
# Generates and returns stubbed response data from the named operation.
|
170
201
|
#
|
171
202
|
# s3 = Aws::S3::Client.new
|
@@ -56,9 +56,11 @@ module Aws
|
|
56
56
|
end
|
57
57
|
|
58
58
|
def timestamp(ref, value)
|
59
|
-
|
60
|
-
|
59
|
+
case ref['timestampFormat'] || ref.shape['timestampFormat']
|
60
|
+
when 'iso8601' then value.utc.iso8601
|
61
|
+
when 'rfc822' then value.utc.httpdate
|
61
62
|
else
|
63
|
+
# rest-json and jsonrpc default to unixTimestamp
|
62
64
|
value.to_i
|
63
65
|
end
|
64
66
|
end
|
@@ -45,7 +45,7 @@ module Aws
|
|
45
45
|
when ListShape then list(ref, value, prefix)
|
46
46
|
when MapShape then raise NotImplementedError
|
47
47
|
when BlobShape then set(prefix, blob(value))
|
48
|
-
when TimestampShape then set(prefix, timestamp(value))
|
48
|
+
when TimestampShape then set(prefix, timestamp(ref, value))
|
49
49
|
else
|
50
50
|
set(prefix, value.to_s)
|
51
51
|
end
|
@@ -68,8 +68,14 @@ module Aws
|
|
68
68
|
Base64.strict_encode64(value)
|
69
69
|
end
|
70
70
|
|
71
|
-
def timestamp(value)
|
72
|
-
|
71
|
+
def timestamp(ref, value)
|
72
|
+
case ref['timestampFormat'] || ref.shape['timestampFormat']
|
73
|
+
when 'unixTimestamp' then value.to_i
|
74
|
+
when 'rfc822' then value.utc.httpdate
|
75
|
+
else
|
76
|
+
# ec2 defaults to iso8601
|
77
|
+
value.utc.iso8601
|
78
|
+
end
|
73
79
|
end
|
74
80
|
|
75
81
|
end
|
@@ -66,7 +66,7 @@ module Aws
|
|
66
66
|
when ListShape then list(ref, value, prefix)
|
67
67
|
when MapShape then map(ref, value, prefix)
|
68
68
|
when BlobShape then set(prefix, blob(value))
|
69
|
-
when TimestampShape then set(prefix, timestamp(value))
|
69
|
+
when TimestampShape then set(prefix, timestamp(ref, value))
|
70
70
|
else set(prefix, value.to_s)
|
71
71
|
end
|
72
72
|
end
|
@@ -83,8 +83,14 @@ module Aws
|
|
83
83
|
ref.shape.flattened
|
84
84
|
end
|
85
85
|
|
86
|
-
def timestamp(value)
|
87
|
-
|
86
|
+
def timestamp(ref, value)
|
87
|
+
case ref['timestampFormat'] || ref.shape['timestampFormat']
|
88
|
+
when 'unixTimestamp' then value.to_i
|
89
|
+
when 'rfc822' then value.utc.httpdate
|
90
|
+
else
|
91
|
+
# query defaults to iso8601
|
92
|
+
value.utc.iso8601
|
93
|
+
end
|
88
94
|
end
|
89
95
|
|
90
96
|
def blob(value)
|
@@ -32,11 +32,21 @@ module Aws
|
|
32
32
|
value = apply_json_trait(value) if ref['jsonvalue']
|
33
33
|
headers[ref.location_name] =
|
34
34
|
case ref.shape
|
35
|
-
when TimestampShape then value
|
35
|
+
when TimestampShape then timestamp(ref, value)
|
36
36
|
else value.to_s
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
40
|
+
def timestamp(ref, value)
|
41
|
+
case ref['timestampFormat'] || ref.shape['timestampFormat']
|
42
|
+
when 'unixTimestamp' then value.to_i
|
43
|
+
when 'iso8601' then value.utc.iso8601
|
44
|
+
else
|
45
|
+
# header default to rfc822
|
46
|
+
value.utc.httpdate
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
40
50
|
def apply_header_map(headers, ref, values)
|
41
51
|
prefix = ref.location_name || ''
|
42
52
|
values.each_pair do |name, value|
|
@@ -36,7 +36,7 @@ module Aws
|
|
36
36
|
"#{param_name}=#{escape(param_value.to_s)}"
|
37
37
|
when TimestampShape
|
38
38
|
param_name = shape_ref.location_name
|
39
|
-
"#{param_name}=#{escape(param_value
|
39
|
+
"#{param_name}=#{escape(timestamp(shape_ref, param_value))}"
|
40
40
|
when MapShape
|
41
41
|
if StringShape === shape_ref.shape.value.shape
|
42
42
|
query_map_of_string(param_value)
|
@@ -59,6 +59,16 @@ module Aws
|
|
59
59
|
end
|
60
60
|
end
|
61
61
|
|
62
|
+
def timestamp(ref, value)
|
63
|
+
case ref['timestampFormat'] || ref.shape['timestampFormat']
|
64
|
+
when 'unixTimestamp' then value.to_i
|
65
|
+
when 'rfc822' then value.utc.httpdate
|
66
|
+
else
|
67
|
+
# querystring defaults to iso8601
|
68
|
+
value.utc.iso8601
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
62
72
|
def query_map_of_string(hash)
|
63
73
|
list = []
|
64
74
|
hash.each_pair do |key, value|
|
@@ -87,7 +87,7 @@ module Aws
|
|
87
87
|
when StructureShape then structure(name, ref, value)
|
88
88
|
when ListShape then list(name, ref, value)
|
89
89
|
when MapShape then map(name, ref, value)
|
90
|
-
when TimestampShape then node(name, ref, timestamp(value))
|
90
|
+
when TimestampShape then node(name, ref, timestamp(ref, value))
|
91
91
|
when BlobShape then node(name, ref, blob(value))
|
92
92
|
else
|
93
93
|
node(name, ref, value.to_s)
|
@@ -99,8 +99,14 @@ module Aws
|
|
99
99
|
Base64.strict_encode64(value)
|
100
100
|
end
|
101
101
|
|
102
|
-
def timestamp(value)
|
103
|
-
|
102
|
+
def timestamp(ref, value)
|
103
|
+
case ref['timestampFormat'] || ref.shape['timestampFormat']
|
104
|
+
when 'unixTimestamp' then value.to_i
|
105
|
+
when 'rfc822' then value.utc.httpdate
|
106
|
+
else
|
107
|
+
# xml defaults to iso8601
|
108
|
+
value.utc.iso8601
|
109
|
+
end
|
104
110
|
end
|
105
111
|
|
106
112
|
# The `args` list may contain:
|
data/lib/aws-sdk-sts.rb
CHANGED
data/lib/aws-sdk-sts/client.rb
CHANGED
data/lib/seahorse/util.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aws-sdk-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.23.0
|
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: 2018-
|
11
|
+
date: 2018-07-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jmespath
|