forked from aws/aws-sdk-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
api.go
4480 lines (3869 loc) · 146 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 (
"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 face 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.
//
// 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.
//
// This is a stateless API operation. That is, data returned by this operation
// doesn't persist.
//
// For an example, see get-started-exercise-compare-faces.
//
// 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.
//
// For an example, see example1.
//
// 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 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 example1.
//
// 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"
// Collection specified in the request is not 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"
// Collection specified in the request is not 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 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 (JPEG or PNG) that is provided as input.
//
// 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.
//
// This is a stateless API operation. That is, the operation does not persist
// any data.
//
// For an example, see get-started-exercise-detect-faces.
//
// 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 labels 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 get-started-exercise-detect-labels.
//
// 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.
//
// You can provide the input image as an S3 object or as base64-encoded bytes.
// 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"
// 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) DetectLabels(input *DetectLabelsInput) (*DetectLabelsOutput, error) {
req, out := c.DetectLabelsRequest(input)
return out, req.Send()
}
// DetectLabelsWithContext is the same as DetectLabels with the addition of
// the ability to pass a context and additional request options.
//
// See DetectLabels 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) DetectLabelsWithContext(ctx aws.Context, input *DetectLabelsInput, opts ...request.Option) (*DetectLabelsOutput, error) {
req, out := c.DetectLabelsRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opDetectModerationLabels = "DetectModerationLabels"
// DetectModerationLabelsRequest generates a "aws/request.Request" representing the
// client's request for the DetectModerationLabels 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 DetectModerationLabels for more information on using the DetectModerationLabels
// 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 DetectModerationLabelsRequest method.
// req, resp := client.DetectModerationLabelsRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
func (c *Rekognition) DetectModerationLabelsRequest(input *DetectModerationLabelsInput) (req *request.Request, output *DetectModerationLabelsOutput) {
op := &request.Operation{
Name: opDetectModerationLabels,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DetectModerationLabelsInput{}
}
output = &DetectModerationLabelsOutput{}
req = c.newRequest(op, input, output)
return
}
// DetectModerationLabels API operation for Amazon Rekognition.
//
// Detects explicit or suggestive adult content in a specified JPEG or PNG format
// image. Use DetectModerationLabels to moderate images depending on your requirements.
// For example, you might want to filter images that contain nudity, but not
// images containing suggestive content.
//
// To filter images, use the labels returned by DetectModerationLabels to determine
// which types of content are appropriate. For information about moderation
// labels, see image-moderation.
//
// 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 DetectModerationLabels 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) DetectModerationLabels(input *DetectModerationLabelsInput) (*DetectModerationLabelsOutput, error) {
req, out := c.DetectModerationLabelsRequest(input)
return out, req.Send()
}
// DetectModerationLabelsWithContext is the same as DetectModerationLabels with the addition of
// the ability to pass a context and additional request options.
//
// See DetectModerationLabels 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) DetectModerationLabelsWithContext(ctx aws.Context, input *DetectModerationLabelsInput, opts ...request.Option) (*DetectModerationLabelsOutput, error) {
req, out := c.DetectModerationLabelsRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opGetCelebrityInfo = "GetCelebrityInfo"
// GetCelebrityInfoRequest generates a "aws/request.Request" representing the
// client's request for the GetCelebrityInfo 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 GetCelebrityInfo for more information on using the GetCelebrityInfo
// 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 GetCelebrityInfoRequest method.
// req, resp := client.GetCelebrityInfoRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
func (c *Rekognition) GetCelebrityInfoRequest(input *GetCelebrityInfoInput) (req *request.Request, output *GetCelebrityInfoOutput) {
op := &request.Operation{
Name: opGetCelebrityInfo,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &GetCelebrityInfoInput{}
}
output = &GetCelebrityInfoOutput{}
req = c.newRequest(op, input, output)
return
}
// GetCelebrityInfo API operation for Amazon Rekognition.
//
// Gets the name and additional information about a celebrity based on his or
// her Rekognition ID. The additional information is returned as an array of
// URLs. If there is no additional information about the celebrity, this list
// is empty. For more information, see celebrity-recognition.
//
// This operation requires permissions to perform the rekognition:GetCelebrityInfo
// 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 GetCelebrityInfo 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"
// Collection specified in the request is not found.
//
func (c *Rekognition) GetCelebrityInfo(input *GetCelebrityInfoInput) (*GetCelebrityInfoOutput, error) {
req, out := c.GetCelebrityInfoRequest(input)
return out, req.Send()
}
// GetCelebrityInfoWithContext is the same as GetCelebrityInfo with the addition of
// the ability to pass a context and additional request options.
//
// See GetCelebrityInfo 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) GetCelebrityInfoWithContext(ctx aws.Context, input *GetCelebrityInfoInput, opts ...request.Option) (*GetCelebrityInfoOutput, error) {
req, out := c.GetCelebrityInfoRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opIndexFaces = "IndexFaces"
// IndexFacesRequest generates a "aws/request.Request" representing the
// client's request for the IndexFaces 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 IndexFaces for more information on using the IndexFaces
// 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 IndexFacesRequest method.
// req, resp := client.IndexFacesRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
func (c *Rekognition) IndexFacesRequest(input *IndexFacesInput) (req *request.Request, output *IndexFacesOutput) {
op := &request.Operation{
Name: opIndexFaces,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &IndexFacesInput{}
}
output = &IndexFacesOutput{}
req = c.newRequest(op, input, output)
return
}
// IndexFaces API operation for Amazon Rekognition.
//
// Detects faces in the input image and adds them to the specified collection.
//
// Amazon Rekognition does not save the actual faces detected. Instead, the
// underlying detection algorithm first detects the faces in the input image,
// and for each face extracts facial features into a feature vector, and stores
// it in the back-end database. Amazon Rekognition uses feature vectors when
// performing face match and search operations using the and operations.
//
// If you provide the optional externalImageID for the input image you provided,
// Amazon Rekognition associates this ID with all faces that it detects. When
// you call the operation, the response returns the external ID. You can use
// this external image ID to create a client-side index to associate the faces
// with each image. You can then use the index to find all faces in an image.
//
// In response, the operation returns an array of metadata for all detected
// faces. This includes, the bounding box of the detected face, confidence value
// (indicating the bounding box contains a face), a face ID assigned by the
// service for each face that is detected and stored, and an image ID assigned
// by the service for the input image. If you request all facial attributes
// (using the detectionAttributes parameter, Amazon Rekognition returns detailed
// facial attributes such as facial landmarks (for example, location of eye
// and mount) and other facial attributes such gender. If you provide the same
// image, specify the same collection, and use the same external ID in the IndexFaces
// operation, Amazon Rekognition doesn't save duplicate face metadata.
//
// For an example, see example2.
//
// This operation requires permissions to perform the rekognition:IndexFaces
// 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 IndexFaces for usage and error information.
//
// Returned Error Codes:
// * ErrCodeInvalidS3ObjectException "InvalidS3ObjectException"