aws-sdk-lexruntimeservice 1.0.0.rc1

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 2a68af403e476909b53d65dcd4367610b56b8edf
4
+ data.tar.gz: e716ca7adac060a4b06fe03dd74d73458f371227
5
+ SHA512:
6
+ metadata.gz: 8ab76ac4c43c1dab2b200d863d50cd8dfa460441c813a1bb32da6d1350c1d66e8f6b67ca97c9eee27d97b216c1f2d06191f7c060d553e3db584356ce318cb055
7
+ data.tar.gz: 32fbb644e634ebd18710119bb599c094a53e5442060f731d235e580db5ad1e4b88a59571c790f2473d352f4310e2a06f032f2bc7bf67c031bff3d2dc1b795191
@@ -0,0 +1,47 @@
1
+ # WARNING ABOUT GENERATED CODE
2
+ #
3
+ # This file is generated. See the contributing guide for more information:
4
+ # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
5
+ #
6
+ # WARNING ABOUT GENERATED CODE
7
+
8
+ require 'aws-sdk-core'
9
+ require 'aws-sigv4'
10
+
11
+ require_relative 'aws-sdk-lexruntimeservice/types'
12
+ require_relative 'aws-sdk-lexruntimeservice/client_api'
13
+ require_relative 'aws-sdk-lexruntimeservice/client'
14
+ require_relative 'aws-sdk-lexruntimeservice/errors'
15
+ require_relative 'aws-sdk-lexruntimeservice/resource'
16
+ require_relative 'aws-sdk-lexruntimeservice/customizations'
17
+
18
+ # This module provides support for Amazon Lex Runtime Service. This module is available in the
19
+ # `aws-sdk-lexruntimeservice` gem.
20
+ #
21
+ # # Client
22
+ #
23
+ # The {Client} class provides one method for each API operation. Operation
24
+ # methods each accept a hash of request parameters and return a response
25
+ # structure.
26
+ #
27
+ # See {Client} for more information.
28
+ #
29
+ # # Errors
30
+ #
31
+ # Errors returned from Amazon Lex Runtime Service all
32
+ # extend {Errors::ServiceError}.
33
+ #
34
+ # begin
35
+ # # do stuff
36
+ # rescue Aws::LexRuntimeService::Errors::ServiceError
37
+ # # rescues all service API errors
38
+ # end
39
+ #
40
+ # See {Errors} for more information.
41
+ #
42
+ # @service
43
+ module Aws::LexRuntimeService
44
+
45
+ GEM_VERSION = '1.0.0.rc1'
46
+
47
+ end
@@ -0,0 +1,318 @@
1
+ # WARNING ABOUT GENERATED CODE
2
+ #
3
+ # This file is generated. See the contributing guide for more information:
4
+ # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
5
+ #
6
+ # WARNING ABOUT GENERATED CODE
7
+
8
+ require 'seahorse/client/plugins/content_length.rb'
9
+ require 'aws-sdk-core/plugins/credentials_configuration.rb'
10
+ require 'aws-sdk-core/plugins/logging.rb'
11
+ require 'aws-sdk-core/plugins/param_converter.rb'
12
+ require 'aws-sdk-core/plugins/param_validator.rb'
13
+ require 'aws-sdk-core/plugins/user_agent.rb'
14
+ require 'aws-sdk-core/plugins/helpful_socket_errors.rb'
15
+ require 'aws-sdk-core/plugins/retry_errors.rb'
16
+ require 'aws-sdk-core/plugins/global_configuration.rb'
17
+ require 'aws-sdk-core/plugins/regional_endpoint.rb'
18
+ require 'aws-sdk-core/plugins/response_paging.rb'
19
+ require 'aws-sdk-core/plugins/stub_responses.rb'
20
+ require 'aws-sdk-core/plugins/idempotency_token.rb'
21
+ require 'aws-sdk-core/plugins/signature_v4.rb'
22
+ require 'aws-sdk-core/plugins/protocols/rest_json.rb'
23
+
24
+ Aws::Plugins::GlobalConfiguration.add_identifier(:lexruntimeservice)
25
+
26
+ module Aws::LexRuntimeService
27
+ class Client < Seahorse::Client::Base
28
+
29
+ include Aws::ClientStubs
30
+
31
+ @identifier = :lexruntimeservice
32
+
33
+ set_api(ClientApi::API)
34
+
35
+ add_plugin(Seahorse::Client::Plugins::ContentLength)
36
+ add_plugin(Aws::Plugins::CredentialsConfiguration)
37
+ add_plugin(Aws::Plugins::Logging)
38
+ add_plugin(Aws::Plugins::ParamConverter)
39
+ add_plugin(Aws::Plugins::ParamValidator)
40
+ add_plugin(Aws::Plugins::UserAgent)
41
+ add_plugin(Aws::Plugins::HelpfulSocketErrors)
42
+ add_plugin(Aws::Plugins::RetryErrors)
43
+ add_plugin(Aws::Plugins::GlobalConfiguration)
44
+ add_plugin(Aws::Plugins::RegionalEndpoint)
45
+ add_plugin(Aws::Plugins::ResponsePaging)
46
+ add_plugin(Aws::Plugins::StubResponses)
47
+ add_plugin(Aws::Plugins::IdempotencyToken)
48
+ add_plugin(Aws::Plugins::SignatureV4)
49
+ add_plugin(Aws::Plugins::Protocols::RestJson)
50
+
51
+ # @option options [required, Aws::CredentialProvider] :credentials
52
+ # Your AWS credentials. This can be an instance of any one of the
53
+ # following classes:
54
+ #
55
+ # * `Aws::Credentials` - Used for configuring static, non-refreshing
56
+ # credentials.
57
+ #
58
+ # * `Aws::InstanceProfileCredentials` - Used for loading credentials
59
+ # from an EC2 IMDS on an EC2 instance.
60
+ #
61
+ # * `Aws::SharedCredentials` - Used for loading credentials from a
62
+ # shared file, such as `~/.aws/config`.
63
+ #
64
+ # * `Aws::AssumeRoleCredentials` - Used when you need to assume a role.
65
+ #
66
+ # When `:credentials` are not configured directly, the following
67
+ # locations will be searched for credentials:
68
+ #
69
+ # * `Aws.config[:credentials]`
70
+ # * The `:access_key_id`, `:secret_access_key`, and `:session_token` options.
71
+ # * ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']
72
+ # * `~/.aws/credentials`
73
+ # * `~/.aws/config`
74
+ # * EC2 IMDS instance profile - When used by default, the timeouts are
75
+ # very aggressive. Construct and pass an instance of
76
+ # `Aws::InstanceProfileCredentails` to enable retries and extended
77
+ # timeouts.
78
+ #
79
+ # @option options [required, String] :region
80
+ # The AWS region to connect to. The configured `:region` is
81
+ # used to determine the service `:endpoint`. When not passed,
82
+ # a default `:region` is search for in the following locations:
83
+ #
84
+ # * `Aws.config[:region]`
85
+ # * `ENV['AWS_REGION']`
86
+ # * `ENV['AMAZON_REGION']`
87
+ # * `ENV['AWS_DEFAULT_REGION']`
88
+ # * `~/.aws/credentials`
89
+ # * `~/.aws/config`
90
+ #
91
+ # @option options [String] :access_key_id
92
+ #
93
+ # @option options [Boolean] :convert_params (true)
94
+ # When `true`, an attempt is made to coerce request parameters into
95
+ # the required types.
96
+ #
97
+ # @option options [String] :endpoint
98
+ # The client endpoint is normally constructed from the `:region`
99
+ # option. You should only configure an `:endpoint` when connecting
100
+ # to test endpoints. This should be avalid HTTP(S) URI.
101
+ #
102
+ # @option options [Aws::Log::Formatter] :log_formatter (Aws::Log::Formatter.default)
103
+ # The log formatter.
104
+ #
105
+ # @option options [Symbol] :log_level (:info)
106
+ # The log level to send messages to the `:logger` at.
107
+ #
108
+ # @option options [Logger] :logger
109
+ # The Logger instance to send log messages to. If this option
110
+ # is not set, logging will be disabled.
111
+ #
112
+ # @option options [String] :profile ("default")
113
+ # Used when loading credentials from the shared credentials file
114
+ # at HOME/.aws/credentials. When not specified, 'default' is used.
115
+ #
116
+ # @option options [Integer] :retry_limit (3)
117
+ # The maximum number of times to retry failed requests. Only
118
+ # ~ 500 level server errors and certain ~ 400 level client errors
119
+ # are retried. Generally, these are throttling errors, data
120
+ # checksum errors, networking errors, timeout errors and auth
121
+ # errors from expired credentials.
122
+ #
123
+ # @option options [String] :secret_access_key
124
+ #
125
+ # @option options [String] :session_token
126
+ #
127
+ # @option options [Boolean] :stub_responses (false)
128
+ # Causes the client to return stubbed responses. By default
129
+ # fake responses are generated and returned. You can specify
130
+ # the response data to return or errors to raise by calling
131
+ # {ClientStubs#stub_responses}. See {ClientStubs} for more information.
132
+ #
133
+ # ** Please note ** When response stubbing is enabled, no HTTP
134
+ # requests are made, and retries are disabled.
135
+ #
136
+ # @option options [Boolean] :validate_params (true)
137
+ # When `true`, request parameters are validated before
138
+ # sending the request.
139
+ #
140
+ def initialize(*args)
141
+ super
142
+ end
143
+
144
+ # @!group API Operations
145
+
146
+ # Sends user input text to Amazon Lex at runtime. Amazon Lex uses the
147
+ # machine learning model that the service built for the application to
148
+ # interpret user input.
149
+ #
150
+ # In response, Amazon Lex returns the next message to convey to the user
151
+ # (based on the context of the user interaction) and whether to expect a
152
+ # user response to the message (`dialogState`). For example, consider
153
+ # the following response messages:
154
+ #
155
+ # * "What pizza toppings would you like?" – In this case, the
156
+ # `dialogState` would be `ElicitSlot` (that is, a user response is
157
+ # expected).
158
+ #
159
+ # * "Your order has been placed." – In this case, Amazon Lex returns
160
+ # one of the following `dialogState` values depending on how the
161
+ # intent fulfillment is configured (see `fulfillmentActivity` in
162
+ # `CreateIntent`):
163
+ #
164
+ # * `FulFilled` – The intent fulfillment is configured through a
165
+ # Lambda function.
166
+ #
167
+ # * `ReadyForFulfilment` – The intent's `fulfillmentActivity` is to
168
+ # simply return the intent data back to the client application.
169
+ #
170
+ # @option params [required, String] :bot_name
171
+ # Name of the Amazon Lex bot.
172
+ #
173
+ # @option params [required, String] :bot_alias
174
+ # Alias of the Amazon Lex bot.
175
+ #
176
+ # @option params [required, String] :user_id
177
+ # User ID of your client application. Typically, each of your
178
+ # application users should have a unique ID. Note the following
179
+ # considerations:
180
+ #
181
+ # * If you want a user to start a conversation on one mobile device and
182
+ # continue the conversation on another device, you might choose a
183
+ # user-specific identifier, such as a login or Amazon Cognito user ID
184
+ # (assuming your application is using Amazon Cognito).
185
+ #
186
+ # * If you want the same user to be able to have two independent
187
+ # conversations on two different devices, you might choose a
188
+ # device-specific identifier, such as device ID, or some globally
189
+ # unique identifier.
190
+ #
191
+ # @option params [Hash<String,String>] :session_attributes
192
+ # A session represents the dialog between a user and Amazon Lex. At
193
+ # runtime, a client application can pass contextual information (session
194
+ # attributes) in the request. For example, `"FirstName" : "Joe"`. Amazon
195
+ # Lex passes these session attributes to the AWS Lambda functions
196
+ # configured for the intent (see `dialogCodeHook` and
197
+ # `fulfillmentActivity.codeHook` in `CreateIntent`).
198
+ #
199
+ # In your Lambda function, you can use the session attributes for
200
+ # customization. Some examples are:
201
+ #
202
+ # * In a pizza ordering application, if you can pass user location as a
203
+ # session attribute (for example, `"Location" : "111 Maple street"`),
204
+ # your Lambda function might use this information to determine the
205
+ # closest pizzeria to place the order.
206
+ #
207
+ # * Use session attributes to personalize prompts. For example, you pass
208
+ # in user name as a session attribute (`"FirstName" : "Joe"`), you
209
+ # might configure subsequent prompts to refer to this attribute, as
210
+ # `$session.FirstName"`. At runtime, Amazon Lex substitutes a real
211
+ # value when it generates a prompt, such as "Hello Joe, what would
212
+ # you like to order?"
213
+ #
214
+ # <note markdown="1"> Amazon Lex does not persist session attributes.
215
+ #
216
+ # If the intent is configured without a Lambda function to process the
217
+ # intent (that is, the client application to process the intent), Amazon
218
+ # Lex simply returns the session attributes back to the client
219
+ # application.
220
+ #
221
+ # If the intent is configured with a Lambda function to process the
222
+ # intent, Amazon Lex passes the incoming session attributes to the
223
+ # Lambda function. The Lambda function must return these session
224
+ # attributes if you want Amazon Lex to return them back to the client.
225
+ #
226
+ # </note>
227
+ #
228
+ # @option params [required, String] :input_text
229
+ # Text user entered (Amazon Lex interprets this text).
230
+ #
231
+ # @return [Types::PostTextResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
232
+ #
233
+ # * {Types::PostTextResponse#intent_name #intent_name} => String
234
+ # * {Types::PostTextResponse#slots #slots} => Hash&lt;String,String&gt;
235
+ # * {Types::PostTextResponse#session_attributes #session_attributes} => Hash&lt;String,String&gt;
236
+ # * {Types::PostTextResponse#message #message} => String
237
+ # * {Types::PostTextResponse#dialog_state #dialog_state} => String
238
+ # * {Types::PostTextResponse#slot_to_elicit #slot_to_elicit} => String
239
+ # * {Types::PostTextResponse#response_card #response_card} => Types::ResponseCard
240
+ #
241
+ # @example Request syntax with placeholder values
242
+ #
243
+ # resp = client.post_text({
244
+ # bot_name: "BotName", # required
245
+ # bot_alias: "BotAlias", # required
246
+ # user_id: "UserId", # required
247
+ # session_attributes: {
248
+ # "String" => "String",
249
+ # },
250
+ # input_text: "Text", # required
251
+ # })
252
+ #
253
+ # @example Response structure
254
+ #
255
+ # resp.intent_name #=> String
256
+ # resp.slots #=> Hash
257
+ # resp.slots["String"] #=> String
258
+ # resp.session_attributes #=> Hash
259
+ # resp.session_attributes["String"] #=> String
260
+ # resp.message #=> String
261
+ # resp.dialog_state #=> String, one of "ElicitIntent", "ConfirmIntent", "ElicitSlot", "Fulfilled", "ReadyForFulfillment", "Failed"
262
+ # resp.slot_to_elicit #=> String
263
+ # resp.response_card.version #=> String
264
+ # resp.response_card.content_type #=> String, one of "application/vnd.amazonaws.card.generic"
265
+ # resp.response_card.generic_attachments #=> Array
266
+ # resp.response_card.generic_attachments[0].title #=> String
267
+ # resp.response_card.generic_attachments[0].sub_title #=> String
268
+ # resp.response_card.generic_attachments[0].attachment_link_url #=> String
269
+ # resp.response_card.generic_attachments[0].image_url #=> String
270
+ # resp.response_card.generic_attachments[0].buttons #=> Array
271
+ # resp.response_card.generic_attachments[0].buttons[0].text #=> String
272
+ # resp.response_card.generic_attachments[0].buttons[0].value #=> String
273
+ #
274
+ # @see http://docs.aws.amazon.com/goto/WebAPI/runtime.lex-2016-11-28/PostText AWS API Documentation
275
+ #
276
+ # @overload post_text(params = {})
277
+ # @param [Hash] params ({})
278
+ def post_text(params = {}, options = {})
279
+ req = build_request(:post_text, params)
280
+ req.send_request(options)
281
+ end
282
+
283
+ # @!endgroup
284
+
285
+ # @param params ({})
286
+ # @api private
287
+ def build_request(operation_name, params = {})
288
+ handlers = @handlers.for(operation_name)
289
+ context = Seahorse::Client::RequestContext.new(
290
+ operation_name: operation_name,
291
+ operation: config.api.operation(operation_name),
292
+ client: self,
293
+ params: params,
294
+ config: config)
295
+ context[:gem_name] = 'aws-sdk-lexruntimeservice'
296
+ context[:gem_version] = '1.0.0.rc1'
297
+ Seahorse::Client::Request.new(handlers, context)
298
+ end
299
+
300
+ # @api private
301
+ # @deprecated
302
+ def waiter_names
303
+ []
304
+ end
305
+
306
+ class << self
307
+
308
+ # @api private
309
+ attr_reader :identifier
310
+
311
+ # @api private
312
+ def errors_module
313
+ Errors
314
+ end
315
+
316
+ end
317
+ end
318
+ end
@@ -0,0 +1,116 @@
1
+ # WARNING ABOUT GENERATED CODE
2
+ #
3
+ # This file is generated. See the contributing guide for more information:
4
+ # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
5
+ #
6
+ # WARNING ABOUT GENERATED CODE
7
+
8
+ module Aws::LexRuntimeService
9
+ # @api private
10
+ module ClientApi
11
+
12
+ include Seahorse::Model
13
+
14
+ BadGatewayException = Shapes::StructureShape.new(name: 'BadGatewayException')
15
+ BadRequestException = Shapes::StructureShape.new(name: 'BadRequestException')
16
+ BotAlias = Shapes::StringShape.new(name: 'BotAlias')
17
+ BotName = Shapes::StringShape.new(name: 'BotName')
18
+ Button = Shapes::StructureShape.new(name: 'Button')
19
+ ButtonTextStringWithLength = Shapes::StringShape.new(name: 'ButtonTextStringWithLength')
20
+ ButtonValueStringWithLength = Shapes::StringShape.new(name: 'ButtonValueStringWithLength')
21
+ ConflictException = Shapes::StructureShape.new(name: 'ConflictException')
22
+ ContentType = Shapes::StringShape.new(name: 'ContentType')
23
+ DependencyFailedException = Shapes::StructureShape.new(name: 'DependencyFailedException')
24
+ DialogState = Shapes::StringShape.new(name: 'DialogState')
25
+ ErrorMessage = Shapes::StringShape.new(name: 'ErrorMessage')
26
+ GenericAttachment = Shapes::StructureShape.new(name: 'GenericAttachment')
27
+ IntentName = Shapes::StringShape.new(name: 'IntentName')
28
+ InternalFailureException = Shapes::StructureShape.new(name: 'InternalFailureException')
29
+ LimitExceededException = Shapes::StructureShape.new(name: 'LimitExceededException')
30
+ LoopDetectedException = Shapes::StructureShape.new(name: 'LoopDetectedException')
31
+ NotFoundException = Shapes::StructureShape.new(name: 'NotFoundException')
32
+ PostTextRequest = Shapes::StructureShape.new(name: 'PostTextRequest')
33
+ PostTextResponse = Shapes::StructureShape.new(name: 'PostTextResponse')
34
+ ResponseCard = Shapes::StructureShape.new(name: 'ResponseCard')
35
+ String = Shapes::StringShape.new(name: 'String')
36
+ StringMap = Shapes::MapShape.new(name: 'StringMap')
37
+ StringUrlWithLength = Shapes::StringShape.new(name: 'StringUrlWithLength')
38
+ StringWithLength = Shapes::StringShape.new(name: 'StringWithLength')
39
+ Text = Shapes::StringShape.new(name: 'Text')
40
+ UserId = Shapes::StringShape.new(name: 'UserId')
41
+ genericAttachmentList = Shapes::ListShape.new(name: 'genericAttachmentList')
42
+ listOfButtons = Shapes::ListShape.new(name: 'listOfButtons')
43
+
44
+ Button.add_member(:text, Shapes::ShapeRef.new(shape: ButtonTextStringWithLength, required: true, location_name: "text"))
45
+ Button.add_member(:value, Shapes::ShapeRef.new(shape: ButtonValueStringWithLength, required: true, location_name: "value"))
46
+ Button.struct_class = Types::Button
47
+
48
+ GenericAttachment.add_member(:title, Shapes::ShapeRef.new(shape: StringWithLength, location_name: "title"))
49
+ GenericAttachment.add_member(:sub_title, Shapes::ShapeRef.new(shape: StringWithLength, location_name: "subTitle"))
50
+ GenericAttachment.add_member(:attachment_link_url, Shapes::ShapeRef.new(shape: StringUrlWithLength, location_name: "attachmentLinkUrl"))
51
+ GenericAttachment.add_member(:image_url, Shapes::ShapeRef.new(shape: StringUrlWithLength, location_name: "imageUrl"))
52
+ GenericAttachment.add_member(:buttons, Shapes::ShapeRef.new(shape: listOfButtons, location_name: "buttons"))
53
+ GenericAttachment.struct_class = Types::GenericAttachment
54
+
55
+ PostTextRequest.add_member(:bot_name, Shapes::ShapeRef.new(shape: BotName, required: true, location: "uri", location_name: "botName"))
56
+ PostTextRequest.add_member(:bot_alias, Shapes::ShapeRef.new(shape: BotAlias, required: true, location: "uri", location_name: "botAlias"))
57
+ PostTextRequest.add_member(:user_id, Shapes::ShapeRef.new(shape: UserId, required: true, location: "uri", location_name: "userId"))
58
+ PostTextRequest.add_member(:session_attributes, Shapes::ShapeRef.new(shape: StringMap, location_name: "sessionAttributes"))
59
+ PostTextRequest.add_member(:input_text, Shapes::ShapeRef.new(shape: Text, required: true, location_name: "inputText"))
60
+ PostTextRequest.struct_class = Types::PostTextRequest
61
+
62
+ PostTextResponse.add_member(:intent_name, Shapes::ShapeRef.new(shape: IntentName, location_name: "intentName"))
63
+ PostTextResponse.add_member(:slots, Shapes::ShapeRef.new(shape: StringMap, location_name: "slots"))
64
+ PostTextResponse.add_member(:session_attributes, Shapes::ShapeRef.new(shape: StringMap, location_name: "sessionAttributes"))
65
+ PostTextResponse.add_member(:message, Shapes::ShapeRef.new(shape: Text, location_name: "message"))
66
+ PostTextResponse.add_member(:dialog_state, Shapes::ShapeRef.new(shape: DialogState, location_name: "dialogState"))
67
+ PostTextResponse.add_member(:slot_to_elicit, Shapes::ShapeRef.new(shape: String, location_name: "slotToElicit"))
68
+ PostTextResponse.add_member(:response_card, Shapes::ShapeRef.new(shape: ResponseCard, location_name: "responseCard"))
69
+ PostTextResponse.struct_class = Types::PostTextResponse
70
+
71
+ ResponseCard.add_member(:version, Shapes::ShapeRef.new(shape: String, location_name: "version"))
72
+ ResponseCard.add_member(:content_type, Shapes::ShapeRef.new(shape: ContentType, location_name: "contentType"))
73
+ ResponseCard.add_member(:generic_attachments, Shapes::ShapeRef.new(shape: genericAttachmentList, location_name: "genericAttachments"))
74
+ ResponseCard.struct_class = Types::ResponseCard
75
+
76
+ StringMap.key = Shapes::ShapeRef.new(shape: String)
77
+ StringMap.value = Shapes::ShapeRef.new(shape: String)
78
+
79
+ genericAttachmentList.member = Shapes::ShapeRef.new(shape: GenericAttachment)
80
+
81
+ listOfButtons.member = Shapes::ShapeRef.new(shape: Button)
82
+
83
+
84
+ # @api private
85
+ API = Seahorse::Model::Api.new.tap do |api|
86
+
87
+ api.version = "2016-11-28"
88
+
89
+ api.metadata = {
90
+ "endpointPrefix" => "runtime.lex",
91
+ "jsonVersion" => "1.1",
92
+ "protocol" => "rest-json",
93
+ "serviceFullName" => "Amazon Lex Runtime Service",
94
+ "signatureVersion" => "v4",
95
+ "signingName" => "lex",
96
+ }
97
+
98
+ api.add_operation(:post_text, Seahorse::Model::Operation.new.tap do |o|
99
+ o.name = "PostText"
100
+ o.http_method = "POST"
101
+ o.http_request_uri = "/bot/{botName}/alias/{botAlias}/user/{userId}/text"
102
+ o.input = Shapes::ShapeRef.new(shape: PostTextRequest)
103
+ o.output = Shapes::ShapeRef.new(shape: PostTextResponse)
104
+ o.errors << Shapes::ShapeRef.new(shape: NotFoundException)
105
+ o.errors << Shapes::ShapeRef.new(shape: BadRequestException)
106
+ o.errors << Shapes::ShapeRef.new(shape: LimitExceededException)
107
+ o.errors << Shapes::ShapeRef.new(shape: InternalFailureException)
108
+ o.errors << Shapes::ShapeRef.new(shape: ConflictException)
109
+ o.errors << Shapes::ShapeRef.new(shape: DependencyFailedException)
110
+ o.errors << Shapes::ShapeRef.new(shape: BadGatewayException)
111
+ o.errors << Shapes::ShapeRef.new(shape: LoopDetectedException)
112
+ end)
113
+ end
114
+
115
+ end
116
+ end
File without changes
@@ -0,0 +1,14 @@
1
+ # WARNING ABOUT GENERATED CODE
2
+ #
3
+ # This file is generated. See the contributing guide for more information:
4
+ # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
5
+ #
6
+ # WARNING ABOUT GENERATED CODE
7
+
8
+ module Aws::LexRuntimeService
9
+ module Errors
10
+
11
+ extend Aws::Errors::DynamicErrors
12
+
13
+ end
14
+ end
@@ -0,0 +1,23 @@
1
+ # WARNING ABOUT GENERATED CODE
2
+ #
3
+ # This file is generated. See the contributing guide for more information:
4
+ # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
5
+ #
6
+ # WARNING ABOUT GENERATED CODE
7
+
8
+ module Aws::LexRuntimeService
9
+ class Resource
10
+
11
+ # @param options ({})
12
+ # @option options [Client] :client
13
+ def initialize(options = {})
14
+ @client = options[:client] || Client.new(options)
15
+ end
16
+
17
+ # @return [Client]
18
+ def client
19
+ @client
20
+ end
21
+
22
+ end
23
+ end
@@ -0,0 +1,288 @@
1
+ # WARNING ABOUT GENERATED CODE
2
+ #
3
+ # This file is generated. See the contributing guide for more information:
4
+ # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
5
+ #
6
+ # WARNING ABOUT GENERATED CODE
7
+
8
+ module Aws::LexRuntimeService
9
+ module Types
10
+
11
+ # Represents an option to be shown on the client platform (Facebook,
12
+ # Slack, etc.)
13
+ #
14
+ # @!attribute [rw] text
15
+ # Text visible to the user on the button.
16
+ # @return [String]
17
+ #
18
+ # @!attribute [rw] value
19
+ # Value sent to Amazon Lex when user clicks the button. For example,
20
+ # consider button text "NYC". When the user clicks the button, the
21
+ # value sent can be "New York City".
22
+ # @return [String]
23
+ #
24
+ # @see http://docs.aws.amazon.com/goto/WebAPI/runtime.lex-2016-11-28/Button AWS API Documentation
25
+ #
26
+ class Button < Struct.new(
27
+ :text,
28
+ :value)
29
+ include Aws::Structure
30
+ end
31
+
32
+ # Represents an option rendered to the user when a prompt is shown. It
33
+ # could be an image, a button, a link, or text.
34
+ #
35
+ # @!attribute [rw] title
36
+ # Title of the option.
37
+ # @return [String]
38
+ #
39
+ # @!attribute [rw] sub_title
40
+ # Subtitle shown below the title.
41
+ # @return [String]
42
+ #
43
+ # @!attribute [rw] attachment_link_url
44
+ # @return [String]
45
+ #
46
+ # @!attribute [rw] image_url
47
+ # URL of an image that is displayed to the user.
48
+ # @return [String]
49
+ #
50
+ # @!attribute [rw] buttons
51
+ # List of options to show to the user.
52
+ # @return [Array<Types::Button>]
53
+ #
54
+ # @see http://docs.aws.amazon.com/goto/WebAPI/runtime.lex-2016-11-28/GenericAttachment AWS API Documentation
55
+ #
56
+ class GenericAttachment < Struct.new(
57
+ :title,
58
+ :sub_title,
59
+ :attachment_link_url,
60
+ :image_url,
61
+ :buttons)
62
+ include Aws::Structure
63
+ end
64
+
65
+ # @note When making an API call, you may pass PostTextRequest
66
+ # data as a hash:
67
+ #
68
+ # {
69
+ # bot_name: "BotName", # required
70
+ # bot_alias: "BotAlias", # required
71
+ # user_id: "UserId", # required
72
+ # session_attributes: {
73
+ # "String" => "String",
74
+ # },
75
+ # input_text: "Text", # required
76
+ # }
77
+ #
78
+ # @!attribute [rw] bot_name
79
+ # Name of the Amazon Lex bot.
80
+ # @return [String]
81
+ #
82
+ # @!attribute [rw] bot_alias
83
+ # Alias of the Amazon Lex bot.
84
+ # @return [String]
85
+ #
86
+ # @!attribute [rw] user_id
87
+ # User ID of your client application. Typically, each of your
88
+ # application users should have a unique ID. Note the following
89
+ # considerations:
90
+ #
91
+ # * If you want a user to start a conversation on one mobile device
92
+ # and continue the conversation on another device, you might choose
93
+ # a user-specific identifier, such as a login or Amazon Cognito user
94
+ # ID (assuming your application is using Amazon Cognito).
95
+ #
96
+ # * If you want the same user to be able to have two independent
97
+ # conversations on two different devices, you might choose a
98
+ # device-specific identifier, such as device ID, or some globally
99
+ # unique identifier.
100
+ # @return [String]
101
+ #
102
+ # @!attribute [rw] session_attributes
103
+ # A session represents the dialog between a user and Amazon Lex. At
104
+ # runtime, a client application can pass contextual information
105
+ # (session attributes) in the request. For example, `"FirstName" :
106
+ # "Joe"`. Amazon Lex passes these session attributes to the AWS Lambda
107
+ # functions configured for the intent (see `dialogCodeHook` and
108
+ # `fulfillmentActivity.codeHook` in `CreateIntent`).
109
+ #
110
+ # In your Lambda function, you can use the session attributes for
111
+ # customization. Some examples are:
112
+ #
113
+ # * In a pizza ordering application, if you can pass user location as
114
+ # a session attribute (for example, `"Location" : "111 Maple
115
+ # street"`), your Lambda function might use this information to
116
+ # determine the closest pizzeria to place the order.
117
+ #
118
+ # * Use session attributes to personalize prompts. For example, you
119
+ # pass in user name as a session attribute (`"FirstName" : "Joe"`),
120
+ # you might configure subsequent prompts to refer to this attribute,
121
+ # as `$session.FirstName"`. At runtime, Amazon Lex substitutes a
122
+ # real value when it generates a prompt, such as "Hello Joe, what
123
+ # would you like to order?"
124
+ #
125
+ # <note markdown="1"> Amazon Lex does not persist session attributes.
126
+ #
127
+ # If the intent is configured without a Lambda function to process the
128
+ # intent (that is, the client application to process the intent),
129
+ # Amazon Lex simply returns the session attributes back to the client
130
+ # application.
131
+ #
132
+ # If the intent is configured with a Lambda function to process the
133
+ # intent, Amazon Lex passes the incoming session attributes to the
134
+ # Lambda function. The Lambda function must return these session
135
+ # attributes if you want Amazon Lex to return them back to the client.
136
+ #
137
+ # </note>
138
+ # @return [Hash<String,String>]
139
+ #
140
+ # @!attribute [rw] input_text
141
+ # Text user entered (Amazon Lex interprets this text).
142
+ # @return [String]
143
+ #
144
+ # @see http://docs.aws.amazon.com/goto/WebAPI/runtime.lex-2016-11-28/PostTextRequest AWS API Documentation
145
+ #
146
+ class PostTextRequest < Struct.new(
147
+ :bot_name,
148
+ :bot_alias,
149
+ :user_id,
150
+ :session_attributes,
151
+ :input_text)
152
+ include Aws::Structure
153
+ end
154
+
155
+ # @!attribute [rw] intent_name
156
+ # Intent Amazon Lex inferred from the user input text. This is one of
157
+ # the intents configured for the bot.
158
+ # @return [String]
159
+ #
160
+ # @!attribute [rw] slots
161
+ # Intent slots (name/value pairs) Amazon Lex detected so far from the
162
+ # user input in the conversation.
163
+ # @return [Hash<String,String>]
164
+ #
165
+ # @!attribute [rw] session_attributes
166
+ # Map of key value pairs representing the session specific context
167
+ # information.
168
+ # @return [Hash<String,String>]
169
+ #
170
+ # @!attribute [rw] message
171
+ # Prompt (or statement) to convey to the user. This is based on the
172
+ # application configuration and context. For example, if Amazon Lex
173
+ # did not understand the user intent, it sends the
174
+ # `clarificationPrompt` configured for the application. In another
175
+ # example, if the intent requires confirmation before taking the
176
+ # fulfillment action, it sends the `confirmationPrompt`. Suppose the
177
+ # Lambda function successfully fulfilled the intent, and sent a
178
+ # message to convey to the user. In that situation, Amazon Lex sends
179
+ # that message in the response.
180
+ # @return [String]
181
+ #
182
+ # @!attribute [rw] dialog_state
183
+ # Represents the message type to be conveyed to the user. For example:
184
+ #
185
+ # * `ElicitIntent` – Amazon Lex wants to elicit user intent. For
186
+ # example, Amazon Lex did not understand the first utterances such
187
+ # as "I want to order pizza", which indicates the OrderPizza
188
+ # intent. If Amazon Lex doesn't understand the intent, it returns
189
+ # this `dialogState`. Another example is when your intent is
190
+ # configured with a follow up prompt. For example, after OrderPizza
191
+ # intent is fulfilled, the intent might have a follow up prompt such
192
+ # as " Do you want to order a drink or desert?" In this case,
193
+ # Amazon Lex returns this `dialogState`.
194
+ #
195
+ # * `ConfirmIntent` – Amazon Lex is expecting a yes/no response from
196
+ # the user indicating whether to go ahead and fulfill the intent
197
+ # (for example, OK to go ahead and order the pizza). In addition to
198
+ # a yes/no reply, the user might provide a response with additional
199
+ # slot information (either new slot information or changes to the
200
+ # existing slot values). For example, "Yes, but change to thick
201
+ # crust." Amazon Lex understands the additional information and
202
+ # updates the intent slots accordingly.
203
+ #
204
+ # Consider another example. Before fulfilling an order, your
205
+ # application might prompt for confirmation such as "Do you want to
206
+ # place this pizza order?" A user might reply with "No, I want to
207
+ # order a drink." Amazon Lex recognizes the new OrderDrink intent.
208
+ #
209
+ # * `ElicitSlot` – Amazon Lex is expecting a value of a slot for the
210
+ # current intent. For example, suppose Amazon Lex asks, "What size
211
+ # pizza would you like?" A user might reply with "Medium pepperoni
212
+ # pizza." Amazon Lex recognizes the size and the topping as the two
213
+ # separate slot values.
214
+ #
215
+ # * `Fulfilled` – Conveys that the Lambda function has successfully
216
+ # fulfilled the intent. If Lambda function returns a
217
+ # statement/message to convey the fulfillment result, Amazon Lex
218
+ # passes this string to the client. If not, Amazon Lex looks for
219
+ # `conclusionStatement` that you configured for the intent.
220
+ #
221
+ # If both the Lambda function statement and the
222
+ # `conclusionStatement` are missing, Amazon Lex throws a bad request
223
+ # exception.
224
+ #
225
+ # * `ReadyForFulfillment` – conveys that the client has to do the
226
+ # fulfillment work for the intent. This is the case when the current
227
+ # intent is configured with `ReturnIntent` as the
228
+ # `fulfillmentActivity `, where Amazon Lex returns this state to
229
+ # client.
230
+ #
231
+ # * `Failed` – Conversation with the user failed. Some of the reasons
232
+ # for this `dialogState` are: after the configured number of
233
+ # attempts the user didn't provide an appropriate response, or the
234
+ # Lambda function failed to fulfill an intent.
235
+ # @return [String]
236
+ #
237
+ # @!attribute [rw] slot_to_elicit
238
+ # If `dialogState` value is `ElicitSlot`, returns the name of the slot
239
+ # for which Amazon Lex is eliciting a value.
240
+ # @return [String]
241
+ #
242
+ # @!attribute [rw] response_card
243
+ # Represents the options that the user has to respond to the current
244
+ # prompt. Amazon Lex sends this in the response only if the
245
+ # `dialogState` value indicates that a user response is expected.
246
+ # @return [Types::ResponseCard]
247
+ #
248
+ # @see http://docs.aws.amazon.com/goto/WebAPI/runtime.lex-2016-11-28/PostTextResponse AWS API Documentation
249
+ #
250
+ class PostTextResponse < Struct.new(
251
+ :intent_name,
252
+ :slots,
253
+ :session_attributes,
254
+ :message,
255
+ :dialog_state,
256
+ :slot_to_elicit,
257
+ :response_card)
258
+ include Aws::Structure
259
+ end
260
+
261
+ # If you configure a response card when creating your bots, Amazon Lex
262
+ # substitutes the session attributes and slot values available, and then
263
+ # returns it. The response card can also come from a Lambda function (
264
+ # `dialogCodeHook` and `fulfillmentActivity` on an intent).
265
+ #
266
+ # @!attribute [rw] version
267
+ # Version of response card format.
268
+ # @return [String]
269
+ #
270
+ # @!attribute [rw] content_type
271
+ # Content type of the response.
272
+ # @return [String]
273
+ #
274
+ # @!attribute [rw] generic_attachments
275
+ # An array of attachment objects representing options.
276
+ # @return [Array<Types::GenericAttachment>]
277
+ #
278
+ # @see http://docs.aws.amazon.com/goto/WebAPI/runtime.lex-2016-11-28/ResponseCard AWS API Documentation
279
+ #
280
+ class ResponseCard < Struct.new(
281
+ :version,
282
+ :content_type,
283
+ :generic_attachments)
284
+ include Aws::Structure
285
+ end
286
+
287
+ end
288
+ end
metadata ADDED
@@ -0,0 +1,80 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: aws-sdk-lexruntimeservice
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0.rc1
5
+ platform: ruby
6
+ authors:
7
+ - Amazon Web Services
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-03-07 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: aws-sdk-core
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '='
18
+ - !ruby/object:Gem::Version
19
+ version: 3.0.0.rc1
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '='
25
+ - !ruby/object:Gem::Version
26
+ version: 3.0.0.rc1
27
+ - !ruby/object:Gem::Dependency
28
+ name: aws-sigv4
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.0'
41
+ description: Official AWS Ruby gem for Amazon Lex Runtime Service. This gem is part
42
+ of the AWS SDK for Ruby.
43
+ email:
44
+ - trevrowe@amazon.com
45
+ executables: []
46
+ extensions: []
47
+ extra_rdoc_files: []
48
+ files:
49
+ - lib/aws-sdk-lexruntimeservice.rb
50
+ - lib/aws-sdk-lexruntimeservice/client.rb
51
+ - lib/aws-sdk-lexruntimeservice/client_api.rb
52
+ - lib/aws-sdk-lexruntimeservice/customizations.rb
53
+ - lib/aws-sdk-lexruntimeservice/errors.rb
54
+ - lib/aws-sdk-lexruntimeservice/resource.rb
55
+ - lib/aws-sdk-lexruntimeservice/types.rb
56
+ homepage: http://github.com/aws/aws-sdk-ruby
57
+ licenses:
58
+ - Apache-2.0
59
+ metadata: {}
60
+ post_install_message:
61
+ rdoc_options: []
62
+ require_paths:
63
+ - lib
64
+ required_ruby_version: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ required_rubygems_version: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - ">"
72
+ - !ruby/object:Gem::Version
73
+ version: 1.3.1
74
+ requirements: []
75
+ rubyforge_project:
76
+ rubygems_version: 2.5.1
77
+ signing_key:
78
+ specification_version: 4
79
+ summary: AWS SDK for Ruby - Amazon Lex Runtime Service
80
+ test_files: []