aws-sdk-personalizeruntime 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: '0394f1e91d4fd5bf1462c9f93bc76b9a69aebee0'
4
+ data.tar.gz: 8b04a171be0a7f2243c281ddb2ecd16e28e878b4
5
+ SHA512:
6
+ metadata.gz: be5c90b6a86d9db9fddc0ec7631060e98f656b65fa3747b75491731f184d44319c9247ab8193de85b5d55c47bca8133f815229a82cd4ece16ffc9be41f58d24a
7
+ data.tar.gz: e2662d3c993d1bb771755b9b7717e933fbd1c069fd805c4c62521ab77eaa96ccb78639539d3605988ffb85b44dabc06a4d655dbba0567df888530213b42315df
@@ -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-personalizeruntime/types'
12
+ require_relative 'aws-sdk-personalizeruntime/client_api'
13
+ require_relative 'aws-sdk-personalizeruntime/client'
14
+ require_relative 'aws-sdk-personalizeruntime/errors'
15
+ require_relative 'aws-sdk-personalizeruntime/resource'
16
+ require_relative 'aws-sdk-personalizeruntime/customizations'
17
+
18
+ # This module provides support for Amazon Personalize Runtime. This module is available in the
19
+ # `aws-sdk-personalizeruntime` 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 Personalize Runtime all
32
+ # extend {Errors::ServiceError}.
33
+ #
34
+ # begin
35
+ # # do stuff
36
+ # rescue Aws::PersonalizeRuntime::Errors::ServiceError
37
+ # # rescues all service API errors
38
+ # end
39
+ #
40
+ # See {Errors} for more information.
41
+ #
42
+ # @service
43
+ module Aws::PersonalizeRuntime
44
+
45
+ GEM_VERSION = '1.0.0'
46
+
47
+ end
@@ -0,0 +1,394 @@
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/endpoint_discovery.rb'
19
+ require 'aws-sdk-core/plugins/endpoint_pattern.rb'
20
+ require 'aws-sdk-core/plugins/response_paging.rb'
21
+ require 'aws-sdk-core/plugins/stub_responses.rb'
22
+ require 'aws-sdk-core/plugins/idempotency_token.rb'
23
+ require 'aws-sdk-core/plugins/jsonvalue_converter.rb'
24
+ require 'aws-sdk-core/plugins/client_metrics_plugin.rb'
25
+ require 'aws-sdk-core/plugins/client_metrics_send_plugin.rb'
26
+ require 'aws-sdk-core/plugins/transfer_encoding.rb'
27
+ require 'aws-sdk-core/plugins/signature_v4.rb'
28
+ require 'aws-sdk-core/plugins/protocols/rest_json.rb'
29
+
30
+ Aws::Plugins::GlobalConfiguration.add_identifier(:personalizeruntime)
31
+
32
+ module Aws::PersonalizeRuntime
33
+ class Client < Seahorse::Client::Base
34
+
35
+ include Aws::ClientStubs
36
+
37
+ @identifier = :personalizeruntime
38
+
39
+ set_api(ClientApi::API)
40
+
41
+ add_plugin(Seahorse::Client::Plugins::ContentLength)
42
+ add_plugin(Aws::Plugins::CredentialsConfiguration)
43
+ add_plugin(Aws::Plugins::Logging)
44
+ add_plugin(Aws::Plugins::ParamConverter)
45
+ add_plugin(Aws::Plugins::ParamValidator)
46
+ add_plugin(Aws::Plugins::UserAgent)
47
+ add_plugin(Aws::Plugins::HelpfulSocketErrors)
48
+ add_plugin(Aws::Plugins::RetryErrors)
49
+ add_plugin(Aws::Plugins::GlobalConfiguration)
50
+ add_plugin(Aws::Plugins::RegionalEndpoint)
51
+ add_plugin(Aws::Plugins::EndpointDiscovery)
52
+ add_plugin(Aws::Plugins::EndpointPattern)
53
+ add_plugin(Aws::Plugins::ResponsePaging)
54
+ add_plugin(Aws::Plugins::StubResponses)
55
+ add_plugin(Aws::Plugins::IdempotencyToken)
56
+ add_plugin(Aws::Plugins::JsonvalueConverter)
57
+ add_plugin(Aws::Plugins::ClientMetricsPlugin)
58
+ add_plugin(Aws::Plugins::ClientMetricsSendPlugin)
59
+ add_plugin(Aws::Plugins::TransferEncoding)
60
+ add_plugin(Aws::Plugins::SignatureV4)
61
+ add_plugin(Aws::Plugins::Protocols::RestJson)
62
+
63
+ # @overload initialize(options)
64
+ # @param [Hash] options
65
+ # @option options [required, Aws::CredentialProvider] :credentials
66
+ # Your AWS credentials. This can be an instance of any one of the
67
+ # following classes:
68
+ #
69
+ # * `Aws::Credentials` - Used for configuring static, non-refreshing
70
+ # credentials.
71
+ #
72
+ # * `Aws::InstanceProfileCredentials` - Used for loading credentials
73
+ # from an EC2 IMDS on an EC2 instance.
74
+ #
75
+ # * `Aws::SharedCredentials` - Used for loading credentials from a
76
+ # shared file, such as `~/.aws/config`.
77
+ #
78
+ # * `Aws::AssumeRoleCredentials` - Used when you need to assume a role.
79
+ #
80
+ # When `:credentials` are not configured directly, the following
81
+ # locations will be searched for credentials:
82
+ #
83
+ # * `Aws.config[:credentials]`
84
+ # * The `:access_key_id`, `:secret_access_key`, and `:session_token` options.
85
+ # * ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']
86
+ # * `~/.aws/credentials`
87
+ # * `~/.aws/config`
88
+ # * EC2 IMDS instance profile - When used by default, the timeouts are
89
+ # very aggressive. Construct and pass an instance of
90
+ # `Aws::InstanceProfileCredentails` to enable retries and extended
91
+ # timeouts.
92
+ #
93
+ # @option options [required, String] :region
94
+ # The AWS region to connect to. The configured `:region` is
95
+ # used to determine the service `:endpoint`. When not passed,
96
+ # a default `:region` is search for in the following locations:
97
+ #
98
+ # * `Aws.config[:region]`
99
+ # * `ENV['AWS_REGION']`
100
+ # * `ENV['AMAZON_REGION']`
101
+ # * `ENV['AWS_DEFAULT_REGION']`
102
+ # * `~/.aws/credentials`
103
+ # * `~/.aws/config`
104
+ #
105
+ # @option options [String] :access_key_id
106
+ #
107
+ # @option options [Boolean] :active_endpoint_cache (false)
108
+ # When set to `true`, a thread polling for endpoints will be running in
109
+ # the background every 60 secs (default). Defaults to `false`.
110
+ #
111
+ # @option options [Boolean] :client_side_monitoring (false)
112
+ # When `true`, client-side metrics will be collected for all API requests from
113
+ # this client.
114
+ #
115
+ # @option options [String] :client_side_monitoring_client_id ("")
116
+ # Allows you to provide an identifier for this client which will be attached to
117
+ # all generated client side metrics. Defaults to an empty string.
118
+ #
119
+ # @option options [Integer] :client_side_monitoring_port (31000)
120
+ # Required for publishing client metrics. The port that the client side monitoring
121
+ # agent is running on, where client metrics will be published via UDP.
122
+ #
123
+ # @option options [Aws::ClientSideMonitoring::Publisher] :client_side_monitoring_publisher (Aws::ClientSideMonitoring::Publisher)
124
+ # Allows you to provide a custom client-side monitoring publisher class. By default,
125
+ # will use the Client Side Monitoring Agent Publisher.
126
+ #
127
+ # @option options [Boolean] :convert_params (true)
128
+ # When `true`, an attempt is made to coerce request parameters into
129
+ # the required types.
130
+ #
131
+ # @option options [Boolean] :disable_host_prefix_injection (false)
132
+ # Set to true to disable SDK automatically adding host prefix
133
+ # to default service endpoint when available.
134
+ #
135
+ # @option options [String] :endpoint
136
+ # The client endpoint is normally constructed from the `:region`
137
+ # option. You should only configure an `:endpoint` when connecting
138
+ # to test endpoints. This should be avalid HTTP(S) URI.
139
+ #
140
+ # @option options [Integer] :endpoint_cache_max_entries (1000)
141
+ # Used for the maximum size limit of the LRU cache storing endpoints data
142
+ # for endpoint discovery enabled operations. Defaults to 1000.
143
+ #
144
+ # @option options [Integer] :endpoint_cache_max_threads (10)
145
+ # Used for the maximum threads in use for polling endpoints to be cached, defaults to 10.
146
+ #
147
+ # @option options [Integer] :endpoint_cache_poll_interval (60)
148
+ # When :endpoint_discovery and :active_endpoint_cache is enabled,
149
+ # Use this option to config the time interval in seconds for making
150
+ # requests fetching endpoints information. Defaults to 60 sec.
151
+ #
152
+ # @option options [Boolean] :endpoint_discovery (false)
153
+ # When set to `true`, endpoint discovery will be enabled for operations when available. Defaults to `false`.
154
+ #
155
+ # @option options [Aws::Log::Formatter] :log_formatter (Aws::Log::Formatter.default)
156
+ # The log formatter.
157
+ #
158
+ # @option options [Symbol] :log_level (:info)
159
+ # The log level to send messages to the `:logger` at.
160
+ #
161
+ # @option options [Logger] :logger
162
+ # The Logger instance to send log messages to. If this option
163
+ # is not set, logging will be disabled.
164
+ #
165
+ # @option options [String] :profile ("default")
166
+ # Used when loading credentials from the shared credentials file
167
+ # at HOME/.aws/credentials. When not specified, 'default' is used.
168
+ #
169
+ # @option options [Float] :retry_base_delay (0.3)
170
+ # The base delay in seconds used by the default backoff function.
171
+ #
172
+ # @option options [Symbol] :retry_jitter (:none)
173
+ # A delay randomiser function used by the default backoff function. Some predefined functions can be referenced by name - :none, :equal, :full, otherwise a Proc that takes and returns a number.
174
+ #
175
+ # @see https://www.awsarchitectureblog.com/2015/03/backoff.html
176
+ #
177
+ # @option options [Integer] :retry_limit (3)
178
+ # The maximum number of times to retry failed requests. Only
179
+ # ~ 500 level server errors and certain ~ 400 level client errors
180
+ # are retried. Generally, these are throttling errors, data
181
+ # checksum errors, networking errors, timeout errors and auth
182
+ # errors from expired credentials.
183
+ #
184
+ # @option options [Integer] :retry_max_delay (0)
185
+ # The maximum number of seconds to delay between retries (0 for no limit) used by the default backoff function.
186
+ #
187
+ # @option options [String] :secret_access_key
188
+ #
189
+ # @option options [String] :session_token
190
+ #
191
+ # @option options [Boolean] :stub_responses (false)
192
+ # Causes the client to return stubbed responses. By default
193
+ # fake responses are generated and returned. You can specify
194
+ # the response data to return or errors to raise by calling
195
+ # {ClientStubs#stub_responses}. See {ClientStubs} for more information.
196
+ #
197
+ # ** Please note ** When response stubbing is enabled, no HTTP
198
+ # requests are made, and retries are disabled.
199
+ #
200
+ # @option options [Boolean] :validate_params (true)
201
+ # When `true`, request parameters are validated before
202
+ # sending the request.
203
+ #
204
+ # @option options [URI::HTTP,String] :http_proxy A proxy to send
205
+ # requests through. Formatted like 'http://proxy.com:123'.
206
+ #
207
+ # @option options [Float] :http_open_timeout (15) The number of
208
+ # seconds to wait when opening a HTTP session before rasing a
209
+ # `Timeout::Error`.
210
+ #
211
+ # @option options [Integer] :http_read_timeout (60) The default
212
+ # number of seconds to wait for response data. This value can
213
+ # safely be set
214
+ # per-request on the session yeidled by {#session_for}.
215
+ #
216
+ # @option options [Float] :http_idle_timeout (5) The number of
217
+ # seconds a connection is allowed to sit idble before it is
218
+ # considered stale. Stale connections are closed and removed
219
+ # from the pool before making a request.
220
+ #
221
+ # @option options [Float] :http_continue_timeout (1) The number of
222
+ # seconds to wait for a 100-continue response before sending the
223
+ # request body. This option has no effect unless the request has
224
+ # "Expect" header set to "100-continue". Defaults to `nil` which
225
+ # disables this behaviour. This value can safely be set per
226
+ # request on the session yeidled by {#session_for}.
227
+ #
228
+ # @option options [Boolean] :http_wire_trace (false) When `true`,
229
+ # HTTP debug output will be sent to the `:logger`.
230
+ #
231
+ # @option options [Boolean] :ssl_verify_peer (true) When `true`,
232
+ # SSL peer certificates are verified when establishing a
233
+ # connection.
234
+ #
235
+ # @option options [String] :ssl_ca_bundle Full path to the SSL
236
+ # certificate authority bundle file that should be used when
237
+ # verifying peer certificates. If you do not pass
238
+ # `:ssl_ca_bundle` or `:ssl_ca_directory` the the system default
239
+ # will be used if available.
240
+ #
241
+ # @option options [String] :ssl_ca_directory Full path of the
242
+ # directory that contains the unbundled SSL certificate
243
+ # authority files for verifying peer certificates. If you do
244
+ # not pass `:ssl_ca_bundle` or `:ssl_ca_directory` the the
245
+ # system default will be used if available.
246
+ #
247
+ def initialize(*args)
248
+ super
249
+ end
250
+
251
+ # @!group API Operations
252
+
253
+ # Re-ranks a list of recommended items for the given user. The first
254
+ # item in the list is deemed the most likely item to be of interest to
255
+ # the user.
256
+ #
257
+ # <note markdown="1"> The solution backing the campaign must have been created using a
258
+ # recipe of type PERSONALIZED\_RANKING.
259
+ #
260
+ # </note>
261
+ #
262
+ # @option params [required, String] :campaign_arn
263
+ # The Amazon Resource Name (ARN) of the campaign to use for generating
264
+ # the personalized ranking.
265
+ #
266
+ # @option params [required, Array<String>] :input_list
267
+ # A list of items (itemId's) to rank. If an item was not included in
268
+ # the training dataset, the item is appended to the end of the reranked
269
+ # list.
270
+ #
271
+ # @option params [required, String] :user_id
272
+ # The user for which you want the campaign to provide a personalized
273
+ # ranking.
274
+ #
275
+ # @return [Types::GetPersonalizedRankingResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
276
+ #
277
+ # * {Types::GetPersonalizedRankingResponse#personalized_ranking #personalized_ranking} => Array&lt;Types::PredictedItem&gt;
278
+ #
279
+ # @example Request syntax with placeholder values
280
+ #
281
+ # resp = client.get_personalized_ranking({
282
+ # campaign_arn: "Arn", # required
283
+ # input_list: ["ItemID"], # required
284
+ # user_id: "UserID", # required
285
+ # })
286
+ #
287
+ # @example Response structure
288
+ #
289
+ # resp.personalized_ranking #=> Array
290
+ # resp.personalized_ranking[0].item_id #=> String
291
+ #
292
+ # @see http://docs.aws.amazon.com/goto/WebAPI/personalize-runtime-2018-05-22/GetPersonalizedRanking AWS API Documentation
293
+ #
294
+ # @overload get_personalized_ranking(params = {})
295
+ # @param [Hash] params ({})
296
+ def get_personalized_ranking(params = {}, options = {})
297
+ req = build_request(:get_personalized_ranking, params)
298
+ req.send_request(options)
299
+ end
300
+
301
+ # Returns a list of recommended items. The required input depends on the
302
+ # recipe type used to create the solution backing the campaign, as
303
+ # follows:
304
+ #
305
+ # * RELATED\_ITEMS - `itemId` required, `userId` not used
306
+ #
307
+ # * USER\_PERSONALIZATION - `itemId` optional, `userId` required
308
+ #
309
+ # <note markdown="1"> Campaigns that are backed by a solution created using a recipe of type
310
+ # PERSONALIZED\_RANKING use the API.
311
+ #
312
+ # </note>
313
+ #
314
+ # @option params [required, String] :campaign_arn
315
+ # The Amazon Resource Name (ARN) of the campaign to use for getting
316
+ # recommendations.
317
+ #
318
+ # @option params [String] :item_id
319
+ # The item ID to provide recommendations for.
320
+ #
321
+ # Required for `RELATED_ITEMS` recipe type.
322
+ #
323
+ # @option params [String] :user_id
324
+ # The user ID to provide recommendations for.
325
+ #
326
+ # Required for `USER_PERSONALIZATION` recipe type.
327
+ #
328
+ # @option params [Integer] :num_results
329
+ # The number of results to return. The default is 25. The maximum is
330
+ # 100.
331
+ #
332
+ # @return [Types::GetRecommendationsResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
333
+ #
334
+ # * {Types::GetRecommendationsResponse#item_list #item_list} => Array&lt;Types::PredictedItem&gt;
335
+ #
336
+ # @example Request syntax with placeholder values
337
+ #
338
+ # resp = client.get_recommendations({
339
+ # campaign_arn: "Arn", # required
340
+ # item_id: "ItemID",
341
+ # user_id: "UserID",
342
+ # num_results: 1,
343
+ # })
344
+ #
345
+ # @example Response structure
346
+ #
347
+ # resp.item_list #=> Array
348
+ # resp.item_list[0].item_id #=> String
349
+ #
350
+ # @see http://docs.aws.amazon.com/goto/WebAPI/personalize-runtime-2018-05-22/GetRecommendations AWS API Documentation
351
+ #
352
+ # @overload get_recommendations(params = {})
353
+ # @param [Hash] params ({})
354
+ def get_recommendations(params = {}, options = {})
355
+ req = build_request(:get_recommendations, params)
356
+ req.send_request(options)
357
+ end
358
+
359
+ # @!endgroup
360
+
361
+ # @param params ({})
362
+ # @api private
363
+ def build_request(operation_name, params = {})
364
+ handlers = @handlers.for(operation_name)
365
+ context = Seahorse::Client::RequestContext.new(
366
+ operation_name: operation_name,
367
+ operation: config.api.operation(operation_name),
368
+ client: self,
369
+ params: params,
370
+ config: config)
371
+ context[:gem_name] = 'aws-sdk-personalizeruntime'
372
+ context[:gem_version] = '1.0.0'
373
+ Seahorse::Client::Request.new(handlers, context)
374
+ end
375
+
376
+ # @api private
377
+ # @deprecated
378
+ def waiter_names
379
+ []
380
+ end
381
+
382
+ class << self
383
+
384
+ # @api private
385
+ attr_reader :identifier
386
+
387
+ # @api private
388
+ def errors_module
389
+ Errors
390
+ end
391
+
392
+ end
393
+ end
394
+ end
@@ -0,0 +1,99 @@
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::PersonalizeRuntime
9
+ # @api private
10
+ module ClientApi
11
+
12
+ include Seahorse::Model
13
+
14
+ Arn = Shapes::StringShape.new(name: 'Arn')
15
+ ErrorMessage = Shapes::StringShape.new(name: 'ErrorMessage')
16
+ GetPersonalizedRankingRequest = Shapes::StructureShape.new(name: 'GetPersonalizedRankingRequest')
17
+ GetPersonalizedRankingResponse = Shapes::StructureShape.new(name: 'GetPersonalizedRankingResponse')
18
+ GetRecommendationsRequest = Shapes::StructureShape.new(name: 'GetRecommendationsRequest')
19
+ GetRecommendationsResponse = Shapes::StructureShape.new(name: 'GetRecommendationsResponse')
20
+ InputList = Shapes::ListShape.new(name: 'InputList')
21
+ InvalidInputException = Shapes::StructureShape.new(name: 'InvalidInputException')
22
+ ItemID = Shapes::StringShape.new(name: 'ItemID')
23
+ ItemList = Shapes::ListShape.new(name: 'ItemList')
24
+ NumResults = Shapes::IntegerShape.new(name: 'NumResults')
25
+ PredictedItem = Shapes::StructureShape.new(name: 'PredictedItem')
26
+ ResourceNotFoundException = Shapes::StructureShape.new(name: 'ResourceNotFoundException')
27
+ UserID = Shapes::StringShape.new(name: 'UserID')
28
+
29
+ GetPersonalizedRankingRequest.add_member(:campaign_arn, Shapes::ShapeRef.new(shape: Arn, required: true, location_name: "campaignArn"))
30
+ GetPersonalizedRankingRequest.add_member(:input_list, Shapes::ShapeRef.new(shape: InputList, required: true, location_name: "inputList"))
31
+ GetPersonalizedRankingRequest.add_member(:user_id, Shapes::ShapeRef.new(shape: UserID, required: true, location_name: "userId"))
32
+ GetPersonalizedRankingRequest.struct_class = Types::GetPersonalizedRankingRequest
33
+
34
+ GetPersonalizedRankingResponse.add_member(:personalized_ranking, Shapes::ShapeRef.new(shape: ItemList, location_name: "personalizedRanking"))
35
+ GetPersonalizedRankingResponse.struct_class = Types::GetPersonalizedRankingResponse
36
+
37
+ GetRecommendationsRequest.add_member(:campaign_arn, Shapes::ShapeRef.new(shape: Arn, required: true, location_name: "campaignArn"))
38
+ GetRecommendationsRequest.add_member(:item_id, Shapes::ShapeRef.new(shape: ItemID, location_name: "itemId"))
39
+ GetRecommendationsRequest.add_member(:user_id, Shapes::ShapeRef.new(shape: UserID, location_name: "userId"))
40
+ GetRecommendationsRequest.add_member(:num_results, Shapes::ShapeRef.new(shape: NumResults, location_name: "numResults"))
41
+ GetRecommendationsRequest.struct_class = Types::GetRecommendationsRequest
42
+
43
+ GetRecommendationsResponse.add_member(:item_list, Shapes::ShapeRef.new(shape: ItemList, location_name: "itemList"))
44
+ GetRecommendationsResponse.struct_class = Types::GetRecommendationsResponse
45
+
46
+ InputList.member = Shapes::ShapeRef.new(shape: ItemID)
47
+
48
+ InvalidInputException.add_member(:message, Shapes::ShapeRef.new(shape: ErrorMessage, location_name: "message"))
49
+ InvalidInputException.struct_class = Types::InvalidInputException
50
+
51
+ ItemList.member = Shapes::ShapeRef.new(shape: PredictedItem)
52
+
53
+ PredictedItem.add_member(:item_id, Shapes::ShapeRef.new(shape: ItemID, location_name: "itemId"))
54
+ PredictedItem.struct_class = Types::PredictedItem
55
+
56
+ ResourceNotFoundException.add_member(:message, Shapes::ShapeRef.new(shape: ErrorMessage, location_name: "message"))
57
+ ResourceNotFoundException.struct_class = Types::ResourceNotFoundException
58
+
59
+
60
+ # @api private
61
+ API = Seahorse::Model::Api.new.tap do |api|
62
+
63
+ api.version = "2018-05-22"
64
+
65
+ api.metadata = {
66
+ "apiVersion" => "2018-05-22",
67
+ "endpointPrefix" => "personalize-runtime",
68
+ "jsonVersion" => "1.1",
69
+ "protocol" => "rest-json",
70
+ "serviceFullName" => "Amazon Personalize Runtime",
71
+ "serviceId" => "Personalize Runtime",
72
+ "signatureVersion" => "v4",
73
+ "signingName" => "personalize",
74
+ "uid" => "personalize-runtime-2018-05-22",
75
+ }
76
+
77
+ api.add_operation(:get_personalized_ranking, Seahorse::Model::Operation.new.tap do |o|
78
+ o.name = "GetPersonalizedRanking"
79
+ o.http_method = "POST"
80
+ o.http_request_uri = "/personalize-ranking"
81
+ o.input = Shapes::ShapeRef.new(shape: GetPersonalizedRankingRequest)
82
+ o.output = Shapes::ShapeRef.new(shape: GetPersonalizedRankingResponse)
83
+ o.errors << Shapes::ShapeRef.new(shape: InvalidInputException)
84
+ o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
85
+ end)
86
+
87
+ api.add_operation(:get_recommendations, Seahorse::Model::Operation.new.tap do |o|
88
+ o.name = "GetRecommendations"
89
+ o.http_method = "POST"
90
+ o.http_request_uri = "/recommendations"
91
+ o.input = Shapes::ShapeRef.new(shape: GetRecommendationsRequest)
92
+ o.output = Shapes::ShapeRef.new(shape: GetRecommendationsResponse)
93
+ o.errors << Shapes::ShapeRef.new(shape: InvalidInputException)
94
+ o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
95
+ end)
96
+ end
97
+
98
+ end
99
+ end
@@ -0,0 +1,46 @@
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::PersonalizeRuntime
9
+ module Errors
10
+
11
+ extend Aws::Errors::DynamicErrors
12
+
13
+ class InvalidInputException < ServiceError
14
+
15
+ # @param [Seahorse::Client::RequestContext] context
16
+ # @param [String] message
17
+ # @param [Aws::PersonalizeRuntime::Types::InvalidInputException] data
18
+ def initialize(context, message, data = Aws::EmptyStructure.new)
19
+ super(context, message, data)
20
+ end
21
+
22
+ # @return [String]
23
+ def message
24
+ @message || @data[:message]
25
+ end
26
+
27
+ end
28
+
29
+ class ResourceNotFoundException < ServiceError
30
+
31
+ # @param [Seahorse::Client::RequestContext] context
32
+ # @param [String] message
33
+ # @param [Aws::PersonalizeRuntime::Types::ResourceNotFoundException] data
34
+ def initialize(context, message, data = Aws::EmptyStructure.new)
35
+ super(context, message, data)
36
+ end
37
+
38
+ # @return [String]
39
+ def message
40
+ @message || @data[:message]
41
+ end
42
+
43
+ end
44
+
45
+ end
46
+ 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::PersonalizeRuntime
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,149 @@
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::PersonalizeRuntime
9
+ module Types
10
+
11
+ # @note When making an API call, you may pass GetPersonalizedRankingRequest
12
+ # data as a hash:
13
+ #
14
+ # {
15
+ # campaign_arn: "Arn", # required
16
+ # input_list: ["ItemID"], # required
17
+ # user_id: "UserID", # required
18
+ # }
19
+ #
20
+ # @!attribute [rw] campaign_arn
21
+ # The Amazon Resource Name (ARN) of the campaign to use for generating
22
+ # the personalized ranking.
23
+ # @return [String]
24
+ #
25
+ # @!attribute [rw] input_list
26
+ # A list of items (itemId's) to rank. If an item was not included in
27
+ # the training dataset, the item is appended to the end of the
28
+ # reranked list.
29
+ # @return [Array<String>]
30
+ #
31
+ # @!attribute [rw] user_id
32
+ # The user for which you want the campaign to provide a personalized
33
+ # ranking.
34
+ # @return [String]
35
+ #
36
+ # @see http://docs.aws.amazon.com/goto/WebAPI/personalize-runtime-2018-05-22/GetPersonalizedRankingRequest AWS API Documentation
37
+ #
38
+ class GetPersonalizedRankingRequest < Struct.new(
39
+ :campaign_arn,
40
+ :input_list,
41
+ :user_id)
42
+ include Aws::Structure
43
+ end
44
+
45
+ # @!attribute [rw] personalized_ranking
46
+ # A list of items in order of most likely interest to the user.
47
+ # @return [Array<Types::PredictedItem>]
48
+ #
49
+ # @see http://docs.aws.amazon.com/goto/WebAPI/personalize-runtime-2018-05-22/GetPersonalizedRankingResponse AWS API Documentation
50
+ #
51
+ class GetPersonalizedRankingResponse < Struct.new(
52
+ :personalized_ranking)
53
+ include Aws::Structure
54
+ end
55
+
56
+ # @note When making an API call, you may pass GetRecommendationsRequest
57
+ # data as a hash:
58
+ #
59
+ # {
60
+ # campaign_arn: "Arn", # required
61
+ # item_id: "ItemID",
62
+ # user_id: "UserID",
63
+ # num_results: 1,
64
+ # }
65
+ #
66
+ # @!attribute [rw] campaign_arn
67
+ # The Amazon Resource Name (ARN) of the campaign to use for getting
68
+ # recommendations.
69
+ # @return [String]
70
+ #
71
+ # @!attribute [rw] item_id
72
+ # The item ID to provide recommendations for.
73
+ #
74
+ # Required for `RELATED_ITEMS` recipe type.
75
+ # @return [String]
76
+ #
77
+ # @!attribute [rw] user_id
78
+ # The user ID to provide recommendations for.
79
+ #
80
+ # Required for `USER_PERSONALIZATION` recipe type.
81
+ # @return [String]
82
+ #
83
+ # @!attribute [rw] num_results
84
+ # The number of results to return. The default is 25. The maximum is
85
+ # 100.
86
+ # @return [Integer]
87
+ #
88
+ # @see http://docs.aws.amazon.com/goto/WebAPI/personalize-runtime-2018-05-22/GetRecommendationsRequest AWS API Documentation
89
+ #
90
+ class GetRecommendationsRequest < Struct.new(
91
+ :campaign_arn,
92
+ :item_id,
93
+ :user_id,
94
+ :num_results)
95
+ include Aws::Structure
96
+ end
97
+
98
+ # @!attribute [rw] item_list
99
+ # A list of recommendations.
100
+ # @return [Array<Types::PredictedItem>]
101
+ #
102
+ # @see http://docs.aws.amazon.com/goto/WebAPI/personalize-runtime-2018-05-22/GetRecommendationsResponse AWS API Documentation
103
+ #
104
+ class GetRecommendationsResponse < Struct.new(
105
+ :item_list)
106
+ include Aws::Structure
107
+ end
108
+
109
+ # Provide a valid value for the field or parameter.
110
+ #
111
+ # @!attribute [rw] message
112
+ # @return [String]
113
+ #
114
+ # @see http://docs.aws.amazon.com/goto/WebAPI/personalize-runtime-2018-05-22/InvalidInputException AWS API Documentation
115
+ #
116
+ class InvalidInputException < Struct.new(
117
+ :message)
118
+ include Aws::Structure
119
+ end
120
+
121
+ # An object that identifies an item.
122
+ #
123
+ # The and APIs return a list of `PredictedItem`s.
124
+ #
125
+ # @!attribute [rw] item_id
126
+ # The recommended item ID.
127
+ # @return [String]
128
+ #
129
+ # @see http://docs.aws.amazon.com/goto/WebAPI/personalize-runtime-2018-05-22/PredictedItem AWS API Documentation
130
+ #
131
+ class PredictedItem < Struct.new(
132
+ :item_id)
133
+ include Aws::Structure
134
+ end
135
+
136
+ # The specified resource does not exist.
137
+ #
138
+ # @!attribute [rw] message
139
+ # @return [String]
140
+ #
141
+ # @see http://docs.aws.amazon.com/goto/WebAPI/personalize-runtime-2018-05-22/ResourceNotFoundException AWS API Documentation
142
+ #
143
+ class ResourceNotFoundException < Struct.new(
144
+ :message)
145
+ include Aws::Structure
146
+ end
147
+
148
+ end
149
+ end
metadata ADDED
@@ -0,0 +1,88 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: aws-sdk-personalizeruntime
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Amazon Web Services
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2019-06-10 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'
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 3.53.0
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: '3'
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 3.53.0
33
+ - !ruby/object:Gem::Dependency
34
+ name: aws-sigv4
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '1.1'
40
+ type: :runtime
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: '1.1'
47
+ description: Official AWS Ruby gem for Amazon Personalize Runtime. This gem is part
48
+ of the AWS SDK for Ruby.
49
+ email:
50
+ - trevrowe@amazon.com
51
+ executables: []
52
+ extensions: []
53
+ extra_rdoc_files: []
54
+ files:
55
+ - lib/aws-sdk-personalizeruntime.rb
56
+ - lib/aws-sdk-personalizeruntime/client.rb
57
+ - lib/aws-sdk-personalizeruntime/client_api.rb
58
+ - lib/aws-sdk-personalizeruntime/customizations.rb
59
+ - lib/aws-sdk-personalizeruntime/errors.rb
60
+ - lib/aws-sdk-personalizeruntime/resource.rb
61
+ - lib/aws-sdk-personalizeruntime/types.rb
62
+ homepage: https://github.com/aws/aws-sdk-ruby
63
+ licenses:
64
+ - Apache-2.0
65
+ metadata:
66
+ source_code_uri: https://github.com/aws/aws-sdk-ruby/tree/master/gems/aws-sdk-personalizeruntime
67
+ changelog_uri: https://github.com/aws/aws-sdk-ruby/tree/master/gems/aws-sdk-personalizeruntime/CHANGELOG.md
68
+ post_install_message:
69
+ rdoc_options: []
70
+ require_paths:
71
+ - lib
72
+ required_ruby_version: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ required_rubygems_version: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
82
+ requirements: []
83
+ rubyforge_project:
84
+ rubygems_version: 2.5.2.3
85
+ signing_key:
86
+ specification_version: 4
87
+ summary: AWS SDK for Ruby - Amazon Personalize Runtime
88
+ test_files: []