forked from aws/aws-sdk-go-v2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
api.go
7018 lines (5813 loc) · 221 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-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
)
const opCompareFaces = "CompareFaces"
// CompareFacesRequest is a API request type for the CompareFaces API operation.
type CompareFacesRequest struct {
*aws.Request
Input *CompareFacesInput
Copy func(*CompareFacesInput) CompareFacesRequest
}
// Send marshals and sends the CompareFaces API request.
func (r CompareFacesRequest) Send() (*CompareFacesOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*CompareFacesOutput), nil
}
// CompareFacesRequest returns a request value for making 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.
//
// // Example sending a request using the CompareFacesRequest method.
// req := client.CompareFacesRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
func (c *Rekognition) CompareFacesRequest(input *CompareFacesInput) CompareFacesRequest {
op := &aws.Operation{
Name: opCompareFaces,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &CompareFacesInput{}
}
output := &CompareFacesOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return CompareFacesRequest{Request: req, Input: input, Copy: c.CompareFacesRequest}
}
const opCreateCollection = "CreateCollection"
// CreateCollectionRequest is a API request type for the CreateCollection API operation.
type CreateCollectionRequest struct {
*aws.Request
Input *CreateCollectionInput
Copy func(*CreateCollectionInput) CreateCollectionRequest
}
// Send marshals and sends the CreateCollection API request.
func (r CreateCollectionRequest) Send() (*CreateCollectionOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*CreateCollectionOutput), nil
}
// CreateCollectionRequest returns a request value for making 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.
//
// // Example sending a request using the CreateCollectionRequest method.
// req := client.CreateCollectionRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
func (c *Rekognition) CreateCollectionRequest(input *CreateCollectionInput) CreateCollectionRequest {
op := &aws.Operation{
Name: opCreateCollection,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &CreateCollectionInput{}
}
output := &CreateCollectionOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return CreateCollectionRequest{Request: req, Input: input, Copy: c.CreateCollectionRequest}
}
const opCreateStreamProcessor = "CreateStreamProcessor"
// CreateStreamProcessorRequest is a API request type for the CreateStreamProcessor API operation.
type CreateStreamProcessorRequest struct {
*aws.Request
Input *CreateStreamProcessorInput
Copy func(*CreateStreamProcessorInput) CreateStreamProcessorRequest
}
// Send marshals and sends the CreateStreamProcessor API request.
func (r CreateStreamProcessorRequest) Send() (*CreateStreamProcessorOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*CreateStreamProcessorOutput), nil
}
// CreateStreamProcessorRequest returns a request value for making 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 .
//
// // Example sending a request using the CreateStreamProcessorRequest method.
// req := client.CreateStreamProcessorRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
func (c *Rekognition) CreateStreamProcessorRequest(input *CreateStreamProcessorInput) CreateStreamProcessorRequest {
op := &aws.Operation{
Name: opCreateStreamProcessor,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &CreateStreamProcessorInput{}
}
output := &CreateStreamProcessorOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return CreateStreamProcessorRequest{Request: req, Input: input, Copy: c.CreateStreamProcessorRequest}
}
const opDeleteCollection = "DeleteCollection"
// DeleteCollectionRequest is a API request type for the DeleteCollection API operation.
type DeleteCollectionRequest struct {
*aws.Request
Input *DeleteCollectionInput
Copy func(*DeleteCollectionInput) DeleteCollectionRequest
}
// Send marshals and sends the DeleteCollection API request.
func (r DeleteCollectionRequest) Send() (*DeleteCollectionOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*DeleteCollectionOutput), nil
}
// DeleteCollectionRequest returns a request value for making 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.
//
// // Example sending a request using the DeleteCollectionRequest method.
// req := client.DeleteCollectionRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
func (c *Rekognition) DeleteCollectionRequest(input *DeleteCollectionInput) DeleteCollectionRequest {
op := &aws.Operation{
Name: opDeleteCollection,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DeleteCollectionInput{}
}
output := &DeleteCollectionOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return DeleteCollectionRequest{Request: req, Input: input, Copy: c.DeleteCollectionRequest}
}
const opDeleteFaces = "DeleteFaces"
// DeleteFacesRequest is a API request type for the DeleteFaces API operation.
type DeleteFacesRequest struct {
*aws.Request
Input *DeleteFacesInput
Copy func(*DeleteFacesInput) DeleteFacesRequest
}
// Send marshals and sends the DeleteFaces API request.
func (r DeleteFacesRequest) Send() (*DeleteFacesOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*DeleteFacesOutput), nil
}
// DeleteFacesRequest returns a request value for making 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.
//
// // Example sending a request using the DeleteFacesRequest method.
// req := client.DeleteFacesRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
func (c *Rekognition) DeleteFacesRequest(input *DeleteFacesInput) DeleteFacesRequest {
op := &aws.Operation{
Name: opDeleteFaces,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DeleteFacesInput{}
}
output := &DeleteFacesOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return DeleteFacesRequest{Request: req, Input: input, Copy: c.DeleteFacesRequest}
}
const opDeleteStreamProcessor = "DeleteStreamProcessor"
// DeleteStreamProcessorRequest is a API request type for the DeleteStreamProcessor API operation.
type DeleteStreamProcessorRequest struct {
*aws.Request
Input *DeleteStreamProcessorInput
Copy func(*DeleteStreamProcessorInput) DeleteStreamProcessorRequest
}
// Send marshals and sends the DeleteStreamProcessor API request.
func (r DeleteStreamProcessorRequest) Send() (*DeleteStreamProcessorOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*DeleteStreamProcessorOutput), nil
}
// DeleteStreamProcessorRequest returns a request value for making 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.
//
// // Example sending a request using the DeleteStreamProcessorRequest method.
// req := client.DeleteStreamProcessorRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
func (c *Rekognition) DeleteStreamProcessorRequest(input *DeleteStreamProcessorInput) DeleteStreamProcessorRequest {
op := &aws.Operation{
Name: opDeleteStreamProcessor,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DeleteStreamProcessorInput{}
}
output := &DeleteStreamProcessorOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return DeleteStreamProcessorRequest{Request: req, Input: input, Copy: c.DeleteStreamProcessorRequest}
}
const opDescribeStreamProcessor = "DescribeStreamProcessor"
// DescribeStreamProcessorRequest is a API request type for the DescribeStreamProcessor API operation.
type DescribeStreamProcessorRequest struct {
*aws.Request
Input *DescribeStreamProcessorInput
Copy func(*DescribeStreamProcessorInput) DescribeStreamProcessorRequest
}
// Send marshals and sends the DescribeStreamProcessor API request.
func (r DescribeStreamProcessorRequest) Send() (*DescribeStreamProcessorOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*DescribeStreamProcessorOutput), nil
}
// DescribeStreamProcessorRequest returns a request value for making 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.
//
// // Example sending a request using the DescribeStreamProcessorRequest method.
// req := client.DescribeStreamProcessorRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
func (c *Rekognition) DescribeStreamProcessorRequest(input *DescribeStreamProcessorInput) DescribeStreamProcessorRequest {
op := &aws.Operation{
Name: opDescribeStreamProcessor,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DescribeStreamProcessorInput{}
}
output := &DescribeStreamProcessorOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return DescribeStreamProcessorRequest{Request: req, Input: input, Copy: c.DescribeStreamProcessorRequest}
}
const opDetectFaces = "DetectFaces"
// DetectFacesRequest is a API request type for the DetectFaces API operation.
type DetectFacesRequest struct {
*aws.Request
Input *DetectFacesInput
Copy func(*DetectFacesInput) DetectFacesRequest
}
// Send marshals and sends the DetectFaces API request.
func (r DetectFacesRequest) Send() (*DetectFacesOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*DetectFacesOutput), nil
}
// DetectFacesRequest returns a request value for making 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.
//
// // Example sending a request using the DetectFacesRequest method.
// req := client.DetectFacesRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
func (c *Rekognition) DetectFacesRequest(input *DetectFacesInput) DetectFacesRequest {
op := &aws.Operation{
Name: opDetectFaces,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DetectFacesInput{}
}
output := &DetectFacesOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return DetectFacesRequest{Request: req, Input: input, Copy: c.DetectFacesRequest}
}
const opDetectLabels = "DetectLabels"
// DetectLabelsRequest is a API request type for the DetectLabels API operation.
type DetectLabelsRequest struct {
*aws.Request
Input *DetectLabelsInput
Copy func(*DetectLabelsInput) DetectLabelsRequest
}
// Send marshals and sends the DetectLabels API request.
func (r DetectLabelsRequest) Send() (*DetectLabelsOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*DetectLabelsOutput), nil
}
// DetectLabelsRequest returns a request value for making 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.
//
// // Example sending a request using the DetectLabelsRequest method.
// req := client.DetectLabelsRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
func (c *Rekognition) DetectLabelsRequest(input *DetectLabelsInput) DetectLabelsRequest {
op := &aws.Operation{
Name: opDetectLabels,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DetectLabelsInput{}
}
output := &DetectLabelsOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return DetectLabelsRequest{Request: req, Input: input, Copy: c.DetectLabelsRequest}
}
const opDetectModerationLabels = "DetectModerationLabels"
// DetectModerationLabelsRequest is a API request type for the DetectModerationLabels API operation.
type DetectModerationLabelsRequest struct {
*aws.Request
Input *DetectModerationLabelsInput
Copy func(*DetectModerationLabelsInput) DetectModerationLabelsRequest
}
// Send marshals and sends the DetectModerationLabels API request.
func (r DetectModerationLabelsRequest) Send() (*DetectModerationLabelsOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*DetectModerationLabelsOutput), nil
}
// DetectModerationLabelsRequest returns a request value for making 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 moderation.
//
// 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.
//
// // Example sending a request using the DetectModerationLabelsRequest method.
// req := client.DetectModerationLabelsRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
func (c *Rekognition) DetectModerationLabelsRequest(input *DetectModerationLabelsInput) DetectModerationLabelsRequest {
op := &aws.Operation{
Name: opDetectModerationLabels,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DetectModerationLabelsInput{}
}
output := &DetectModerationLabelsOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return DetectModerationLabelsRequest{Request: req, Input: input, Copy: c.DetectModerationLabelsRequest}
}
const opDetectText = "DetectText"
// DetectTextRequest is a API request type for the DetectText API operation.
type DetectTextRequest struct {
*aws.Request
Input *DetectTextInput
Copy func(*DetectTextInput) DetectTextRequest
}
// Send marshals and sends the DetectText API request.
func (r DetectTextRequest) Send() (*DetectTextOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*DetectTextOutput), nil
}
// DetectTextRequest returns a request value for making API operation for
// Amazon Rekognition.
//
// Detects text in the input image and converts it into machine-readable text.
//
// 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 AWS CLI to call Amazon Rekognition
// operations, you must pass it as a reference to an image in an Amazon S3 bucket.
// For the AWS CLI, passing image bytes is not supported. The image must be
// either a .png or .jpeg formatted file.
//
// The DetectText operation returns text in an array of elements, TextDetections.
// Each TextDetection element provides information about a single word or line
// of text that was detected in the image.
//
// A word is one or more ISO basic latin script characters that are not separated
// by spaces. DetectText can detect up to 50 words in an image.
//
// A line is a string of equally spaced words. A line isn't necessarily a complete
// sentence. For example, a driver's license number is detected as a line. A
// line ends when there is no aligned text after it. Also, a line ends when
// there is a large gap between words, relative to the length of the words.
// This means, depending on the gap between words, Amazon Rekognition may detect
// multiple lines in text aligned in the same direction. Periods don't represent
// the end of a line. If a sentence spans multiple lines, the DetectText operation
// returns multiple lines.
//
// To determine whether a TextDetection element is a line of text or a word,
// use the TextDetection object Type field.
//
// To be detected, text must be within +/- 30 degrees orientation of the horizontal
// axis.
//
// For more information, see text-detection.
//
// // Example sending a request using the DetectTextRequest method.
// req := client.DetectTextRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
func (c *Rekognition) DetectTextRequest(input *DetectTextInput) DetectTextRequest {
op := &aws.Operation{
Name: opDetectText,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DetectTextInput{}
}
output := &DetectTextOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return DetectTextRequest{Request: req, Input: input, Copy: c.DetectTextRequest}
}
const opGetCelebrityInfo = "GetCelebrityInfo"
// GetCelebrityInfoRequest is a API request type for the GetCelebrityInfo API operation.
type GetCelebrityInfoRequest struct {
*aws.Request
Input *GetCelebrityInfoInput
Copy func(*GetCelebrityInfoInput) GetCelebrityInfoRequest
}
// Send marshals and sends the GetCelebrityInfo API request.
func (r GetCelebrityInfoRequest) Send() (*GetCelebrityInfoOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*GetCelebrityInfoOutput), nil
}
// GetCelebrityInfoRequest returns a request value for making 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 get-celebrity-info-procedure.
//
// This operation requires permissions to perform the rekognition:GetCelebrityInfo
// action.
//
// // Example sending a request using the GetCelebrityInfoRequest method.
// req := client.GetCelebrityInfoRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
func (c *Rekognition) GetCelebrityInfoRequest(input *GetCelebrityInfoInput) GetCelebrityInfoRequest {
op := &aws.Operation{
Name: opGetCelebrityInfo,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &GetCelebrityInfoInput{}
}
output := &GetCelebrityInfoOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return GetCelebrityInfoRequest{Request: req, Input: input, Copy: c.GetCelebrityInfoRequest}
}
const opGetCelebrityRecognition = "GetCelebrityRecognition"
// GetCelebrityRecognitionRequest is a API request type for the GetCelebrityRecognition API operation.
type GetCelebrityRecognitionRequest struct {
*aws.Request
Input *GetCelebrityRecognitionInput
Copy func(*GetCelebrityRecognitionInput) GetCelebrityRecognitionRequest
}
// Send marshals and sends the GetCelebrityRecognition API request.
func (r GetCelebrityRecognitionRequest) Send() (*GetCelebrityRecognitionOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*GetCelebrityRecognitionOutput), nil
}
// GetCelebrityRecognitionRequest returns a request value for making API operation for
// Amazon Rekognition.
//
// Gets the celebrity recognition results for a Rekognition Video analysis started
// by .
//
// Celebrity recognition in a video is an asynchronous operation. Analysis is
// started by a call to which returns a job identifier (JobId). When the celebrity
// recognition operation finishes, Rekognition Video publishes a completion
// status to the Amazon Simple Notification Service topic registered in the
// initial call to StartCelebrityRecognition. To get the results of the celebrity
// recognition analysis, first check that the status value published to the
// Amazon SNS topic is SUCCEEDED. If so, call GetCelebrityDetection and pass
// the job identifier (JobId) from the initial call to StartCelebrityDetection.
// For more information, see video.
//
// GetCelebrityRecognition returns detected celebrities and the time(s) they
// are detected in an array (Celebrities) of objects. Each CelebrityRecognition
// contains information about the celebrity in a object and the time, Timestamp,
// the celebrity was detected.
//
// By default, the Celebrities array is sorted by time (milliseconds from the
// start of the video). You can also sort the array by celebrity by specifying
// the value ID in the SortBy input parameter.
//
// The CelebrityDetail object includes the celebrity identifer and additional
// information urls. If you don't store the additional information urls, you
// can get them later by calling with the celebrity identifer.
//
// No information is returned for faces not recognized as celebrities.
//
// Use MaxResults parameter to limit the number of labels returned. If there
// are more results than specified in MaxResults, the value of NextToken in
// the operation response contains a pagination token for getting the next set
// of results. To get the next page of results, call GetCelebrityDetection and
// populate the NextToken request parameter with the token value returned from
// the previous call to GetCelebrityRecognition.
//
// // Example sending a request using the GetCelebrityRecognitionRequest method.
// req := client.GetCelebrityRecognitionRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
func (c *Rekognition) GetCelebrityRecognitionRequest(input *GetCelebrityRecognitionInput) GetCelebrityRecognitionRequest {
op := &aws.Operation{
Name: opGetCelebrityRecognition,
HTTPMethod: "POST",
HTTPPath: "/",
Paginator: &aws.Paginator{
InputTokens: []string{"NextToken"},
OutputTokens: []string{"NextToken"},
LimitToken: "MaxResults",
TruncationToken: "",
},
}
if input == nil {
input = &GetCelebrityRecognitionInput{}
}
output := &GetCelebrityRecognitionOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return GetCelebrityRecognitionRequest{Request: req, Input: input, Copy: c.GetCelebrityRecognitionRequest}
}
// Paginate pages iterates over the pages of a GetCelebrityRecognitionRequest operation,
// calling the Next method for each page. Using the paginators Next
// method will depict whether or not there are more pages.
//
// Note: This operation can generate multiple requests to a service.
//
// // Example iterating over at most 3 pages of a GetCelebrityRecognition operation.
// req := client.GetCelebrityRecognitionRequest(input)
// p := req.Paginate()
// for p.Next() {
// page := p.CurrentPage()
// }
//
// if err := p.Err(); err != nil {
// return err
// }
//
func (p *GetCelebrityRecognitionRequest) Paginate(opts ...aws.Option) GetCelebrityRecognitionPager {
return GetCelebrityRecognitionPager{
Pager: aws.Pager{
NewRequest: func() (*aws.Request, error) {
var inCpy *GetCelebrityRecognitionInput
if p.Input != nil {
tmp := *p.Input
inCpy = &tmp
}
req := p.Copy(inCpy)
req.ApplyOptions(opts...)
return req.Request, nil
},
},
}
}
// GetCelebrityRecognitionPager is used to paginate the request. This can be done by
// calling Next and CurrentPage.
type GetCelebrityRecognitionPager struct {
aws.Pager
}
func (p *GetCelebrityRecognitionPager) CurrentPage() *GetCelebrityRecognitionOutput {
return p.Pager.CurrentPage().(*GetCelebrityRecognitionOutput)
}
const opGetContentModeration = "GetContentModeration"
// GetContentModerationRequest is a API request type for the GetContentModeration API operation.
type GetContentModerationRequest struct {
*aws.Request
Input *GetContentModerationInput
Copy func(*GetContentModerationInput) GetContentModerationRequest
}
// Send marshals and sends the GetContentModeration API request.
func (r GetContentModerationRequest) Send() (*GetContentModerationOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*GetContentModerationOutput), nil
}
// GetContentModerationRequest returns a request value for making API operation for
// Amazon Rekognition.
//
// Gets the content moderation analysis results for a Rekognition Video analysis
// started by .
//
// Content moderation analysis of a video is an asynchronous operation. You
// start analysis by calling . which returns a job identifier (JobId). When
// analysis finishes, Rekognition Video publishes a completion status to the
// Amazon Simple Notification Service topic registered in the initial call to
// StartContentModeration. To get the results of the content moderation analysis,
// first check that the status value published to the Amazon SNS topic is SUCCEEDED.
// If so, call GetCelebrityDetection and pass the job identifier (JobId) from
// the initial call to StartCelebrityDetection. For more information, see video.
//
// GetContentModeration returns detected content moderation labels, and the
// time they are detected, in an array, ModerationLabels, of objects.
//
// By default, the moderated labels are returned sorted by time, in milliseconds
// from the start of the video. You can also sort them by moderated label by
// specifying NAME for the SortBy input parameter.
//
// Since video analysis can return a large number of results, use the MaxResults
// parameter to limit the number of labels returned in a single call to GetContentModeration.
// If there are more results than specified in MaxResults, the value of NextToken
// in the operation response contains a pagination token for getting the next
// set of results. To get the next page of results, call GetContentModeration
// and populate the NextToken request parameter with the value of NextToken
// returned from the previous call to GetContentModeration.
//
// For more information, see moderation.
//
// // Example sending a request using the GetContentModerationRequest method.
// req := client.GetContentModerationRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
func (c *Rekognition) GetContentModerationRequest(input *GetContentModerationInput) GetContentModerationRequest {
op := &aws.Operation{
Name: opGetContentModeration,
HTTPMethod: "POST",
HTTPPath: "/",
Paginator: &aws.Paginator{
InputTokens: []string{"NextToken"},
OutputTokens: []string{"NextToken"},
LimitToken: "MaxResults",
TruncationToken: "",
},
}
if input == nil {
input = &GetContentModerationInput{}
}
output := &GetContentModerationOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}