aws-sdk-qbusiness 1.4.0 → 1.5.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 +5 -0
- data/VERSION +1 -1
- data/lib/aws-sdk-qbusiness/async_client.rb +606 -0
- data/lib/aws-sdk-qbusiness/client.rb +941 -834
- data/lib/aws-sdk-qbusiness/client_api.rb +422 -247
- data/lib/aws-sdk-qbusiness/endpoints.rb +13 -0
- data/lib/aws-sdk-qbusiness/errors.rb +5 -5
- data/lib/aws-sdk-qbusiness/event_streams.rb +170 -0
- data/lib/aws-sdk-qbusiness/plugins/endpoints.rb +2 -0
- data/lib/aws-sdk-qbusiness/types.rb +1961 -1312
- data/lib/aws-sdk-qbusiness/waiters.rb +15 -0
- data/lib/aws-sdk-qbusiness.rb +4 -1
- data/sig/client.rbs +444 -388
- data/sig/errors.rbs +1 -1
- data/sig/resource.rbs +3 -0
- data/sig/types.rbs +411 -245
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cfd90006fedd19600f18caae518c2d2f321992861de12654adf982499f2f779e
|
4
|
+
data.tar.gz: ff34d4d4054052b6981bfe70fb2d576d967a8a252f3bc9dd7dc1582587af0aaa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f25edfebd6145e10bbd7c6ba0332b97116c3291a49c133f4c7a312a88a84a355920dbafd95e43d4fbc3badde3b9747406a3953dc83b3720db60500a8b3e8a19
|
7
|
+
data.tar.gz: e45a933169c428c56b3e49ecbdf55d3cd63a3e6da8e5475d33cc00744c3e43fd8499fb38bbaaf276afe3ffd05391294b41d62364aa51dfbc87b1ae6dbfc023c1
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,11 @@
|
|
1
1
|
Unreleased Changes
|
2
2
|
------------------
|
3
3
|
|
4
|
+
1.5.0 (2024-04-30)
|
5
|
+
------------------
|
6
|
+
|
7
|
+
* Feature - This is a general availability (GA) release of Amazon Q Business. Q Business enables employees in an enterprise to get comprehensive answers to complex questions and take actions through a unified, intuitive web-based chat experience - using an enterprise's existing content, data, and systems.
|
8
|
+
|
4
9
|
1.4.0 (2024-04-25)
|
5
10
|
------------------
|
6
11
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.5.0
|
@@ -0,0 +1,606 @@
|
|
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
|
+
begin
|
11
|
+
require 'http/2'
|
12
|
+
rescue LoadError; end
|
13
|
+
require 'aws-sdk-core/plugins/credentials_configuration.rb'
|
14
|
+
require 'aws-sdk-core/plugins/logging.rb'
|
15
|
+
require 'aws-sdk-core/plugins/param_converter.rb'
|
16
|
+
require 'aws-sdk-core/plugins/param_validator.rb'
|
17
|
+
require 'aws-sdk-core/plugins/user_agent.rb'
|
18
|
+
require 'aws-sdk-core/plugins/helpful_socket_errors.rb'
|
19
|
+
require 'aws-sdk-core/plugins/retry_errors.rb'
|
20
|
+
require 'aws-sdk-core/plugins/global_configuration.rb'
|
21
|
+
require 'aws-sdk-core/plugins/regional_endpoint.rb'
|
22
|
+
require 'aws-sdk-core/plugins/stub_responses.rb'
|
23
|
+
require 'aws-sdk-core/plugins/idempotency_token.rb'
|
24
|
+
require 'aws-sdk-core/plugins/invocation_id.rb'
|
25
|
+
require 'aws-sdk-core/plugins/jsonvalue_converter.rb'
|
26
|
+
require 'aws-sdk-core/plugins/http_checksum.rb'
|
27
|
+
require 'aws-sdk-core/plugins/checksum_algorithm.rb'
|
28
|
+
require 'aws-sdk-core/plugins/request_compression.rb'
|
29
|
+
require 'aws-sdk-core/plugins/defaults_mode.rb'
|
30
|
+
require 'aws-sdk-core/plugins/recursion_detection.rb'
|
31
|
+
require 'aws-sdk-core/plugins/sign.rb'
|
32
|
+
require 'aws-sdk-core/plugins/protocols/rest_json.rb'
|
33
|
+
require 'aws-sdk-core/plugins/event_stream_configuration.rb'
|
34
|
+
|
35
|
+
Aws::Plugins::GlobalConfiguration.add_identifier(:qbusiness)
|
36
|
+
|
37
|
+
module Aws::QBusiness
|
38
|
+
class AsyncClient < Seahorse::Client::AsyncBase
|
39
|
+
|
40
|
+
include Aws::AsyncClientStubs
|
41
|
+
|
42
|
+
@identifier = :qbusiness
|
43
|
+
|
44
|
+
set_api(ClientApi::API)
|
45
|
+
|
46
|
+
add_plugin(Aws::Plugins::CredentialsConfiguration)
|
47
|
+
add_plugin(Aws::Plugins::Logging)
|
48
|
+
add_plugin(Aws::Plugins::ParamConverter)
|
49
|
+
add_plugin(Aws::Plugins::ParamValidator)
|
50
|
+
add_plugin(Aws::Plugins::UserAgent)
|
51
|
+
add_plugin(Aws::Plugins::HelpfulSocketErrors)
|
52
|
+
add_plugin(Aws::Plugins::RetryErrors)
|
53
|
+
add_plugin(Aws::Plugins::GlobalConfiguration)
|
54
|
+
add_plugin(Aws::Plugins::RegionalEndpoint)
|
55
|
+
add_plugin(Aws::Plugins::StubResponses)
|
56
|
+
add_plugin(Aws::Plugins::IdempotencyToken)
|
57
|
+
add_plugin(Aws::Plugins::InvocationId)
|
58
|
+
add_plugin(Aws::Plugins::JsonvalueConverter)
|
59
|
+
add_plugin(Aws::Plugins::HttpChecksum)
|
60
|
+
add_plugin(Aws::Plugins::ChecksumAlgorithm)
|
61
|
+
add_plugin(Aws::Plugins::RequestCompression)
|
62
|
+
add_plugin(Aws::Plugins::DefaultsMode)
|
63
|
+
add_plugin(Aws::Plugins::RecursionDetection)
|
64
|
+
add_plugin(Aws::Plugins::Sign)
|
65
|
+
add_plugin(Aws::Plugins::Protocols::RestJson)
|
66
|
+
add_plugin(Aws::Plugins::EventStreamConfiguration)
|
67
|
+
add_plugin(Aws::QBusiness::Plugins::Endpoints)
|
68
|
+
|
69
|
+
# @option options [required, Aws::CredentialProvider] :credentials
|
70
|
+
# Your AWS credentials. This can be an instance of any one of the
|
71
|
+
# following classes:
|
72
|
+
#
|
73
|
+
# * `Aws::Credentials` - Used for configuring static, non-refreshing
|
74
|
+
# credentials.
|
75
|
+
#
|
76
|
+
# * `Aws::SharedCredentials` - Used for loading static credentials from a
|
77
|
+
# shared file, such as `~/.aws/config`.
|
78
|
+
#
|
79
|
+
# * `Aws::AssumeRoleCredentials` - Used when you need to assume a role.
|
80
|
+
#
|
81
|
+
# * `Aws::AssumeRoleWebIdentityCredentials` - Used when you need to
|
82
|
+
# assume a role after providing credentials via the web.
|
83
|
+
#
|
84
|
+
# * `Aws::SSOCredentials` - Used for loading credentials from AWS SSO using an
|
85
|
+
# access token generated from `aws login`.
|
86
|
+
#
|
87
|
+
# * `Aws::ProcessCredentials` - Used for loading credentials from a
|
88
|
+
# process that outputs to stdout.
|
89
|
+
#
|
90
|
+
# * `Aws::InstanceProfileCredentials` - Used for loading credentials
|
91
|
+
# from an EC2 IMDS on an EC2 instance.
|
92
|
+
#
|
93
|
+
# * `Aws::ECSCredentials` - Used for loading credentials from
|
94
|
+
# instances running in ECS.
|
95
|
+
#
|
96
|
+
# * `Aws::CognitoIdentityCredentials` - Used for loading credentials
|
97
|
+
# from the Cognito Identity service.
|
98
|
+
#
|
99
|
+
# When `:credentials` are not configured directly, the following
|
100
|
+
# locations will be searched for credentials:
|
101
|
+
#
|
102
|
+
# * `Aws.config[:credentials]`
|
103
|
+
# * The `:access_key_id`, `:secret_access_key`, and `:session_token` options.
|
104
|
+
# * ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']
|
105
|
+
# * `~/.aws/credentials`
|
106
|
+
# * `~/.aws/config`
|
107
|
+
# * EC2/ECS IMDS instance profile - When used by default, the timeouts
|
108
|
+
# are very aggressive. Construct and pass an instance of
|
109
|
+
# `Aws::InstanceProfileCredentails` or `Aws::ECSCredentials` to
|
110
|
+
# enable retries and extended timeouts. Instance profile credential
|
111
|
+
# fetching can be disabled by setting ENV['AWS_EC2_METADATA_DISABLED']
|
112
|
+
# to true.
|
113
|
+
#
|
114
|
+
# @option options [required, String] :region
|
115
|
+
# The AWS region to connect to. The configured `:region` is
|
116
|
+
# used to determine the service `:endpoint`. When not passed,
|
117
|
+
# a default `:region` is searched for in the following locations:
|
118
|
+
#
|
119
|
+
# * `Aws.config[:region]`
|
120
|
+
# * `ENV['AWS_REGION']`
|
121
|
+
# * `ENV['AMAZON_REGION']`
|
122
|
+
# * `ENV['AWS_DEFAULT_REGION']`
|
123
|
+
# * `~/.aws/credentials`
|
124
|
+
# * `~/.aws/config`
|
125
|
+
#
|
126
|
+
# @option options [String] :access_key_id
|
127
|
+
#
|
128
|
+
# @option options [Boolean] :adaptive_retry_wait_to_fill (true)
|
129
|
+
# Used only in `adaptive` retry mode. When true, the request will sleep
|
130
|
+
# until there is sufficent client side capacity to retry the request.
|
131
|
+
# When false, the request will raise a `RetryCapacityNotAvailableError` and will
|
132
|
+
# not retry instead of sleeping.
|
133
|
+
#
|
134
|
+
# @option options [Boolean] :convert_params (true)
|
135
|
+
# When `true`, an attempt is made to coerce request parameters into
|
136
|
+
# the required types.
|
137
|
+
#
|
138
|
+
# @option options [Boolean] :correct_clock_skew (true)
|
139
|
+
# Used only in `standard` and adaptive retry modes. Specifies whether to apply
|
140
|
+
# a clock skew correction and retry requests with skewed client clocks.
|
141
|
+
#
|
142
|
+
# @option options [String] :defaults_mode ("legacy")
|
143
|
+
# See {Aws::DefaultsModeConfiguration} for a list of the
|
144
|
+
# accepted modes and the configuration defaults that are included.
|
145
|
+
#
|
146
|
+
# @option options [Boolean] :disable_request_compression (false)
|
147
|
+
# When set to 'true' the request body will not be compressed
|
148
|
+
# for supported operations.
|
149
|
+
#
|
150
|
+
# @option options [String, URI::HTTPS, URI::HTTP] :endpoint
|
151
|
+
# Normally you should not configure the `:endpoint` option
|
152
|
+
# directly. This is normally constructed from the `:region`
|
153
|
+
# option. Configuring `:endpoint` is normally reserved for
|
154
|
+
# connecting to test or custom endpoints. The endpoint should
|
155
|
+
# be a URI formatted like:
|
156
|
+
#
|
157
|
+
# 'http://example.com'
|
158
|
+
# 'https://example.com'
|
159
|
+
# 'http://example.com:123'
|
160
|
+
#
|
161
|
+
#
|
162
|
+
# @option options [Proc] :event_stream_handler
|
163
|
+
# When an EventStream or Proc object is provided, it will be used as callback for each chunk of event stream response received along the way.
|
164
|
+
#
|
165
|
+
# @option options [Boolean] :ignore_configured_endpoint_urls
|
166
|
+
# Setting to true disables use of endpoint URLs provided via environment
|
167
|
+
# variables and the shared configuration file.
|
168
|
+
#
|
169
|
+
# @option options [Proc] :input_event_stream_handler
|
170
|
+
# When an EventStream or Proc object is provided, it can be used for sending events for the event stream.
|
171
|
+
#
|
172
|
+
# @option options [Aws::Log::Formatter] :log_formatter (Aws::Log::Formatter.default)
|
173
|
+
# The log formatter.
|
174
|
+
#
|
175
|
+
# @option options [Symbol] :log_level (:info)
|
176
|
+
# The log level to send messages to the `:logger` at.
|
177
|
+
#
|
178
|
+
# @option options [Logger] :logger
|
179
|
+
# The Logger instance to send log messages to. If this option
|
180
|
+
# is not set, logging will be disabled.
|
181
|
+
#
|
182
|
+
# @option options [Integer] :max_attempts (3)
|
183
|
+
# An integer representing the maximum number attempts that will be made for
|
184
|
+
# a single request, including the initial attempt. For example,
|
185
|
+
# setting this value to 5 will result in a request being retried up to
|
186
|
+
# 4 times. Used in `standard` and `adaptive` retry modes.
|
187
|
+
#
|
188
|
+
# @option options [Proc] :output_event_stream_handler
|
189
|
+
# When an EventStream or Proc object is provided, it will be used as callback for each chunk of event stream response received along the way.
|
190
|
+
#
|
191
|
+
# @option options [String] :profile ("default")
|
192
|
+
# Used when loading credentials from the shared credentials file
|
193
|
+
# at HOME/.aws/credentials. When not specified, 'default' is used.
|
194
|
+
#
|
195
|
+
# @option options [Integer] :request_min_compression_size_bytes (10240)
|
196
|
+
# The minimum size in bytes that triggers compression for request
|
197
|
+
# bodies. The value must be non-negative integer value between 0
|
198
|
+
# and 10485780 bytes inclusive.
|
199
|
+
#
|
200
|
+
# @option options [Proc] :retry_backoff
|
201
|
+
# A proc or lambda used for backoff. Defaults to 2**retries * retry_base_delay.
|
202
|
+
# This option is only used in the `legacy` retry mode.
|
203
|
+
#
|
204
|
+
# @option options [Float] :retry_base_delay (0.3)
|
205
|
+
# The base delay in seconds used by the default backoff function. This option
|
206
|
+
# is only used in the `legacy` retry mode.
|
207
|
+
#
|
208
|
+
# @option options [Symbol] :retry_jitter (:none)
|
209
|
+
# A delay randomiser function used by the default backoff function.
|
210
|
+
# Some predefined functions can be referenced by name - :none, :equal, :full,
|
211
|
+
# otherwise a Proc that takes and returns a number. This option is only used
|
212
|
+
# in the `legacy` retry mode.
|
213
|
+
#
|
214
|
+
# @see https://www.awsarchitectureblog.com/2015/03/backoff.html
|
215
|
+
#
|
216
|
+
# @option options [Integer] :retry_limit (3)
|
217
|
+
# The maximum number of times to retry failed requests. Only
|
218
|
+
# ~ 500 level server errors and certain ~ 400 level client errors
|
219
|
+
# are retried. Generally, these are throttling errors, data
|
220
|
+
# checksum errors, networking errors, timeout errors, auth errors,
|
221
|
+
# endpoint discovery, and errors from expired credentials.
|
222
|
+
# This option is only used in the `legacy` retry mode.
|
223
|
+
#
|
224
|
+
# @option options [Integer] :retry_max_delay (0)
|
225
|
+
# The maximum number of seconds to delay between retries (0 for no limit)
|
226
|
+
# used by the default backoff function. This option is only used in the
|
227
|
+
# `legacy` retry mode.
|
228
|
+
#
|
229
|
+
# @option options [String] :retry_mode ("legacy")
|
230
|
+
# Specifies which retry algorithm to use. Values are:
|
231
|
+
#
|
232
|
+
# * `legacy` - The pre-existing retry behavior. This is default value if
|
233
|
+
# no retry mode is provided.
|
234
|
+
#
|
235
|
+
# * `standard` - A standardized set of retry rules across the AWS SDKs.
|
236
|
+
# This includes support for retry quotas, which limit the number of
|
237
|
+
# unsuccessful retries a client can make.
|
238
|
+
#
|
239
|
+
# * `adaptive` - An experimental retry mode that includes all the
|
240
|
+
# functionality of `standard` mode along with automatic client side
|
241
|
+
# throttling. This is a provisional mode that may change behavior
|
242
|
+
# in the future.
|
243
|
+
#
|
244
|
+
#
|
245
|
+
# @option options [String] :sdk_ua_app_id
|
246
|
+
# A unique and opaque application ID that is appended to the
|
247
|
+
# User-Agent header as app/<sdk_ua_app_id>. It should have a
|
248
|
+
# maximum length of 50.
|
249
|
+
#
|
250
|
+
# @option options [String] :secret_access_key
|
251
|
+
#
|
252
|
+
# @option options [String] :session_token
|
253
|
+
#
|
254
|
+
# @option options [Boolean] :stub_responses (false)
|
255
|
+
# Causes the client to return stubbed responses. By default
|
256
|
+
# fake responses are generated and returned. You can specify
|
257
|
+
# the response data to return or errors to raise by calling
|
258
|
+
# {ClientStubs#stub_responses}. See {ClientStubs} for more information.
|
259
|
+
#
|
260
|
+
# ** Please note ** When response stubbing is enabled, no HTTP
|
261
|
+
# requests are made, and retries are disabled.
|
262
|
+
#
|
263
|
+
# @option options [Aws::TokenProvider] :token_provider
|
264
|
+
# A Bearer Token Provider. This can be an instance of any one of the
|
265
|
+
# following classes:
|
266
|
+
#
|
267
|
+
# * `Aws::StaticTokenProvider` - Used for configuring static, non-refreshing
|
268
|
+
# tokens.
|
269
|
+
#
|
270
|
+
# * `Aws::SSOTokenProvider` - Used for loading tokens from AWS SSO using an
|
271
|
+
# access token generated from `aws login`.
|
272
|
+
#
|
273
|
+
# When `:token_provider` is not configured directly, the `Aws::TokenProviderChain`
|
274
|
+
# will be used to search for tokens configured for your profile in shared configuration files.
|
275
|
+
#
|
276
|
+
# @option options [Boolean] :use_dualstack_endpoint
|
277
|
+
# When set to `true`, dualstack enabled endpoints (with `.aws` TLD)
|
278
|
+
# will be used if available.
|
279
|
+
#
|
280
|
+
# @option options [Boolean] :use_fips_endpoint
|
281
|
+
# When set to `true`, fips compatible endpoints will be used if available.
|
282
|
+
# When a `fips` region is used, the region is normalized and this config
|
283
|
+
# is set to `true`.
|
284
|
+
#
|
285
|
+
# @option options [Boolean] :validate_params (true)
|
286
|
+
# When `true`, request parameters are validated before
|
287
|
+
# sending the request.
|
288
|
+
#
|
289
|
+
# @option options [Aws::QBusiness::EndpointProvider] :endpoint_provider
|
290
|
+
# The endpoint provider used to resolve endpoints. Any object that responds to `#resolve_endpoint(parameters)` where `parameters` is a Struct similar to `Aws::QBusiness::EndpointParameters`
|
291
|
+
#
|
292
|
+
# @option options [Integer] :connection_read_timeout (60)
|
293
|
+
# Connection read timeout in seconds, defaults to 60 sec.
|
294
|
+
#
|
295
|
+
# @option options [Integer] :connection_timeout (60)
|
296
|
+
# Connection timeout in seconds, defaults to 60 sec.
|
297
|
+
#
|
298
|
+
# @option options [Boolean] :enable_alpn (false)
|
299
|
+
# Set to `true` to enable ALPN in HTTP2 over TLS. Requires Openssl version >= 1.0.2.
|
300
|
+
# Defaults to false. Note: not all service HTTP2 operations supports ALPN on server
|
301
|
+
# side, please refer to service documentation.
|
302
|
+
#
|
303
|
+
# @option options [Boolean] :http_wire_trace (false)
|
304
|
+
# When `true`, HTTP2 debug output will be sent to the `:logger`.
|
305
|
+
#
|
306
|
+
# @option options [Integer] :max_concurrent_streams (100)
|
307
|
+
# Maximum concurrent streams used in HTTP2 connection, defaults to 100. Note that server may send back
|
308
|
+
# :settings_max_concurrent_streams value which will take priority when initializing new streams.
|
309
|
+
#
|
310
|
+
# @option options [Boolean] :raise_response_errors (true)
|
311
|
+
# Defaults to `true`, raises errors if exist when #wait or #join! is called upon async response.
|
312
|
+
#
|
313
|
+
# @option options [Integer] :read_chunk_size (1024)
|
314
|
+
#
|
315
|
+
# @option options [String] :ssl_ca_bundle
|
316
|
+
# Full path to the SSL certificate authority bundle file that should be used when
|
317
|
+
# verifying peer certificates. If you do not pass `:ssl_ca_directory` or `:ssl_ca_bundle`
|
318
|
+
# the system default will be used if available.
|
319
|
+
#
|
320
|
+
# @option options [String] :ssl_ca_directory
|
321
|
+
# Full path of the directory that contains the unbundled SSL certificate authority
|
322
|
+
# files for verifying peer certificates. If you do not pass `:ssl_ca_bundle` or
|
323
|
+
# `:ssl_ca_directory` the system default will be used if available.
|
324
|
+
#
|
325
|
+
# @option options [String] :ssl_ca_store
|
326
|
+
#
|
327
|
+
# @option options [Boolean] :ssl_verify_peer (true)
|
328
|
+
# When `true`, SSL peer certificates are verified when establishing a connection.
|
329
|
+
#
|
330
|
+
def initialize(*args)
|
331
|
+
unless Kernel.const_defined?("HTTP2")
|
332
|
+
raise "Must include http/2 gem to use AsyncClient instances."
|
333
|
+
end
|
334
|
+
super
|
335
|
+
end
|
336
|
+
|
337
|
+
# @!group API Operations
|
338
|
+
|
339
|
+
# Starts or continues a streaming Amazon Q Business conversation.
|
340
|
+
#
|
341
|
+
# @option params [required, String] :application_id
|
342
|
+
# The identifier of the Amazon Q Business application linked to a
|
343
|
+
# streaming Amazon Q Business conversation.
|
344
|
+
#
|
345
|
+
# @option params [String] :user_id
|
346
|
+
# The identifier of the user attached to the chat input.
|
347
|
+
#
|
348
|
+
# @option params [Array<String>] :user_groups
|
349
|
+
# The groups that a user associated with the chat input belongs to.
|
350
|
+
#
|
351
|
+
# @option params [String] :conversation_id
|
352
|
+
# The identifier of the Amazon Q Business conversation.
|
353
|
+
#
|
354
|
+
# @option params [String] :parent_message_id
|
355
|
+
# The identifier used to associate a user message with a AI generated
|
356
|
+
# response.
|
357
|
+
#
|
358
|
+
# @option params [String] :client_token
|
359
|
+
# A token that you provide to identify the chat input.
|
360
|
+
#
|
361
|
+
# **A suitable default value is auto-generated.** You should normally
|
362
|
+
# not need to pass this option.**
|
363
|
+
#
|
364
|
+
# @return [Types::ChatOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
|
365
|
+
#
|
366
|
+
# * {Types::ChatOutput#output_stream #output_stream} => Types::ChatOutputStream
|
367
|
+
#
|
368
|
+
# @example Bi-directional EventStream Operation Example
|
369
|
+
#
|
370
|
+
# You can signal input events after the initial request is established. Events
|
371
|
+
# will be sent to the stream immediately once the stream connection is
|
372
|
+
# established successfully.
|
373
|
+
#
|
374
|
+
# To signal events, you can call the #signal methods from an Aws::QBusiness::EventStreams::ChatInputStream
|
375
|
+
# object. You must signal events before calling #wait or #join! on the async response.
|
376
|
+
#
|
377
|
+
# input_stream = Aws::QBusiness::EventStreams::ChatInputStream.new
|
378
|
+
#
|
379
|
+
# async_resp = client.chat(
|
380
|
+
# # params input
|
381
|
+
# input_event_stream_handler: input_stream) do |out_stream|
|
382
|
+
#
|
383
|
+
# # register callbacks for events
|
384
|
+
# out_stream.on_text_event_event do |event|
|
385
|
+
# event # => Aws::QBusiness::Types::textEvent
|
386
|
+
# end
|
387
|
+
# out_stream.on_metadata_event_event do |event|
|
388
|
+
# event # => Aws::QBusiness::Types::metadataEvent
|
389
|
+
# end
|
390
|
+
# out_stream.on_action_review_event_event do |event|
|
391
|
+
# event # => Aws::QBusiness::Types::actionReviewEvent
|
392
|
+
# end
|
393
|
+
# out_stream.on_failed_attachment_event_event do |event|
|
394
|
+
# event # => Aws::QBusiness::Types::failedAttachmentEvent
|
395
|
+
# end
|
396
|
+
# out_stream.on_auth_challenge_request_event_event do |event|
|
397
|
+
# event # => Aws::QBusiness::Types::authChallengeRequestEvent
|
398
|
+
# end
|
399
|
+
#
|
400
|
+
# end
|
401
|
+
# # => Aws::Seahorse::Client::AsyncResponse
|
402
|
+
#
|
403
|
+
# # signal events
|
404
|
+
# input_stream.signal_configuration_event_event( ... )
|
405
|
+
# input_stream.signal_text_event_event( ... )
|
406
|
+
# input_stream.signal_attachment_event_event( ... )
|
407
|
+
# input_stream.signal_action_execution_event_event( ... )
|
408
|
+
# input_stream.signal_end_of_input_event_event( ... )
|
409
|
+
# input_stream.signal_auth_challenge_response_event_event( ... )
|
410
|
+
#
|
411
|
+
# # make sure to signal :end_stream at the end
|
412
|
+
# input_stream.signal_end_stream
|
413
|
+
#
|
414
|
+
# # wait until stream is closed before finalizing the sync response
|
415
|
+
# resp = async_resp.wait
|
416
|
+
# # Or close the stream and finalize sync response immediately
|
417
|
+
# # resp = async_resp.join!
|
418
|
+
#
|
419
|
+
# You can also provide an Aws::QBusiness::EventStreams::ChatOutputStream object to register callbacks
|
420
|
+
# before initializing the request instead of processing from the request block.
|
421
|
+
#
|
422
|
+
# output_stream = Aws::QBusiness::EventStreams::ChatOutputStream.new
|
423
|
+
# # register callbacks for output events
|
424
|
+
# output_stream.on_text_event_event do |event|
|
425
|
+
# event # => Aws::QBusiness::Types::textEvent
|
426
|
+
# end
|
427
|
+
# output_stream.on_metadata_event_event do |event|
|
428
|
+
# event # => Aws::QBusiness::Types::metadataEvent
|
429
|
+
# end
|
430
|
+
# output_stream.on_action_review_event_event do |event|
|
431
|
+
# event # => Aws::QBusiness::Types::actionReviewEvent
|
432
|
+
# end
|
433
|
+
# output_stream.on_failed_attachment_event_event do |event|
|
434
|
+
# event # => Aws::QBusiness::Types::failedAttachmentEvent
|
435
|
+
# end
|
436
|
+
# output_stream.on_auth_challenge_request_event_event do |event|
|
437
|
+
# event # => Aws::QBusiness::Types::authChallengeRequestEvent
|
438
|
+
# end
|
439
|
+
# output_stream.on_error_event do |event|
|
440
|
+
# # catch unmodeled error event in the stream
|
441
|
+
# raise event
|
442
|
+
# # => Aws::Errors::EventError
|
443
|
+
# # event.event_type => :error
|
444
|
+
# # event.error_code => String
|
445
|
+
# # event.error_message => String
|
446
|
+
# end
|
447
|
+
#
|
448
|
+
# async_resp = client.chat (
|
449
|
+
# # params input
|
450
|
+
# input_event_stream_handler: input_stream
|
451
|
+
# output_event_stream_handler: output_stream
|
452
|
+
# )
|
453
|
+
#
|
454
|
+
# resp = async_resp.join!
|
455
|
+
#
|
456
|
+
# You can also iterate through events after the response is complete.
|
457
|
+
#
|
458
|
+
# Events are available at resp.output_stream # => Enumerator
|
459
|
+
#
|
460
|
+
# @example Request syntax with placeholder values
|
461
|
+
#
|
462
|
+
# async_resp = async_client.chat({
|
463
|
+
# application_id: "ApplicationId", # required
|
464
|
+
# user_id: "UserId",
|
465
|
+
# user_groups: ["String"],
|
466
|
+
# conversation_id: "ConversationId",
|
467
|
+
# parent_message_id: "MessageId",
|
468
|
+
# client_token: "ClientToken",
|
469
|
+
# input_event_stream_hander: EventStreams::ChatInputStream.new,
|
470
|
+
# })
|
471
|
+
# # => Seahorse::Client::AsyncResponse
|
472
|
+
# async_resp.wait
|
473
|
+
# # => Seahorse::Client::Response
|
474
|
+
# # Or use async_resp.join!
|
475
|
+
#
|
476
|
+
# @example Response structure
|
477
|
+
#
|
478
|
+
# All events are available at resp.output_stream:
|
479
|
+
# resp.output_stream #=> Enumerator
|
480
|
+
# resp.output_stream.event_types #=> [:text_event, :metadata_event, :action_review_event, :failed_attachment_event, :auth_challenge_request_event]
|
481
|
+
#
|
482
|
+
# For :text_event event available at #on_text_event_event callback and response eventstream enumerator:
|
483
|
+
# event.conversation_id #=> String
|
484
|
+
# event.user_message_id #=> String
|
485
|
+
# event.system_message_id #=> String
|
486
|
+
# event.system_message #=> String
|
487
|
+
#
|
488
|
+
# For :metadata_event event available at #on_metadata_event_event callback and response eventstream enumerator:
|
489
|
+
# event.conversation_id #=> String
|
490
|
+
# event.user_message_id #=> String
|
491
|
+
# event.system_message_id #=> String
|
492
|
+
# event.source_attributions #=> Array
|
493
|
+
# event.source_attributions[0].title #=> String
|
494
|
+
# event.source_attributions[0].snippet #=> String
|
495
|
+
# event.source_attributions[0].url #=> String
|
496
|
+
# event.source_attributions[0].citation_number #=> Integer
|
497
|
+
# event.source_attributions[0].updated_at #=> Time
|
498
|
+
# event.source_attributions[0].text_message_segments #=> Array
|
499
|
+
# event.source_attributions[0].text_message_segments[0].begin_offset #=> Integer
|
500
|
+
# event.source_attributions[0].text_message_segments[0].end_offset #=> Integer
|
501
|
+
# event.source_attributions[0].text_message_segments[0].snippet_excerpt.text #=> String
|
502
|
+
# event.final_text_message #=> String
|
503
|
+
#
|
504
|
+
# For :action_review_event event available at #on_action_review_event_event callback and response eventstream enumerator:
|
505
|
+
# event.conversation_id #=> String
|
506
|
+
# event.user_message_id #=> String
|
507
|
+
# event.system_message_id #=> String
|
508
|
+
# event.plugin_id #=> String
|
509
|
+
# event.plugin_type #=> String, one of "SERVICE_NOW", "SALESFORCE", "JIRA", "ZENDESK", "CUSTOM"
|
510
|
+
# event.payload #=> Hash
|
511
|
+
# event.payload["ActionPayloadFieldKey"].display_name #=> String
|
512
|
+
# event.payload["ActionPayloadFieldKey"].display_order #=> Integer
|
513
|
+
# event.payload["ActionPayloadFieldKey"].display_description #=> String
|
514
|
+
# event.payload["ActionPayloadFieldKey"].type #=> String, one of "STRING", "NUMBER", "ARRAY", "BOOLEAN"
|
515
|
+
# event.payload["ActionPayloadFieldKey"].allowed_values #=> Array
|
516
|
+
# event.payload["ActionPayloadFieldKey"].allowed_format #=> String
|
517
|
+
# event.payload["ActionPayloadFieldKey"].required #=> Boolean
|
518
|
+
# event.payload_field_name_separator #=> String
|
519
|
+
#
|
520
|
+
# For :failed_attachment_event event available at #on_failed_attachment_event_event callback and response eventstream enumerator:
|
521
|
+
# event.conversation_id #=> String
|
522
|
+
# event.user_message_id #=> String
|
523
|
+
# event.system_message_id #=> String
|
524
|
+
# event.attachment.name #=> String
|
525
|
+
# event.attachment.status #=> String, one of "FAILED", "SUCCEEDED"
|
526
|
+
# event.attachment.error.error_message #=> String
|
527
|
+
# event.attachment.error.error_code #=> String, one of "InternalError", "InvalidRequest", "ResourceInactive", "ResourceNotFound"
|
528
|
+
#
|
529
|
+
# For :auth_challenge_request_event event available at #on_auth_challenge_request_event_event callback and response eventstream enumerator:
|
530
|
+
# event.authorization_url #=> String
|
531
|
+
#
|
532
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/Chat AWS API Documentation
|
533
|
+
#
|
534
|
+
# @overload chat(params = {})
|
535
|
+
# @param [Hash] params ({})
|
536
|
+
def chat(params = {}, options = {}, &block)
|
537
|
+
params = params.dup
|
538
|
+
input_event_stream_handler = _event_stream_handler(
|
539
|
+
:input,
|
540
|
+
params.delete(:input_event_stream_handler),
|
541
|
+
EventStreams::ChatInputStream
|
542
|
+
)
|
543
|
+
output_event_stream_handler = _event_stream_handler(
|
544
|
+
:output,
|
545
|
+
params.delete(:output_event_stream_handler) || params.delete(:event_stream_handler),
|
546
|
+
EventStreams::ChatOutputStream
|
547
|
+
)
|
548
|
+
|
549
|
+
yield(output_event_stream_handler) if block_given?
|
550
|
+
|
551
|
+
req = build_request(:chat, params)
|
552
|
+
|
553
|
+
req.context[:input_event_stream_handler] = input_event_stream_handler
|
554
|
+
req.handlers.add(Aws::Binary::EncodeHandler, priority: 55)
|
555
|
+
req.context[:output_event_stream_handler] = output_event_stream_handler
|
556
|
+
req.handlers.add(Aws::Binary::DecodeHandler, priority: 55)
|
557
|
+
|
558
|
+
req.send_request(options, &block)
|
559
|
+
end
|
560
|
+
|
561
|
+
# @!endgroup
|
562
|
+
|
563
|
+
# @param params ({})
|
564
|
+
# @api private
|
565
|
+
def build_request(operation_name, params = {})
|
566
|
+
handlers = @handlers.for(operation_name)
|
567
|
+
context = Seahorse::Client::RequestContext.new(
|
568
|
+
operation_name: operation_name,
|
569
|
+
operation: config.api.operation(operation_name),
|
570
|
+
client: self,
|
571
|
+
params: params,
|
572
|
+
http_response: Seahorse::Client::Http::AsyncResponse.new,
|
573
|
+
config: config)
|
574
|
+
context[:gem_name] = 'aws-sdk-qbusiness'
|
575
|
+
context[:gem_version] = '1.5.0'
|
576
|
+
Seahorse::Client::Request.new(handlers, context)
|
577
|
+
end
|
578
|
+
|
579
|
+
private
|
580
|
+
|
581
|
+
def _event_stream_handler(type, handler, event_stream_class)
|
582
|
+
case handler
|
583
|
+
when event_stream_class then handler
|
584
|
+
when Proc then event_stream_class.new.tap(&handler)
|
585
|
+
when nil then event_stream_class.new
|
586
|
+
else
|
587
|
+
msg = "expected #{type}_event_stream_handler to be a block or "\
|
588
|
+
"instance of Aws::QBusiness::#{event_stream_class}"\
|
589
|
+
", got `#{handler.inspect}` instead"
|
590
|
+
raise ArgumentError, msg
|
591
|
+
end
|
592
|
+
end
|
593
|
+
|
594
|
+
class << self
|
595
|
+
|
596
|
+
# @api private
|
597
|
+
attr_reader :identifier
|
598
|
+
|
599
|
+
# @api private
|
600
|
+
def errors_module
|
601
|
+
Errors
|
602
|
+
end
|
603
|
+
|
604
|
+
end
|
605
|
+
end
|
606
|
+
end
|