aws-sdk-forecastqueryservice 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 2431c0ccf52c6c0a7fd2cbf990cefed34d387d51
4
+ data.tar.gz: 508a2dfb0efd9cf72743d1c2e7a3dcf5db35fec5
5
+ SHA512:
6
+ metadata.gz: 1199a44d5c0b496ff351c12cdfd48d52b0cee8bd22cefd83c8998b43033c8cbfb23fb2dda535902e7f57f48c0ddfaabeed88f1529461207f3b621bc1aef2dbcd
7
+ data.tar.gz: 4c50768b01664e4a3f2469f70b01ce13be51b163a3c5e80030af88e1018ad1658bf7b36d32b796ad9ed27c05c62bc226be09e4ba7e2f6df8f5effd6de5bafdc9
@@ -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-forecastqueryservice/types'
12
+ require_relative 'aws-sdk-forecastqueryservice/client_api'
13
+ require_relative 'aws-sdk-forecastqueryservice/client'
14
+ require_relative 'aws-sdk-forecastqueryservice/errors'
15
+ require_relative 'aws-sdk-forecastqueryservice/resource'
16
+ require_relative 'aws-sdk-forecastqueryservice/customizations'
17
+
18
+ # This module provides support for Amazon Forecast Query Service. This module is available in the
19
+ # `aws-sdk-forecastqueryservice` 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 Forecast Query Service all
32
+ # extend {Errors::ServiceError}.
33
+ #
34
+ # begin
35
+ # # do stuff
36
+ # rescue Aws::ForecastQueryService::Errors::ServiceError
37
+ # # rescues all service API errors
38
+ # end
39
+ #
40
+ # See {Errors} for more information.
41
+ #
42
+ # @service
43
+ module Aws::ForecastQueryService
44
+
45
+ GEM_VERSION = '1.0.0'
46
+
47
+ end
@@ -0,0 +1,390 @@
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/json_rpc.rb'
29
+
30
+ Aws::Plugins::GlobalConfiguration.add_identifier(:forecastqueryservice)
31
+
32
+ module Aws::ForecastQueryService
33
+ class Client < Seahorse::Client::Base
34
+
35
+ include Aws::ClientStubs
36
+
37
+ @identifier = :forecastqueryservice
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::JsonRpc)
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 [String] :client_side_monitoring_host ("127.0.0.1")
120
+ # Allows you to specify the DNS hostname or IPv4 or IPv6 address that the client
121
+ # side monitoring agent is running on, where client metrics will be published via UDP.
122
+ #
123
+ # @option options [Integer] :client_side_monitoring_port (31000)
124
+ # Required for publishing client metrics. The port that the client side monitoring
125
+ # agent is running on, where client metrics will be published via UDP.
126
+ #
127
+ # @option options [Aws::ClientSideMonitoring::Publisher] :client_side_monitoring_publisher (Aws::ClientSideMonitoring::Publisher)
128
+ # Allows you to provide a custom client-side monitoring publisher class. By default,
129
+ # will use the Client Side Monitoring Agent Publisher.
130
+ #
131
+ # @option options [Boolean] :convert_params (true)
132
+ # When `true`, an attempt is made to coerce request parameters into
133
+ # the required types.
134
+ #
135
+ # @option options [Boolean] :disable_host_prefix_injection (false)
136
+ # Set to true to disable SDK automatically adding host prefix
137
+ # to default service endpoint when available.
138
+ #
139
+ # @option options [String] :endpoint
140
+ # The client endpoint is normally constructed from the `:region`
141
+ # option. You should only configure an `:endpoint` when connecting
142
+ # to test endpoints. This should be avalid HTTP(S) URI.
143
+ #
144
+ # @option options [Integer] :endpoint_cache_max_entries (1000)
145
+ # Used for the maximum size limit of the LRU cache storing endpoints data
146
+ # for endpoint discovery enabled operations. Defaults to 1000.
147
+ #
148
+ # @option options [Integer] :endpoint_cache_max_threads (10)
149
+ # Used for the maximum threads in use for polling endpoints to be cached, defaults to 10.
150
+ #
151
+ # @option options [Integer] :endpoint_cache_poll_interval (60)
152
+ # When :endpoint_discovery and :active_endpoint_cache is enabled,
153
+ # Use this option to config the time interval in seconds for making
154
+ # requests fetching endpoints information. Defaults to 60 sec.
155
+ #
156
+ # @option options [Boolean] :endpoint_discovery (false)
157
+ # When set to `true`, endpoint discovery will be enabled for operations when available. Defaults to `false`.
158
+ #
159
+ # @option options [Aws::Log::Formatter] :log_formatter (Aws::Log::Formatter.default)
160
+ # The log formatter.
161
+ #
162
+ # @option options [Symbol] :log_level (:info)
163
+ # The log level to send messages to the `:logger` at.
164
+ #
165
+ # @option options [Logger] :logger
166
+ # The Logger instance to send log messages to. If this option
167
+ # is not set, logging will be disabled.
168
+ #
169
+ # @option options [String] :profile ("default")
170
+ # Used when loading credentials from the shared credentials file
171
+ # at HOME/.aws/credentials. When not specified, 'default' is used.
172
+ #
173
+ # @option options [Float] :retry_base_delay (0.3)
174
+ # The base delay in seconds used by the default backoff function.
175
+ #
176
+ # @option options [Symbol] :retry_jitter (:none)
177
+ # 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.
178
+ #
179
+ # @see https://www.awsarchitectureblog.com/2015/03/backoff.html
180
+ #
181
+ # @option options [Integer] :retry_limit (3)
182
+ # The maximum number of times to retry failed requests. Only
183
+ # ~ 500 level server errors and certain ~ 400 level client errors
184
+ # are retried. Generally, these are throttling errors, data
185
+ # checksum errors, networking errors, timeout errors and auth
186
+ # errors from expired credentials.
187
+ #
188
+ # @option options [Integer] :retry_max_delay (0)
189
+ # The maximum number of seconds to delay between retries (0 for no limit) used by the default backoff function.
190
+ #
191
+ # @option options [String] :secret_access_key
192
+ #
193
+ # @option options [String] :session_token
194
+ #
195
+ # @option options [Boolean] :simple_json (false)
196
+ # Disables request parameter conversion, validation, and formatting.
197
+ # Also disable response data type conversions. This option is useful
198
+ # when you want to ensure the highest level of performance by
199
+ # avoiding overhead of walking request parameters and response data
200
+ # structures.
201
+ #
202
+ # When `:simple_json` is enabled, the request parameters hash must
203
+ # be formatted exactly as the DynamoDB API expects.
204
+ #
205
+ # @option options [Boolean] :stub_responses (false)
206
+ # Causes the client to return stubbed responses. By default
207
+ # fake responses are generated and returned. You can specify
208
+ # the response data to return or errors to raise by calling
209
+ # {ClientStubs#stub_responses}. See {ClientStubs} for more information.
210
+ #
211
+ # ** Please note ** When response stubbing is enabled, no HTTP
212
+ # requests are made, and retries are disabled.
213
+ #
214
+ # @option options [Boolean] :validate_params (true)
215
+ # When `true`, request parameters are validated before
216
+ # sending the request.
217
+ #
218
+ # @option options [URI::HTTP,String] :http_proxy A proxy to send
219
+ # requests through. Formatted like 'http://proxy.com:123'.
220
+ #
221
+ # @option options [Float] :http_open_timeout (15) The number of
222
+ # seconds to wait when opening a HTTP session before rasing a
223
+ # `Timeout::Error`.
224
+ #
225
+ # @option options [Integer] :http_read_timeout (60) The default
226
+ # number of seconds to wait for response data. This value can
227
+ # safely be set
228
+ # per-request on the session yeidled by {#session_for}.
229
+ #
230
+ # @option options [Float] :http_idle_timeout (5) The number of
231
+ # seconds a connection is allowed to sit idble before it is
232
+ # considered stale. Stale connections are closed and removed
233
+ # from the pool before making a request.
234
+ #
235
+ # @option options [Float] :http_continue_timeout (1) The number of
236
+ # seconds to wait for a 100-continue response before sending the
237
+ # request body. This option has no effect unless the request has
238
+ # "Expect" header set to "100-continue". Defaults to `nil` which
239
+ # disables this behaviour. This value can safely be set per
240
+ # request on the session yeidled by {#session_for}.
241
+ #
242
+ # @option options [Boolean] :http_wire_trace (false) When `true`,
243
+ # HTTP debug output will be sent to the `:logger`.
244
+ #
245
+ # @option options [Boolean] :ssl_verify_peer (true) When `true`,
246
+ # SSL peer certificates are verified when establishing a
247
+ # connection.
248
+ #
249
+ # @option options [String] :ssl_ca_bundle Full path to the SSL
250
+ # certificate authority bundle file that should be used when
251
+ # verifying peer certificates. If you do not pass
252
+ # `:ssl_ca_bundle` or `:ssl_ca_directory` the the system default
253
+ # will be used if available.
254
+ #
255
+ # @option options [String] :ssl_ca_directory Full path of the
256
+ # directory that contains the unbundled SSL certificate
257
+ # authority files for verifying peer certificates. If you do
258
+ # not pass `:ssl_ca_bundle` or `:ssl_ca_directory` the the
259
+ # system default will be used if available.
260
+ #
261
+ def initialize(*args)
262
+ super
263
+ end
264
+
265
+ # @!group API Operations
266
+
267
+ # Retrieves a forecast filtered by the supplied criteria.
268
+ #
269
+ # The criteria is a key-value pair. The key is either `item_id` (or the
270
+ # equivalent non-timestamp, non-target field) from the
271
+ # `TARGET_TIME_SERIES` dataset, or one of the forecast dimensions
272
+ # specified as part of the `FeaturizationConfig` object.
273
+ #
274
+ # By default, the complete date range of the filtered forecast is
275
+ # returned. Optionally, you can request a specific date range within the
276
+ # forecast.
277
+ #
278
+ # <note markdown="1"> The forecasts generated by Amazon Forecast are in the same timezone as
279
+ # the dataset that was used to create the predictor.
280
+ #
281
+ # </note>
282
+ #
283
+ # @option params [required, String] :forecast_arn
284
+ # The Amazon Resource Name (ARN) of the forecast to query.
285
+ #
286
+ # @option params [String] :start_date
287
+ # The start date for the forecast. Specify the date using this format:
288
+ # yyyy-MM-dd'T'HH:mm:ss'Z' (ISO 8601 format) For example,
289
+ # "1970-01-01T00:00:00Z."
290
+ #
291
+ # @option params [String] :end_date
292
+ # The end date for the forecast. Specify the date using this format:
293
+ # yyyy-MM-dd'T'HH:mm:ss'Z' (ISO 8601 format). For example,
294
+ # "1970-01-01T00:00:00Z."
295
+ #
296
+ # @option params [required, Hash<String,String>] :filters
297
+ # The filtering criteria to apply when retrieving the forecast. For
298
+ # example:
299
+ #
300
+ # * To get a forecast for a specific item specify the following:
301
+ #
302
+ # `\{"item_id" : "client_1"\}`
303
+ # ^
304
+ #
305
+ # * To get a forecast for a specific item sold in a specific location,
306
+ # specify the following:
307
+ #
308
+ # `\{"item_id" : "client_1", "location" : "ny"\}`
309
+ # ^
310
+ #
311
+ # * To get a forecast for all blue items sold in a specific location,
312
+ # specify the following:
313
+ #
314
+ # `\{ "location" : "ny", "color":"blue"\}`
315
+ #
316
+ # To get the full forecast, use the operation.
317
+ #
318
+ # @option params [String] :next_token
319
+ # If the result of the previous request was truncated, the response
320
+ # includes a `NextToken`. To retrieve the next set of results, use the
321
+ # token in the next request. Tokens expire after 24 hours.
322
+ #
323
+ # @return [Types::QueryForecastResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
324
+ #
325
+ # * {Types::QueryForecastResponse#forecast #forecast} => Types::Forecast
326
+ #
327
+ # @example Request syntax with placeholder values
328
+ #
329
+ # resp = client.query_forecast({
330
+ # forecast_arn: "Arn", # required
331
+ # start_date: "DateTime",
332
+ # end_date: "DateTime",
333
+ # filters: { # required
334
+ # "AttributeName" => "AttributeValue",
335
+ # },
336
+ # next_token: "NextToken",
337
+ # })
338
+ #
339
+ # @example Response structure
340
+ #
341
+ # resp.forecast.predictions #=> Hash
342
+ # resp.forecast.predictions["Statistic"] #=> Array
343
+ # resp.forecast.predictions["Statistic"][0].timestamp #=> String
344
+ # resp.forecast.predictions["Statistic"][0].value #=> Float
345
+ #
346
+ # @see http://docs.aws.amazon.com/goto/WebAPI/forecastquery-2018-06-26/QueryForecast AWS API Documentation
347
+ #
348
+ # @overload query_forecast(params = {})
349
+ # @param [Hash] params ({})
350
+ def query_forecast(params = {}, options = {})
351
+ req = build_request(:query_forecast, params)
352
+ req.send_request(options)
353
+ end
354
+
355
+ # @!endgroup
356
+
357
+ # @param params ({})
358
+ # @api private
359
+ def build_request(operation_name, params = {})
360
+ handlers = @handlers.for(operation_name)
361
+ context = Seahorse::Client::RequestContext.new(
362
+ operation_name: operation_name,
363
+ operation: config.api.operation(operation_name),
364
+ client: self,
365
+ params: params,
366
+ config: config)
367
+ context[:gem_name] = 'aws-sdk-forecastqueryservice'
368
+ context[:gem_version] = '1.0.0'
369
+ Seahorse::Client::Request.new(handlers, context)
370
+ end
371
+
372
+ # @api private
373
+ # @deprecated
374
+ def waiter_names
375
+ []
376
+ end
377
+
378
+ class << self
379
+
380
+ # @api private
381
+ attr_reader :identifier
382
+
383
+ # @api private
384
+ def errors_module
385
+ Errors
386
+ end
387
+
388
+ end
389
+ end
390
+ end
@@ -0,0 +1,110 @@
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::ForecastQueryService
9
+ # @api private
10
+ module ClientApi
11
+
12
+ include Seahorse::Model
13
+
14
+ Arn = Shapes::StringShape.new(name: 'Arn')
15
+ AttributeName = Shapes::StringShape.new(name: 'AttributeName')
16
+ AttributeValue = Shapes::StringShape.new(name: 'AttributeValue')
17
+ DataPoint = Shapes::StructureShape.new(name: 'DataPoint')
18
+ DateTime = Shapes::StringShape.new(name: 'DateTime')
19
+ Double = Shapes::FloatShape.new(name: 'Double')
20
+ ErrorMessage = Shapes::StringShape.new(name: 'ErrorMessage')
21
+ Filters = Shapes::MapShape.new(name: 'Filters')
22
+ Forecast = Shapes::StructureShape.new(name: 'Forecast')
23
+ InvalidInputException = Shapes::StructureShape.new(name: 'InvalidInputException')
24
+ InvalidNextTokenException = Shapes::StructureShape.new(name: 'InvalidNextTokenException')
25
+ LimitExceededException = Shapes::StructureShape.new(name: 'LimitExceededException')
26
+ NextToken = Shapes::StringShape.new(name: 'NextToken')
27
+ Predictions = Shapes::MapShape.new(name: 'Predictions')
28
+ QueryForecastRequest = Shapes::StructureShape.new(name: 'QueryForecastRequest')
29
+ QueryForecastResponse = Shapes::StructureShape.new(name: 'QueryForecastResponse')
30
+ ResourceInUseException = Shapes::StructureShape.new(name: 'ResourceInUseException')
31
+ ResourceNotFoundException = Shapes::StructureShape.new(name: 'ResourceNotFoundException')
32
+ Statistic = Shapes::StringShape.new(name: 'Statistic')
33
+ TimeSeries = Shapes::ListShape.new(name: 'TimeSeries')
34
+ Timestamp = Shapes::StringShape.new(name: 'Timestamp')
35
+
36
+ DataPoint.add_member(:timestamp, Shapes::ShapeRef.new(shape: Timestamp, location_name: "Timestamp"))
37
+ DataPoint.add_member(:value, Shapes::ShapeRef.new(shape: Double, location_name: "Value"))
38
+ DataPoint.struct_class = Types::DataPoint
39
+
40
+ Filters.key = Shapes::ShapeRef.new(shape: AttributeName)
41
+ Filters.value = Shapes::ShapeRef.new(shape: AttributeValue)
42
+
43
+ Forecast.add_member(:predictions, Shapes::ShapeRef.new(shape: Predictions, location_name: "Predictions"))
44
+ Forecast.struct_class = Types::Forecast
45
+
46
+ InvalidInputException.add_member(:message, Shapes::ShapeRef.new(shape: ErrorMessage, location_name: "Message"))
47
+ InvalidInputException.struct_class = Types::InvalidInputException
48
+
49
+ InvalidNextTokenException.add_member(:message, Shapes::ShapeRef.new(shape: ErrorMessage, location_name: "Message"))
50
+ InvalidNextTokenException.struct_class = Types::InvalidNextTokenException
51
+
52
+ LimitExceededException.add_member(:message, Shapes::ShapeRef.new(shape: ErrorMessage, location_name: "Message"))
53
+ LimitExceededException.struct_class = Types::LimitExceededException
54
+
55
+ Predictions.key = Shapes::ShapeRef.new(shape: Statistic)
56
+ Predictions.value = Shapes::ShapeRef.new(shape: TimeSeries)
57
+
58
+ QueryForecastRequest.add_member(:forecast_arn, Shapes::ShapeRef.new(shape: Arn, required: true, location_name: "ForecastArn"))
59
+ QueryForecastRequest.add_member(:start_date, Shapes::ShapeRef.new(shape: DateTime, location_name: "StartDate"))
60
+ QueryForecastRequest.add_member(:end_date, Shapes::ShapeRef.new(shape: DateTime, location_name: "EndDate"))
61
+ QueryForecastRequest.add_member(:filters, Shapes::ShapeRef.new(shape: Filters, required: true, location_name: "Filters"))
62
+ QueryForecastRequest.add_member(:next_token, Shapes::ShapeRef.new(shape: NextToken, location_name: "NextToken"))
63
+ QueryForecastRequest.struct_class = Types::QueryForecastRequest
64
+
65
+ QueryForecastResponse.add_member(:forecast, Shapes::ShapeRef.new(shape: Forecast, location_name: "Forecast"))
66
+ QueryForecastResponse.struct_class = Types::QueryForecastResponse
67
+
68
+ ResourceInUseException.add_member(:message, Shapes::ShapeRef.new(shape: ErrorMessage, location_name: "Message"))
69
+ ResourceInUseException.struct_class = Types::ResourceInUseException
70
+
71
+ ResourceNotFoundException.add_member(:message, Shapes::ShapeRef.new(shape: ErrorMessage, location_name: "Message"))
72
+ ResourceNotFoundException.struct_class = Types::ResourceNotFoundException
73
+
74
+ TimeSeries.member = Shapes::ShapeRef.new(shape: DataPoint)
75
+
76
+
77
+ # @api private
78
+ API = Seahorse::Model::Api.new.tap do |api|
79
+
80
+ api.version = "2018-06-26"
81
+
82
+ api.metadata = {
83
+ "apiVersion" => "2018-06-26",
84
+ "endpointPrefix" => "forecastquery",
85
+ "jsonVersion" => "1.1",
86
+ "protocol" => "json",
87
+ "serviceFullName" => "Amazon Forecast Query Service",
88
+ "serviceId" => "forecastquery",
89
+ "signatureVersion" => "v4",
90
+ "signingName" => "forecast",
91
+ "targetPrefix" => "AmazonForecastRuntime",
92
+ "uid" => "forecastquery-2018-06-26",
93
+ }
94
+
95
+ api.add_operation(:query_forecast, Seahorse::Model::Operation.new.tap do |o|
96
+ o.name = "QueryForecast"
97
+ o.http_method = "POST"
98
+ o.http_request_uri = "/"
99
+ o.input = Shapes::ShapeRef.new(shape: QueryForecastRequest)
100
+ o.output = Shapes::ShapeRef.new(shape: QueryForecastResponse)
101
+ o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
102
+ o.errors << Shapes::ShapeRef.new(shape: ResourceInUseException)
103
+ o.errors << Shapes::ShapeRef.new(shape: InvalidInputException)
104
+ o.errors << Shapes::ShapeRef.new(shape: LimitExceededException)
105
+ o.errors << Shapes::ShapeRef.new(shape: InvalidNextTokenException)
106
+ end)
107
+ end
108
+
109
+ end
110
+ end
@@ -0,0 +1,94 @@
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::ForecastQueryService
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::ForecastQueryService::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 InvalidNextTokenException < ServiceError
30
+
31
+ # @param [Seahorse::Client::RequestContext] context
32
+ # @param [String] message
33
+ # @param [Aws::ForecastQueryService::Types::InvalidNextTokenException] 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
+ class LimitExceededException < ServiceError
46
+
47
+ # @param [Seahorse::Client::RequestContext] context
48
+ # @param [String] message
49
+ # @param [Aws::ForecastQueryService::Types::LimitExceededException] data
50
+ def initialize(context, message, data = Aws::EmptyStructure.new)
51
+ super(context, message, data)
52
+ end
53
+
54
+ # @return [String]
55
+ def message
56
+ @message || @data[:message]
57
+ end
58
+
59
+ end
60
+
61
+ class ResourceInUseException < ServiceError
62
+
63
+ # @param [Seahorse::Client::RequestContext] context
64
+ # @param [String] message
65
+ # @param [Aws::ForecastQueryService::Types::ResourceInUseException] data
66
+ def initialize(context, message, data = Aws::EmptyStructure.new)
67
+ super(context, message, data)
68
+ end
69
+
70
+ # @return [String]
71
+ def message
72
+ @message || @data[:message]
73
+ end
74
+
75
+ end
76
+
77
+ class ResourceNotFoundException < ServiceError
78
+
79
+ # @param [Seahorse::Client::RequestContext] context
80
+ # @param [String] message
81
+ # @param [Aws::ForecastQueryService::Types::ResourceNotFoundException] data
82
+ def initialize(context, message, data = Aws::EmptyStructure.new)
83
+ super(context, message, data)
84
+ end
85
+
86
+ # @return [String]
87
+ def message
88
+ @message || @data[:message]
89
+ end
90
+
91
+ end
92
+
93
+ end
94
+ 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::ForecastQueryService
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,196 @@
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::ForecastQueryService
9
+ module Types
10
+
11
+ # The forecast value for a specific date. Part of the Forecast object.
12
+ #
13
+ # @!attribute [rw] timestamp
14
+ # The timestamp of the specific forecast.
15
+ # @return [String]
16
+ #
17
+ # @!attribute [rw] value
18
+ # The forecast value.
19
+ # @return [Float]
20
+ #
21
+ # @see http://docs.aws.amazon.com/goto/WebAPI/forecastquery-2018-06-26/DataPoint AWS API Documentation
22
+ #
23
+ class DataPoint < Struct.new(
24
+ :timestamp,
25
+ :value)
26
+ include Aws::Structure
27
+ end
28
+
29
+ # Provides information about a forecast. Returned as part of the
30
+ # QueryForecast response.
31
+ #
32
+ # @!attribute [rw] predictions
33
+ # The forecast.
34
+ #
35
+ # The *string* of the string to array map is one of the following
36
+ # values:
37
+ #
38
+ # * mean
39
+ #
40
+ # * p10
41
+ #
42
+ # * p50
43
+ #
44
+ # * p90
45
+ # @return [Hash<String,Array<Types::DataPoint>>]
46
+ #
47
+ # @see http://docs.aws.amazon.com/goto/WebAPI/forecastquery-2018-06-26/Forecast AWS API Documentation
48
+ #
49
+ class Forecast < Struct.new(
50
+ :predictions)
51
+ include Aws::Structure
52
+ end
53
+
54
+ # The value that you provided was invalid or too long.
55
+ #
56
+ # @!attribute [rw] message
57
+ # @return [String]
58
+ #
59
+ # @see http://docs.aws.amazon.com/goto/WebAPI/forecastquery-2018-06-26/InvalidInputException AWS API Documentation
60
+ #
61
+ class InvalidInputException < Struct.new(
62
+ :message)
63
+ include Aws::Structure
64
+ end
65
+
66
+ # The token is not valid. Tokens expire after 24 hours.
67
+ #
68
+ # @!attribute [rw] message
69
+ # @return [String]
70
+ #
71
+ # @see http://docs.aws.amazon.com/goto/WebAPI/forecastquery-2018-06-26/InvalidNextTokenException AWS API Documentation
72
+ #
73
+ class InvalidNextTokenException < Struct.new(
74
+ :message)
75
+ include Aws::Structure
76
+ end
77
+
78
+ # The limit on the number of requests per second has been exceeded.
79
+ #
80
+ # @!attribute [rw] message
81
+ # @return [String]
82
+ #
83
+ # @see http://docs.aws.amazon.com/goto/WebAPI/forecastquery-2018-06-26/LimitExceededException AWS API Documentation
84
+ #
85
+ class LimitExceededException < Struct.new(
86
+ :message)
87
+ include Aws::Structure
88
+ end
89
+
90
+ # @note When making an API call, you may pass QueryForecastRequest
91
+ # data as a hash:
92
+ #
93
+ # {
94
+ # forecast_arn: "Arn", # required
95
+ # start_date: "DateTime",
96
+ # end_date: "DateTime",
97
+ # filters: { # required
98
+ # "AttributeName" => "AttributeValue",
99
+ # },
100
+ # next_token: "NextToken",
101
+ # }
102
+ #
103
+ # @!attribute [rw] forecast_arn
104
+ # The Amazon Resource Name (ARN) of the forecast to query.
105
+ # @return [String]
106
+ #
107
+ # @!attribute [rw] start_date
108
+ # The start date for the forecast. Specify the date using this format:
109
+ # yyyy-MM-dd'T'HH:mm:ss'Z' (ISO 8601 format) For example,
110
+ # "1970-01-01T00:00:00Z."
111
+ # @return [String]
112
+ #
113
+ # @!attribute [rw] end_date
114
+ # The end date for the forecast. Specify the date using this format:
115
+ # yyyy-MM-dd'T'HH:mm:ss'Z' (ISO 8601 format). For example,
116
+ # "1970-01-01T00:00:00Z."
117
+ # @return [String]
118
+ #
119
+ # @!attribute [rw] filters
120
+ # The filtering criteria to apply when retrieving the forecast. For
121
+ # example:
122
+ #
123
+ # * To get a forecast for a specific item specify the following:
124
+ #
125
+ # `\{"item_id" : "client_1"\}`
126
+ # ^
127
+ #
128
+ # * To get a forecast for a specific item sold in a specific location,
129
+ # specify the following:
130
+ #
131
+ # `\{"item_id" : "client_1", "location" : "ny"\}`
132
+ # ^
133
+ #
134
+ # * To get a forecast for all blue items sold in a specific location,
135
+ # specify the following:
136
+ #
137
+ # `\{ "location" : "ny", "color":"blue"\}`
138
+ #
139
+ # To get the full forecast, use the operation.
140
+ # @return [Hash<String,String>]
141
+ #
142
+ # @!attribute [rw] next_token
143
+ # If the result of the previous request was truncated, the response
144
+ # includes a `NextToken`. To retrieve the next set of results, use the
145
+ # token in the next request. Tokens expire after 24 hours.
146
+ # @return [String]
147
+ #
148
+ # @see http://docs.aws.amazon.com/goto/WebAPI/forecastquery-2018-06-26/QueryForecastRequest AWS API Documentation
149
+ #
150
+ class QueryForecastRequest < Struct.new(
151
+ :forecast_arn,
152
+ :start_date,
153
+ :end_date,
154
+ :filters,
155
+ :next_token)
156
+ include Aws::Structure
157
+ end
158
+
159
+ # @!attribute [rw] forecast
160
+ # The forecast.
161
+ # @return [Types::Forecast]
162
+ #
163
+ # @see http://docs.aws.amazon.com/goto/WebAPI/forecastquery-2018-06-26/QueryForecastResponse AWS API Documentation
164
+ #
165
+ class QueryForecastResponse < Struct.new(
166
+ :forecast)
167
+ include Aws::Structure
168
+ end
169
+
170
+ # The specified resource is in use.
171
+ #
172
+ # @!attribute [rw] message
173
+ # @return [String]
174
+ #
175
+ # @see http://docs.aws.amazon.com/goto/WebAPI/forecastquery-2018-06-26/ResourceInUseException AWS API Documentation
176
+ #
177
+ class ResourceInUseException < Struct.new(
178
+ :message)
179
+ include Aws::Structure
180
+ end
181
+
182
+ # We can't find that resource. Check the information that you've
183
+ # provided and try again.
184
+ #
185
+ # @!attribute [rw] message
186
+ # @return [String]
187
+ #
188
+ # @see http://docs.aws.amazon.com/goto/WebAPI/forecastquery-2018-06-26/ResourceNotFoundException AWS API Documentation
189
+ #
190
+ class ResourceNotFoundException < Struct.new(
191
+ :message)
192
+ include Aws::Structure
193
+ end
194
+
195
+ end
196
+ end
metadata ADDED
@@ -0,0 +1,88 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: aws-sdk-forecastqueryservice
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-08-21 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.61.1
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.61.1
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 Forecast Query Service. This gem is
48
+ part 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-forecastqueryservice.rb
56
+ - lib/aws-sdk-forecastqueryservice/client.rb
57
+ - lib/aws-sdk-forecastqueryservice/client_api.rb
58
+ - lib/aws-sdk-forecastqueryservice/customizations.rb
59
+ - lib/aws-sdk-forecastqueryservice/errors.rb
60
+ - lib/aws-sdk-forecastqueryservice/resource.rb
61
+ - lib/aws-sdk-forecastqueryservice/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-forecastqueryservice
67
+ changelog_uri: https://github.com/aws/aws-sdk-ruby/tree/master/gems/aws-sdk-forecastqueryservice/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 Forecast Query Service
88
+ test_files: []