aws-sdk-lexruntimev2 1.16.0 → 1.18.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 668edc5f74b262fa29ee8eec9d635f47e4f087e754f0151541a1bae77b809ed2
4
- data.tar.gz: 27c09efe73b65fe6fb55ad55e66534ff1bb3318d8cf99c981c9c2b0c017cd0bd
3
+ metadata.gz: 5c26df7492f393ad42bc3e76d4a126122a7d162735625cd3b5fac0550dc5950d
4
+ data.tar.gz: 59c0fbcb9fde494f14aab28ad4dfb41452d934c6bf0ee42a164237491b6464f6
5
5
  SHA512:
6
- metadata.gz: 801b1b7364ee463a35cedefa8c0bf0b0572fa92e712bb177027ab153ad3cf932e0bbd17c196f9e49930d09856aa3adf06f0dfc72e6fa5039b47ed1654dc9dd78
7
- data.tar.gz: 0656d3fddadeab663ba3cab556ca434dd6c030d14eacdf06904bd135bc050733b87e3371c995c7aece66c9af2b8cbbc3a8860215aec308ae791fbc88e21160f5
6
+ metadata.gz: c39e5cf6673d9b397b59eefa40ea980e1b991f01cdaac1cef9194be359bb8fe1a3317db738766c55cdfb5c816c4f8f48a5af3b9d11f2b07ebf0f729f021b51bc
7
+ data.tar.gz: cac575579cf951a2fb3c62ce16686a35b3ee335de25f5d6d2f5fa25462b7ef5cc8df1ff05c5b9f64097ef7415311e3716b2a1a834b98be9afb94968f462e8461
data/CHANGELOG.md CHANGED
@@ -1,6 +1,18 @@
1
1
  Unreleased Changes
2
2
  ------------------
3
3
 
4
+ 1.18.0 (2023-01-18)
5
+ ------------------
6
+
7
+ * Feature - Code Generated Changes, see `./build_tools` or `aws-sdk-core`'s CHANGELOG.md for details.
8
+
9
+ * Issue - Replace runtime endpoint resolution approach with generated ruby code.
10
+
11
+ 1.17.0 (2022-10-25)
12
+ ------------------
13
+
14
+ * Feature - Code Generated Changes, see `./build_tools` or `aws-sdk-core`'s CHANGELOG.md for details.
15
+
4
16
  1.16.0 (2022-09-09)
5
17
  ------------------
6
18
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.16.0
1
+ 1.18.0
@@ -27,7 +27,7 @@ require 'aws-sdk-core/plugins/checksum_algorithm.rb'
27
27
  require 'aws-sdk-core/plugins/defaults_mode.rb'
28
28
  require 'aws-sdk-core/plugins/recursion_detection.rb'
29
29
  require 'aws-sdk-core/plugins/invocation_id.rb'
30
- require 'aws-sdk-core/plugins/signature_v4.rb'
30
+ require 'aws-sdk-core/plugins/sign.rb'
31
31
  require 'aws-sdk-core/plugins/protocols/rest_json.rb'
32
32
  require 'aws-sdk-core/plugins/event_stream_configuration.rb'
33
33
 
@@ -59,9 +59,10 @@ module Aws::LexRuntimeV2
59
59
  add_plugin(Aws::Plugins::DefaultsMode)
60
60
  add_plugin(Aws::Plugins::RecursionDetection)
61
61
  add_plugin(Aws::Plugins::InvocationId)
62
- add_plugin(Aws::Plugins::SignatureV4)
62
+ add_plugin(Aws::Plugins::Sign)
63
63
  add_plugin(Aws::Plugins::Protocols::RestJson)
64
64
  add_plugin(Aws::Plugins::EventStreamConfiguration)
65
+ add_plugin(Aws::LexRuntimeV2::Plugins::Endpoints)
65
66
 
66
67
  # @option options [required, Aws::CredentialProvider] :credentials
67
68
  # Your AWS credentials. This can be an instance of any one of the
@@ -232,6 +233,19 @@ module Aws::LexRuntimeV2
232
233
  # ** Please note ** When response stubbing is enabled, no HTTP
233
234
  # requests are made, and retries are disabled.
234
235
  #
236
+ # @option options [Aws::TokenProvider] :token_provider
237
+ # A Bearer Token Provider. This can be an instance of any one of the
238
+ # following classes:
239
+ #
240
+ # * `Aws::StaticTokenProvider` - Used for configuring static, non-refreshing
241
+ # tokens.
242
+ #
243
+ # * `Aws::SSOTokenProvider` - Used for loading tokens from AWS SSO using an
244
+ # access token generated from `aws login`.
245
+ #
246
+ # When `:token_provider` is not configured directly, the `Aws::TokenProviderChain`
247
+ # will be used to search for tokens configured for your profile in shared configuration files.
248
+ #
235
249
  # @option options [Boolean] :use_dualstack_endpoint
236
250
  # When set to `true`, dualstack enabled endpoints (with `.aws` TLD)
237
251
  # will be used if available.
@@ -245,6 +259,9 @@ module Aws::LexRuntimeV2
245
259
  # When `true`, request parameters are validated before
246
260
  # sending the request.
247
261
  #
262
+ # @option options [Aws::LexRuntimeV2::EndpointProvider] :endpoint_provider
263
+ # The endpoint provider used to resolve endpoints. Any object that responds to `#resolve_endpoint(parameters)` where `parameters` is a Struct similar to `Aws::LexRuntimeV2::EndpointParameters`
264
+ #
248
265
  def initialize(*args)
249
266
  unless Kernel.const_defined?("HTTP2")
250
267
  raise "Must include http/2 gem to use AsyncClient instances."
@@ -627,9 +644,9 @@ module Aws::LexRuntimeV2
627
644
  req = build_request(:start_conversation, params)
628
645
 
629
646
  req.context[:input_event_stream_handler] = input_event_stream_handler
630
- req.handlers.add(Aws::Binary::EncodeHandler, priority: 95)
647
+ req.handlers.add(Aws::Binary::EncodeHandler, priority: 55)
631
648
  req.context[:output_event_stream_handler] = output_event_stream_handler
632
- req.handlers.add(Aws::Binary::DecodeHandler, priority: 95)
649
+ req.handlers.add(Aws::Binary::DecodeHandler, priority: 55)
633
650
 
634
651
  req.send_request(options, &block)
635
652
  end
@@ -648,7 +665,7 @@ module Aws::LexRuntimeV2
648
665
  http_response: Seahorse::Client::Http::AsyncResponse.new,
649
666
  config: config)
650
667
  context[:gem_name] = 'aws-sdk-lexruntimev2'
651
- context[:gem_version] = '1.16.0'
668
+ context[:gem_version] = '1.18.0'
652
669
  Seahorse::Client::Request.new(handlers, context)
653
670
  end
654
671
 
@@ -30,7 +30,7 @@ require 'aws-sdk-core/plugins/http_checksum.rb'
30
30
  require 'aws-sdk-core/plugins/checksum_algorithm.rb'
31
31
  require 'aws-sdk-core/plugins/defaults_mode.rb'
32
32
  require 'aws-sdk-core/plugins/recursion_detection.rb'
33
- require 'aws-sdk-core/plugins/signature_v4.rb'
33
+ require 'aws-sdk-core/plugins/sign.rb'
34
34
  require 'aws-sdk-core/plugins/protocols/rest_json.rb'
35
35
  require 'aws-sdk-core/plugins/event_stream_configuration.rb'
36
36
 
@@ -80,9 +80,10 @@ module Aws::LexRuntimeV2
80
80
  add_plugin(Aws::Plugins::ChecksumAlgorithm)
81
81
  add_plugin(Aws::Plugins::DefaultsMode)
82
82
  add_plugin(Aws::Plugins::RecursionDetection)
83
- add_plugin(Aws::Plugins::SignatureV4)
83
+ add_plugin(Aws::Plugins::Sign)
84
84
  add_plugin(Aws::Plugins::Protocols::RestJson)
85
85
  add_plugin(Aws::Plugins::EventStreamConfiguration)
86
+ add_plugin(Aws::LexRuntimeV2::Plugins::Endpoints)
86
87
 
87
88
  # @overload initialize(options)
88
89
  # @param [Hash] options
@@ -298,6 +299,19 @@ module Aws::LexRuntimeV2
298
299
  # ** Please note ** When response stubbing is enabled, no HTTP
299
300
  # requests are made, and retries are disabled.
300
301
  #
302
+ # @option options [Aws::TokenProvider] :token_provider
303
+ # A Bearer Token Provider. This can be an instance of any one of the
304
+ # following classes:
305
+ #
306
+ # * `Aws::StaticTokenProvider` - Used for configuring static, non-refreshing
307
+ # tokens.
308
+ #
309
+ # * `Aws::SSOTokenProvider` - Used for loading tokens from AWS SSO using an
310
+ # access token generated from `aws login`.
311
+ #
312
+ # When `:token_provider` is not configured directly, the `Aws::TokenProviderChain`
313
+ # will be used to search for tokens configured for your profile in shared configuration files.
314
+ #
301
315
  # @option options [Boolean] :use_dualstack_endpoint
302
316
  # When set to `true`, dualstack enabled endpoints (with `.aws` TLD)
303
317
  # will be used if available.
@@ -311,6 +325,9 @@ module Aws::LexRuntimeV2
311
325
  # When `true`, request parameters are validated before
312
326
  # sending the request.
313
327
  #
328
+ # @option options [Aws::LexRuntimeV2::EndpointProvider] :endpoint_provider
329
+ # The endpoint provider used to resolve endpoints. Any object that responds to `#resolve_endpoint(parameters)` where `parameters` is a Struct similar to `Aws::LexRuntimeV2::EndpointParameters`
330
+ #
314
331
  # @option options [URI::HTTP,String] :http_proxy A proxy to send
315
332
  # requests through. Formatted like 'http://proxy.com:123'.
316
333
  #
@@ -1125,7 +1142,7 @@ module Aws::LexRuntimeV2
1125
1142
  params: params,
1126
1143
  config: config)
1127
1144
  context[:gem_name] = 'aws-sdk-lexruntimev2'
1128
- context[:gem_version] = '1.16.0'
1145
+ context[:gem_version] = '1.18.0'
1129
1146
  Seahorse::Client::Request.new(handlers, context)
1130
1147
  end
1131
1148
 
@@ -0,0 +1,66 @@
1
+ # frozen_string_literal: true
2
+
3
+ # WARNING ABOUT GENERATED CODE
4
+ #
5
+ # This file is generated. See the contributing guide for more information:
6
+ # https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
7
+ #
8
+ # WARNING ABOUT GENERATED CODE
9
+
10
+ module Aws::LexRuntimeV2
11
+ # Endpoint parameters used to influence endpoints per request.
12
+ #
13
+ # @!attribute region
14
+ # The AWS region used to dispatch the request.
15
+ #
16
+ # @return [String]
17
+ #
18
+ # @!attribute use_dual_stack
19
+ # When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.
20
+ #
21
+ # @return [Boolean]
22
+ #
23
+ # @!attribute use_fips
24
+ # When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.
25
+ #
26
+ # @return [Boolean]
27
+ #
28
+ # @!attribute endpoint
29
+ # Override the endpoint used to send this request
30
+ #
31
+ # @return [String]
32
+ #
33
+ EndpointParameters = Struct.new(
34
+ :region,
35
+ :use_dual_stack,
36
+ :use_fips,
37
+ :endpoint,
38
+ ) do
39
+ include Aws::Structure
40
+
41
+ # @api private
42
+ class << self
43
+ PARAM_MAP = {
44
+ 'Region' => :region,
45
+ 'UseDualStack' => :use_dual_stack,
46
+ 'UseFIPS' => :use_fips,
47
+ 'Endpoint' => :endpoint,
48
+ }.freeze
49
+ end
50
+
51
+ def initialize(options = {})
52
+ self[:region] = options[:region]
53
+ self[:use_dual_stack] = options[:use_dual_stack]
54
+ self[:use_dual_stack] = false if self[:use_dual_stack].nil?
55
+ if self[:use_dual_stack].nil?
56
+ raise ArgumentError, "Missing required EndpointParameter: :use_dual_stack"
57
+ end
58
+ self[:use_fips] = options[:use_fips]
59
+ self[:use_fips] = false if self[:use_fips].nil?
60
+ if self[:use_fips].nil?
61
+ raise ArgumentError, "Missing required EndpointParameter: :use_fips"
62
+ end
63
+ self[:endpoint] = options[:endpoint]
64
+ end
65
+ end
66
+ end
@@ -0,0 +1,51 @@
1
+ # frozen_string_literal: true
2
+
3
+ # WARNING ABOUT GENERATED CODE
4
+ #
5
+ # This file is generated. See the contributing guide for more information:
6
+ # https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
7
+ #
8
+ # WARNING ABOUT GENERATED CODE
9
+
10
+ module Aws::LexRuntimeV2
11
+ class EndpointProvider
12
+ def resolve_endpoint(parameters)
13
+ region = parameters.region
14
+ use_dual_stack = parameters.use_dual_stack
15
+ use_fips = parameters.use_fips
16
+ endpoint = parameters.endpoint
17
+ if (partition_result = Aws::Endpoints::Matchers.aws_partition(region))
18
+ if Aws::Endpoints::Matchers.set?(endpoint) && (url = Aws::Endpoints::Matchers.parse_url(endpoint))
19
+ if Aws::Endpoints::Matchers.boolean_equals?(use_fips, true)
20
+ raise ArgumentError, "Invalid Configuration: FIPS and custom endpoint are not supported"
21
+ end
22
+ if Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, true)
23
+ raise ArgumentError, "Invalid Configuration: Dualstack and custom endpoint are not supported"
24
+ end
25
+ return Aws::Endpoints::Endpoint.new(url: endpoint, headers: {}, properties: {})
26
+ end
27
+ if Aws::Endpoints::Matchers.boolean_equals?(use_fips, true) && Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, true)
28
+ if Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsFIPS")) && Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsDualStack"))
29
+ return Aws::Endpoints::Endpoint.new(url: "https://runtime-v2-lex-fips.#{region}.#{partition_result['dualStackDnsSuffix']}", headers: {}, properties: {})
30
+ end
31
+ raise ArgumentError, "FIPS and DualStack are enabled, but this partition does not support one or both"
32
+ end
33
+ if Aws::Endpoints::Matchers.boolean_equals?(use_fips, true)
34
+ if Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsFIPS"))
35
+ return Aws::Endpoints::Endpoint.new(url: "https://runtime-v2-lex-fips.#{region}.#{partition_result['dnsSuffix']}", headers: {}, properties: {})
36
+ end
37
+ raise ArgumentError, "FIPS is enabled but this partition does not support FIPS"
38
+ end
39
+ if Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, true)
40
+ if Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsDualStack"))
41
+ return Aws::Endpoints::Endpoint.new(url: "https://runtime-v2-lex.#{region}.#{partition_result['dualStackDnsSuffix']}", headers: {}, properties: {})
42
+ end
43
+ raise ArgumentError, "DualStack is enabled but this partition does not support DualStack"
44
+ end
45
+ return Aws::Endpoints::Endpoint.new(url: "https://runtime-v2-lex.#{region}.#{partition_result['dnsSuffix']}", headers: {}, properties: {})
46
+ end
47
+ raise ArgumentError, 'No endpoint could be resolved'
48
+
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,99 @@
1
+ # frozen_string_literal: true
2
+
3
+ # WARNING ABOUT GENERATED CODE
4
+ #
5
+ # This file is generated. See the contributing guide for more information:
6
+ # https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
7
+ #
8
+ # WARNING ABOUT GENERATED CODE
9
+
10
+
11
+ module Aws::LexRuntimeV2
12
+ module Endpoints
13
+
14
+ class DeleteSession
15
+ def self.build(context)
16
+ unless context.config.regional_endpoint
17
+ endpoint = context.config.endpoint.to_s
18
+ end
19
+ Aws::LexRuntimeV2::EndpointParameters.new(
20
+ region: context.config.region,
21
+ use_dual_stack: context.config.use_dualstack_endpoint,
22
+ use_fips: context.config.use_fips_endpoint,
23
+ endpoint: endpoint,
24
+ )
25
+ end
26
+ end
27
+
28
+ class GetSession
29
+ def self.build(context)
30
+ unless context.config.regional_endpoint
31
+ endpoint = context.config.endpoint.to_s
32
+ end
33
+ Aws::LexRuntimeV2::EndpointParameters.new(
34
+ region: context.config.region,
35
+ use_dual_stack: context.config.use_dualstack_endpoint,
36
+ use_fips: context.config.use_fips_endpoint,
37
+ endpoint: endpoint,
38
+ )
39
+ end
40
+ end
41
+
42
+ class PutSession
43
+ def self.build(context)
44
+ unless context.config.regional_endpoint
45
+ endpoint = context.config.endpoint.to_s
46
+ end
47
+ Aws::LexRuntimeV2::EndpointParameters.new(
48
+ region: context.config.region,
49
+ use_dual_stack: context.config.use_dualstack_endpoint,
50
+ use_fips: context.config.use_fips_endpoint,
51
+ endpoint: endpoint,
52
+ )
53
+ end
54
+ end
55
+
56
+ class RecognizeText
57
+ def self.build(context)
58
+ unless context.config.regional_endpoint
59
+ endpoint = context.config.endpoint.to_s
60
+ end
61
+ Aws::LexRuntimeV2::EndpointParameters.new(
62
+ region: context.config.region,
63
+ use_dual_stack: context.config.use_dualstack_endpoint,
64
+ use_fips: context.config.use_fips_endpoint,
65
+ endpoint: endpoint,
66
+ )
67
+ end
68
+ end
69
+
70
+ class RecognizeUtterance
71
+ def self.build(context)
72
+ unless context.config.regional_endpoint
73
+ endpoint = context.config.endpoint.to_s
74
+ end
75
+ Aws::LexRuntimeV2::EndpointParameters.new(
76
+ region: context.config.region,
77
+ use_dual_stack: context.config.use_dualstack_endpoint,
78
+ use_fips: context.config.use_fips_endpoint,
79
+ endpoint: endpoint,
80
+ )
81
+ end
82
+ end
83
+
84
+ class StartConversation
85
+ def self.build(context)
86
+ unless context.config.regional_endpoint
87
+ endpoint = context.config.endpoint.to_s
88
+ end
89
+ Aws::LexRuntimeV2::EndpointParameters.new(
90
+ region: context.config.region,
91
+ use_dual_stack: context.config.use_dualstack_endpoint,
92
+ use_fips: context.config.use_fips_endpoint,
93
+ endpoint: endpoint,
94
+ )
95
+ end
96
+ end
97
+
98
+ end
99
+ end
@@ -0,0 +1,80 @@
1
+ # frozen_string_literal: true
2
+
3
+ # WARNING ABOUT GENERATED CODE
4
+ #
5
+ # This file is generated. See the contributing guide for more information:
6
+ # https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
7
+ #
8
+ # WARNING ABOUT GENERATED CODE
9
+
10
+
11
+ module Aws::LexRuntimeV2
12
+ module Plugins
13
+ class Endpoints < Seahorse::Client::Plugin
14
+ option(
15
+ :endpoint_provider,
16
+ doc_type: 'Aws::LexRuntimeV2::EndpointProvider',
17
+ docstring: 'The endpoint provider used to resolve endpoints. Any '\
18
+ 'object that responds to `#resolve_endpoint(parameters)` '\
19
+ 'where `parameters` is a Struct similar to '\
20
+ '`Aws::LexRuntimeV2::EndpointParameters`'
21
+ ) do |cfg|
22
+ Aws::LexRuntimeV2::EndpointProvider.new
23
+ end
24
+
25
+ # @api private
26
+ class Handler < Seahorse::Client::Handler
27
+ def call(context)
28
+ # If endpoint was discovered, do not resolve or apply the endpoint.
29
+ unless context[:discovered_endpoint]
30
+ params = parameters_for_operation(context)
31
+ endpoint = context.config.endpoint_provider.resolve_endpoint(params)
32
+
33
+ context.http_request.endpoint = endpoint.url
34
+ apply_endpoint_headers(context, endpoint.headers)
35
+ end
36
+
37
+ context[:endpoint_params] = params
38
+ context[:auth_scheme] =
39
+ Aws::Endpoints.resolve_auth_scheme(context, endpoint)
40
+
41
+ @handler.call(context)
42
+ end
43
+
44
+ private
45
+
46
+ def apply_endpoint_headers(context, headers)
47
+ headers.each do |key, values|
48
+ value = values
49
+ .compact
50
+ .map { |s| Seahorse::Util.escape_header_list_string(s.to_s) }
51
+ .join(',')
52
+
53
+ context.http_request.headers[key] = value
54
+ end
55
+ end
56
+
57
+ def parameters_for_operation(context)
58
+ case context.operation_name
59
+ when :delete_session
60
+ Aws::LexRuntimeV2::Endpoints::DeleteSession.build(context)
61
+ when :get_session
62
+ Aws::LexRuntimeV2::Endpoints::GetSession.build(context)
63
+ when :put_session
64
+ Aws::LexRuntimeV2::Endpoints::PutSession.build(context)
65
+ when :recognize_text
66
+ Aws::LexRuntimeV2::Endpoints::RecognizeText.build(context)
67
+ when :recognize_utterance
68
+ Aws::LexRuntimeV2::Endpoints::RecognizeUtterance.build(context)
69
+ when :start_conversation
70
+ Aws::LexRuntimeV2::Endpoints::StartConversation.build(context)
71
+ end
72
+ end
73
+ end
74
+
75
+ def add_handlers(handlers, _config)
76
+ handlers.add(Handler, step: :build, priority: 75)
77
+ end
78
+ end
79
+ end
80
+ end