aws-sdk-core 3.117.0 → 3.119.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -0
- data/VERSION +1 -1
- 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/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: ddf31c8c3694470609211adc4d264fe1cb30e4150506b1c509df6a5c544f5915
|
4
|
+
data.tar.gz: 2de3c3db20153adc6d6e558b26d467d158a584f4376fced873a34338fd1c8eb1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f03cbc10196aae90f25910784c6b15ebff818d88a08b015a34f4c7dfb2c85c795e513f56473df82a69fb626ad54662c21bd65b02d6bc4f1ae4010b01d722e09b
|
7
|
+
data.tar.gz: b3e7f451f64f74fdbdc24e7891791e3b1ad6993c434321cff87d6088e663cda733513b194d7697af227e545b589257091909a624a2ad6e41c4e1e6f37882d87c
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,16 @@
|
|
1
1
|
Unreleased Changes
|
2
2
|
------------------
|
3
3
|
|
4
|
+
3.119.0 (2021-07-30)
|
5
|
+
------------------
|
6
|
+
|
7
|
+
* 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)
|
8
|
+
|
9
|
+
3.118.0 (2021-07-28)
|
10
|
+
------------------
|
11
|
+
|
12
|
+
* Feature - Add support for Tagged Unions using a "sealed" classes like approach where each union member has a corresponding subclass.
|
13
|
+
|
4
14
|
3.117.0 (2021-07-12)
|
5
15
|
------------------
|
6
16
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.
|
1
|
+
3.119.0
|
@@ -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)
|
@@ -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.0'
|
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.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: 2021-07-
|
11
|
+
date: 2021-07-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jmespath
|