aws-sdk-core 3.39.0 → 3.54.2
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/VERSION +1 -1
- data/lib/aws-sdk-core/async_client_stubs.rb +80 -0
- data/lib/aws-sdk-core/binary/decode_handler.rb +9 -1
- data/lib/aws-sdk-core/binary/encode_handler.rb +32 -0
- data/lib/aws-sdk-core/binary/event_builder.rb +122 -0
- data/lib/aws-sdk-core/binary/event_parser.rb +48 -18
- data/lib/aws-sdk-core/binary/event_stream_decoder.rb +5 -2
- data/lib/aws-sdk-core/binary/event_stream_encoder.rb +53 -0
- data/lib/aws-sdk-core/binary.rb +3 -0
- data/lib/aws-sdk-core/client_side_monitoring/request_metrics.rb +63 -9
- data/lib/aws-sdk-core/client_stubs.rb +1 -1
- data/lib/aws-sdk-core/ecs_credentials.rb +12 -8
- data/lib/aws-sdk-core/errors.rb +38 -2
- data/lib/aws-sdk-core/event_emitter.rb +42 -0
- data/lib/aws-sdk-core/instance_profile_credentials.rb +12 -8
- data/lib/aws-sdk-core/json/error_handler.rb +19 -2
- data/lib/aws-sdk-core/json/handler.rb +19 -1
- data/lib/aws-sdk-core/log/param_filter.rb +1 -1
- data/lib/aws-sdk-core/param_validator.rb +9 -1
- data/lib/aws-sdk-core/plugins/client_metrics_plugin.rb +22 -3
- data/lib/aws-sdk-core/plugins/client_metrics_send_plugin.rb +5 -1
- data/lib/aws-sdk-core/plugins/event_stream_configuration.rb +14 -0
- data/lib/aws-sdk-core/plugins/invocation_id.rb +33 -0
- data/lib/aws-sdk-core/plugins/retry_errors.rb +2 -0
- data/lib/aws-sdk-core/plugins/stub_responses.rb +19 -7
- data/lib/aws-sdk-core/plugins/transfer_encoding.rb +53 -0
- data/lib/aws-sdk-core/plugins/user_agent.rb +6 -0
- data/lib/aws-sdk-core/process_credentials.rb +7 -1
- data/lib/aws-sdk-core/query/handler.rb +6 -1
- data/lib/aws-sdk-core/refreshing_credentials.rb +1 -1
- data/lib/aws-sdk-core/resources/collection.rb +1 -1
- data/lib/aws-sdk-core/structure.rb +6 -2
- data/lib/aws-sdk-core/stubbing/protocols/rest.rb +19 -0
- data/lib/aws-sdk-core/stubbing/stub_data.rb +13 -4
- data/lib/aws-sdk-core/waiters/waiter.rb +2 -2
- data/lib/aws-sdk-core/xml/error_handler.rb +26 -3
- data/lib/aws-sdk-core.rb +1 -0
- data/lib/aws-sdk-sts/client.rb +622 -427
- data/lib/aws-sdk-sts/client_api.rb +35 -0
- data/lib/aws-sdk-sts/errors.rb +128 -0
- data/lib/aws-sdk-sts/types.rb +498 -165
- data/lib/aws-sdk-sts.rb +1 -1
- data/lib/seahorse/client/async_base.rb +50 -0
- data/lib/seahorse/client/async_response.rb +62 -0
- data/lib/seahorse/client/base.rb +1 -1
- data/lib/seahorse/client/configuration.rb +4 -2
- data/lib/seahorse/client/events.rb +1 -1
- data/lib/seahorse/client/h2/connection.rb +244 -0
- data/lib/seahorse/client/h2/handler.rb +151 -0
- data/lib/seahorse/client/http/async_response.rb +42 -0
- data/lib/seahorse/client/http/response.rb +13 -8
- data/lib/seahorse/client/net_http/patches.rb +7 -1
- data/lib/seahorse/client/networking_error.rb +28 -0
- data/lib/seahorse/client/plugin.rb +1 -1
- data/lib/seahorse/client/plugins/content_length.rb +7 -2
- data/lib/seahorse/client/plugins/h2.rb +64 -0
- data/lib/seahorse/model/api.rb +4 -0
- data/lib/seahorse/model/operation.rb +4 -0
- data/lib/seahorse/model/shapes.rb +2 -2
- data/lib/seahorse.rb +9 -0
- metadata +23 -5
@@ -20,17 +20,26 @@ module Aws
|
|
20
20
|
def remove_paging_tokens(stub)
|
21
21
|
if @pager
|
22
22
|
@pager.instance_variable_get("@tokens").keys.each do |path|
|
23
|
-
|
24
|
-
|
23
|
+
if divide = (path[' || '] || path[' or '])
|
24
|
+
path = path.split(divide)[0]
|
25
|
+
end
|
26
|
+
parts = path.split(/\b/)
|
27
|
+
# if nested struct/expression, EmptyStub auto-pop "string"
|
28
|
+
# currently not support remove "string" for nested/expression
|
29
|
+
# as it requires reverse JMESPATH search
|
30
|
+
stub[parts[0]] = nil if parts.size == 1
|
25
31
|
end
|
26
32
|
if more_results = @pager.instance_variable_get('@more_results')
|
27
|
-
|
33
|
+
parts = more_results.split(/\b/)
|
34
|
+
# if nested struct/expression, EmptyStub auto-pop false value
|
35
|
+
# no further work needed
|
36
|
+
stub[parts[0]] = false if parts.size == 1
|
28
37
|
end
|
29
38
|
end
|
30
39
|
end
|
31
40
|
|
32
41
|
def apply_data(data, stub)
|
33
|
-
ParamValidator.new(@rules, validate_required:false).validate!(data)
|
42
|
+
ParamValidator.new(@rules, validate_required: false, input: false).validate!(data)
|
34
43
|
DataApplicator.new(@rules).apply_data(data, stub)
|
35
44
|
end
|
36
45
|
end
|
@@ -50,7 +50,7 @@ module Aws
|
|
50
50
|
#
|
51
51
|
# @yieldparam [Integer] attempts The number of attempts made.
|
52
52
|
def before_attempt(&block)
|
53
|
-
@before_attempt <<
|
53
|
+
@before_attempt << block if block_given?
|
54
54
|
end
|
55
55
|
|
56
56
|
# Register a callback that is invoked after an attempt but before
|
@@ -81,7 +81,7 @@ module Aws
|
|
81
81
|
# @yieldparam [Seahorse::Client::Response] response The response from
|
82
82
|
# the previous polling attempts.
|
83
83
|
def before_wait(&block)
|
84
|
-
@before_wait <<
|
84
|
+
@before_wait << block if block_given?
|
85
85
|
end
|
86
86
|
|
87
87
|
# @option options [Client] :client
|
@@ -18,20 +18,43 @@ module Aws
|
|
18
18
|
if body.empty?
|
19
19
|
code = http_status_error_code(context)
|
20
20
|
message = ''
|
21
|
+
data = EmptyStructure.new
|
21
22
|
else
|
22
|
-
code, message = extract_error(body, context)
|
23
|
+
code, message, data = extract_error(body, context)
|
23
24
|
end
|
24
25
|
errors_module = context.client.class.errors_module
|
25
|
-
errors_module.error_class(code).new(context, message)
|
26
|
+
error_class = errors_module.error_class(code).new(context, message, data)
|
27
|
+
error_class
|
26
28
|
end
|
27
29
|
|
28
30
|
def extract_error(body, context)
|
31
|
+
code = error_code(body, context)
|
29
32
|
[
|
30
|
-
|
33
|
+
code,
|
31
34
|
error_message(body),
|
35
|
+
error_data(context, code)
|
32
36
|
]
|
33
37
|
end
|
34
38
|
|
39
|
+
def error_data(context, code)
|
40
|
+
data = EmptyStructure.new
|
41
|
+
if error_rules = context.operation.errors
|
42
|
+
error_rules.each do |rule|
|
43
|
+
# for modeled shape with error trait
|
44
|
+
# match `code` in the error trait before
|
45
|
+
# match modeled shape name
|
46
|
+
error_shape_code = rule.shape['error']['code'] if rule.shape['error']
|
47
|
+
match = (code == error_shape_code || code == rule.shape.name)
|
48
|
+
if match && rule.shape.members.any?
|
49
|
+
data = Parser.new(rule).parse(context.http_response.body_contents)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
data
|
54
|
+
rescue Xml::Parser::ParsingError
|
55
|
+
EmptyStructure.new
|
56
|
+
end
|
57
|
+
|
35
58
|
def error_code(body, context)
|
36
59
|
if matches = body.match(/<Code>(.+?)<\/Code>/)
|
37
60
|
remove_prefix(unescape(matches[1]), context)
|
data/lib/aws-sdk-core.rb
CHANGED
@@ -19,6 +19,7 @@ require_relative 'aws-sdk-core/process_credentials'
|
|
19
19
|
# client modules
|
20
20
|
|
21
21
|
require_relative 'aws-sdk-core/client_stubs'
|
22
|
+
require_relative 'aws-sdk-core/async_client_stubs'
|
22
23
|
require_relative 'aws-sdk-core/eager_loader'
|
23
24
|
require_relative 'aws-sdk-core/errors'
|
24
25
|
require_relative 'aws-sdk-core/pageable_response'
|