aws-sdk-core 3.198.0 → 3.199.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 +9 -0
- data/VERSION +1 -1
- data/lib/aws-sdk-core/binary/decode_handler.rb +3 -4
- data/lib/aws-sdk-core/binary/encode_handler.rb +1 -1
- data/lib/aws-sdk-core/binary/event_stream_decoder.rb +1 -0
- data/lib/aws-sdk-core/binary/event_stream_encoder.rb +4 -3
- data/lib/aws-sdk-core/cbor/cbor_engine.rb +19 -0
- data/lib/aws-sdk-core/cbor/decoder.rb +310 -0
- data/lib/aws-sdk-core/cbor/encoder.rb +243 -0
- data/lib/aws-sdk-core/cbor.rb +106 -0
- data/lib/aws-sdk-core/client_stubs.rb +3 -2
- data/lib/aws-sdk-core/error_handler.rb +41 -0
- data/lib/aws-sdk-core/json/error_handler.rb +6 -8
- data/lib/aws-sdk-core/json/handler.rb +5 -6
- data/lib/aws-sdk-core/json/json_engine.rb +3 -1
- data/lib/aws-sdk-core/json/oj_engine.rb +7 -1
- data/lib/aws-sdk-core/json/parser.rb +2 -0
- data/lib/aws-sdk-core/json.rb +43 -14
- data/lib/aws-sdk-core/plugins/protocols/api_gateway.rb +3 -1
- data/lib/aws-sdk-core/plugins/protocols/ec2.rb +2 -24
- data/lib/aws-sdk-core/plugins/protocols/json_rpc.rb +6 -8
- data/lib/aws-sdk-core/plugins/protocols/query.rb +4 -2
- data/lib/aws-sdk-core/plugins/protocols/rest_json.rb +4 -3
- data/lib/aws-sdk-core/plugins/protocols/rest_xml.rb +5 -1
- data/lib/aws-sdk-core/plugins/protocols/rpc_v2.rb +17 -0
- data/lib/aws-sdk-core/query/ec2_handler.rb +27 -0
- data/lib/aws-sdk-core/query/handler.rb +4 -4
- data/lib/aws-sdk-core/query.rb +2 -1
- data/lib/aws-sdk-core/rest/{request/content_type.rb → content_type_handler.rb} +1 -1
- data/lib/aws-sdk-core/rest/handler.rb +3 -4
- data/lib/aws-sdk-core/rest.rb +1 -1
- data/lib/aws-sdk-core/rpc_v2/builder.rb +62 -0
- data/lib/aws-sdk-core/rpc_v2/content_type_handler.rb +45 -0
- data/lib/aws-sdk-core/rpc_v2/error_handler.rb +84 -0
- data/lib/aws-sdk-core/rpc_v2/handler.rb +74 -0
- data/lib/aws-sdk-core/rpc_v2/parser.rb +90 -0
- data/lib/aws-sdk-core/rpc_v2.rb +6 -0
- data/lib/aws-sdk-core/stubbing/protocols/rpc_v2.rb +41 -0
- data/lib/aws-sdk-core/xml/error_handler.rb +11 -37
- data/lib/aws-sdk-core/xml/parser.rb +2 -6
- data/lib/aws-sdk-core.rb +6 -2
- data/lib/aws-sdk-sso/client.rb +1 -1
- data/lib/aws-sdk-sso.rb +1 -1
- data/lib/aws-sdk-ssooidc/client.rb +1 -1
- data/lib/aws-sdk-ssooidc.rb +1 -1
- data/lib/aws-sdk-sts/client.rb +1 -1
- data/lib/aws-sdk-sts.rb +1 -1
- data/lib/seahorse/client/handler.rb +1 -1
- metadata +22 -8
- /data/lib/aws-sdk-core/xml/parser/{engines/libxml.rb → libxml_engine.rb} +0 -0
- /data/lib/aws-sdk-core/xml/parser/{engines/nokogiri.rb → nokogiri_engine.rb} +0 -0
- /data/lib/aws-sdk-core/xml/parser/{engines/oga.rb → oga_engine.rb} +0 -0
- /data/lib/aws-sdk-core/xml/parser/{engines/ox.rb → ox_engine.rb} +0 -0
- /data/lib/aws-sdk-core/xml/parser/{engines/rexml.rb → rexml_engine.rb} +0 -0
@@ -0,0 +1,62 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'base64'
|
4
|
+
|
5
|
+
module Aws
|
6
|
+
module RpcV2
|
7
|
+
class Builder
|
8
|
+
include Seahorse::Model::Shapes
|
9
|
+
|
10
|
+
def initialize(rules, _options = {})
|
11
|
+
@rules = rules
|
12
|
+
end
|
13
|
+
|
14
|
+
def serialize(params)
|
15
|
+
# If the input shape is empty, do not set a body. This is
|
16
|
+
# different than if the input shape is a structure with no members.
|
17
|
+
return nil if @rules.shape.struct_class == EmptyStructure
|
18
|
+
|
19
|
+
Cbor.encode(format(@rules, params))
|
20
|
+
end
|
21
|
+
|
22
|
+
private
|
23
|
+
|
24
|
+
def structure(ref, values)
|
25
|
+
shape = ref.shape
|
26
|
+
values.each_pair.with_object({}) do |(key, value), data|
|
27
|
+
if shape.member?(key) && !value.nil?
|
28
|
+
member_ref = shape.member(key)
|
29
|
+
member_name = member_ref.location_name || key
|
30
|
+
data[member_name] = format(member_ref, value)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def list(ref, values)
|
36
|
+
member_ref = ref.shape.member
|
37
|
+
values.collect { |value| format(member_ref, value) }
|
38
|
+
end
|
39
|
+
|
40
|
+
def map(ref, values)
|
41
|
+
value_ref = ref.shape.value
|
42
|
+
values.each.with_object({}) do |(key, value), data|
|
43
|
+
data[key] = format(value_ref, value)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
def blob(value)
|
48
|
+
(String === value ? value : value.read).force_encoding(Encoding::BINARY)
|
49
|
+
end
|
50
|
+
|
51
|
+
def format(ref, value)
|
52
|
+
case ref.shape
|
53
|
+
when StructureShape then structure(ref, value)
|
54
|
+
when ListShape then list(ref, value)
|
55
|
+
when MapShape then map(ref, value)
|
56
|
+
when BlobShape then blob(value)
|
57
|
+
else value
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Aws
|
4
|
+
module RpcV2
|
5
|
+
class ContentTypeHandler < Seahorse::Client::Handler
|
6
|
+
def call(context)
|
7
|
+
content_type =
|
8
|
+
if eventstream_input?(context)
|
9
|
+
'application/vnd.amazon.eventstream'
|
10
|
+
elsif !empty_input_structure?(context)
|
11
|
+
'application/cbor'
|
12
|
+
end
|
13
|
+
accept =
|
14
|
+
if eventstream_output?(context)
|
15
|
+
'application/vnd.amazon.eventstream'
|
16
|
+
end
|
17
|
+
|
18
|
+
headers = context.http_request.headers
|
19
|
+
headers['Content-Type'] ||= content_type if content_type
|
20
|
+
headers['Accept'] ||= accept if accept
|
21
|
+
@handler.call(context)
|
22
|
+
end
|
23
|
+
|
24
|
+
private
|
25
|
+
|
26
|
+
def eventstream_input?(context)
|
27
|
+
context.operation.input.shape.members.each do |_, ref|
|
28
|
+
return true if ref.eventstream
|
29
|
+
end
|
30
|
+
false
|
31
|
+
end
|
32
|
+
|
33
|
+
def eventstream_output?(context)
|
34
|
+
context.operation.output.shape.members.each do |_, ref|
|
35
|
+
return true if ref.eventstream
|
36
|
+
end
|
37
|
+
false
|
38
|
+
end
|
39
|
+
|
40
|
+
def empty_input_structure?(context)
|
41
|
+
context.operation.input.shape.struct_class == EmptyStructure
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,84 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Aws
|
4
|
+
module RpcV2
|
5
|
+
class ErrorHandler < Aws::ErrorHandler
|
6
|
+
|
7
|
+
def call(context)
|
8
|
+
# Malformed responses should throw an http based error, so we check
|
9
|
+
# 200 range for error handling only for this case.
|
10
|
+
@handler.call(context).on(200..599) do |response|
|
11
|
+
if !valid_response?(context)
|
12
|
+
code, message, data = http_status_error(context)
|
13
|
+
response.error = build_error(context, code, message, data)
|
14
|
+
elsif (300..599).cover?(context.http_response.status_code)
|
15
|
+
response.error = error(context)
|
16
|
+
end
|
17
|
+
response.data = nil
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
def valid_response?(context)
|
24
|
+
req_header = context.http_request.headers['smithy-protocol']
|
25
|
+
resp_header = context.http_response.headers['smithy-protocol']
|
26
|
+
req_header == resp_header
|
27
|
+
end
|
28
|
+
|
29
|
+
def extract_error(body, context)
|
30
|
+
data = Cbor.decode(body)
|
31
|
+
code = error_code(data, context)
|
32
|
+
message = data['message']
|
33
|
+
data = parse_error_data(context, body, code)
|
34
|
+
[code, message, data]
|
35
|
+
rescue Cbor::Error
|
36
|
+
[http_status_error_code(context), '', EmptyStructure.new]
|
37
|
+
end
|
38
|
+
|
39
|
+
def error_code(data, context)
|
40
|
+
code =
|
41
|
+
if aws_query_error?(context)
|
42
|
+
error = context.http_response.headers['x-amzn-query-error'].split(';')[0]
|
43
|
+
remove_prefix(error, context)
|
44
|
+
else
|
45
|
+
data['__type']
|
46
|
+
end
|
47
|
+
if code
|
48
|
+
code.split('#').last
|
49
|
+
else
|
50
|
+
http_status_error_code(context)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
def parse_error_data(context, body, code)
|
55
|
+
data = EmptyStructure.new
|
56
|
+
if (error_rules = context.operation.errors)
|
57
|
+
error_rules.each do |rule|
|
58
|
+
# match modeled shape name with the type(code) only
|
59
|
+
# some type(code) might contains invalid characters
|
60
|
+
# such as ':' (efs) etc
|
61
|
+
match = rule.shape.name == code.gsub(/[^^a-zA-Z0-9]/, '')
|
62
|
+
next unless match && rule.shape.members.any?
|
63
|
+
|
64
|
+
data = Parser.new(rule).parse(body)
|
65
|
+
end
|
66
|
+
end
|
67
|
+
data
|
68
|
+
end
|
69
|
+
|
70
|
+
def aws_query_error?(context)
|
71
|
+
context.config.api.metadata['awsQueryCompatible'] &&
|
72
|
+
context.http_response.headers['x-amzn-query-error']
|
73
|
+
end
|
74
|
+
|
75
|
+
def remove_prefix(error_code, context)
|
76
|
+
if (prefix = context.config.api.metadata['errorPrefix'])
|
77
|
+
error_code.sub(/^#{prefix}/, '')
|
78
|
+
else
|
79
|
+
error_code
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
@@ -0,0 +1,74 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Aws
|
4
|
+
module RpcV2
|
5
|
+
class Handler < Seahorse::Client::Handler
|
6
|
+
# @param [Seahorse::Client::RequestContext] context
|
7
|
+
# @return [Seahorse::Client::Response]
|
8
|
+
def call(context)
|
9
|
+
build_request(context)
|
10
|
+
response = @handler.call(context)
|
11
|
+
response.on(200..299) { |resp| resp.data = parse_body(context) }
|
12
|
+
response.on(200..599) { |_resp| apply_request_id(context) }
|
13
|
+
response
|
14
|
+
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
def build_request(context)
|
19
|
+
context.http_request.headers['smithy-protocol'] = 'rpc-v2-cbor'
|
20
|
+
context.http_request.http_method = 'POST'
|
21
|
+
context.http_request.body = build_body(context)
|
22
|
+
build_url(context)
|
23
|
+
end
|
24
|
+
|
25
|
+
def build_url(context)
|
26
|
+
base = context.http_request.endpoint
|
27
|
+
service_name = context.config.api.metadata['targetPrefix']
|
28
|
+
base.path += "/service/#{service_name}/operation/#{context.operation.name}"
|
29
|
+
end
|
30
|
+
|
31
|
+
def build_body(context)
|
32
|
+
Builder.new(context.operation.input).serialize(context.params)
|
33
|
+
end
|
34
|
+
|
35
|
+
def parse_body(context)
|
36
|
+
cbor = context.http_response.body_contents
|
37
|
+
if (rules = context.operation.output)
|
38
|
+
if cbor.is_a?(Array)
|
39
|
+
# an array of emitted events
|
40
|
+
if cbor[0].respond_to?(:response)
|
41
|
+
# initial response exists
|
42
|
+
# it must be the first event arrived
|
43
|
+
resp_struct = cbor.shift.response
|
44
|
+
else
|
45
|
+
resp_struct = context.operation.output.shape.struct_class.new
|
46
|
+
end
|
47
|
+
|
48
|
+
rules.shape.members.each do |name, ref|
|
49
|
+
if ref.eventstream
|
50
|
+
resp_struct.send("#{name}=", cbor.to_enum)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
resp_struct
|
54
|
+
else
|
55
|
+
Parser.new(
|
56
|
+
rules,
|
57
|
+
query_compatible: query_compatible?(context)
|
58
|
+
).parse(cbor)
|
59
|
+
end
|
60
|
+
else
|
61
|
+
EmptyStructure.new
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
def apply_request_id(context)
|
66
|
+
context[:request_id] = context.http_response.headers['x-amzn-requestid']
|
67
|
+
end
|
68
|
+
|
69
|
+
def query_compatible?(context)
|
70
|
+
context.config.api.metadata.key?('awsQueryCompatible')
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
@@ -0,0 +1,90 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'time'
|
4
|
+
|
5
|
+
module Aws
|
6
|
+
module RpcV2
|
7
|
+
class Parser
|
8
|
+
include Seahorse::Model::Shapes
|
9
|
+
|
10
|
+
# @param [Seahorse::Model::ShapeRef] rules
|
11
|
+
def initialize(rules, query_compatible: false)
|
12
|
+
@rules = rules
|
13
|
+
@query_compatible = query_compatible
|
14
|
+
end
|
15
|
+
|
16
|
+
def parse(cbor, target = nil)
|
17
|
+
return {} if cbor.empty?
|
18
|
+
|
19
|
+
parse_ref(@rules, Cbor.decode(cbor), target)
|
20
|
+
end
|
21
|
+
|
22
|
+
private
|
23
|
+
|
24
|
+
def structure(ref, values, target = nil)
|
25
|
+
shape = ref.shape
|
26
|
+
target = ref.shape.struct_class.new if target.nil?
|
27
|
+
values.each do |key, value|
|
28
|
+
member_name, member_ref = shape.member_by_location_name(key)
|
29
|
+
if member_ref
|
30
|
+
target[member_name] = parse_ref(member_ref, value)
|
31
|
+
elsif shape.union && key != '__type'
|
32
|
+
target[:unknown] = { 'name' => key, 'value' => value }
|
33
|
+
end
|
34
|
+
end
|
35
|
+
# In services that were previously Query/XML, members that were
|
36
|
+
# "flattened" defaulted to empty lists. In JSON, these values are nil,
|
37
|
+
# which is backwards incompatible. To preserve backwards compatibility,
|
38
|
+
# we set a default value of [] for these members.
|
39
|
+
if @query_compatible
|
40
|
+
ref.shape.members.each do |member_name, member_target|
|
41
|
+
next unless target[member_name].nil?
|
42
|
+
|
43
|
+
if flattened_list?(member_target.shape)
|
44
|
+
target[member_name] = []
|
45
|
+
elsif flattened_map?(member_target.shape)
|
46
|
+
target[member_name] = {}
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
if shape.union
|
52
|
+
# convert to subclass
|
53
|
+
member_subclass = shape.member_subclass(target.member).new
|
54
|
+
member_subclass[target.member] = target.value
|
55
|
+
target = member_subclass
|
56
|
+
end
|
57
|
+
target
|
58
|
+
end
|
59
|
+
|
60
|
+
def list(ref, values, target = nil)
|
61
|
+
target = [] if target.nil?
|
62
|
+
values.each do |value|
|
63
|
+
target << parse_ref(ref.shape.member, value)
|
64
|
+
end
|
65
|
+
target
|
66
|
+
end
|
67
|
+
|
68
|
+
def map(ref, values, target = nil)
|
69
|
+
target = {} if target.nil?
|
70
|
+
values.each do |key, value|
|
71
|
+
target[key] = parse_ref(ref.shape.value, value) unless value.nil?
|
72
|
+
end
|
73
|
+
target
|
74
|
+
end
|
75
|
+
|
76
|
+
def parse_ref(ref, value, target = nil)
|
77
|
+
if value.nil?
|
78
|
+
nil
|
79
|
+
else
|
80
|
+
case ref.shape
|
81
|
+
when StructureShape then structure(ref, value, target)
|
82
|
+
when ListShape then list(ref, value, target)
|
83
|
+
when MapShape then map(ref, value, target)
|
84
|
+
else value
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Aws
|
4
|
+
module Stubbing
|
5
|
+
module Protocols
|
6
|
+
class RpcV2
|
7
|
+
|
8
|
+
def stub_data(api, operation, data)
|
9
|
+
resp = Seahorse::Client::Http::Response.new
|
10
|
+
resp.status_code = 200
|
11
|
+
resp.headers['Content-Type'] = content_type(api)
|
12
|
+
resp.headers['x-amzn-RequestId'] = 'stubbed-request-id'
|
13
|
+
resp.body = build_body(operation, data)
|
14
|
+
resp
|
15
|
+
end
|
16
|
+
|
17
|
+
def stub_error(error_code)
|
18
|
+
http_resp = Seahorse::Client::Http::Response.new
|
19
|
+
http_resp.status_code = 400
|
20
|
+
http_resp.body = <<-JSON.strip
|
21
|
+
{
|
22
|
+
"code": #{error_code.inspect},
|
23
|
+
"message": "stubbed-response-error-message"
|
24
|
+
}
|
25
|
+
JSON
|
26
|
+
http_resp
|
27
|
+
end
|
28
|
+
|
29
|
+
private
|
30
|
+
|
31
|
+
def content_type(api)
|
32
|
+
'application/cbor'
|
33
|
+
end
|
34
|
+
|
35
|
+
def build_body(operation, data)
|
36
|
+
Aws::RpcV2::Builder.new(operation.output).serialize(data)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -4,7 +4,7 @@ require 'cgi'
|
|
4
4
|
|
5
5
|
module Aws
|
6
6
|
module Xml
|
7
|
-
class ErrorHandler <
|
7
|
+
class ErrorHandler < Aws::ErrorHandler
|
8
8
|
|
9
9
|
def call(context)
|
10
10
|
@handler.call(context).on(300..599) do |response|
|
@@ -15,32 +15,19 @@ module Aws
|
|
15
15
|
|
16
16
|
private
|
17
17
|
|
18
|
-
def error(context)
|
19
|
-
body = context.http_response.body_contents
|
20
|
-
if body.empty?
|
21
|
-
code = http_status_error_code(context)
|
22
|
-
message = ''
|
23
|
-
data = EmptyStructure.new
|
24
|
-
else
|
25
|
-
code, message, data = extract_error(body, context)
|
26
|
-
end
|
27
|
-
context[:request_id] = request_id(body)
|
28
|
-
errors_module = context.client.class.errors_module
|
29
|
-
errors_module.error_class(code).new(context, message, data)
|
30
|
-
end
|
31
|
-
|
32
18
|
def extract_error(body, context)
|
19
|
+
context[:request_id] = request_id(body)
|
33
20
|
code = error_code(body, context)
|
34
21
|
[
|
35
22
|
code,
|
36
23
|
error_message(body),
|
37
|
-
error_data(context, code)
|
24
|
+
error_data(context, body, code)
|
38
25
|
]
|
39
26
|
end
|
40
27
|
|
41
|
-
def error_data(context, code)
|
28
|
+
def error_data(context, body, code)
|
42
29
|
data = EmptyStructure.new
|
43
|
-
if error_rules = context.operation.errors
|
30
|
+
if (error_rules = context.operation.errors)
|
44
31
|
error_rules.each do |rule|
|
45
32
|
# query protocol may have custom error code
|
46
33
|
# reference: https://smithy.io/2.0/aws/protocols/aws-query-protocol.html#error-code-resolution
|
@@ -48,7 +35,7 @@ module Aws
|
|
48
35
|
match = (code == error_shape_code || code == rule.shape.name)
|
49
36
|
next unless match && rule.shape.members.any?
|
50
37
|
|
51
|
-
data = parse_error_data(rule,
|
38
|
+
data = parse_error_data(rule, body)
|
52
39
|
# supporting HTTP bindings
|
53
40
|
apply_error_headers(rule, context, data)
|
54
41
|
end
|
@@ -62,7 +49,7 @@ module Aws
|
|
62
49
|
# errors may nested under <Errors><Error>structure_data</Error></Errors>
|
63
50
|
# Or may be flat and under <Error>structure_data</Error>
|
64
51
|
body = body.tr("\n", '')
|
65
|
-
if matches = body.match(/<Error>(.+?)<\/Error>/)
|
52
|
+
if (matches = body.match(/<Error>(.+?)<\/Error>/))
|
66
53
|
Parser.new(rule).parse("<#{rule.shape.name}>#{matches[1]}</#{rule.shape.name}>")
|
67
54
|
else
|
68
55
|
EmptyStructure.new
|
@@ -75,28 +62,15 @@ module Aws
|
|
75
62
|
end
|
76
63
|
|
77
64
|
def error_code(body, context)
|
78
|
-
if matches = body.match(/<Code>(.+?)<\/Code>/)
|
65
|
+
if (matches = body.match(/<Code>(.+?)<\/Code>/))
|
79
66
|
remove_prefix(unescape(matches[1]), context)
|
80
67
|
else
|
81
68
|
http_status_error_code(context)
|
82
69
|
end
|
83
70
|
end
|
84
71
|
|
85
|
-
def http_status_error_code(context)
|
86
|
-
status_code = context.http_response.status_code
|
87
|
-
{
|
88
|
-
302 => 'MovedTemporarily',
|
89
|
-
304 => 'NotModified',
|
90
|
-
400 => 'BadRequest',
|
91
|
-
403 => 'Forbidden',
|
92
|
-
404 => 'NotFound',
|
93
|
-
412 => 'PreconditionFailed',
|
94
|
-
413 => 'RequestEntityTooLarge',
|
95
|
-
}[status_code] || "Http#{status_code}Error"
|
96
|
-
end
|
97
|
-
|
98
72
|
def remove_prefix(error_code, context)
|
99
|
-
if prefix = context.config.api.metadata['errorPrefix']
|
73
|
+
if (prefix = context.config.api.metadata['errorPrefix'])
|
100
74
|
error_code.sub(/^#{prefix}/, '')
|
101
75
|
else
|
102
76
|
error_code
|
@@ -104,7 +78,7 @@ module Aws
|
|
104
78
|
end
|
105
79
|
|
106
80
|
def error_message(body)
|
107
|
-
if matches = body.match(/<Message>(.+?)<\/Message>/m)
|
81
|
+
if (matches = body.match(/<Message>(.+?)<\/Message>/m))
|
108
82
|
unescape(matches[1])
|
109
83
|
else
|
110
84
|
''
|
@@ -112,7 +86,7 @@ module Aws
|
|
112
86
|
end
|
113
87
|
|
114
88
|
def request_id(body)
|
115
|
-
if matches = body.match(/<RequestId>(.+?)<\/RequestId>/m)
|
89
|
+
if (matches = body.match(/<RequestId>(.+?)<\/RequestId>/m))
|
116
90
|
matches[1]
|
117
91
|
end
|
118
92
|
end
|
@@ -5,7 +5,6 @@ module Aws
|
|
5
5
|
module Xml
|
6
6
|
# A SAX-style XML parser that uses a shape context to handle types.
|
7
7
|
class Parser
|
8
|
-
|
9
8
|
# @param [Seahorse::Model::ShapeRef] rules
|
10
9
|
def initialize(rules, options = {})
|
11
10
|
@rules = rules
|
@@ -47,8 +46,7 @@ module Aws
|
|
47
46
|
# * :libxml
|
48
47
|
# * :nokogiri
|
49
48
|
# * :rexml
|
50
|
-
|
51
|
-
def engine= engine
|
49
|
+
def engine=(engine)
|
52
50
|
@engine = Class === engine ? engine : load_engine(engine)
|
53
51
|
end
|
54
52
|
|
@@ -60,7 +58,6 @@ module Aws
|
|
60
58
|
# * {LibxmlEngine}
|
61
59
|
# * {NokogiriEngine}
|
62
60
|
# * {RexmlEngine}
|
63
|
-
#
|
64
61
|
def engine
|
65
62
|
set_default_engine unless @engine
|
66
63
|
@engine
|
@@ -80,7 +77,7 @@ module Aws
|
|
80
77
|
private
|
81
78
|
|
82
79
|
def load_engine(name)
|
83
|
-
require "aws-sdk-core/xml/parser
|
80
|
+
require "aws-sdk-core/xml/parser/#{name}_engine"
|
84
81
|
const_name = name[0].upcase + name[1..-1] + 'Engine'
|
85
82
|
const_get(const_name)
|
86
83
|
end
|
@@ -94,7 +91,6 @@ module Aws
|
|
94
91
|
end
|
95
92
|
|
96
93
|
set_default_engine
|
97
|
-
|
98
94
|
end
|
99
95
|
end
|
100
96
|
end
|
data/lib/aws-sdk-core.rb
CHANGED
@@ -63,19 +63,23 @@ require_relative 'aws-sdk-core/stubbing/xml_error'
|
|
63
63
|
|
64
64
|
# stubbing protocols
|
65
65
|
|
66
|
-
require_relative 'aws-sdk-core/stubbing/protocols/ec2'
|
67
66
|
require_relative 'aws-sdk-core/stubbing/protocols/json'
|
68
|
-
require_relative 'aws-sdk-core/stubbing/protocols/query'
|
69
67
|
require_relative 'aws-sdk-core/stubbing/protocols/rest'
|
70
68
|
require_relative 'aws-sdk-core/stubbing/protocols/rest_json'
|
71
69
|
require_relative 'aws-sdk-core/stubbing/protocols/rest_xml'
|
70
|
+
require_relative 'aws-sdk-core/stubbing/protocols/query'
|
71
|
+
require_relative 'aws-sdk-core/stubbing/protocols/ec2'
|
72
|
+
require_relative 'aws-sdk-core/stubbing/protocols/rpc_v2'
|
72
73
|
require_relative 'aws-sdk-core/stubbing/protocols/api_gateway'
|
73
74
|
|
74
75
|
# protocols
|
75
76
|
|
77
|
+
require_relative 'aws-sdk-core/error_handler'
|
76
78
|
require_relative 'aws-sdk-core/rest'
|
77
79
|
require_relative 'aws-sdk-core/xml'
|
78
80
|
require_relative 'aws-sdk-core/json'
|
81
|
+
require_relative 'aws-sdk-core/query'
|
82
|
+
require_relative 'aws-sdk-core/rpc_v2'
|
79
83
|
|
80
84
|
# event stream
|
81
85
|
|
data/lib/aws-sdk-sso/client.rb
CHANGED
data/lib/aws-sdk-sso.rb
CHANGED
data/lib/aws-sdk-ssooidc.rb
CHANGED
data/lib/aws-sdk-sts/client.rb
CHANGED
@@ -2380,7 +2380,7 @@ module Aws::STS
|
|
2380
2380
|
params: params,
|
2381
2381
|
config: config)
|
2382
2382
|
context[:gem_name] = 'aws-sdk-core'
|
2383
|
-
context[:gem_version] = '3.
|
2383
|
+
context[:gem_version] = '3.199.0'
|
2384
2384
|
Seahorse::Client::Request.new(handlers, context)
|
2385
2385
|
end
|
2386
2386
|
|
data/lib/aws-sdk-sts.rb
CHANGED