-
Notifications
You must be signed in to change notification settings - Fork 2.1k
/
api.go
10896 lines (9539 loc) · 362 KB
/
api.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package forecastservice
import (
"fmt"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awsutil"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/private/protocol"
"github.com/aws/aws-sdk-go/private/protocol/jsonrpc"
)
const opCreateDataset = "CreateDataset"
// CreateDatasetRequest generates a "aws/request.Request" representing the
// client's request for the CreateDataset operation. The "output" return
// value will be populated with the request's response once the request completes
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See CreateDataset for more information on using the CreateDataset
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the CreateDatasetRequest method.
// req, resp := client.CreateDatasetRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/forecast-2018-06-26/CreateDataset
func (c *ForecastService) CreateDatasetRequest(input *CreateDatasetInput) (req *request.Request, output *CreateDatasetOutput) {
op := &request.Operation{
Name: opCreateDataset,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &CreateDatasetInput{}
}
output = &CreateDatasetOutput{}
req = c.newRequest(op, input, output)
return
}
// CreateDataset API operation for Amazon Forecast Service.
//
// Creates an Amazon Forecast dataset. The information about the dataset that
// you provide helps Forecast understand how to consume the data for model training.
// This includes the following:
//
// * DataFrequency - How frequently your historical time-series data is collected.
//
// * Domain and DatasetType - Each dataset has an associated dataset domain
// and a type within the domain. Amazon Forecast provides a list of predefined
// domains and types within each domain. For each unique dataset domain and
// type within the domain, Amazon Forecast requires your data to include
// a minimum set of predefined fields.
//
// * Schema - A schema specifies the fields in the dataset, including the
// field name and data type.
//
// After creating a dataset, you import your training data into it and add the
// dataset to a dataset group. You use the dataset group to create a predictor.
// For more information, see howitworks-datasets-groups.
//
// To get a list of all your datasets, use the ListDatasets operation.
//
// For example Forecast datasets, see the Amazon Forecast Sample GitHub repository
// (https://github.com/aws-samples/amazon-forecast-samples).
//
// The Status of a dataset must be ACTIVE before you can import training data.
// Use the DescribeDataset operation to get the status.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon Forecast Service's
// API operation CreateDataset for usage and error information.
//
// Returned Error Types:
// * InvalidInputException
// We can't process the request because it includes an invalid value or a value
// that exceeds the valid range.
//
// * ResourceAlreadyExistsException
// There is already a resource with this name. Try again with a different name.
//
// * LimitExceededException
// The limit on the number of resources per account has been exceeded.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/forecast-2018-06-26/CreateDataset
func (c *ForecastService) CreateDataset(input *CreateDatasetInput) (*CreateDatasetOutput, error) {
req, out := c.CreateDatasetRequest(input)
return out, req.Send()
}
// CreateDatasetWithContext is the same as CreateDataset with the addition of
// the ability to pass a context and additional request options.
//
// See CreateDataset for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *ForecastService) CreateDatasetWithContext(ctx aws.Context, input *CreateDatasetInput, opts ...request.Option) (*CreateDatasetOutput, error) {
req, out := c.CreateDatasetRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opCreateDatasetGroup = "CreateDatasetGroup"
// CreateDatasetGroupRequest generates a "aws/request.Request" representing the
// client's request for the CreateDatasetGroup operation. The "output" return
// value will be populated with the request's response once the request completes
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See CreateDatasetGroup for more information on using the CreateDatasetGroup
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the CreateDatasetGroupRequest method.
// req, resp := client.CreateDatasetGroupRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/forecast-2018-06-26/CreateDatasetGroup
func (c *ForecastService) CreateDatasetGroupRequest(input *CreateDatasetGroupInput) (req *request.Request, output *CreateDatasetGroupOutput) {
op := &request.Operation{
Name: opCreateDatasetGroup,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &CreateDatasetGroupInput{}
}
output = &CreateDatasetGroupOutput{}
req = c.newRequest(op, input, output)
return
}
// CreateDatasetGroup API operation for Amazon Forecast Service.
//
// Creates a dataset group, which holds a collection of related datasets. You
// can add datasets to the dataset group when you create the dataset group,
// or later by using the UpdateDatasetGroup operation.
//
// After creating a dataset group and adding datasets, you use the dataset group
// when you create a predictor. For more information, see howitworks-datasets-groups.
//
// To get a list of all your datasets groups, use the ListDatasetGroups operation.
//
// The Status of a dataset group must be ACTIVE before you can use the dataset
// group to create a predictor. To get the status, use the DescribeDatasetGroup
// operation.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon Forecast Service's
// API operation CreateDatasetGroup for usage and error information.
//
// Returned Error Types:
// * InvalidInputException
// We can't process the request because it includes an invalid value or a value
// that exceeds the valid range.
//
// * ResourceAlreadyExistsException
// There is already a resource with this name. Try again with a different name.
//
// * ResourceNotFoundException
// We can't find a resource with that Amazon Resource Name (ARN). Check the
// ARN and try again.
//
// * ResourceInUseException
// The specified resource is in use.
//
// * LimitExceededException
// The limit on the number of resources per account has been exceeded.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/forecast-2018-06-26/CreateDatasetGroup
func (c *ForecastService) CreateDatasetGroup(input *CreateDatasetGroupInput) (*CreateDatasetGroupOutput, error) {
req, out := c.CreateDatasetGroupRequest(input)
return out, req.Send()
}
// CreateDatasetGroupWithContext is the same as CreateDatasetGroup with the addition of
// the ability to pass a context and additional request options.
//
// See CreateDatasetGroup for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *ForecastService) CreateDatasetGroupWithContext(ctx aws.Context, input *CreateDatasetGroupInput, opts ...request.Option) (*CreateDatasetGroupOutput, error) {
req, out := c.CreateDatasetGroupRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opCreateDatasetImportJob = "CreateDatasetImportJob"
// CreateDatasetImportJobRequest generates a "aws/request.Request" representing the
// client's request for the CreateDatasetImportJob operation. The "output" return
// value will be populated with the request's response once the request completes
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See CreateDatasetImportJob for more information on using the CreateDatasetImportJob
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the CreateDatasetImportJobRequest method.
// req, resp := client.CreateDatasetImportJobRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/forecast-2018-06-26/CreateDatasetImportJob
func (c *ForecastService) CreateDatasetImportJobRequest(input *CreateDatasetImportJobInput) (req *request.Request, output *CreateDatasetImportJobOutput) {
op := &request.Operation{
Name: opCreateDatasetImportJob,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &CreateDatasetImportJobInput{}
}
output = &CreateDatasetImportJobOutput{}
req = c.newRequest(op, input, output)
return
}
// CreateDatasetImportJob API operation for Amazon Forecast Service.
//
// Imports your training data to an Amazon Forecast dataset. You provide the
// location of your training data in an Amazon Simple Storage Service (Amazon
// S3) bucket and the Amazon Resource Name (ARN) of the dataset that you want
// to import the data to.
//
// You must specify a DataSource object that includes an AWS Identity and Access
// Management (IAM) role that Amazon Forecast can assume to access the data,
// as Amazon Forecast makes a copy of your data and processes it in an internal
// AWS system. For more information, see aws-forecast-iam-roles.
//
// The training data must be in CSV format. The delimiter must be a comma (,).
//
// You can specify the path to a specific CSV file, the S3 bucket, or to a folder
// in the S3 bucket. For the latter two cases, Amazon Forecast imports all files
// up to the limit of 10,000 files.
//
// Because dataset imports are not aggregated, your most recent dataset import
// is the one that is used when training a predictor or generating a forecast.
// Make sure that your most recent dataset import contains all of the data you
// want to model off of, and not just the new data collected since the previous
// import.
//
// To get a list of all your dataset import jobs, filtered by specified criteria,
// use the ListDatasetImportJobs operation.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon Forecast Service's
// API operation CreateDatasetImportJob for usage and error information.
//
// Returned Error Types:
// * InvalidInputException
// We can't process the request because it includes an invalid value or a value
// that exceeds the valid range.
//
// * ResourceAlreadyExistsException
// There is already a resource with this name. Try again with a different name.
//
// * ResourceNotFoundException
// We can't find a resource with that Amazon Resource Name (ARN). Check the
// ARN and try again.
//
// * ResourceInUseException
// The specified resource is in use.
//
// * LimitExceededException
// The limit on the number of resources per account has been exceeded.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/forecast-2018-06-26/CreateDatasetImportJob
func (c *ForecastService) CreateDatasetImportJob(input *CreateDatasetImportJobInput) (*CreateDatasetImportJobOutput, error) {
req, out := c.CreateDatasetImportJobRequest(input)
return out, req.Send()
}
// CreateDatasetImportJobWithContext is the same as CreateDatasetImportJob with the addition of
// the ability to pass a context and additional request options.
//
// See CreateDatasetImportJob for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *ForecastService) CreateDatasetImportJobWithContext(ctx aws.Context, input *CreateDatasetImportJobInput, opts ...request.Option) (*CreateDatasetImportJobOutput, error) {
req, out := c.CreateDatasetImportJobRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opCreateForecast = "CreateForecast"
// CreateForecastRequest generates a "aws/request.Request" representing the
// client's request for the CreateForecast operation. The "output" return
// value will be populated with the request's response once the request completes
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See CreateForecast for more information on using the CreateForecast
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the CreateForecastRequest method.
// req, resp := client.CreateForecastRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/forecast-2018-06-26/CreateForecast
func (c *ForecastService) CreateForecastRequest(input *CreateForecastInput) (req *request.Request, output *CreateForecastOutput) {
op := &request.Operation{
Name: opCreateForecast,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &CreateForecastInput{}
}
output = &CreateForecastOutput{}
req = c.newRequest(op, input, output)
return
}
// CreateForecast API operation for Amazon Forecast Service.
//
// Creates a forecast for each item in the TARGET_TIME_SERIES dataset that was
// used to train the predictor. This is known as inference. To retrieve the
// forecast for a single item at low latency, use the operation. To export the
// complete forecast into your Amazon Simple Storage Service (Amazon S3) bucket,
// use the CreateForecastExportJob operation.
//
// The range of the forecast is determined by the ForecastHorizon value, which
// you specify in the CreatePredictor request. When you query a forecast, you
// can request a specific date range within the forecast.
//
// To get a list of all your forecasts, use the ListForecasts operation.
//
// The forecasts generated by Amazon Forecast are in the same time zone as the
// dataset that was used to create the predictor.
//
// For more information, see howitworks-forecast.
//
// The Status of the forecast must be ACTIVE before you can query or export
// the forecast. Use the DescribeForecast operation to get the status.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon Forecast Service's
// API operation CreateForecast for usage and error information.
//
// Returned Error Types:
// * InvalidInputException
// We can't process the request because it includes an invalid value or a value
// that exceeds the valid range.
//
// * ResourceAlreadyExistsException
// There is already a resource with this name. Try again with a different name.
//
// * ResourceNotFoundException
// We can't find a resource with that Amazon Resource Name (ARN). Check the
// ARN and try again.
//
// * ResourceInUseException
// The specified resource is in use.
//
// * LimitExceededException
// The limit on the number of resources per account has been exceeded.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/forecast-2018-06-26/CreateForecast
func (c *ForecastService) CreateForecast(input *CreateForecastInput) (*CreateForecastOutput, error) {
req, out := c.CreateForecastRequest(input)
return out, req.Send()
}
// CreateForecastWithContext is the same as CreateForecast with the addition of
// the ability to pass a context and additional request options.
//
// See CreateForecast for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *ForecastService) CreateForecastWithContext(ctx aws.Context, input *CreateForecastInput, opts ...request.Option) (*CreateForecastOutput, error) {
req, out := c.CreateForecastRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opCreateForecastExportJob = "CreateForecastExportJob"
// CreateForecastExportJobRequest generates a "aws/request.Request" representing the
// client's request for the CreateForecastExportJob operation. The "output" return
// value will be populated with the request's response once the request completes
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See CreateForecastExportJob for more information on using the CreateForecastExportJob
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the CreateForecastExportJobRequest method.
// req, resp := client.CreateForecastExportJobRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/forecast-2018-06-26/CreateForecastExportJob
func (c *ForecastService) CreateForecastExportJobRequest(input *CreateForecastExportJobInput) (req *request.Request, output *CreateForecastExportJobOutput) {
op := &request.Operation{
Name: opCreateForecastExportJob,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &CreateForecastExportJobInput{}
}
output = &CreateForecastExportJobOutput{}
req = c.newRequest(op, input, output)
return
}
// CreateForecastExportJob API operation for Amazon Forecast Service.
//
// Exports a forecast created by the CreateForecast operation to your Amazon
// Simple Storage Service (Amazon S3) bucket. The forecast file name will match
// the following conventions:
//
// <ForecastExportJobName>_<ExportTimestamp>_<PartNumber>
//
// where the <ExportTimestamp> component is in Java SimpleDateFormat (yyyy-MM-ddTHH-mm-ssZ).
//
// You must specify a DataDestination object that includes an AWS Identity and
// Access Management (IAM) role that Amazon Forecast can assume to access the
// Amazon S3 bucket. For more information, see aws-forecast-iam-roles.
//
// For more information, see howitworks-forecast.
//
// To get a list of all your forecast export jobs, use the ListForecastExportJobs
// operation.
//
// The Status of the forecast export job must be ACTIVE before you can access
// the forecast in your Amazon S3 bucket. To get the status, use the DescribeForecastExportJob
// operation.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon Forecast Service's
// API operation CreateForecastExportJob for usage and error information.
//
// Returned Error Types:
// * InvalidInputException
// We can't process the request because it includes an invalid value or a value
// that exceeds the valid range.
//
// * ResourceAlreadyExistsException
// There is already a resource with this name. Try again with a different name.
//
// * ResourceNotFoundException
// We can't find a resource with that Amazon Resource Name (ARN). Check the
// ARN and try again.
//
// * ResourceInUseException
// The specified resource is in use.
//
// * LimitExceededException
// The limit on the number of resources per account has been exceeded.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/forecast-2018-06-26/CreateForecastExportJob
func (c *ForecastService) CreateForecastExportJob(input *CreateForecastExportJobInput) (*CreateForecastExportJobOutput, error) {
req, out := c.CreateForecastExportJobRequest(input)
return out, req.Send()
}
// CreateForecastExportJobWithContext is the same as CreateForecastExportJob with the addition of
// the ability to pass a context and additional request options.
//
// See CreateForecastExportJob for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *ForecastService) CreateForecastExportJobWithContext(ctx aws.Context, input *CreateForecastExportJobInput, opts ...request.Option) (*CreateForecastExportJobOutput, error) {
req, out := c.CreateForecastExportJobRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opCreatePredictor = "CreatePredictor"
// CreatePredictorRequest generates a "aws/request.Request" representing the
// client's request for the CreatePredictor operation. The "output" return
// value will be populated with the request's response once the request completes
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See CreatePredictor for more information on using the CreatePredictor
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the CreatePredictorRequest method.
// req, resp := client.CreatePredictorRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/forecast-2018-06-26/CreatePredictor
func (c *ForecastService) CreatePredictorRequest(input *CreatePredictorInput) (req *request.Request, output *CreatePredictorOutput) {
op := &request.Operation{
Name: opCreatePredictor,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &CreatePredictorInput{}
}
output = &CreatePredictorOutput{}
req = c.newRequest(op, input, output)
return
}
// CreatePredictor API operation for Amazon Forecast Service.
//
// Creates an Amazon Forecast predictor.
//
// In the request, provide a dataset group and either specify an algorithm or
// let Amazon Forecast choose an algorithm for you using AutoML. If you specify
// an algorithm, you also can override algorithm-specific hyperparameters.
//
// Amazon Forecast uses the algorithm to train a predictor using the latest
// version of the datasets in the specified dataset group. You can then generate
// a forecast using the CreateForecast operation.
//
// To see the evaluation metrics, use the GetAccuracyMetrics operation.
//
// You can specify a featurization configuration to fill and aggregate the data
// fields in the TARGET_TIME_SERIES dataset to improve model training. For more
// information, see FeaturizationConfig.
//
// For RELATED_TIME_SERIES datasets, CreatePredictor verifies that the DataFrequency
// specified when the dataset was created matches the ForecastFrequency. TARGET_TIME_SERIES
// datasets don't have this restriction. Amazon Forecast also verifies the delimiter
// and timestamp format. For more information, see howitworks-datasets-groups.
//
// By default, predictors are trained and evaluated at the 0.1 (P10), 0.5 (P50),
// and 0.9 (P90) quantiles. You can choose custom forecast types to train and
// evaluate your predictor by setting the ForecastTypes.
//
// AutoML
//
// If you want Amazon Forecast to evaluate each algorithm and choose the one
// that minimizes the objective function, set PerformAutoML to true. The objective
// function is defined as the mean of the weighted losses over the forecast
// types. By default, these are the p10, p50, and p90 quantile losses. For more
// information, see EvaluationResult.
//
// When AutoML is enabled, the following properties are disallowed:
//
// * AlgorithmArn
//
// * HPOConfig
//
// * PerformHPO
//
// * TrainingParameters
//
// To get a list of all of your predictors, use the ListPredictors operation.
//
// Before you can use the predictor to create a forecast, the Status of the
// predictor must be ACTIVE, signifying that training has completed. To get
// the status, use the DescribePredictor operation.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon Forecast Service's
// API operation CreatePredictor for usage and error information.
//
// Returned Error Types:
// * InvalidInputException
// We can't process the request because it includes an invalid value or a value
// that exceeds the valid range.
//
// * ResourceAlreadyExistsException
// There is already a resource with this name. Try again with a different name.
//
// * ResourceNotFoundException
// We can't find a resource with that Amazon Resource Name (ARN). Check the
// ARN and try again.
//
// * ResourceInUseException
// The specified resource is in use.
//
// * LimitExceededException
// The limit on the number of resources per account has been exceeded.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/forecast-2018-06-26/CreatePredictor
func (c *ForecastService) CreatePredictor(input *CreatePredictorInput) (*CreatePredictorOutput, error) {
req, out := c.CreatePredictorRequest(input)
return out, req.Send()
}
// CreatePredictorWithContext is the same as CreatePredictor with the addition of
// the ability to pass a context and additional request options.
//
// See CreatePredictor for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *ForecastService) CreatePredictorWithContext(ctx aws.Context, input *CreatePredictorInput, opts ...request.Option) (*CreatePredictorOutput, error) {
req, out := c.CreatePredictorRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opCreatePredictorBacktestExportJob = "CreatePredictorBacktestExportJob"
// CreatePredictorBacktestExportJobRequest generates a "aws/request.Request" representing the
// client's request for the CreatePredictorBacktestExportJob operation. The "output" return
// value will be populated with the request's response once the request completes
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See CreatePredictorBacktestExportJob for more information on using the CreatePredictorBacktestExportJob
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the CreatePredictorBacktestExportJobRequest method.
// req, resp := client.CreatePredictorBacktestExportJobRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/forecast-2018-06-26/CreatePredictorBacktestExportJob
func (c *ForecastService) CreatePredictorBacktestExportJobRequest(input *CreatePredictorBacktestExportJobInput) (req *request.Request, output *CreatePredictorBacktestExportJobOutput) {
op := &request.Operation{
Name: opCreatePredictorBacktestExportJob,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &CreatePredictorBacktestExportJobInput{}
}
output = &CreatePredictorBacktestExportJobOutput{}
req = c.newRequest(op, input, output)
return
}
// CreatePredictorBacktestExportJob API operation for Amazon Forecast Service.
//
// Exports backtest forecasts and accuracy metrics generated by the CreatePredictor
// operation. Two folders containing CSV files are exported to your specified
// S3 bucket.
//
// The export file names will match the following conventions:
//
// <ExportJobName>_<ExportTimestamp>_<PartNumber>.csv
//
// The <ExportTimestamp> component is in Java SimpleDate format (yyyy-MM-ddTHH-mm-ssZ).
//
// You must specify a DataDestination object that includes an Amazon S3 bucket
// and an AWS Identity and Access Management (IAM) role that Amazon Forecast
// can assume to access the Amazon S3 bucket. For more information, see aws-forecast-iam-roles.
//
// The Status of the export job must be ACTIVE before you can access the export
// in your Amazon S3 bucket. To get the status, use the DescribePredictorBacktestExportJob
// operation.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon Forecast Service's
// API operation CreatePredictorBacktestExportJob for usage and error information.
//
// Returned Error Types:
// * InvalidInputException
// We can't process the request because it includes an invalid value or a value
// that exceeds the valid range.
//
// * ResourceAlreadyExistsException
// There is already a resource with this name. Try again with a different name.
//
// * ResourceNotFoundException
// We can't find a resource with that Amazon Resource Name (ARN). Check the
// ARN and try again.
//
// * ResourceInUseException
// The specified resource is in use.
//
// * LimitExceededException
// The limit on the number of resources per account has been exceeded.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/forecast-2018-06-26/CreatePredictorBacktestExportJob
func (c *ForecastService) CreatePredictorBacktestExportJob(input *CreatePredictorBacktestExportJobInput) (*CreatePredictorBacktestExportJobOutput, error) {
req, out := c.CreatePredictorBacktestExportJobRequest(input)
return out, req.Send()
}
// CreatePredictorBacktestExportJobWithContext is the same as CreatePredictorBacktestExportJob with the addition of
// the ability to pass a context and additional request options.
//
// See CreatePredictorBacktestExportJob for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *ForecastService) CreatePredictorBacktestExportJobWithContext(ctx aws.Context, input *CreatePredictorBacktestExportJobInput, opts ...request.Option) (*CreatePredictorBacktestExportJobOutput, error) {
req, out := c.CreatePredictorBacktestExportJobRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opDeleteDataset = "DeleteDataset"
// DeleteDatasetRequest generates a "aws/request.Request" representing the
// client's request for the DeleteDataset operation. The "output" return
// value will be populated with the request's response once the request completes
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See DeleteDataset for more information on using the DeleteDataset
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the DeleteDatasetRequest method.
// req, resp := client.DeleteDatasetRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/forecast-2018-06-26/DeleteDataset
func (c *ForecastService) DeleteDatasetRequest(input *DeleteDatasetInput) (req *request.Request, output *DeleteDatasetOutput) {
op := &request.Operation{
Name: opDeleteDataset,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DeleteDatasetInput{}
}
output = &DeleteDatasetOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
// DeleteDataset API operation for Amazon Forecast Service.
//
// Deletes an Amazon Forecast dataset that was created using the CreateDataset
// operation. You can only delete datasets that have a status of ACTIVE or CREATE_FAILED.
// To get the status use the DescribeDataset operation.
//
// Forecast does not automatically update any dataset groups that contain the
// deleted dataset. In order to update the dataset group, use the operation,
// omitting the deleted dataset's ARN.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon Forecast Service's
// API operation DeleteDataset for usage and error information.
//
// Returned Error Types:
// * InvalidInputException
// We can't process the request because it includes an invalid value or a value
// that exceeds the valid range.
//
// * ResourceNotFoundException
// We can't find a resource with that Amazon Resource Name (ARN). Check the
// ARN and try again.
//
// * ResourceInUseException
// The specified resource is in use.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/forecast-2018-06-26/DeleteDataset
func (c *ForecastService) DeleteDataset(input *DeleteDatasetInput) (*DeleteDatasetOutput, error) {
req, out := c.DeleteDatasetRequest(input)
return out, req.Send()
}
// DeleteDatasetWithContext is the same as DeleteDataset with the addition of
// the ability to pass a context and additional request options.
//
// See DeleteDataset for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *ForecastService) DeleteDatasetWithContext(ctx aws.Context, input *DeleteDatasetInput, opts ...request.Option) (*DeleteDatasetOutput, error) {
req, out := c.DeleteDatasetRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opDeleteDatasetGroup = "DeleteDatasetGroup"
// DeleteDatasetGroupRequest generates a "aws/request.Request" representing the
// client's request for the DeleteDatasetGroup operation. The "output" return
// value will be populated with the request's response once the request completes
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See DeleteDatasetGroup for more information on using the DeleteDatasetGroup
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the DeleteDatasetGroupRequest method.
// req, resp := client.DeleteDatasetGroupRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/forecast-2018-06-26/DeleteDatasetGroup
func (c *ForecastService) DeleteDatasetGroupRequest(input *DeleteDatasetGroupInput) (req *request.Request, output *DeleteDatasetGroupOutput) {
op := &request.Operation{
Name: opDeleteDatasetGroup,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DeleteDatasetGroupInput{}
}
output = &DeleteDatasetGroupOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
// DeleteDatasetGroup API operation for Amazon Forecast Service.
//
// Deletes a dataset group created using the CreateDatasetGroup operation. You
// can only delete dataset groups that have a status of ACTIVE, CREATE_FAILED,
// or UPDATE_FAILED. To get the status, use the DescribeDatasetGroup operation.
//
// This operation deletes only the dataset group, not the datasets in the group.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon Forecast Service's
// API operation DeleteDatasetGroup for usage and error information.
//
// Returned Error Types:
// * InvalidInputException
// We can't process the request because it includes an invalid value or a value
// that exceeds the valid range.
//
// * ResourceNotFoundException
// We can't find a resource with that Amazon Resource Name (ARN). Check the
// ARN and try again.
//
// * ResourceInUseException
// The specified resource is in use.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/forecast-2018-06-26/DeleteDatasetGroup
func (c *ForecastService) DeleteDatasetGroup(input *DeleteDatasetGroupInput) (*DeleteDatasetGroupOutput, error) {
req, out := c.DeleteDatasetGroupRequest(input)
return out, req.Send()
}
// DeleteDatasetGroupWithContext is the same as DeleteDatasetGroup with the addition of
// the ability to pass a context and additional request options.
//
// See DeleteDatasetGroup for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *ForecastService) DeleteDatasetGroupWithContext(ctx aws.Context, input *DeleteDatasetGroupInput, opts ...request.Option) (*DeleteDatasetGroupOutput, error) {
req, out := c.DeleteDatasetGroupRequest(input)
req.SetContext(ctx)