aws-sdk-core 3.116.0 → 3.119.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/CHANGELOG.md +22 -0
- data/VERSION +1 -1
- data/lib/aws-sdk-core/credential_provider_chain.rb +2 -1
- data/lib/aws-sdk-core/ec2_metadata.rb +24 -5
- data/lib/aws-sdk-core/instance_profile_credentials.rb +39 -4
- data/lib/aws-sdk-core/json.rb +8 -26
- data/lib/aws-sdk-core/json/json_engine.rb +10 -8
- data/lib/aws-sdk-core/json/oj_engine.rb +33 -6
- data/lib/aws-sdk-core/json/parser.rb +8 -0
- data/lib/aws-sdk-core/log/param_filter.rb +9 -1
- data/lib/aws-sdk-core/param_validator.rb +29 -0
- data/lib/aws-sdk-core/shared_config.rb +2 -0
- data/lib/aws-sdk-core/shared_credentials.rb +7 -1
- data/lib/aws-sdk-core/structure.rb +10 -1
- data/lib/aws-sdk-core/xml/parser/frame.rb +23 -0
- data/lib/aws-sdk-sso.rb +1 -1
- data/lib/aws-sdk-sso/client.rb +1 -1
- data/lib/aws-sdk-sts.rb +1 -1
- data/lib/aws-sdk-sts/client.rb +1 -1
- data/lib/seahorse/model/shapes.rb +25 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2204dd63e0622d30f7241676f266444b2e29756ac65acb60d8b370f61fb40358
|
4
|
+
data.tar.gz: 2bead5790227d431d1a44902c64394dd16ec11daa992c0820edb7783425889c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 037db3003b591729cfe9f18a2df4611ce93d8bb912bd0ff145f485c46ab3902fff79267985d7d0d15dcb03dad6b082679185673e8649913fe8949993476fdd8e
|
7
|
+
data.tar.gz: 6f74ddc9038054f1f4cf3c89722ad30395e9bda01ef4a60665158ceae74b2b140489ae5ce2aee33da2e89c4301c27048332aae5b714fd20752025604a3c0b672
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,28 @@
|
|
1
1
|
Unreleased Changes
|
2
2
|
------------------
|
3
3
|
|
4
|
+
3.119.1 (2021-08-20)
|
5
|
+
------------------
|
6
|
+
|
7
|
+
* Issue - Refactored `Aws::Json::Engine` to remove dead code and replaced usage of `JSON.load` with `JSON.parse`.
|
8
|
+
|
9
|
+
3.119.0 (2021-07-30)
|
10
|
+
------------------
|
11
|
+
|
12
|
+
* Feature - Support Document Types. Document types are used to carry open content. A document type value is serialized using the same format as its surroundings and requires no additional encoding or escaping.(#2523)
|
13
|
+
|
14
|
+
3.118.0 (2021-07-28)
|
15
|
+
------------------
|
16
|
+
|
17
|
+
* Feature - Add support for Tagged Unions using a "sealed" classes like approach where each union member has a corresponding subclass.
|
18
|
+
|
19
|
+
3.117.0 (2021-07-12)
|
20
|
+
------------------
|
21
|
+
|
22
|
+
* Feature - Support IPv6 endpoints for `Aws::InstanceProfileCredentials`. It supports two shared configuration options (`ec2_metadata_service_endpoint` & `ec2_metadata_service_endpoint_mode`), two ENV variables (`AWS_EC2_METADATA_SERVICE_ENDPOINT` & `AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE`), and two constructor options (`:endpoint` & `:endpoint_mode`).
|
23
|
+
|
24
|
+
* Feature - Support IPv6 endpoint for `Aws::EC2Metadata` client. It can be configured with `:endpoint` or `:endpoint_mode`.
|
25
|
+
|
4
26
|
3.116.0 (2021-07-07)
|
5
27
|
------------------
|
6
28
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.
|
1
|
+
3.119.1
|
@@ -160,10 +160,11 @@ module Aws
|
|
160
160
|
end
|
161
161
|
|
162
162
|
def instance_profile_credentials(options)
|
163
|
+
profile_name = determine_profile_name(options)
|
163
164
|
if ENV['AWS_CONTAINER_CREDENTIALS_RELATIVE_URI']
|
164
165
|
ECSCredentials.new(options)
|
165
166
|
else
|
166
|
-
InstanceProfileCredentials.new(options)
|
167
|
+
InstanceProfileCredentials.new(options.merge(profile: profile_name))
|
167
168
|
end
|
168
169
|
end
|
169
170
|
|
@@ -39,7 +39,11 @@ module Aws
|
|
39
39
|
# defaulting to 6 hours.
|
40
40
|
# @option options [Integer] :retries (3) The number of retries for failed
|
41
41
|
# requests.
|
42
|
-
# @option options [String] :endpoint (169.254.169.254) The IMDS
|
42
|
+
# @option options [String] :endpoint ('http://169.254.169.254') The IMDS
|
43
|
+
# endpoint. This option has precedence over the :endpoint_mode.
|
44
|
+
# @option options [String] :endpoint_mode ('IPv4') The endpoint mode for
|
45
|
+
# the instance metadata service. This is either 'IPv4'
|
46
|
+
# ('http://169.254.169.254') or 'IPv6' ('http://[fd00:ec2::254]').
|
43
47
|
# @option options [Integer] :port (80) The IMDS endpoint port.
|
44
48
|
# @option options [Integer] :http_open_timeout (1) The number of seconds to
|
45
49
|
# wait for the connection to open.
|
@@ -55,7 +59,8 @@ module Aws
|
|
55
59
|
@retries = options[:retries] || 3
|
56
60
|
@backoff = backoff(options[:backoff])
|
57
61
|
|
58
|
-
|
62
|
+
endpoint_mode = options[:endpoint_mode] || 'IPv4'
|
63
|
+
@endpoint = resolve_endpoint(options[:endpoint], endpoint_mode)
|
59
64
|
@port = options[:port] || 80
|
60
65
|
|
61
66
|
@http_open_timeout = options[:http_open_timeout] || 1
|
@@ -76,7 +81,7 @@ module Aws
|
|
76
81
|
# ec2_metadata.get('/latest/meta-data/instance-id')
|
77
82
|
# => "i-023a25f10a73a0f79"
|
78
83
|
#
|
79
|
-
# @
|
84
|
+
# @note This implementation always returns a String and will not parse any
|
80
85
|
# responses. Parsable responses may include JSON objects or directory
|
81
86
|
# listings, which are strings separated by line feeds (ASCII 10).
|
82
87
|
#
|
@@ -93,7 +98,7 @@ module Aws
|
|
93
98
|
# listing.split(10.chr)
|
94
99
|
# => ["ami-id", "ami-launch-index", ...]
|
95
100
|
#
|
96
|
-
# @
|
101
|
+
# @note Unlike other services, IMDS does not have a service API model. This
|
97
102
|
# means that we cannot confidently generate code with methods and
|
98
103
|
# response structures. This implementation ensures that new IMDS features
|
99
104
|
# are always supported by being deployed to the instance and does not
|
@@ -116,6 +121,19 @@ module Aws
|
|
116
121
|
|
117
122
|
private
|
118
123
|
|
124
|
+
def resolve_endpoint(endpoint, endpoint_mode)
|
125
|
+
return endpoint if endpoint
|
126
|
+
|
127
|
+
case endpoint_mode.downcase
|
128
|
+
when 'ipv4' then 'http://169.254.169.254'
|
129
|
+
when 'ipv6' then 'http://[fd00:ec2::254]'
|
130
|
+
else
|
131
|
+
raise ArgumentError,
|
132
|
+
':endpoint_mode is not valid, expected IPv4 or IPv6, '\
|
133
|
+
"got: #{endpoint_mode}"
|
134
|
+
end
|
135
|
+
end
|
136
|
+
|
119
137
|
def fetch_token
|
120
138
|
open_connection do |conn|
|
121
139
|
token_value, token_ttl = http_put(conn, @token_ttl)
|
@@ -163,7 +181,8 @@ module Aws
|
|
163
181
|
end
|
164
182
|
|
165
183
|
def open_connection
|
166
|
-
|
184
|
+
uri = URI.parse(@endpoint)
|
185
|
+
http = Net::HTTP.new(uri.hostname || @endpoint, @port || uri.port)
|
167
186
|
http.open_timeout = @http_open_timeout
|
168
187
|
http.read_timeout = @http_read_timeout
|
169
188
|
http.set_debug_output(@http_debug_output) if @http_debug_output
|
@@ -5,7 +5,6 @@ require 'net/http'
|
|
5
5
|
|
6
6
|
module Aws
|
7
7
|
class InstanceProfileCredentials
|
8
|
-
|
9
8
|
include CredentialProvider
|
10
9
|
include RefreshingCredentials
|
11
10
|
|
@@ -44,7 +43,13 @@ module Aws
|
|
44
43
|
# @param [Hash] options
|
45
44
|
# @option options [Integer] :retries (1) Number of times to retry
|
46
45
|
# when retrieving credentials.
|
47
|
-
# @option options [String] :
|
46
|
+
# @option options [String] :endpoint ('http://169.254.169.254') The IMDS
|
47
|
+
# endpoint. This option has precedence over the :endpoint_mode.
|
48
|
+
# @option options [String] :endpoint_mode ('IPv4') The endpoint mode for
|
49
|
+
# the instance metadata service. This is either 'IPv4' ('169.254.169.254')
|
50
|
+
# or 'IPv6' ('[fd00:ec2::254]').
|
51
|
+
# @option options [String] :ip_address ('169.254.169.254') Deprecated. Use
|
52
|
+
# :endpoint instead. The IP address for the endpoint.
|
48
53
|
# @option options [Integer] :port (80)
|
49
54
|
# @option options [Float] :http_open_timeout (1)
|
50
55
|
# @option options [Float] :http_read_timeout (1)
|
@@ -60,7 +65,8 @@ module Aws
|
|
60
65
|
# to 21600 seconds
|
61
66
|
def initialize(options = {})
|
62
67
|
@retries = options[:retries] || 1
|
63
|
-
|
68
|
+
endpoint_mode = resolve_endpoint_mode(options)
|
69
|
+
@endpoint = resolve_endpoint(options, endpoint_mode)
|
64
70
|
@port = options[:port] || 80
|
65
71
|
@http_open_timeout = options[:http_open_timeout] || 1
|
66
72
|
@http_read_timeout = options[:http_read_timeout] || 1
|
@@ -78,6 +84,34 @@ module Aws
|
|
78
84
|
|
79
85
|
private
|
80
86
|
|
87
|
+
def resolve_endpoint_mode(options)
|
88
|
+
value = options[:endpoint_mode]
|
89
|
+
value ||= ENV['AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE']
|
90
|
+
value ||= Aws.shared_config.ec2_metadata_service_endpoint_mode(
|
91
|
+
profile: options[:profile]
|
92
|
+
)
|
93
|
+
value || 'IPv4'
|
94
|
+
end
|
95
|
+
|
96
|
+
def resolve_endpoint(options, endpoint_mode)
|
97
|
+
value = options[:endpoint] || options[:ip_address]
|
98
|
+
value ||= ENV['AWS_EC2_METADATA_SERVICE_ENDPOINT']
|
99
|
+
value ||= Aws.shared_config.ec2_metadata_service_endpoint(
|
100
|
+
profile: options[:profile]
|
101
|
+
)
|
102
|
+
|
103
|
+
return value if value
|
104
|
+
|
105
|
+
case endpoint_mode.downcase
|
106
|
+
when 'ipv4' then 'http://169.254.169.254'
|
107
|
+
when 'ipv6' then 'http://[fd00:ec2::254]'
|
108
|
+
else
|
109
|
+
raise ArgumentError,
|
110
|
+
':endpoint_mode is not valid, expected IPv4 or IPv6, '\
|
111
|
+
"got: #{endpoint_mode}"
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
81
115
|
def backoff(backoff)
|
82
116
|
case backoff
|
83
117
|
when Proc then backoff
|
@@ -152,7 +186,8 @@ module Aws
|
|
152
186
|
end
|
153
187
|
|
154
188
|
def open_connection
|
155
|
-
|
189
|
+
uri = URI.parse(@endpoint)
|
190
|
+
http = Net::HTTP.new(uri.hostname || @endpoint, @port || uri.port)
|
156
191
|
http.open_timeout = @http_open_timeout
|
157
192
|
http.read_timeout = @http_read_timeout
|
158
193
|
http.set_debug_output(@http_debug_output) if @http_debug_output
|
data/lib/aws-sdk-core/json.rb
CHANGED
@@ -5,6 +5,8 @@ require_relative 'json/builder'
|
|
5
5
|
require_relative 'json/error_handler'
|
6
6
|
require_relative 'json/handler'
|
7
7
|
require_relative 'json/parser'
|
8
|
+
require_relative 'json/json_engine'
|
9
|
+
require_relative 'json/oj_engine'
|
8
10
|
|
9
11
|
module Aws
|
10
12
|
# @api private
|
@@ -20,9 +22,7 @@ module Aws
|
|
20
22
|
|
21
23
|
class << self
|
22
24
|
def load(json)
|
23
|
-
ENGINE.load(json
|
24
|
-
rescue *ENGINE_ERRORS => e
|
25
|
-
raise ParseError, e
|
25
|
+
ENGINE.load(json)
|
26
26
|
end
|
27
27
|
|
28
28
|
def load_file(path)
|
@@ -30,38 +30,20 @@ module Aws
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def dump(value)
|
33
|
-
ENGINE.dump(value
|
33
|
+
ENGINE.dump(value)
|
34
34
|
end
|
35
35
|
|
36
36
|
private
|
37
37
|
|
38
|
-
def
|
38
|
+
def select_engine
|
39
39
|
require 'oj'
|
40
|
-
|
41
|
-
Oj,
|
42
|
-
[{ mode: :compat, symbol_keys: false, empty_string: false }],
|
43
|
-
[{ mode: :compat }],
|
44
|
-
oj_parse_error
|
45
|
-
]
|
40
|
+
OjEngine
|
46
41
|
rescue LoadError
|
47
|
-
|
48
|
-
end
|
49
|
-
|
50
|
-
def json_engine
|
51
|
-
[JSON, [], [], [JSON::ParserError]]
|
52
|
-
end
|
53
|
-
|
54
|
-
def oj_parse_error
|
55
|
-
if Oj.const_defined?('ParseError')
|
56
|
-
[Oj::ParseError, EncodingError, JSON::ParserError]
|
57
|
-
else
|
58
|
-
[SyntaxError]
|
59
|
-
end
|
42
|
+
JSONEngine
|
60
43
|
end
|
61
44
|
end
|
62
45
|
|
63
46
|
# @api private
|
64
|
-
ENGINE
|
65
|
-
oj_engine || json_engine
|
47
|
+
ENGINE = select_engine
|
66
48
|
end
|
67
49
|
end
|
@@ -2,16 +2,18 @@
|
|
2
2
|
|
3
3
|
module Aws
|
4
4
|
module Json
|
5
|
-
|
5
|
+
module JSONEngine
|
6
|
+
class << self
|
7
|
+
def load(json)
|
8
|
+
JSON.parse(json)
|
9
|
+
rescue JSON::ParserError => e
|
10
|
+
raise ParseError.new(e)
|
11
|
+
end
|
6
12
|
|
7
|
-
|
8
|
-
|
13
|
+
def dump(value)
|
14
|
+
JSON.dump(value)
|
15
|
+
end
|
9
16
|
end
|
10
|
-
|
11
|
-
def self.dump(value)
|
12
|
-
JSON.dump(value)
|
13
|
-
end
|
14
|
-
|
15
17
|
end
|
16
18
|
end
|
17
19
|
end
|
@@ -2,16 +2,43 @@
|
|
2
2
|
|
3
3
|
module Aws
|
4
4
|
module Json
|
5
|
-
|
5
|
+
module OjEngine
|
6
|
+
# @api private
|
7
|
+
LOAD_OPTIONS = { mode: :compat, symbol_keys: false, empty_string: false }.freeze
|
6
8
|
|
7
|
-
|
8
|
-
|
9
|
-
|
9
|
+
# @api private
|
10
|
+
DUMP_OPTIONS = { mode: :compat }.freeze
|
11
|
+
|
12
|
+
class << self
|
13
|
+
def load(json)
|
14
|
+
Oj.load(json, LOAD_OPTIONS)
|
15
|
+
rescue *PARSE_ERRORS => e
|
16
|
+
raise ParseError.new(e)
|
17
|
+
end
|
18
|
+
|
19
|
+
def dump(value)
|
20
|
+
Oj.dump(value, DUMP_OPTIONS)
|
21
|
+
end
|
22
|
+
|
23
|
+
private
|
24
|
+
|
25
|
+
# Oj before 1.4.0 does not define Oj::ParseError and instead raises
|
26
|
+
# SyntaxError on failure
|
27
|
+
def detect_oj_parse_errors
|
28
|
+
require 'oj'
|
10
29
|
|
11
|
-
|
12
|
-
|
30
|
+
if Oj.const_defined?(:ParseError)
|
31
|
+
[Oj::ParseError, EncodingError, JSON::ParserError]
|
32
|
+
else
|
33
|
+
[SyntaxError]
|
34
|
+
end
|
35
|
+
rescue LoadError
|
36
|
+
nil
|
37
|
+
end
|
13
38
|
end
|
14
39
|
|
40
|
+
# @api private
|
41
|
+
PARSE_ERRORS = detect_oj_parse_errors
|
15
42
|
end
|
16
43
|
end
|
17
44
|
end
|
@@ -28,8 +28,16 @@ module Aws
|
|
28
28
|
member_name, member_ref = shape.member_by_location_name(key)
|
29
29
|
if member_ref
|
30
30
|
target[member_name] = parse_ref(member_ref, value)
|
31
|
+
elsif shape.union
|
32
|
+
target[:unknown] = { 'name' => key, 'value' => value }
|
31
33
|
end
|
32
34
|
end
|
35
|
+
if shape.union
|
36
|
+
# convert to subclass
|
37
|
+
member_subclass = shape.member_subclass(target.member).new
|
38
|
+
member_subclass[target.member] = target.value
|
39
|
+
target = member_subclass
|
40
|
+
end
|
33
41
|
target
|
34
42
|
end
|
35
43
|
|
@@ -26,7 +26,8 @@ module Aws
|
|
26
26
|
|
27
27
|
def filter(values, type)
|
28
28
|
case values
|
29
|
-
when Struct
|
29
|
+
when Struct then filter_struct(values, type)
|
30
|
+
when Hash then filter_hash(values, type)
|
30
31
|
when Array then filter_array(values, type)
|
31
32
|
else values
|
32
33
|
end
|
@@ -34,6 +35,13 @@ module Aws
|
|
34
35
|
|
35
36
|
private
|
36
37
|
|
38
|
+
def filter_struct(values, type)
|
39
|
+
if values.class.include? Aws::Structure::Union
|
40
|
+
values = { values.member => values.value }
|
41
|
+
end
|
42
|
+
filter_hash(values, type)
|
43
|
+
end
|
44
|
+
|
37
45
|
def filter_hash(values, type)
|
38
46
|
if type.const_defined?('SENSITIVE')
|
39
47
|
filters = type::SENSITIVE + @additional_filters
|
@@ -70,6 +70,14 @@ module Aws
|
|
70
70
|
end
|
71
71
|
end
|
72
72
|
|
73
|
+
if @validate_required && shape.union
|
74
|
+
if values.length > 1
|
75
|
+
errors << "multiple values provided to union at #{context} - must contain exactly one of the supported types: #{shape.member_names.join(', ')}"
|
76
|
+
elsif values.length == 0
|
77
|
+
errors << "No values provided to union at #{context} - must contain exactly one of the supported types: #{shape.member_names.join(', ')}"
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
73
81
|
# validate non-nil members
|
74
82
|
values.each_pair do |name, value|
|
75
83
|
unless value.nil?
|
@@ -117,11 +125,32 @@ module Aws
|
|
117
125
|
end
|
118
126
|
end
|
119
127
|
|
128
|
+
def document(ref, value, errors, context)
|
129
|
+
document_types = [Hash, Array, Numeric, String, TrueClass, FalseClass, NilClass]
|
130
|
+
unless document_types.any? { |t| value.is_a?(t) }
|
131
|
+
errors << expected_got(context, "one of #{document_types.join(', ')}", value)
|
132
|
+
end
|
133
|
+
|
134
|
+
# recursively validate types for aggregated types
|
135
|
+
case value
|
136
|
+
when Hash
|
137
|
+
value.each do |k, v|
|
138
|
+
document(ref, v, errors, context + "[#{k}]")
|
139
|
+
end
|
140
|
+
when Array
|
141
|
+
value.each do |v|
|
142
|
+
document(ref, v, errors, context)
|
143
|
+
end
|
144
|
+
end
|
145
|
+
|
146
|
+
end
|
147
|
+
|
120
148
|
def shape(ref, value, errors, context)
|
121
149
|
case ref.shape
|
122
150
|
when StructureShape then structure(ref, value, errors, context)
|
123
151
|
when ListShape then list(ref, value, errors, context)
|
124
152
|
when MapShape then map(ref, value, errors, context)
|
153
|
+
when DocumentShape then document(ref, value, errors, context)
|
125
154
|
when StringShape
|
126
155
|
unless value.is_a?(String)
|
127
156
|
errors << expected_got(context, "a String", value)
|
@@ -14,11 +14,17 @@ module Aws
|
|
14
14
|
'aws_session_token' => 'session_token',
|
15
15
|
}
|
16
16
|
|
17
|
-
# Constructs a new SharedCredentials object. This will load
|
17
|
+
# Constructs a new SharedCredentials object. This will load static
|
18
|
+
# (access_key_id, secret_access_key and session_token) AWS access
|
18
19
|
# credentials from an ini file, which supports profiles. The default
|
19
20
|
# profile name is 'default'. You can specify the profile name with the
|
20
21
|
# `ENV['AWS_PROFILE']` or with the `:profile_name` option.
|
21
22
|
#
|
23
|
+
# To use credentials from the default credential resolution chain
|
24
|
+
# create a client without the credential option specified.
|
25
|
+
# You may access the resolved credentials through
|
26
|
+
# `client.config.credentials`.
|
27
|
+
#
|
22
28
|
# @option [String] :path Path to the shared file. Defaults
|
23
29
|
# to "#{Dir.home}/.aws/credentials".
|
24
30
|
#
|
@@ -70,11 +70,20 @@ module Aws
|
|
70
70
|
end
|
71
71
|
|
72
72
|
end
|
73
|
+
|
74
|
+
module Union
|
75
|
+
def member
|
76
|
+
self.members.select { |k| self[k] }.first
|
77
|
+
end
|
78
|
+
|
79
|
+
def value
|
80
|
+
self[member] if member
|
81
|
+
end
|
82
|
+
end
|
73
83
|
end
|
74
84
|
|
75
85
|
# @api private
|
76
86
|
class EmptyStructure < Struct.new('AwsEmptyStructure')
|
77
87
|
include(Aws::Structure)
|
78
88
|
end
|
79
|
-
|
80
89
|
end
|
@@ -95,6 +95,8 @@ module Aws
|
|
95
95
|
def child_frame(xml_name)
|
96
96
|
if @member = @members[xml_name]
|
97
97
|
Frame.new(xml_name, self, @member[:ref])
|
98
|
+
elsif @ref.shape.union
|
99
|
+
UnknownMemberFrame.new(xml_name, self, nil, @result)
|
98
100
|
else
|
99
101
|
NullFrame.new(xml_name, self)
|
100
102
|
end
|
@@ -106,10 +108,24 @@ module Aws
|
|
106
108
|
@result[@member[:name]][child.key.result] = child.value.result
|
107
109
|
when FlatListFrame
|
108
110
|
@result[@member[:name]] << child.result
|
111
|
+
when UnknownMemberFrame
|
112
|
+
@result[:unknown] = { 'name' => child.path.last, 'value' => child.result }
|
109
113
|
when NullFrame
|
110
114
|
else
|
111
115
|
@result[@member[:name]] = child.result
|
112
116
|
end
|
117
|
+
|
118
|
+
if @ref.shape.union
|
119
|
+
# a union may only have one member set
|
120
|
+
# convert to the union subclass
|
121
|
+
# The default Struct created will have defaults set for all values
|
122
|
+
# This also sets only one of the values leaving everything else nil
|
123
|
+
# as required for unions
|
124
|
+
set_member_name = @member ? @member[:name] : :unknown
|
125
|
+
member_subclass = @ref.shape.member_subclass(set_member_name).new # shape.member_subclass(target.member).new
|
126
|
+
member_subclass[set_member_name] = @result[set_member_name]
|
127
|
+
@result = member_subclass
|
128
|
+
end
|
113
129
|
end
|
114
130
|
|
115
131
|
private
|
@@ -242,6 +258,12 @@ module Aws
|
|
242
258
|
end
|
243
259
|
end
|
244
260
|
|
261
|
+
class UnknownMemberFrame < Frame
|
262
|
+
def result
|
263
|
+
@text.join
|
264
|
+
end
|
265
|
+
end
|
266
|
+
|
245
267
|
class BlobFrame < Frame
|
246
268
|
def result
|
247
269
|
@text.empty? ? nil : Base64.decode64(@text.join)
|
@@ -302,6 +324,7 @@ module Aws
|
|
302
324
|
MapShape => MapFrame,
|
303
325
|
StringShape => StringFrame,
|
304
326
|
StructureShape => StructureFrame,
|
327
|
+
UnionShape => StructureFrame,
|
305
328
|
TimestampShape => TimestampFrame,
|
306
329
|
}
|
307
330
|
|
data/lib/aws-sdk-sso.rb
CHANGED
data/lib/aws-sdk-sso/client.rb
CHANGED
data/lib/aws-sdk-sts.rb
CHANGED
data/lib/aws-sdk-sts/client.rb
CHANGED
@@ -2303,7 +2303,7 @@ module Aws::STS
|
|
2303
2303
|
params: params,
|
2304
2304
|
config: config)
|
2305
2305
|
context[:gem_name] = 'aws-sdk-core'
|
2306
|
-
context[:gem_version] = '3.
|
2306
|
+
context[:gem_version] = '3.119.1'
|
2307
2307
|
Seahorse::Client::Request.new(handlers, context)
|
2308
2308
|
end
|
2309
2309
|
|
@@ -61,6 +61,9 @@ module Seahorse
|
|
61
61
|
# @return [Boolean]
|
62
62
|
attr_accessor :eventheader_type
|
63
63
|
|
64
|
+
# @return [Boolean]
|
65
|
+
attr_accessor :document
|
66
|
+
|
64
67
|
# @return [String, nil]
|
65
68
|
def location
|
66
69
|
@location || (shape && shape[:location])
|
@@ -114,6 +117,9 @@ module Seahorse
|
|
114
117
|
# @return [String, nil]
|
115
118
|
attr_accessor :documentation
|
116
119
|
|
120
|
+
# @return [Boolean]
|
121
|
+
attr_accessor :union
|
122
|
+
|
117
123
|
# Gets metadata for the given `key`.
|
118
124
|
def [](key)
|
119
125
|
@metadata[key.to_s]
|
@@ -264,8 +270,27 @@ module Seahorse
|
|
264
270
|
|
265
271
|
end
|
266
272
|
|
273
|
+
class UnionShape < StructureShape
|
274
|
+
def initialize(options = {})
|
275
|
+
@member_subclasses = {}
|
276
|
+
super options.merge(union: true)
|
277
|
+
end
|
278
|
+
|
279
|
+
# @api private
|
280
|
+
def member_subclass(member)
|
281
|
+
@member_subclasses[member]
|
282
|
+
end
|
283
|
+
|
284
|
+
# @api private
|
285
|
+
def add_member_subclass(member, subclass)
|
286
|
+
@member_subclasses[member] = subclass
|
287
|
+
end
|
288
|
+
end
|
289
|
+
|
267
290
|
class TimestampShape < Shape; end
|
268
291
|
|
292
|
+
class DocumentShape < Shape; end
|
293
|
+
|
269
294
|
end
|
270
295
|
end
|
271
296
|
end
|
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.119.1
|
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: 2021-
|
11
|
+
date: 2021-08-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jmespath
|