forked from aws/aws-sdk-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
api.go
10286 lines (8954 loc) · 350 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 rekognition
import (
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awsutil"
"github.com/aws/aws-sdk-go/aws/request"
)
const opCompareFaces = "CompareFaces"
// CompareFacesRequest generates a "aws/request.Request" representing the
// client's request for the CompareFaces operation. The "output" return
// value will be populated with the request's response once the request complets
// successfuly.
//
// 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 CompareFaces for more information on using the CompareFaces
// 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 CompareFacesRequest method.
// req, resp := client.CompareFacesRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
func (c *Rekognition) CompareFacesRequest(input *CompareFacesInput) (req *request.Request, output *CompareFacesOutput) {
op := &request.Operation{
Name: opCompareFaces,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &CompareFacesInput{}
}
output = &CompareFacesOutput{}
req = c.newRequest(op, input, output)
return
}
// CompareFaces API operation for Amazon Rekognition.
//
// Compares a face in the source input image with each of the 100 largest faces
// detected in the target input image.
//
// If the source image contains multiple faces, the service detects the largest
// face and compares it with each face detected in the target image.
//
// You pass the input and target images either as base64-encoded image bytes
// or as a references to images in an Amazon S3 bucket. If you use the Amazon
// CLI to call Amazon Rekognition operations, passing image bytes is not supported.
// The image must be either a PNG or JPEG formatted file.
//
// In response, the operation returns an array of face matches ordered by similarity
// score in descending order. For each face match, the response provides a bounding
// box of the face, facial landmarks, pose details (pitch, role, and yaw), quality
// (brightness and sharpness), and confidence value (indicating the level of
// confidence that the bounding box contains a face). The response also provides
// a similarity score, which indicates how closely the faces match.
//
// By default, only faces with a similarity score of greater than or equal to
// 80% are returned in the response. You can change this value by specifying
// the SimilarityThreshold parameter.
//
// CompareFaces also returns an array of faces that don't match the source image.
// For each face, it returns a bounding box, confidence value, landmarks, pose
// details, and quality. The response also returns information about the face
// in the source image, including the bounding box of the face and confidence
// value.
//
// If the image doesn't contain Exif metadata, CompareFaces returns orientation
// information for the source and target images. Use these values to display
// the images with the correct image orientation.
//
// If no faces are detected in the source or target images, CompareFaces returns
// an InvalidParameterException error.
//
// This is a stateless API operation. That is, data returned by this operation
// doesn't persist.
//
// For an example, see faces-compare-images.
//
// This operation requires permissions to perform the rekognition:CompareFaces
// action.
//
// 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 Rekognition's
// API operation CompareFaces for usage and error information.
//
// Returned Error Codes:
// * ErrCodeInvalidParameterException "InvalidParameterException"
// Input parameter violated a constraint. Validate your parameter before calling
// the API operation again.
//
// * ErrCodeInvalidS3ObjectException "InvalidS3ObjectException"
// Amazon Rekognition is unable to access the S3 object specified in the request.
//
// * ErrCodeImageTooLargeException "ImageTooLargeException"
// The input image size exceeds the allowed limit. For more information, see
// limits.
//
// * ErrCodeAccessDeniedException "AccessDeniedException"
// You are not authorized to perform the action.
//
// * ErrCodeInternalServerError "InternalServerError"
// Amazon Rekognition experienced a service issue. Try your call again.
//
// * ErrCodeThrottlingException "ThrottlingException"
// Amazon Rekognition is temporarily unable to process the request. Try your
// call again.
//
// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException"
// The number of requests exceeded your throughput limit. If you want to increase
// this limit, contact Amazon Rekognition.
//
// * ErrCodeInvalidImageFormatException "InvalidImageFormatException"
// The provided image format is not supported.
//
func (c *Rekognition) CompareFaces(input *CompareFacesInput) (*CompareFacesOutput, error) {
req, out := c.CompareFacesRequest(input)
return out, req.Send()
}
// CompareFacesWithContext is the same as CompareFaces with the addition of
// the ability to pass a context and additional request options.
//
// See CompareFaces 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 *Rekognition) CompareFacesWithContext(ctx aws.Context, input *CompareFacesInput, opts ...request.Option) (*CompareFacesOutput, error) {
req, out := c.CompareFacesRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opCreateCollection = "CreateCollection"
// CreateCollectionRequest generates a "aws/request.Request" representing the
// client's request for the CreateCollection operation. The "output" return
// value will be populated with the request's response once the request complets
// successfuly.
//
// 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 CreateCollection for more information on using the CreateCollection
// 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 CreateCollectionRequest method.
// req, resp := client.CreateCollectionRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
func (c *Rekognition) CreateCollectionRequest(input *CreateCollectionInput) (req *request.Request, output *CreateCollectionOutput) {
op := &request.Operation{
Name: opCreateCollection,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &CreateCollectionInput{}
}
output = &CreateCollectionOutput{}
req = c.newRequest(op, input, output)
return
}
// CreateCollection API operation for Amazon Rekognition.
//
// Creates a collection in an AWS Region. You can add faces to the collection
// using the operation.
//
// For example, you might create collections, one for each of your application
// users. A user can then index faces using the IndexFaces operation and persist
// results in a specific collection. Then, a user can search the collection
// for faces in the user-specific container.
//
// Collection names are case-sensitive.
//
// This operation requires permissions to perform the rekognition:CreateCollection
// action.
//
// 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 Rekognition's
// API operation CreateCollection for usage and error information.
//
// Returned Error Codes:
// * ErrCodeInvalidParameterException "InvalidParameterException"
// Input parameter violated a constraint. Validate your parameter before calling
// the API operation again.
//
// * ErrCodeAccessDeniedException "AccessDeniedException"
// You are not authorized to perform the action.
//
// * ErrCodeInternalServerError "InternalServerError"
// Amazon Rekognition experienced a service issue. Try your call again.
//
// * ErrCodeThrottlingException "ThrottlingException"
// Amazon Rekognition is temporarily unable to process the request. Try your
// call again.
//
// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException"
// The number of requests exceeded your throughput limit. If you want to increase
// this limit, contact Amazon Rekognition.
//
// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException"
// A collection with the specified ID already exists.
//
func (c *Rekognition) CreateCollection(input *CreateCollectionInput) (*CreateCollectionOutput, error) {
req, out := c.CreateCollectionRequest(input)
return out, req.Send()
}
// CreateCollectionWithContext is the same as CreateCollection with the addition of
// the ability to pass a context and additional request options.
//
// See CreateCollection 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 *Rekognition) CreateCollectionWithContext(ctx aws.Context, input *CreateCollectionInput, opts ...request.Option) (*CreateCollectionOutput, error) {
req, out := c.CreateCollectionRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opCreateStreamProcessor = "CreateStreamProcessor"
// CreateStreamProcessorRequest generates a "aws/request.Request" representing the
// client's request for the CreateStreamProcessor operation. The "output" return
// value will be populated with the request's response once the request complets
// successfuly.
//
// 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 CreateStreamProcessor for more information on using the CreateStreamProcessor
// 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 CreateStreamProcessorRequest method.
// req, resp := client.CreateStreamProcessorRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
func (c *Rekognition) CreateStreamProcessorRequest(input *CreateStreamProcessorInput) (req *request.Request, output *CreateStreamProcessorOutput) {
op := &request.Operation{
Name: opCreateStreamProcessor,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &CreateStreamProcessorInput{}
}
output = &CreateStreamProcessorOutput{}
req = c.newRequest(op, input, output)
return
}
// CreateStreamProcessor API operation for Amazon Rekognition.
//
// Creates an Amazon Rekognition stream processor that you can use to detect
// and recognize faces in a streaming video.
//
// Rekognition Video is a consumer of live video from Amazon Kinesis Video Streams.
// Rekognition Video sends analysis results to Amazon Kinesis Data Streams.
//
// You provide as input a Kinesis video stream (Input) and a Kinesis data stream
// (Output) stream. You also specify the face recognition criteria in Settings.
// For example, the collection containing faces that you want to recognize.
// Use Name to assign an identifier for the stream processor. You use Name to
// manage the stream processor. For example, you can start processing the source
// video by calling with the Name field.
//
// After you have finished analyzing a streaming video, use to stop processing.
// You can delete the stream processor by calling .
//
// 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 Rekognition's
// API operation CreateStreamProcessor for usage and error information.
//
// Returned Error Codes:
// * ErrCodeAccessDeniedException "AccessDeniedException"
// You are not authorized to perform the action.
//
// * ErrCodeInternalServerError "InternalServerError"
// Amazon Rekognition experienced a service issue. Try your call again.
//
// * ErrCodeThrottlingException "ThrottlingException"
// Amazon Rekognition is temporarily unable to process the request. Try your
// call again.
//
// * ErrCodeInvalidParameterException "InvalidParameterException"
// Input parameter violated a constraint. Validate your parameter before calling
// the API operation again.
//
// * ErrCodeLimitExceededException "LimitExceededException"
//
// * ErrCodeResourceInUseException "ResourceInUseException"
//
// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException"
// The number of requests exceeded your throughput limit. If you want to increase
// this limit, contact Amazon Rekognition.
//
func (c *Rekognition) CreateStreamProcessor(input *CreateStreamProcessorInput) (*CreateStreamProcessorOutput, error) {
req, out := c.CreateStreamProcessorRequest(input)
return out, req.Send()
}
// CreateStreamProcessorWithContext is the same as CreateStreamProcessor with the addition of
// the ability to pass a context and additional request options.
//
// See CreateStreamProcessor 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 *Rekognition) CreateStreamProcessorWithContext(ctx aws.Context, input *CreateStreamProcessorInput, opts ...request.Option) (*CreateStreamProcessorOutput, error) {
req, out := c.CreateStreamProcessorRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opDeleteCollection = "DeleteCollection"
// DeleteCollectionRequest generates a "aws/request.Request" representing the
// client's request for the DeleteCollection operation. The "output" return
// value will be populated with the request's response once the request complets
// successfuly.
//
// 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 DeleteCollection for more information on using the DeleteCollection
// 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 DeleteCollectionRequest method.
// req, resp := client.DeleteCollectionRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
func (c *Rekognition) DeleteCollectionRequest(input *DeleteCollectionInput) (req *request.Request, output *DeleteCollectionOutput) {
op := &request.Operation{
Name: opDeleteCollection,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DeleteCollectionInput{}
}
output = &DeleteCollectionOutput{}
req = c.newRequest(op, input, output)
return
}
// DeleteCollection API operation for Amazon Rekognition.
//
// Deletes the specified collection. Note that this operation removes all faces
// in the collection. For an example, see delete-collection-procedure.
//
// This operation requires permissions to perform the rekognition:DeleteCollection
// action.
//
// 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 Rekognition's
// API operation DeleteCollection for usage and error information.
//
// Returned Error Codes:
// * ErrCodeInvalidParameterException "InvalidParameterException"
// Input parameter violated a constraint. Validate your parameter before calling
// the API operation again.
//
// * ErrCodeAccessDeniedException "AccessDeniedException"
// You are not authorized to perform the action.
//
// * ErrCodeInternalServerError "InternalServerError"
// Amazon Rekognition experienced a service issue. Try your call again.
//
// * ErrCodeThrottlingException "ThrottlingException"
// Amazon Rekognition is temporarily unable to process the request. Try your
// call again.
//
// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException"
// The number of requests exceeded your throughput limit. If you want to increase
// this limit, contact Amazon Rekognition.
//
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
// The collection specified in the request cannot be found.
//
func (c *Rekognition) DeleteCollection(input *DeleteCollectionInput) (*DeleteCollectionOutput, error) {
req, out := c.DeleteCollectionRequest(input)
return out, req.Send()
}
// DeleteCollectionWithContext is the same as DeleteCollection with the addition of
// the ability to pass a context and additional request options.
//
// See DeleteCollection 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 *Rekognition) DeleteCollectionWithContext(ctx aws.Context, input *DeleteCollectionInput, opts ...request.Option) (*DeleteCollectionOutput, error) {
req, out := c.DeleteCollectionRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opDeleteFaces = "DeleteFaces"
// DeleteFacesRequest generates a "aws/request.Request" representing the
// client's request for the DeleteFaces operation. The "output" return
// value will be populated with the request's response once the request complets
// successfuly.
//
// 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 DeleteFaces for more information on using the DeleteFaces
// 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 DeleteFacesRequest method.
// req, resp := client.DeleteFacesRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
func (c *Rekognition) DeleteFacesRequest(input *DeleteFacesInput) (req *request.Request, output *DeleteFacesOutput) {
op := &request.Operation{
Name: opDeleteFaces,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DeleteFacesInput{}
}
output = &DeleteFacesOutput{}
req = c.newRequest(op, input, output)
return
}
// DeleteFaces API operation for Amazon Rekognition.
//
// Deletes faces from a collection. You specify a collection ID and an array
// of face IDs to remove from the collection.
//
// This operation requires permissions to perform the rekognition:DeleteFaces
// action.
//
// 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 Rekognition's
// API operation DeleteFaces for usage and error information.
//
// Returned Error Codes:
// * ErrCodeInvalidParameterException "InvalidParameterException"
// Input parameter violated a constraint. Validate your parameter before calling
// the API operation again.
//
// * ErrCodeAccessDeniedException "AccessDeniedException"
// You are not authorized to perform the action.
//
// * ErrCodeInternalServerError "InternalServerError"
// Amazon Rekognition experienced a service issue. Try your call again.
//
// * ErrCodeThrottlingException "ThrottlingException"
// Amazon Rekognition is temporarily unable to process the request. Try your
// call again.
//
// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException"
// The number of requests exceeded your throughput limit. If you want to increase
// this limit, contact Amazon Rekognition.
//
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
// The collection specified in the request cannot be found.
//
func (c *Rekognition) DeleteFaces(input *DeleteFacesInput) (*DeleteFacesOutput, error) {
req, out := c.DeleteFacesRequest(input)
return out, req.Send()
}
// DeleteFacesWithContext is the same as DeleteFaces with the addition of
// the ability to pass a context and additional request options.
//
// See DeleteFaces 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 *Rekognition) DeleteFacesWithContext(ctx aws.Context, input *DeleteFacesInput, opts ...request.Option) (*DeleteFacesOutput, error) {
req, out := c.DeleteFacesRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opDeleteStreamProcessor = "DeleteStreamProcessor"
// DeleteStreamProcessorRequest generates a "aws/request.Request" representing the
// client's request for the DeleteStreamProcessor operation. The "output" return
// value will be populated with the request's response once the request complets
// successfuly.
//
// 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 DeleteStreamProcessor for more information on using the DeleteStreamProcessor
// 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 DeleteStreamProcessorRequest method.
// req, resp := client.DeleteStreamProcessorRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
func (c *Rekognition) DeleteStreamProcessorRequest(input *DeleteStreamProcessorInput) (req *request.Request, output *DeleteStreamProcessorOutput) {
op := &request.Operation{
Name: opDeleteStreamProcessor,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DeleteStreamProcessorInput{}
}
output = &DeleteStreamProcessorOutput{}
req = c.newRequest(op, input, output)
return
}
// DeleteStreamProcessor API operation for Amazon Rekognition.
//
// Deletes the stream processor identified by Name. You assign the value for
// Name when you create the stream processor with . You might not be able to
// use the same name for a stream processor for a few seconds after calling
// DeleteStreamProcessor.
//
// 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 Rekognition's
// API operation DeleteStreamProcessor for usage and error information.
//
// Returned Error Codes:
// * ErrCodeAccessDeniedException "AccessDeniedException"
// You are not authorized to perform the action.
//
// * ErrCodeInternalServerError "InternalServerError"
// Amazon Rekognition experienced a service issue. Try your call again.
//
// * ErrCodeThrottlingException "ThrottlingException"
// Amazon Rekognition is temporarily unable to process the request. Try your
// call again.
//
// * ErrCodeInvalidParameterException "InvalidParameterException"
// Input parameter violated a constraint. Validate your parameter before calling
// the API operation again.
//
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
// The collection specified in the request cannot be found.
//
// * ErrCodeResourceInUseException "ResourceInUseException"
//
// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException"
// The number of requests exceeded your throughput limit. If you want to increase
// this limit, contact Amazon Rekognition.
//
func (c *Rekognition) DeleteStreamProcessor(input *DeleteStreamProcessorInput) (*DeleteStreamProcessorOutput, error) {
req, out := c.DeleteStreamProcessorRequest(input)
return out, req.Send()
}
// DeleteStreamProcessorWithContext is the same as DeleteStreamProcessor with the addition of
// the ability to pass a context and additional request options.
//
// See DeleteStreamProcessor 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 *Rekognition) DeleteStreamProcessorWithContext(ctx aws.Context, input *DeleteStreamProcessorInput, opts ...request.Option) (*DeleteStreamProcessorOutput, error) {
req, out := c.DeleteStreamProcessorRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opDescribeStreamProcessor = "DescribeStreamProcessor"
// DescribeStreamProcessorRequest generates a "aws/request.Request" representing the
// client's request for the DescribeStreamProcessor operation. The "output" return
// value will be populated with the request's response once the request complets
// successfuly.
//
// 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 DescribeStreamProcessor for more information on using the DescribeStreamProcessor
// 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 DescribeStreamProcessorRequest method.
// req, resp := client.DescribeStreamProcessorRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
func (c *Rekognition) DescribeStreamProcessorRequest(input *DescribeStreamProcessorInput) (req *request.Request, output *DescribeStreamProcessorOutput) {
op := &request.Operation{
Name: opDescribeStreamProcessor,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DescribeStreamProcessorInput{}
}
output = &DescribeStreamProcessorOutput{}
req = c.newRequest(op, input, output)
return
}
// DescribeStreamProcessor API operation for Amazon Rekognition.
//
// Provides information about a stream processor created by . You can get information
// about the input and output streams, the input parameters for the face recognition
// being performed, and the current status of the stream processor.
//
// 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 Rekognition's
// API operation DescribeStreamProcessor for usage and error information.
//
// Returned Error Codes:
// * ErrCodeAccessDeniedException "AccessDeniedException"
// You are not authorized to perform the action.
//
// * ErrCodeInternalServerError "InternalServerError"
// Amazon Rekognition experienced a service issue. Try your call again.
//
// * ErrCodeThrottlingException "ThrottlingException"
// Amazon Rekognition is temporarily unable to process the request. Try your
// call again.
//
// * ErrCodeInvalidParameterException "InvalidParameterException"
// Input parameter violated a constraint. Validate your parameter before calling
// the API operation again.
//
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
// The collection specified in the request cannot be found.
//
// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException"
// The number of requests exceeded your throughput limit. If you want to increase
// this limit, contact Amazon Rekognition.
//
func (c *Rekognition) DescribeStreamProcessor(input *DescribeStreamProcessorInput) (*DescribeStreamProcessorOutput, error) {
req, out := c.DescribeStreamProcessorRequest(input)
return out, req.Send()
}
// DescribeStreamProcessorWithContext is the same as DescribeStreamProcessor with the addition of
// the ability to pass a context and additional request options.
//
// See DescribeStreamProcessor 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 *Rekognition) DescribeStreamProcessorWithContext(ctx aws.Context, input *DescribeStreamProcessorInput, opts ...request.Option) (*DescribeStreamProcessorOutput, error) {
req, out := c.DescribeStreamProcessorRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opDetectFaces = "DetectFaces"
// DetectFacesRequest generates a "aws/request.Request" representing the
// client's request for the DetectFaces operation. The "output" return
// value will be populated with the request's response once the request complets
// successfuly.
//
// 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 DetectFaces for more information on using the DetectFaces
// 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 DetectFacesRequest method.
// req, resp := client.DetectFacesRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
func (c *Rekognition) DetectFacesRequest(input *DetectFacesInput) (req *request.Request, output *DetectFacesOutput) {
op := &request.Operation{
Name: opDetectFaces,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DetectFacesInput{}
}
output = &DetectFacesOutput{}
req = c.newRequest(op, input, output)
return
}
// DetectFaces API operation for Amazon Rekognition.
//
// Detects faces within an image that is provided as input.
//
// DetectFaces detects the 100 largest faces in the image. For each face detected,
// the operation returns face details including a bounding box of the face,
// a confidence value (that the bounding box contains a face), and a fixed set
// of attributes such as facial landmarks (for example, coordinates of eye and
// mouth), gender, presence of beard, sunglasses, etc.
//
// The face-detection algorithm is most effective on frontal faces. For non-frontal
// or obscured faces, the algorithm may not detect the faces or might detect
// faces with lower confidence.
//
// You pass the input image either as base64-encoded image bytes or as a reference
// to an image in an Amazon S3 bucket. If you use the Amazon CLI to call Amazon
// Rekognition operations, passing image bytes is not supported. The image must
// be either a PNG or JPEG formatted file.
//
// This is a stateless API operation. That is, the operation does not persist
// any data.
//
// For an example, see procedure-detecting-faces-in-images.
//
// This operation requires permissions to perform the rekognition:DetectFaces
// action.
//
// 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 Rekognition's
// API operation DetectFaces for usage and error information.
//
// Returned Error Codes:
// * ErrCodeInvalidS3ObjectException "InvalidS3ObjectException"
// Amazon Rekognition is unable to access the S3 object specified in the request.
//
// * ErrCodeInvalidParameterException "InvalidParameterException"
// Input parameter violated a constraint. Validate your parameter before calling
// the API operation again.
//
// * ErrCodeImageTooLargeException "ImageTooLargeException"
// The input image size exceeds the allowed limit. For more information, see
// limits.
//
// * ErrCodeAccessDeniedException "AccessDeniedException"
// You are not authorized to perform the action.
//
// * ErrCodeInternalServerError "InternalServerError"
// Amazon Rekognition experienced a service issue. Try your call again.
//
// * ErrCodeThrottlingException "ThrottlingException"
// Amazon Rekognition is temporarily unable to process the request. Try your
// call again.
//
// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException"
// The number of requests exceeded your throughput limit. If you want to increase
// this limit, contact Amazon Rekognition.
//
// * ErrCodeInvalidImageFormatException "InvalidImageFormatException"
// The provided image format is not supported.
//
func (c *Rekognition) DetectFaces(input *DetectFacesInput) (*DetectFacesOutput, error) {
req, out := c.DetectFacesRequest(input)
return out, req.Send()
}
// DetectFacesWithContext is the same as DetectFaces with the addition of
// the ability to pass a context and additional request options.
//
// See DetectFaces 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 *Rekognition) DetectFacesWithContext(ctx aws.Context, input *DetectFacesInput, opts ...request.Option) (*DetectFacesOutput, error) {
req, out := c.DetectFacesRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opDetectLabels = "DetectLabels"
// DetectLabelsRequest generates a "aws/request.Request" representing the
// client's request for the DetectLabels operation. The "output" return
// value will be populated with the request's response once the request complets
// successfuly.
//
// 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 DetectLabels for more information on using the DetectLabels
// 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 DetectLabelsRequest method.
// req, resp := client.DetectLabelsRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
func (c *Rekognition) DetectLabelsRequest(input *DetectLabelsInput) (req *request.Request, output *DetectLabelsOutput) {
op := &request.Operation{
Name: opDetectLabels,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DetectLabelsInput{}
}
output = &DetectLabelsOutput{}
req = c.newRequest(op, input, output)
return
}
// DetectLabels API operation for Amazon Rekognition.
//
// Detects instances of real-world entities within an image (JPEG or PNG) provided
// as input. This includes objects like flower, tree, and table; events like
// wedding, graduation, and birthday party; and concepts like landscape, evening,
// and nature. For an example, see images-s3.
//
// DetectLabels does not support the detection of activities. However, activity
// detection is supported for label detection in videos. For more information,
// see .
//
// You pass the input image as base64-encoded image bytes or as a reference
// to an image in an Amazon S3 bucket. If you use the Amazon CLI to call Amazon
// Rekognition operations, passing image bytes is not supported. The image must
// be either a PNG or JPEG formatted file.
//
// For each object, scene, and concept the API returns one or more labels. Each
// label provides the object name, and the level of confidence that the image
// contains the object. For example, suppose the input image has a lighthouse,
// the sea, and a rock. The response will include all three labels, one for
// each object.
//
// {Name: lighthouse, Confidence: 98.4629}
//
// {Name: rock,Confidence: 79.2097}
//
// {Name: sea,Confidence: 75.061}
//
// In the preceding example, the operation returns one label for each of the
// three objects. The operation can also return multiple labels for the same
// object in the image. For example, if the input image shows a flower (for
// example, a tulip), the operation might return the following three labels.
//
// {Name: flower,Confidence: 99.0562}
//
// {Name: plant,Confidence: 99.0562}
//
// {Name: tulip,Confidence: 99.0562}
//
// In this example, the detection algorithm more precisely identifies the flower
// as a tulip.
//
// In response, the API returns an array of labels. In addition, the response
// also includes the orientation correction. Optionally, you can specify MinConfidence
// to control the confidence threshold for the labels returned. The default
// is 50%. You can also add the MaxLabels parameter to limit the number of labels
// returned.
//
// If the object detected is a person, the operation doesn't provide the same
// facial details that the DetectFaces operation provides.
//
// This is a stateless API operation. That is, the operation does not persist
// any data.
//
// This operation requires permissions to perform the rekognition:DetectLabels
// action.
//
// 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 Rekognition's
// API operation DetectLabels for usage and error information.
//
// Returned Error Codes:
// * ErrCodeInvalidS3ObjectException "InvalidS3ObjectException"
// Amazon Rekognition is unable to access the S3 object specified in the request.
//
// * ErrCodeInvalidParameterException "InvalidParameterException"
// Input parameter violated a constraint. Validate your parameter before calling
// the API operation again.
//
// * ErrCodeImageTooLargeException "ImageTooLargeException"
// The input image size exceeds the allowed limit. For more information, see
// limits.
//
// * ErrCodeAccessDeniedException "AccessDeniedException"