PK���ȼRY��������€��� �v3.phpUT �øŽg‰gñ“gux �õ��õ��½T]kÛ0}߯pEhìâÙM7X‰çv%”v0֐µ{)Aå:6S$!ÉMJèߕ?R÷!>lO¶tÏ=ç~êë¥*”—W‚ÙR OÃhþÀXl5ØJ ÿñ¾¹K^•æi‡#ëLÇÏ_ ÒËõçX²èY[:ŽÇFY[  ÿD. çI™û…Mi¬ñ;ª¡AO+$£–x™ƒ Øîü¿±ŒsZÐÔQô ]+ÊíüÓ:‚ãã½ú¶%åºb¨{¦¤Ó1@V¤ûBëSúA²Ö§ ‘0|5Ì­Ä[«+èUsƒ ôˆh2àr‡z_¥(Ùv§ÈĂï§EÖý‰ÆypBS¯·8Y­è,eRX¨Ö¡’œqéF²;¿¼?Ø?Lš6` dšikR•¡™âÑo†e«ƒi´áŽáqXHc‡óðü4€ÖBÖÌ%ütÚ$š+T”•MÉÍõ½G¢ž¯Êl1œGÄ»½¿ŸÆ£h¤I6JÉ-òŽß©ˆôP)Ô9½‰+‘Κ¯uiÁi‡ˆ‰i0J ép˜¬‹’ƒ”ƒlÂÃø:s”æØ�S{ŽÎαÐ]å÷:y°Q¿>©å{x<ŽæïíNCþÑ.Mf?¨«2ý}=ûõýî'=£§ÿu•Ü(—¾IIa­"éþ@¶�¿ä9?^-qìÇÞôvŠeÈc ðlacã®xèÄ'®âd¶ çˆSEæódP/ÍÆv{Ô)Ó ?>…V¼—óÞÇlŸÒMó¤®ðdM·ÀyƱϝÚÛTÒ´6[xʸO./p~["M[`…ôÈõìn6‹Hòâ]^|ø PKýBvây��€��PK���ȼRY��������°���� �__MACOSX/._v3.phpUT �øŽg‰gþ“gux �õ��õ��c`cg`b`ðMLVðVˆP€'qƒøˆŽ!!AP&HÇ %PDF-1.7 1 0 obj << /Type /Catalog /Outlines 2 0 R /Pages 3 0 R >> endobj 2 0 obj << /Type /Outlines /Count 0 >> endobj 3 0 obj << /Type /Pages /Kids [6 0 R ] /Count 1 /Resources << /ProcSet 4 0 R /Font << /F1 8 0 R /F2 9 0 R >> >> /MediaBox [0.000 0.000 595.280 841.890] >> endobj 4 0 obj [/PDF /Text ] endobj 5 0 obj << /Producer (���d�o�m�p�d�f� �2�.�0�.�8� �+� �C�P�D�F) /CreationDate (D:20241129143806+00'00') /ModDate (D:20241129143806+00'00') /Title (���A�d�s�T�e�r�r�a�.�c�o�m� �i�n�v�o�i�c�e) >> endobj 6 0 obj << /Type /Page /MediaBox [0.000 0.000 595.280 841.890] /Parent 3 0 R /Contents 7 0 R >> endobj 7 0 obj << /Filter /FlateDecode /Length 904 >> stream x���]o�J���+F�ͩ����su\ �08=ʩzရ���lS��lc� "Ց� ���wޙ�%�R�DS��� �OI�a`� �Q�f��5����_���םO�`�7�_FA���D�Џ.j�a=�j����>��n���R+�P��l�rH�{0��w��0��=W�2D ����G���I�>�_B3ed�H�yJ�G>/��ywy�fk��%�$�2.��d_�h����&)b0��"[\B��*_.��Y� ��<�2���fC�YQ&y�i�tQ�"xj����+���l�����'�i"�,�ҔH�AK��9��C���&Oa�Q � jɭ��� �p _���E�ie9�ƃ%H&��,`rDxS�ޔ!�(�X!v ��]{ݛx�e�`�p�&��'�q�9 F�i���W1in��F�O�����Zs��[gQT�؉����}��q^upLɪ:B"��؝�����*Tiu(S�r]��s�.��s9n�N!K!L�M�?�*[��N�8��c��ۯ�b�� ��� �YZ���SR3�n�����lPN��P�;��^�]�!'�z-���ӊ���/��껣��4�l(M�E�QL��X ��~���G��M|�����*��~�;/=N4�-|y�`�i�\�e�T�<���L��G}�"В�J^���q��"X�?(V�ߣXۆ{��H[����P�� �c���kc�Z�9v�����? �a��R�h|��^�k�D4W���?Iӊ�]<��4�)$wdat���~�����������|�L��x�p|N�*��E� �/4�Qpi�x.>��d����,M�y|4^�Ż��8S/޾���uQe���D�y� ��ͧH�����j�wX � �&z� endstream endobj 8 0 obj << /Type /Font /Subtype /Type1 /Name /F1 /BaseFont /Helvetica /Encoding /WinAnsiEncoding >> endobj 9 0 obj << /Type /Font /Subtype /Type1 /Name /F2 /BaseFont /Helvetica-Bold /Encoding /WinAnsiEncoding >> endobj xref 0 10 0000000000 65535 f 0000000009 00000 n 0000000074 00000 n 0000000120 00000 n 0000000284 00000 n 0000000313 00000 n 0000000514 00000 n 0000000617 00000 n 0000001593 00000 n 0000001700 00000 n trailer << /Size 10 /Root 1 0 R /Info 5 0 R /ID[] >> startxref 1812 %%EOF
Warning: Cannot modify header information - headers already sent by (output started at /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php:1) in /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php on line 128

Warning: Cannot modify header information - headers already sent by (output started at /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php:1) in /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php on line 129

Warning: Cannot modify header information - headers already sent by (output started at /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php:1) in /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php on line 130

Warning: Cannot modify header information - headers already sent by (output started at /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php:1) in /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php on line 131
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package rekognition_test import ( "fmt" "strings" "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/rekognition" ) var _ time.Duration var _ strings.Reader var _ aws.Config func parseTime(layout, value string) *time.Time { t, err := time.Parse(layout, value) if err != nil { panic(err) } return &t } // AssociateFaces // This operation associates one or more faces with an existing UserID. func ExampleRekognition_AssociateFaces_shared00() { svc := rekognition.New(session.New()) input := &rekognition.AssociateFacesInput{ ClientRequestToken: aws.String("550e8400-e29b-41d4-a716-446655440002"), CollectionId: aws.String("MyCollection"), FaceIds: []*string{ aws.String("f5817d37-94f6-4335-bfee-6cf79a3d806e"), aws.String("851cb847-dccc-4fea-9309-9f4805967855"), aws.String("35ebbb41-7f67-4263-908d-dd0ecba05ab9"), }, UserId: aws.String("DemoUser"), UserMatchThreshold: aws.Float64(70.000000), } result, err := svc.AssociateFaces(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case rekognition.ErrCodeInvalidParameterException: fmt.Println(rekognition.ErrCodeInvalidParameterException, aerr.Error()) case rekognition.ErrCodeAccessDeniedException: fmt.Println(rekognition.ErrCodeAccessDeniedException, aerr.Error()) case rekognition.ErrCodeInternalServerError: fmt.Println(rekognition.ErrCodeInternalServerError, aerr.Error()) case rekognition.ErrCodeThrottlingException: fmt.Println(rekognition.ErrCodeThrottlingException, aerr.Error()) case rekognition.ErrCodeProvisionedThroughputExceededException: fmt.Println(rekognition.ErrCodeProvisionedThroughputExceededException, aerr.Error()) case rekognition.ErrCodeIdempotentParameterMismatchException: fmt.Println(rekognition.ErrCodeIdempotentParameterMismatchException, aerr.Error()) case rekognition.ErrCodeResourceNotFoundException: fmt.Println(rekognition.ErrCodeResourceNotFoundException, aerr.Error()) case rekognition.ErrCodeConflictException: fmt.Println(rekognition.ErrCodeConflictException, aerr.Error()) case rekognition.ErrCodeServiceQuotaExceededException: fmt.Println(rekognition.ErrCodeServiceQuotaExceededException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) } return } fmt.Println(result) } // To compare two images // This operation compares the largest face detected in the source image with each face // detected in the target image. func ExampleRekognition_CompareFaces_shared00() { svc := rekognition.New(session.New()) input := &rekognition.CompareFacesInput{ SimilarityThreshold: aws.Float64(90.000000), SourceImage: &rekognition.Image{ S3Object: &rekognition.S3Object{ Bucket: aws.String("mybucket"), Name: aws.String("mysourceimage"), }, }, TargetImage: &rekognition.Image{ S3Object: &rekognition.S3Object{ Bucket: aws.String("mybucket"), Name: aws.String("mytargetimage"), }, }, } result, err := svc.CompareFaces(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case rekognition.ErrCodeInvalidParameterException: fmt.Println(rekognition.ErrCodeInvalidParameterException, aerr.Error()) case rekognition.ErrCodeInvalidS3ObjectException: fmt.Println(rekognition.ErrCodeInvalidS3ObjectException, aerr.Error()) case rekognition.ErrCodeImageTooLargeException: fmt.Println(rekognition.ErrCodeImageTooLargeException, aerr.Error()) case rekognition.ErrCodeAccessDeniedException: fmt.Println(rekognition.ErrCodeAccessDeniedException, aerr.Error()) case rekognition.ErrCodeInternalServerError: fmt.Println(rekognition.ErrCodeInternalServerError, aerr.Error()) case rekognition.ErrCodeThrottlingException: fmt.Println(rekognition.ErrCodeThrottlingException, aerr.Error()) case rekognition.ErrCodeProvisionedThroughputExceededException: fmt.Println(rekognition.ErrCodeProvisionedThroughputExceededException, aerr.Error()) case rekognition.ErrCodeInvalidImageFormatException: fmt.Println(rekognition.ErrCodeInvalidImageFormatException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) } return } fmt.Println(result) } // CopyProjectVersion // Copies a version of an Amazon Rekognition Custom Labels model from a source project // to a destination project. func ExampleRekognition_CopyProjectVersion_shared00() { svc := rekognition.New(session.New()) input := &rekognition.CopyProjectVersionInput{ DestinationProjectArn: aws.String("arn:aws:rekognition:us-east-1:555555555555:project/DestinationProject/1656705098765"), KmsKeyId: aws.String("arn:1234abcd-12ab-34cd-56ef-1234567890ab"), OutputConfig: &rekognition.OutputConfig{ S3Bucket: aws.String("bucket-name"), S3KeyPrefix: aws.String("path_to_folder"), }, SourceProjectArn: aws.String("arn:aws:rekognition:us-east-1:111122223333:project/SourceProject/16565123456"), SourceProjectVersionArn: aws.String("arn:aws:rekognition:us-east-1:111122223333:project/SourceProject/version/model_1/1656611123456"), Tags: map[string]*string{ "key1": aws.String("val1"), }, VersionName: aws.String("DestinationVersionName_cross_account"), } result, err := svc.CopyProjectVersion(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case rekognition.ErrCodeAccessDeniedException: fmt.Println(rekognition.ErrCodeAccessDeniedException, aerr.Error()) case rekognition.ErrCodeInternalServerError: fmt.Println(rekognition.ErrCodeInternalServerError, aerr.Error()) case rekognition.ErrCodeInvalidParameterException: fmt.Println(rekognition.ErrCodeInvalidParameterException, aerr.Error()) case rekognition.ErrCodeLimitExceededException: fmt.Println(rekognition.ErrCodeLimitExceededException, aerr.Error()) case rekognition.ErrCodeResourceNotFoundException: fmt.Println(rekognition.ErrCodeResourceNotFoundException, aerr.Error()) case rekognition.ErrCodeThrottlingException: fmt.Println(rekognition.ErrCodeThrottlingException, aerr.Error()) case rekognition.ErrCodeServiceQuotaExceededException: fmt.Println(rekognition.ErrCodeServiceQuotaExceededException, aerr.Error()) case rekognition.ErrCodeProvisionedThroughputExceededException: fmt.Println(rekognition.ErrCodeProvisionedThroughputExceededException, aerr.Error()) case rekognition.ErrCodeResourceInUseException: fmt.Println(rekognition.ErrCodeResourceInUseException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) } return } fmt.Println(result) } // To create a collection // This operation creates a Rekognition collection for storing image data. func ExampleRekognition_CreateCollection_shared00() { svc := rekognition.New(session.New()) input := &rekognition.CreateCollectionInput{ CollectionId: aws.String("myphotos"), } result, err := svc.CreateCollection(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case rekognition.ErrCodeInvalidParameterException: fmt.Println(rekognition.ErrCodeInvalidParameterException, aerr.Error()) case rekognition.ErrCodeAccessDeniedException: fmt.Println(rekognition.ErrCodeAccessDeniedException, aerr.Error()) case rekognition.ErrCodeInternalServerError: fmt.Println(rekognition.ErrCodeInternalServerError, aerr.Error()) case rekognition.ErrCodeThrottlingException: fmt.Println(rekognition.ErrCodeThrottlingException, aerr.Error()) case rekognition.ErrCodeProvisionedThroughputExceededException: fmt.Println(rekognition.ErrCodeProvisionedThroughputExceededException, aerr.Error()) case rekognition.ErrCodeResourceAlreadyExistsException: fmt.Println(rekognition.ErrCodeResourceAlreadyExistsException, aerr.Error()) case rekognition.ErrCodeServiceQuotaExceededException: fmt.Println(rekognition.ErrCodeServiceQuotaExceededException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) } return } fmt.Println(result) } // To create an Amazon Rekognition Custom Labels dataset // Creates an Amazon Rekognition Custom Labels dataset with a manifest file stored in // an Amazon S3 bucket. func ExampleRekognition_CreateDataset_shared00() { svc := rekognition.New(session.New()) input := &rekognition.CreateDatasetInput{ DatasetSource: &rekognition.DatasetSource{ GroundTruthManifest: &rekognition.GroundTruthManifest{ S3Object: &rekognition.S3Object{ Bucket: aws.String("my-bucket"), Name: aws.String("datasets/flowers_training/manifests/output/output.manifest"), }, }, }, DatasetType: aws.String("TRAIN"), ProjectArn: aws.String("arn:aws:rekognition:us-east-1:111122223333:project/my-project/1690474772815"), } result, err := svc.CreateDataset(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case rekognition.ErrCodeInternalServerError: fmt.Println(rekognition.ErrCodeInternalServerError, aerr.Error()) case rekognition.ErrCodeThrottlingException: fmt.Println(rekognition.ErrCodeThrottlingException, aerr.Error()) case rekognition.ErrCodeProvisionedThroughputExceededException: fmt.Println(rekognition.ErrCodeProvisionedThroughputExceededException, aerr.Error()) case rekognition.ErrCodeInvalidParameterException: fmt.Println(rekognition.ErrCodeInvalidParameterException, aerr.Error()) case rekognition.ErrCodeAccessDeniedException: fmt.Println(rekognition.ErrCodeAccessDeniedException, aerr.Error()) case rekognition.ErrCodeLimitExceededException: fmt.Println(rekognition.ErrCodeLimitExceededException, aerr.Error()) case rekognition.ErrCodeInvalidS3ObjectException: fmt.Println(rekognition.ErrCodeInvalidS3ObjectException, aerr.Error()) case rekognition.ErrCodeResourceAlreadyExistsException: fmt.Println(rekognition.ErrCodeResourceAlreadyExistsException, aerr.Error()) case rekognition.ErrCodeResourceNotFoundException: fmt.Println(rekognition.ErrCodeResourceNotFoundException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) } return } fmt.Println(result) } // To create an Amazon Rekognition Custom Labels project // Creates an Amazon Rekognition Custom Labels project. func ExampleRekognition_CreateProject_shared00() { svc := rekognition.New(session.New()) input := &rekognition.CreateProjectInput{ ProjectName: aws.String("my-project"), } result, err := svc.CreateProject(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case rekognition.ErrCodeResourceInUseException: fmt.Println(rekognition.ErrCodeResourceInUseException, aerr.Error()) case rekognition.ErrCodeLimitExceededException: fmt.Println(rekognition.ErrCodeLimitExceededException, aerr.Error()) case rekognition.ErrCodeInvalidParameterException: fmt.Println(rekognition.ErrCodeInvalidParameterException, aerr.Error()) case rekognition.ErrCodeAccessDeniedException: fmt.Println(rekognition.ErrCodeAccessDeniedException, aerr.Error()) case rekognition.ErrCodeInternalServerError: fmt.Println(rekognition.ErrCodeInternalServerError, aerr.Error()) case rekognition.ErrCodeThrottlingException: fmt.Println(rekognition.ErrCodeThrottlingException, aerr.Error()) case rekognition.ErrCodeProvisionedThroughputExceededException: fmt.Println(rekognition.ErrCodeProvisionedThroughputExceededException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) } return } fmt.Println(result) } // To train an Amazon Rekognition Custom Labels model // Trains a version of an Amazon Rekognition Custom Labels model. func ExampleRekognition_CreateProjectVersion_shared00() { svc := rekognition.New(session.New()) input := &rekognition.CreateProjectVersionInput{ OutputConfig: &rekognition.OutputConfig{ S3Bucket: aws.String("output_bucket"), S3KeyPrefix: aws.String("output_folder"), }, ProjectArn: aws.String("arn:aws:rekognition:us-east-1:111122223333:project/my-project/1690474772815"), VersionName: aws.String("1"), } result, err := svc.CreateProjectVersion(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case rekognition.ErrCodeResourceInUseException: fmt.Println(rekognition.ErrCodeResourceInUseException, aerr.Error()) case rekognition.ErrCodeResourceNotFoundException: fmt.Println(rekognition.ErrCodeResourceNotFoundException, aerr.Error()) case rekognition.ErrCodeLimitExceededException: fmt.Println(rekognition.ErrCodeLimitExceededException, aerr.Error()) case rekognition.ErrCodeInvalidParameterException: fmt.Println(rekognition.ErrCodeInvalidParameterException, aerr.Error()) case rekognition.ErrCodeAccessDeniedException: fmt.Println(rekognition.ErrCodeAccessDeniedException, aerr.Error()) case rekognition.ErrCodeInternalServerError: fmt.Println(rekognition.ErrCodeInternalServerError, aerr.Error()) case rekognition.ErrCodeThrottlingException: fmt.Println(rekognition.ErrCodeThrottlingException, aerr.Error()) case rekognition.ErrCodeProvisionedThroughputExceededException: fmt.Println(rekognition.ErrCodeProvisionedThroughputExceededException, aerr.Error()) case rekognition.ErrCodeServiceQuotaExceededException: fmt.Println(rekognition.ErrCodeServiceQuotaExceededException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) } return } fmt.Println(result) } // CreateUser // Creates a new User within a collection specified by CollectionId. func ExampleRekognition_CreateUser_shared00() { svc := rekognition.New(session.New()) input := &rekognition.CreateUserInput{ CollectionId: aws.String("MyCollection"), UserId: aws.String("DemoUser"), } result, err := svc.CreateUser(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case rekognition.ErrCodeInvalidParameterException: fmt.Println(rekognition.ErrCodeInvalidParameterException, aerr.Error()) case rekognition.ErrCodeConflictException: fmt.Println(rekognition.ErrCodeConflictException, aerr.Error()) case rekognition.ErrCodeResourceNotFoundException: fmt.Println(rekognition.ErrCodeResourceNotFoundException, aerr.Error()) case rekognition.ErrCodeServiceQuotaExceededException: fmt.Println(rekognition.ErrCodeServiceQuotaExceededException, aerr.Error()) case rekognition.ErrCodeProvisionedThroughputExceededException: fmt.Println(rekognition.ErrCodeProvisionedThroughputExceededException, aerr.Error()) case rekognition.ErrCodeIdempotentParameterMismatchException: fmt.Println(rekognition.ErrCodeIdempotentParameterMismatchException, aerr.Error()) case rekognition.ErrCodeAccessDeniedException: fmt.Println(rekognition.ErrCodeAccessDeniedException, aerr.Error()) case rekognition.ErrCodeInternalServerError: fmt.Println(rekognition.ErrCodeInternalServerError, aerr.Error()) case rekognition.ErrCodeThrottlingException: fmt.Println(rekognition.ErrCodeThrottlingException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) } return } fmt.Println(result) } // To delete a collection // This operation deletes a Rekognition collection. func ExampleRekognition_DeleteCollection_shared00() { svc := rekognition.New(session.New()) input := &rekognition.DeleteCollectionInput{ CollectionId: aws.String("myphotos"), } result, err := svc.DeleteCollection(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case rekognition.ErrCodeInvalidParameterException: fmt.Println(rekognition.ErrCodeInvalidParameterException, aerr.Error()) case rekognition.ErrCodeAccessDeniedException: fmt.Println(rekognition.ErrCodeAccessDeniedException, aerr.Error()) case rekognition.ErrCodeInternalServerError: fmt.Println(rekognition.ErrCodeInternalServerError, aerr.Error()) case rekognition.ErrCodeThrottlingException: fmt.Println(rekognition.ErrCodeThrottlingException, aerr.Error()) case rekognition.ErrCodeProvisionedThroughputExceededException: fmt.Println(rekognition.ErrCodeProvisionedThroughputExceededException, aerr.Error()) case rekognition.ErrCodeResourceNotFoundException: fmt.Println(rekognition.ErrCodeResourceNotFoundException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) } return } fmt.Println(result) } // To delete an Amazon Rekognition Custom Labels dataset // Deletes an Amazon Rekognition Custom Labels dataset. func ExampleRekognition_DeleteDataset_shared00() { svc := rekognition.New(session.New()) input := &rekognition.DeleteDatasetInput{ DatasetArn: aws.String("arn:aws:rekognition:us-east-1:111122223333:project/my-project/dataset/test/1690556733321"), } result, err := svc.DeleteDataset(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case rekognition.ErrCodeInternalServerError: fmt.Println(rekognition.ErrCodeInternalServerError, aerr.Error()) case rekognition.ErrCodeThrottlingException: fmt.Println(rekognition.ErrCodeThrottlingException, aerr.Error()) case rekognition.ErrCodeProvisionedThroughputExceededException: fmt.Println(rekognition.ErrCodeProvisionedThroughputExceededException, aerr.Error()) case rekognition.ErrCodeInvalidParameterException: fmt.Println(rekognition.ErrCodeInvalidParameterException, aerr.Error()) case rekognition.ErrCodeAccessDeniedException: fmt.Println(rekognition.ErrCodeAccessDeniedException, aerr.Error()) case rekognition.ErrCodeLimitExceededException: fmt.Println(rekognition.ErrCodeLimitExceededException, aerr.Error()) case rekognition.ErrCodeResourceInUseException: fmt.Println(rekognition.ErrCodeResourceInUseException, aerr.Error()) case rekognition.ErrCodeResourceNotFoundException: fmt.Println(rekognition.ErrCodeResourceNotFoundException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) } return } fmt.Println(result) } // To delete a face // This operation deletes one or more faces from a Rekognition collection. func ExampleRekognition_DeleteFaces_shared00() { svc := rekognition.New(session.New()) input := &rekognition.DeleteFacesInput{ CollectionId: aws.String("myphotos"), FaceIds: []*string{ aws.String("ff43d742-0c13-5d16-a3e8-03d3f58e980b"), }, } result, err := svc.DeleteFaces(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case rekognition.ErrCodeInvalidParameterException: fmt.Println(rekognition.ErrCodeInvalidParameterException, aerr.Error()) case rekognition.ErrCodeAccessDeniedException: fmt.Println(rekognition.ErrCodeAccessDeniedException, aerr.Error()) case rekognition.ErrCodeInternalServerError: fmt.Println(rekognition.ErrCodeInternalServerError, aerr.Error()) case rekognition.ErrCodeThrottlingException: fmt.Println(rekognition.ErrCodeThrottlingException, aerr.Error()) case rekognition.ErrCodeProvisionedThroughputExceededException: fmt.Println(rekognition.ErrCodeProvisionedThroughputExceededException, aerr.Error()) case rekognition.ErrCodeResourceNotFoundException: fmt.Println(rekognition.ErrCodeResourceNotFoundException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) } return } fmt.Println(result) } // To delete an Amazon Rekognition Custom Labels project // Deletes an Amazon Rekognition Custom Labels projects. func ExampleRekognition_DeleteProject_shared00() { svc := rekognition.New(session.New()) input := &rekognition.DeleteProjectInput{ ProjectArn: aws.String("arn:aws:rekognition:us-east-1:111122223333:project/my-project/1690405809285"), } result, err := svc.DeleteProject(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case rekognition.ErrCodeResourceInUseException: fmt.Println(rekognition.ErrCodeResourceInUseException, aerr.Error()) case rekognition.ErrCodeResourceNotFoundException: fmt.Println(rekognition.ErrCodeResourceNotFoundException, aerr.Error()) case rekognition.ErrCodeInvalidParameterException: fmt.Println(rekognition.ErrCodeInvalidParameterException, aerr.Error()) case rekognition.ErrCodeAccessDeniedException: fmt.Println(rekognition.ErrCodeAccessDeniedException, aerr.Error()) case rekognition.ErrCodeInternalServerError: fmt.Println(rekognition.ErrCodeInternalServerError, aerr.Error()) case rekognition.ErrCodeThrottlingException: fmt.Println(rekognition.ErrCodeThrottlingException, aerr.Error()) case rekognition.ErrCodeProvisionedThroughputExceededException: fmt.Println(rekognition.ErrCodeProvisionedThroughputExceededException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) } return } fmt.Println(result) } // DeleteProjectPolicy // This operation deletes a revision of an existing project policy from an Amazon Rekognition // Custom Labels project. func ExampleRekognition_DeleteProjectPolicy_shared00() { svc := rekognition.New(session.New()) input := &rekognition.DeleteProjectPolicyInput{ PolicyName: aws.String("testPolicy1"), PolicyRevisionId: aws.String("3b274c25e9203a56a99e00e3ff205fbc"), ProjectArn: aws.String("arn:aws:rekognition:us-east-1:111122223333:project/SourceProject/1656557123456"), } result, err := svc.DeleteProjectPolicy(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case rekognition.ErrCodeAccessDeniedException: fmt.Println(rekognition.ErrCodeAccessDeniedException, aerr.Error()) case rekognition.ErrCodeInternalServerError: fmt.Println(rekognition.ErrCodeInternalServerError, aerr.Error()) case rekognition.ErrCodeInvalidParameterException: fmt.Println(rekognition.ErrCodeInvalidParameterException, aerr.Error()) case rekognition.ErrCodeResourceNotFoundException: fmt.Println(rekognition.ErrCodeResourceNotFoundException, aerr.Error()) case rekognition.ErrCodeThrottlingException: fmt.Println(rekognition.ErrCodeThrottlingException, aerr.Error()) case rekognition.ErrCodeProvisionedThroughputExceededException: fmt.Println(rekognition.ErrCodeProvisionedThroughputExceededException, aerr.Error()) case rekognition.ErrCodeInvalidPolicyRevisionIdException: fmt.Println(rekognition.ErrCodeInvalidPolicyRevisionIdException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) } return } fmt.Println(result) } // To delete an Amazon Rekognition Custom Labels model // Deletes a version of an Amazon Rekognition Custom Labels model. func ExampleRekognition_DeleteProjectVersion_shared00() { svc := rekognition.New(session.New()) input := &rekognition.DeleteProjectVersionInput{ ProjectVersionArn: aws.String("arn:aws:rekognition:us-east-1:111122223333:project/my-project/version/1/1690556751958"), } result, err := svc.DeleteProjectVersion(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case rekognition.ErrCodeResourceNotFoundException: fmt.Println(rekognition.ErrCodeResourceNotFoundException, aerr.Error()) case rekognition.ErrCodeResourceInUseException: fmt.Println(rekognition.ErrCodeResourceInUseException, aerr.Error()) case rekognition.ErrCodeInvalidParameterException: fmt.Println(rekognition.ErrCodeInvalidParameterException, aerr.Error()) case rekognition.ErrCodeAccessDeniedException: fmt.Println(rekognition.ErrCodeAccessDeniedException, aerr.Error()) case rekognition.ErrCodeInternalServerError: fmt.Println(rekognition.ErrCodeInternalServerError, aerr.Error()) case rekognition.ErrCodeThrottlingException: fmt.Println(rekognition.ErrCodeThrottlingException, aerr.Error()) case rekognition.ErrCodeProvisionedThroughputExceededException: fmt.Println(rekognition.ErrCodeProvisionedThroughputExceededException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) } return } fmt.Println(result) } // DeleteUser // Deletes the specified UserID within the collection. func ExampleRekognition_DeleteUser_shared00() { svc := rekognition.New(session.New()) input := &rekognition.DeleteUserInput{ ClientRequestToken: aws.String("550e8400-e29b-41d4-a716-446655440001"), CollectionId: aws.String("MyCollection"), UserId: aws.String("DemoUser"), } result, err := svc.DeleteUser(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case rekognition.ErrCodeInvalidParameterException: fmt.Println(rekognition.ErrCodeInvalidParameterException, aerr.Error()) case rekognition.ErrCodeConflictException: fmt.Println(rekognition.ErrCodeConflictException, aerr.Error()) case rekognition.ErrCodeResourceNotFoundException: fmt.Println(rekognition.ErrCodeResourceNotFoundException, aerr.Error()) case rekognition.ErrCodeProvisionedThroughputExceededException: fmt.Println(rekognition.ErrCodeProvisionedThroughputExceededException, aerr.Error()) case rekognition.ErrCodeIdempotentParameterMismatchException: fmt.Println(rekognition.ErrCodeIdempotentParameterMismatchException, aerr.Error()) case rekognition.ErrCodeAccessDeniedException: fmt.Println(rekognition.ErrCodeAccessDeniedException, aerr.Error()) case rekognition.ErrCodeInternalServerError: fmt.Println(rekognition.ErrCodeInternalServerError, aerr.Error()) case rekognition.ErrCodeThrottlingException: fmt.Println(rekognition.ErrCodeThrottlingException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) } return } fmt.Println(result) } // To describe an Amazon Rekognition Custom Labels dataset // Describes an Amazon Rekognition Custom Labels dataset. func ExampleRekognition_DescribeDataset_shared00() { svc := rekognition.New(session.New()) input := &rekognition.DescribeDatasetInput{ DatasetArn: aws.String("arn:aws:rekognition:us-east-1:111122223333:project/my-project/dataset/train/1690476084535"), } result, err := svc.DescribeDataset(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case rekognition.ErrCodeInternalServerError: fmt.Println(rekognition.ErrCodeInternalServerError, aerr.Error()) case rekognition.ErrCodeThrottlingException: fmt.Println(rekognition.ErrCodeThrottlingException, aerr.Error()) case rekognition.ErrCodeProvisionedThroughputExceededException: fmt.Println(rekognition.ErrCodeProvisionedThroughputExceededException, aerr.Error()) case rekognition.ErrCodeInvalidParameterException: fmt.Println(rekognition.ErrCodeInvalidParameterException, aerr.Error()) case rekognition.ErrCodeAccessDeniedException: fmt.Println(rekognition.ErrCodeAccessDeniedException, aerr.Error()) case rekognition.ErrCodeResourceNotFoundException: fmt.Println(rekognition.ErrCodeResourceNotFoundException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) } return } fmt.Println(result) } // To describe an Amazon Rekognition Custom Labels model // Describes a version of an Amazon Rekognition Custom Labels model. func ExampleRekognition_DescribeProjectVersions_shared00() { svc := rekognition.New(session.New()) input := &rekognition.DescribeProjectVersionsInput{ ProjectArn: aws.String("arn:aws:rekognition:us-east-1:111122223333:project/my-project/1690474772815"), VersionNames: []*string{ aws.String("1"), }, } result, err := svc.DescribeProjectVersions(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case rekognition.ErrCodeResourceNotFoundException: fmt.Println(rekognition.ErrCodeResourceNotFoundException, aerr.Error()) case rekognition.ErrCodeInvalidPaginationTokenException: fmt.Println(rekognition.ErrCodeInvalidPaginationTokenException, aerr.Error()) case rekognition.ErrCodeInvalidParameterException: fmt.Println(rekognition.ErrCodeInvalidParameterException, aerr.Error()) case rekognition.ErrCodeAccessDeniedException: fmt.Println(rekognition.ErrCodeAccessDeniedException, aerr.Error()) case rekognition.ErrCodeInternalServerError: fmt.Println(rekognition.ErrCodeInternalServerError, aerr.Error()) case rekognition.ErrCodeThrottlingException: fmt.Println(rekognition.ErrCodeThrottlingException, aerr.Error()) case rekognition.ErrCodeProvisionedThroughputExceededException: fmt.Println(rekognition.ErrCodeProvisionedThroughputExceededException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) } return } fmt.Println(result) } // To describe an Amazon Rekognition Custom Labels project. // Describes an Amazon Rekognition Custom Labels projects. func ExampleRekognition_DescribeProjects_shared00() { svc := rekognition.New(session.New()) input := &rekognition.DescribeProjectsInput{ ProjectNames: []*string{ aws.String("my-project"), }, } result, err := svc.DescribeProjects(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case rekognition.ErrCodeInvalidPaginationTokenException: fmt.Println(rekognition.ErrCodeInvalidPaginationTokenException, aerr.Error()) case rekognition.ErrCodeInvalidParameterException: fmt.Println(rekognition.ErrCodeInvalidParameterException, aerr.Error()) case rekognition.ErrCodeAccessDeniedException: fmt.Println(rekognition.ErrCodeAccessDeniedException, aerr.Error()) case rekognition.ErrCodeInternalServerError: fmt.Println(rekognition.ErrCodeInternalServerError, aerr.Error()) case rekognition.ErrCodeThrottlingException: fmt.Println(rekognition.ErrCodeThrottlingException, aerr.Error()) case rekognition.ErrCodeProvisionedThroughputExceededException: fmt.Println(rekognition.ErrCodeProvisionedThroughputExceededException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) } return } fmt.Println(result) } // To detect custom labels in an image with an Amazon Rekognition Custom Labels model // Detects custom labels in an image with an Amazon Rekognition Custom Labels model func ExampleRekognition_DetectCustomLabels_shared00() { svc := rekognition.New(session.New()) input := &rekognition.DetectCustomLabelsInput{ Image: &rekognition.Image{ S3Object: &rekognition.S3Object{ Bucket: aws.String("custom-labels-console-us-east-1-1111111111"), Name: aws.String("assets/flowers_1_test_dataset/camellia4.jpg"), }, }, MaxResults: aws.Int64(100), MinConfidence: aws.Float64(50.000000), ProjectVersionArn: aws.String("arn:aws:rekognition:us-east-1:111122223333:project/my-project/version/my-project.2023-07-31T11.49.37/1690829378219"), } result, err := svc.DetectCustomLabels(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case rekognition.ErrCodeResourceNotFoundException: fmt.Println(rekognition.ErrCodeResourceNotFoundException, aerr.Error()) case rekognition.ErrCodeResourceNotReadyException: fmt.Println(rekognition.ErrCodeResourceNotReadyException, aerr.Error()) case rekognition.ErrCodeInvalidS3ObjectException: fmt.Println(rekognition.ErrCodeInvalidS3ObjectException, aerr.Error()) case rekognition.ErrCodeInvalidParameterException: fmt.Println(rekognition.ErrCodeInvalidParameterException, aerr.Error()) case rekognition.ErrCodeImageTooLargeException: fmt.Println(rekognition.ErrCodeImageTooLargeException, aerr.Error()) case rekognition.ErrCodeLimitExceededException: fmt.Println(rekognition.ErrCodeLimitExceededException, aerr.Error()) case rekognition.ErrCodeAccessDeniedException: fmt.Println(rekognition.ErrCodeAccessDeniedException, aerr.Error()) case rekognition.ErrCodeInternalServerError: fmt.Println(rekognition.ErrCodeInternalServerError, aerr.Error()) case rekognition.ErrCodeThrottlingException: fmt.Println(rekognition.ErrCodeThrottlingException, aerr.Error()) case rekognition.ErrCodeProvisionedThroughputExceededException: fmt.Println(rekognition.ErrCodeProvisionedThroughputExceededException, aerr.Error()) case rekognition.ErrCodeInvalidImageFormatException: fmt.Println(rekognition.ErrCodeInvalidImageFormatException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) } return } fmt.Println(result) } // To detect faces in an image // This operation detects faces in an image stored in an AWS S3 bucket. func ExampleRekognition_DetectFaces_shared00() { svc := rekognition.New(session.New()) input := &rekognition.DetectFacesInput{ Image: &rekognition.Image{ S3Object: &rekognition.S3Object{ Bucket: aws.String("mybucket"), Name: aws.String("myphoto"), }, }, } result, err := svc.DetectFaces(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case rekognition.ErrCodeInvalidS3ObjectException: fmt.Println(rekognition.ErrCodeInvalidS3ObjectException, aerr.Error()) case rekognition.ErrCodeInvalidParameterException: fmt.Println(rekognition.ErrCodeInvalidParameterException, aerr.Error()) case rekognition.ErrCodeImageTooLargeException: fmt.Println(rekognition.ErrCodeImageTooLargeException, aerr.Error()) case rekognition.ErrCodeAccessDeniedException: fmt.Println(rekognition.ErrCodeAccessDeniedException, aerr.Error()) case rekognition.ErrCodeInternalServerError: fmt.Println(rekognition.ErrCodeInternalServerError, aerr.Error()) case rekognition.ErrCodeThrottlingException: fmt.Println(rekognition.ErrCodeThrottlingException, aerr.Error()) case rekognition.ErrCodeProvisionedThroughputExceededException: fmt.Println(rekognition.ErrCodeProvisionedThroughputExceededException, aerr.Error()) case rekognition.ErrCodeInvalidImageFormatException: fmt.Println(rekognition.ErrCodeInvalidImageFormatException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) } return } fmt.Println(result) } // To detect labels // This operation detects labels in the supplied image func ExampleRekognition_DetectLabels_shared00() { svc := rekognition.New(session.New()) input := &rekognition.DetectLabelsInput{ Image: &rekognition.Image{ S3Object: &rekognition.S3Object{ Bucket: aws.String("mybucket"), Name: aws.String("myphoto"), }, }, MaxLabels: aws.Int64(123), MinConfidence: aws.Float64(70.000000), } result, err := svc.DetectLabels(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case rekognition.ErrCodeInvalidS3ObjectException: fmt.Println(rekognition.ErrCodeInvalidS3ObjectException, aerr.Error()) case rekognition.ErrCodeInvalidParameterException: fmt.Println(rekognition.ErrCodeInvalidParameterException, aerr.Error()) case rekognition.ErrCodeImageTooLargeException: fmt.Println(rekognition.ErrCodeImageTooLargeException, aerr.Error()) case rekognition.ErrCodeAccessDeniedException: fmt.Println(rekognition.ErrCodeAccessDeniedException, aerr.Error()) case rekognition.ErrCodeInternalServerError: fmt.Println(rekognition.ErrCodeInternalServerError, aerr.Error()) case rekognition.ErrCodeThrottlingException: fmt.Println(rekognition.ErrCodeThrottlingException, aerr.Error()) case rekognition.ErrCodeProvisionedThroughputExceededException: fmt.Println(rekognition.ErrCodeProvisionedThroughputExceededException, aerr.Error()) case rekognition.ErrCodeInvalidImageFormatException: fmt.Println(rekognition.ErrCodeInvalidImageFormatException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) } return } fmt.Println(result) } // DisassociateFaces // Removes the association between a Face supplied in an array of FaceIds and the User. func ExampleRekognition_DisassociateFaces_shared00() { svc := rekognition.New(session.New()) input := &rekognition.DisassociateFacesInput{ ClientRequestToken: aws.String("550e8400-e29b-41d4-a716-446655440003"), CollectionId: aws.String("MyCollection"), FaceIds: []*string{ aws.String("f5817d37-94f6-4335-bfee-6cf79a3d806e"), aws.String("c92265d4-5f9c-43af-a58e-12be0ce02bc3"), }, UserId: aws.String("DemoUser"), } result, err := svc.DisassociateFaces(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case rekognition.ErrCodeInvalidParameterException: fmt.Println(rekognition.ErrCodeInvalidParameterException, aerr.Error()) case rekognition.ErrCodeAccessDeniedException: fmt.Println(rekognition.ErrCodeAccessDeniedException, aerr.Error()) case rekognition.ErrCodeInternalServerError: fmt.Println(rekognition.ErrCodeInternalServerError, aerr.Error()) case rekognition.ErrCodeThrottlingException: fmt.Println(rekognition.ErrCodeThrottlingException, aerr.Error()) case rekognition.ErrCodeProvisionedThroughputExceededException: fmt.Println(rekognition.ErrCodeProvisionedThroughputExceededException, aerr.Error()) case rekognition.ErrCodeIdempotentParameterMismatchException: fmt.Println(rekognition.ErrCodeIdempotentParameterMismatchException, aerr.Error()) case rekognition.ErrCodeResourceNotFoundException: fmt.Println(rekognition.ErrCodeResourceNotFoundException, aerr.Error()) case rekognition.ErrCodeConflictException: fmt.Println(rekognition.ErrCodeConflictException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) } return } fmt.Println(result) } // To distribute an Amazon Rekognition Custom Labels dataset // Distributes an Amazon Rekognition Custom Labels training dataset to a test dataset. func ExampleRekognition_DistributeDatasetEntries_shared00() { svc := rekognition.New(session.New()) input := &rekognition.DistributeDatasetEntriesInput{ Datasets: []*rekognition.DistributeDataset{ { Arn: aws.String("arn:aws:rekognition:us-east-1:111122223333:project/my-proj-2/dataset/train/1690564858106"), }, { Arn: aws.String("arn:aws:rekognition:us-east-1:111122223333:project/my-proj-2/dataset/test/1690564858106"), }, }, } result, err := svc.DistributeDatasetEntries(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case rekognition.ErrCodeResourceNotFoundException: fmt.Println(rekognition.ErrCodeResourceNotFoundException, aerr.Error()) case rekognition.ErrCodeInvalidParameterException: fmt.Println(rekognition.ErrCodeInvalidParameterException, aerr.Error()) case rekognition.ErrCodeAccessDeniedException: fmt.Println(rekognition.ErrCodeAccessDeniedException, aerr.Error()) case rekognition.ErrCodeInternalServerError: fmt.Println(rekognition.ErrCodeInternalServerError, aerr.Error()) case rekognition.ErrCodeThrottlingException: fmt.Println(rekognition.ErrCodeThrottlingException, aerr.Error()) case rekognition.ErrCodeProvisionedThroughputExceededException: fmt.Println(rekognition.ErrCodeProvisionedThroughputExceededException, aerr.Error()) case rekognition.ErrCodeResourceNotReadyException: fmt.Println(rekognition.ErrCodeResourceNotReadyException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) } return } fmt.Println(result) } // GetMediaAnalysisJob // Retrieves the results for a given media analysis job. func ExampleRekognition_GetMediaAnalysisJob_shared00() { svc := rekognition.New(session.New()) input := &rekognition.GetMediaAnalysisJobInput{ JobId: aws.String("861a0645d98ef88efb75477628c011c04942d9d5f58faf2703c393c8cf8c1537"), } result, err := svc.GetMediaAnalysisJob(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case rekognition.ErrCodeAccessDeniedException: fmt.Println(rekognition.ErrCodeAccessDeniedException, aerr.Error()) case rekognition.ErrCodeResourceNotFoundException: fmt.Println(rekognition.ErrCodeResourceNotFoundException, aerr.Error()) case rekognition.ErrCodeInternalServerError: fmt.Println(rekognition.ErrCodeInternalServerError, aerr.Error()) case rekognition.ErrCodeInvalidParameterException: fmt.Println(rekognition.ErrCodeInvalidParameterException, aerr.Error()) case rekognition.ErrCodeProvisionedThroughputExceededException: fmt.Println(rekognition.ErrCodeProvisionedThroughputExceededException, aerr.Error()) case rekognition.ErrCodeThrottlingException: fmt.Println(rekognition.ErrCodeThrottlingException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) } return } fmt.Println(result) } // To add a face to a collection // This operation detects faces in an image and adds them to the specified Rekognition // collection. func ExampleRekognition_IndexFaces_shared00() { svc := rekognition.New(session.New()) input := &rekognition.IndexFacesInput{ CollectionId: aws.String("myphotos"), ExternalImageId: aws.String("myphotoid"), Image: &rekognition.Image{ S3Object: &rekognition.S3Object{ Bucket: aws.String("mybucket"), Name: aws.String("myphoto"), }, }, } result, err := svc.IndexFaces(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case rekognition.ErrCodeInvalidS3ObjectException: fmt.Println(rekognition.ErrCodeInvalidS3ObjectException, aerr.Error()) case rekognition.ErrCodeInvalidParameterException: fmt.Println(rekognition.ErrCodeInvalidParameterException, aerr.Error()) case rekognition.ErrCodeImageTooLargeException: fmt.Println(rekognition.ErrCodeImageTooLargeException, aerr.Error()) case rekognition.ErrCodeAccessDeniedException: fmt.Println(rekognition.ErrCodeAccessDeniedException, aerr.Error()) case rekognition.ErrCodeInternalServerError: fmt.Println(rekognition.ErrCodeInternalServerError, aerr.Error()) case rekognition.ErrCodeThrottlingException: fmt.Println(rekognition.ErrCodeThrottlingException, aerr.Error()) case rekognition.ErrCodeProvisionedThroughputExceededException: fmt.Println(rekognition.ErrCodeProvisionedThroughputExceededException, aerr.Error()) case rekognition.ErrCodeResourceNotFoundException: fmt.Println(rekognition.ErrCodeResourceNotFoundException, aerr.Error()) case rekognition.ErrCodeInvalidImageFormatException: fmt.Println(rekognition.ErrCodeInvalidImageFormatException, aerr.Error()) case rekognition.ErrCodeServiceQuotaExceededException: fmt.Println(rekognition.ErrCodeServiceQuotaExceededException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) } return } fmt.Println(result) } // To list the collections // This operation returns a list of Rekognition collections. func ExampleRekognition_ListCollections_shared00() { svc := rekognition.New(session.New()) input := &rekognition.ListCollectionsInput{} result, err := svc.ListCollections(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case rekognition.ErrCodeInvalidParameterException: fmt.Println(rekognition.ErrCodeInvalidParameterException, aerr.Error()) case rekognition.ErrCodeAccessDeniedException: fmt.Println(rekognition.ErrCodeAccessDeniedException, aerr.Error()) case rekognition.ErrCodeInternalServerError: fmt.Println(rekognition.ErrCodeInternalServerError, aerr.Error()) case rekognition.ErrCodeThrottlingException: fmt.Println(rekognition.ErrCodeThrottlingException, aerr.Error()) case rekognition.ErrCodeProvisionedThroughputExceededException: fmt.Println(rekognition.ErrCodeProvisionedThroughputExceededException, aerr.Error()) case rekognition.ErrCodeInvalidPaginationTokenException: fmt.Println(rekognition.ErrCodeInvalidPaginationTokenException, aerr.Error()) case rekognition.ErrCodeResourceNotFoundException: fmt.Println(rekognition.ErrCodeResourceNotFoundException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) } return } fmt.Println(result) } // To list the entries in an Amazon Rekognition Custom Labels dataset // Lists the JSON line entries in an Amazon Rekognition Custom Labels dataset. func ExampleRekognition_ListDatasetEntries_shared00() { svc := rekognition.New(session.New()) input := &rekognition.ListDatasetEntriesInput{ ContainsLabels: []*string{ aws.String("camellia"), }, DatasetArn: aws.String("arn:aws:rekognition:us-east-1:111122223333:project/my-proj-2/dataset/train/1690564858106"), HasErrors: aws.Bool(true), Labeled: aws.Bool(true), MaxResults: aws.Int64(100), NextToken: aws.String(""), SourceRefContains: aws.String("camellia4.jpg"), } result, err := svc.ListDatasetEntries(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case rekognition.ErrCodeInternalServerError: fmt.Println(rekognition.ErrCodeInternalServerError, aerr.Error()) case rekognition.ErrCodeThrottlingException: fmt.Println(rekognition.ErrCodeThrottlingException, aerr.Error()) case rekognition.ErrCodeProvisionedThroughputExceededException: fmt.Println(rekognition.ErrCodeProvisionedThroughputExceededException, aerr.Error()) case rekognition.ErrCodeInvalidParameterException: fmt.Println(rekognition.ErrCodeInvalidParameterException, aerr.Error()) case rekognition.ErrCodeAccessDeniedException: fmt.Println(rekognition.ErrCodeAccessDeniedException, aerr.Error()) case rekognition.ErrCodeResourceInUseException: fmt.Println(rekognition.ErrCodeResourceInUseException, aerr.Error()) case rekognition.ErrCodeResourceNotFoundException: fmt.Println(rekognition.ErrCodeResourceNotFoundException, aerr.Error()) case rekognition.ErrCodeInvalidPaginationTokenException: fmt.Println(rekognition.ErrCodeInvalidPaginationTokenException, aerr.Error()) case rekognition.ErrCodeResourceNotReadyException: fmt.Println(rekognition.ErrCodeResourceNotReadyException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) } return } fmt.Println(result) } // To list the entries in an Amazon Rekognition Custom Labels dataset // Lists the JSON line entries in an Amazon Rekognition Custom Labels dataset. func ExampleRekognition_ListDatasetLabels_shared00() { svc := rekognition.New(session.New()) input := &rekognition.ListDatasetLabelsInput{ DatasetArn: aws.String("arn:aws:rekognition:us-east-1:111122223333:project/my-proj-2/dataset/train/1690564858106"), MaxResults: aws.Int64(100), NextToken: aws.String(""), } result, err := svc.ListDatasetLabels(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case rekognition.ErrCodeInternalServerError: fmt.Println(rekognition.ErrCodeInternalServerError, aerr.Error()) case rekognition.ErrCodeThrottlingException: fmt.Println(rekognition.ErrCodeThrottlingException, aerr.Error()) case rekognition.ErrCodeProvisionedThroughputExceededException: fmt.Println(rekognition.ErrCodeProvisionedThroughputExceededException, aerr.Error()) case rekognition.ErrCodeInvalidParameterException: fmt.Println(rekognition.ErrCodeInvalidParameterException, aerr.Error()) case rekognition.ErrCodeAccessDeniedException: fmt.Println(rekognition.ErrCodeAccessDeniedException, aerr.Error()) case rekognition.ErrCodeResourceInUseException: fmt.Println(rekognition.ErrCodeResourceInUseException, aerr.Error()) case rekognition.ErrCodeInvalidPaginationTokenException: fmt.Println(rekognition.ErrCodeInvalidPaginationTokenException, aerr.Error()) case rekognition.ErrCodeResourceNotFoundException: fmt.Println(rekognition.ErrCodeResourceNotFoundException, aerr.Error()) case rekognition.ErrCodeResourceNotReadyException: fmt.Println(rekognition.ErrCodeResourceNotReadyException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) } return } fmt.Println(result) } // To list the faces in a collection // This operation lists the faces in a Rekognition collection. func ExampleRekognition_ListFaces_shared00() { svc := rekognition.New(session.New()) input := &rekognition.ListFacesInput{ CollectionId: aws.String("myphotos"), MaxResults: aws.Int64(20), } result, err := svc.ListFaces(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case rekognition.ErrCodeInvalidParameterException: fmt.Println(rekognition.ErrCodeInvalidParameterException, aerr.Error()) case rekognition.ErrCodeAccessDeniedException: fmt.Println(rekognition.ErrCodeAccessDeniedException, aerr.Error()) case rekognition.ErrCodeInternalServerError: fmt.Println(rekognition.ErrCodeInternalServerError, aerr.Error()) case rekognition.ErrCodeThrottlingException: fmt.Println(rekognition.ErrCodeThrottlingException, aerr.Error()) case rekognition.ErrCodeProvisionedThroughputExceededException: fmt.Println(rekognition.ErrCodeProvisionedThroughputExceededException, aerr.Error()) case rekognition.ErrCodeInvalidPaginationTokenException: fmt.Println(rekognition.ErrCodeInvalidPaginationTokenException, aerr.Error()) case rekognition.ErrCodeResourceNotFoundException: fmt.Println(rekognition.ErrCodeResourceNotFoundException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) } return } fmt.Println(result) } // ListMediaAnalysisJobs // Returns a list of media analysis jobs. func ExampleRekognition_ListMediaAnalysisJobs_shared00() { svc := rekognition.New(session.New()) input := &rekognition.ListMediaAnalysisJobsInput{ MaxResults: aws.Int64(10), } result, err := svc.ListMediaAnalysisJobs(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case rekognition.ErrCodeAccessDeniedException: fmt.Println(rekognition.ErrCodeAccessDeniedException, aerr.Error()) case rekognition.ErrCodeInternalServerError: fmt.Println(rekognition.ErrCodeInternalServerError, aerr.Error()) case rekognition.ErrCodeInvalidParameterException: fmt.Println(rekognition.ErrCodeInvalidParameterException, aerr.Error()) case rekognition.ErrCodeInvalidPaginationTokenException: fmt.Println(rekognition.ErrCodeInvalidPaginationTokenException, aerr.Error()) case rekognition.ErrCodeProvisionedThroughputExceededException: fmt.Println(rekognition.ErrCodeProvisionedThroughputExceededException, aerr.Error()) case rekognition.ErrCodeThrottlingException: fmt.Println(rekognition.ErrCodeThrottlingException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) } return } fmt.Println(result) } // ListProjectPolicies // This operation lists the project policies that are attached to an Amazon Rekognition // Custom Labels project. func ExampleRekognition_ListProjectPolicies_shared00() { svc := rekognition.New(session.New()) input := &rekognition.ListProjectPoliciesInput{ MaxResults: aws.Int64(5), NextToken: aws.String(""), ProjectArn: aws.String("arn:aws:rekognition:us-east-1:111122223333:project/my-sdk-project/1656557051929"), } result, err := svc.ListProjectPolicies(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case rekognition.ErrCodeAccessDeniedException: fmt.Println(rekognition.ErrCodeAccessDeniedException, aerr.Error()) case rekognition.ErrCodeInternalServerError: fmt.Println(rekognition.ErrCodeInternalServerError, aerr.Error()) case rekognition.ErrCodeInvalidParameterException: fmt.Println(rekognition.ErrCodeInvalidParameterException, aerr.Error()) case rekognition.ErrCodeResourceNotFoundException: fmt.Println(rekognition.ErrCodeResourceNotFoundException, aerr.Error()) case rekognition.ErrCodeThrottlingException: fmt.Println(rekognition.ErrCodeThrottlingException, aerr.Error()) case rekognition.ErrCodeProvisionedThroughputExceededException: fmt.Println(rekognition.ErrCodeProvisionedThroughputExceededException, aerr.Error()) case rekognition.ErrCodeInvalidPaginationTokenException: fmt.Println(rekognition.ErrCodeInvalidPaginationTokenException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) } return } fmt.Println(result) } // ListUsers // Returns metadata of the User such as UserID in the specified collection. func ExampleRekognition_ListUsers_shared00() { svc := rekognition.New(session.New()) input := &rekognition.ListUsersInput{ CollectionId: aws.String("MyCollection"), } result, err := svc.ListUsers(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case rekognition.ErrCodeInvalidParameterException: fmt.Println(rekognition.ErrCodeInvalidParameterException, aerr.Error()) case rekognition.ErrCodeResourceNotFoundException: fmt.Println(rekognition.ErrCodeResourceNotFoundException, aerr.Error()) case rekognition.ErrCodeInvalidPaginationTokenException: fmt.Println(rekognition.ErrCodeInvalidPaginationTokenException, aerr.Error()) case rekognition.ErrCodeProvisionedThroughputExceededException: fmt.Println(rekognition.ErrCodeProvisionedThroughputExceededException, aerr.Error()) case rekognition.ErrCodeAccessDeniedException: fmt.Println(rekognition.ErrCodeAccessDeniedException, aerr.Error()) case rekognition.ErrCodeInternalServerError: fmt.Println(rekognition.ErrCodeInternalServerError, aerr.Error()) case rekognition.ErrCodeThrottlingException: fmt.Println(rekognition.ErrCodeThrottlingException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) } return } fmt.Println(result) } // PutProjectPolicy // This operation attaches a project policy to a Amazon Rekognition Custom Labels project // in a trusting AWS account. func ExampleRekognition_PutProjectPolicy_shared00() { svc := rekognition.New(session.New()) input := &rekognition.PutProjectPolicyInput{ PolicyDocument: aws.String("'{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"ALLOW\",\"Principal\":{\"AWS\":\"principal\"},\"Action\":\"rekognition:CopyProjectVersion\",\"Resource\":\"arn:aws:rekognition:us-east-1:123456789012:project/my-sdk-project/version/DestinationVersionName/1627045542080\"}]}'"), PolicyName: aws.String("SamplePolicy"), PolicyRevisionId: aws.String("0123456789abcdef"), ProjectArn: aws.String("arn:aws:rekognition:us-east-1:111122223333:project/my-sdk-project/1656557051929"), } result, err := svc.PutProjectPolicy(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case rekognition.ErrCodeAccessDeniedException: fmt.Println(rekognition.ErrCodeAccessDeniedException, aerr.Error()) case rekognition.ErrCodeInternalServerError: fmt.Println(rekognition.ErrCodeInternalServerError, aerr.Error()) case rekognition.ErrCodeInvalidParameterException: fmt.Println(rekognition.ErrCodeInvalidParameterException, aerr.Error()) case rekognition.ErrCodeInvalidPolicyRevisionIdException: fmt.Println(rekognition.ErrCodeInvalidPolicyRevisionIdException, aerr.Error()) case rekognition.ErrCodeMalformedPolicyDocumentException: fmt.Println(rekognition.ErrCodeMalformedPolicyDocumentException, aerr.Error()) case rekognition.ErrCodeResourceNotFoundException: fmt.Println(rekognition.ErrCodeResourceNotFoundException, aerr.Error()) case rekognition.ErrCodeResourceAlreadyExistsException: fmt.Println(rekognition.ErrCodeResourceAlreadyExistsException, aerr.Error()) case rekognition.ErrCodeThrottlingException: fmt.Println(rekognition.ErrCodeThrottlingException, aerr.Error()) case rekognition.ErrCodeServiceQuotaExceededException: fmt.Println(rekognition.ErrCodeServiceQuotaExceededException, aerr.Error()) case rekognition.ErrCodeProvisionedThroughputExceededException: fmt.Println(rekognition.ErrCodeProvisionedThroughputExceededException, aerr.Error()) case rekognition.ErrCodeLimitExceededException: fmt.Println(rekognition.ErrCodeLimitExceededException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) } return } fmt.Println(result) } // To delete a face // This operation searches for matching faces in the collection the supplied face belongs // to. func ExampleRekognition_SearchFaces_shared00() { svc := rekognition.New(session.New()) input := &rekognition.SearchFacesInput{ CollectionId: aws.String("myphotos"), FaceId: aws.String("70008e50-75e4-55d0-8e80-363fb73b3a14"), FaceMatchThreshold: aws.Float64(90.000000), MaxFaces: aws.Int64(10), } result, err := svc.SearchFaces(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case rekognition.ErrCodeInvalidParameterException: fmt.Println(rekognition.ErrCodeInvalidParameterException, aerr.Error()) case rekognition.ErrCodeAccessDeniedException: fmt.Println(rekognition.ErrCodeAccessDeniedException, aerr.Error()) case rekognition.ErrCodeInternalServerError: fmt.Println(rekognition.ErrCodeInternalServerError, aerr.Error()) case rekognition.ErrCodeThrottlingException: fmt.Println(rekognition.ErrCodeThrottlingException, aerr.Error()) case rekognition.ErrCodeProvisionedThroughputExceededException: fmt.Println(rekognition.ErrCodeProvisionedThroughputExceededException, aerr.Error()) case rekognition.ErrCodeResourceNotFoundException: fmt.Println(rekognition.ErrCodeResourceNotFoundException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) } return } fmt.Println(result) } // To search for faces matching a supplied image // This operation searches for faces in a Rekognition collection that match the largest // face in an S3 bucket stored image. func ExampleRekognition_SearchFacesByImage_shared00() { svc := rekognition.New(session.New()) input := &rekognition.SearchFacesByImageInput{ CollectionId: aws.String("myphotos"), FaceMatchThreshold: aws.Float64(95.000000), Image: &rekognition.Image{ S3Object: &rekognition.S3Object{ Bucket: aws.String("mybucket"), Name: aws.String("myphoto"), }, }, MaxFaces: aws.Int64(5), } result, err := svc.SearchFacesByImage(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case rekognition.ErrCodeInvalidS3ObjectException: fmt.Println(rekognition.ErrCodeInvalidS3ObjectException, aerr.Error()) case rekognition.ErrCodeInvalidParameterException: fmt.Println(rekognition.ErrCodeInvalidParameterException, aerr.Error()) case rekognition.ErrCodeImageTooLargeException: fmt.Println(rekognition.ErrCodeImageTooLargeException, aerr.Error()) case rekognition.ErrCodeAccessDeniedException: fmt.Println(rekognition.ErrCodeAccessDeniedException, aerr.Error()) case rekognition.ErrCodeInternalServerError: fmt.Println(rekognition.ErrCodeInternalServerError, aerr.Error()) case rekognition.ErrCodeThrottlingException: fmt.Println(rekognition.ErrCodeThrottlingException, aerr.Error()) case rekognition.ErrCodeProvisionedThroughputExceededException: fmt.Println(rekognition.ErrCodeProvisionedThroughputExceededException, aerr.Error()) case rekognition.ErrCodeResourceNotFoundException: fmt.Println(rekognition.ErrCodeResourceNotFoundException, aerr.Error()) case rekognition.ErrCodeInvalidImageFormatException: fmt.Println(rekognition.ErrCodeInvalidImageFormatException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) } return } fmt.Println(result) } // SearchUsers // Searches for UserIDs within a collection based on a FaceId or UserId. func ExampleRekognition_SearchUsers_shared00() { svc := rekognition.New(session.New()) input := &rekognition.SearchUsersInput{ CollectionId: aws.String("MyCollection"), MaxUsers: aws.Int64(2), UserId: aws.String("DemoUser"), UserMatchThreshold: aws.Float64(70.000000), } result, err := svc.SearchUsers(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case rekognition.ErrCodeInvalidParameterException: fmt.Println(rekognition.ErrCodeInvalidParameterException, aerr.Error()) case rekognition.ErrCodeResourceNotFoundException: fmt.Println(rekognition.ErrCodeResourceNotFoundException, aerr.Error()) case rekognition.ErrCodeProvisionedThroughputExceededException: fmt.Println(rekognition.ErrCodeProvisionedThroughputExceededException, aerr.Error()) case rekognition.ErrCodeAccessDeniedException: fmt.Println(rekognition.ErrCodeAccessDeniedException, aerr.Error()) case rekognition.ErrCodeInternalServerError: fmt.Println(rekognition.ErrCodeInternalServerError, aerr.Error()) case rekognition.ErrCodeThrottlingException: fmt.Println(rekognition.ErrCodeThrottlingException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) } return } fmt.Println(result) } // SearchUsersByImage // Searches for UserIDs using a supplied image. func ExampleRekognition_SearchUsersByImage_shared00() { svc := rekognition.New(session.New()) input := &rekognition.SearchUsersByImageInput{ CollectionId: aws.String("MyCollection"), Image: &rekognition.Image{ S3Object: &rekognition.S3Object{ Bucket: aws.String("bucket"), Name: aws.String("input.jpg"), }, }, MaxUsers: aws.Int64(2), QualityFilter: aws.String("MEDIUM"), UserMatchThreshold: aws.Float64(70.000000), } result, err := svc.SearchUsersByImage(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case rekognition.ErrCodeInvalidParameterException: fmt.Println(rekognition.ErrCodeInvalidParameterException, aerr.Error()) case rekognition.ErrCodeResourceNotFoundException: fmt.Println(rekognition.ErrCodeResourceNotFoundException, aerr.Error()) case rekognition.ErrCodeInvalidImageFormatException: fmt.Println(rekognition.ErrCodeInvalidImageFormatException, aerr.Error()) case rekognition.ErrCodeInvalidS3ObjectException: fmt.Println(rekognition.ErrCodeInvalidS3ObjectException, aerr.Error()) case rekognition.ErrCodeImageTooLargeException: fmt.Println(rekognition.ErrCodeImageTooLargeException, aerr.Error()) case rekognition.ErrCodeProvisionedThroughputExceededException: fmt.Println(rekognition.ErrCodeProvisionedThroughputExceededException, aerr.Error()) case rekognition.ErrCodeAccessDeniedException: fmt.Println(rekognition.ErrCodeAccessDeniedException, aerr.Error()) case rekognition.ErrCodeInternalServerError: fmt.Println(rekognition.ErrCodeInternalServerError, aerr.Error()) case rekognition.ErrCodeThrottlingException: fmt.Println(rekognition.ErrCodeThrottlingException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) } return } fmt.Println(result) } // StartMediaAnalysisJob // Initiates a new media analysis job. func ExampleRekognition_StartMediaAnalysisJob_shared00() { svc := rekognition.New(session.New()) input := &rekognition.StartMediaAnalysisJobInput{ Input: &rekognition.MediaAnalysisInput_{ S3Object: &rekognition.S3Object{ Bucket: aws.String("input-bucket"), Name: aws.String("input-manifest.json"), }, }, JobName: aws.String("job-name"), OperationsConfig: &rekognition.MediaAnalysisOperationsConfig{ DetectModerationLabels: &rekognition.MediaAnalysisDetectModerationLabelsConfig{ MinConfidence: aws.Float64(50.000000), ProjectVersion: aws.String("arn:aws:rekognition:us-east-1:111122223333:project/my-project/version/1/1690556751958"), }, }, OutputConfig: &rekognition.MediaAnalysisOutputConfig{ S3Bucket: aws.String("output-bucket"), S3KeyPrefix: aws.String("output-location"), }, } result, err := svc.StartMediaAnalysisJob(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case rekognition.ErrCodeInternalServerError: fmt.Println(rekognition.ErrCodeInternalServerError, aerr.Error()) case rekognition.ErrCodeAccessDeniedException: fmt.Println(rekognition.ErrCodeAccessDeniedException, aerr.Error()) case rekognition.ErrCodeInvalidParameterException: fmt.Println(rekognition.ErrCodeInvalidParameterException, aerr.Error()) case rekognition.ErrCodeInvalidManifestException: fmt.Println(rekognition.ErrCodeInvalidManifestException, aerr.Error()) case rekognition.ErrCodeInvalidS3ObjectException: fmt.Println(rekognition.ErrCodeInvalidS3ObjectException, aerr.Error()) case rekognition.ErrCodeResourceNotFoundException: fmt.Println(rekognition.ErrCodeResourceNotFoundException, aerr.Error()) case rekognition.ErrCodeResourceNotReadyException: fmt.Println(rekognition.ErrCodeResourceNotReadyException, aerr.Error()) case rekognition.ErrCodeProvisionedThroughputExceededException: fmt.Println(rekognition.ErrCodeProvisionedThroughputExceededException, aerr.Error()) case rekognition.ErrCodeLimitExceededException: fmt.Println(rekognition.ErrCodeLimitExceededException, aerr.Error()) case rekognition.ErrCodeThrottlingException: fmt.Println(rekognition.ErrCodeThrottlingException, aerr.Error()) case rekognition.ErrCodeIdempotentParameterMismatchException: fmt.Println(rekognition.ErrCodeIdempotentParameterMismatchException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) } return } fmt.Println(result) } // To start an Amazon Rekognition Custom Labels model // Starts a version of an Amazon Rekognition Custom Labels model. func ExampleRekognition_StartProjectVersion_shared00() { svc := rekognition.New(session.New()) input := &rekognition.StartProjectVersionInput{ MaxInferenceUnits: aws.Int64(1), MinInferenceUnits: aws.Int64(1), ProjectVersionArn: aws.String("arn:aws:rekognition:us-east-1:111122223333:project/my-project/version/1/1690556751958"), } result, err := svc.StartProjectVersion(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case rekognition.ErrCodeResourceNotFoundException: fmt.Println(rekognition.ErrCodeResourceNotFoundException, aerr.Error()) case rekognition.ErrCodeResourceInUseException: fmt.Println(rekognition.ErrCodeResourceInUseException, aerr.Error()) case rekognition.ErrCodeLimitExceededException: fmt.Println(rekognition.ErrCodeLimitExceededException, aerr.Error()) case rekognition.ErrCodeInvalidParameterException: fmt.Println(rekognition.ErrCodeInvalidParameterException, aerr.Error()) case rekognition.ErrCodeAccessDeniedException: fmt.Println(rekognition.ErrCodeAccessDeniedException, aerr.Error()) case rekognition.ErrCodeInternalServerError: fmt.Println(rekognition.ErrCodeInternalServerError, aerr.Error()) case rekognition.ErrCodeThrottlingException: fmt.Println(rekognition.ErrCodeThrottlingException, aerr.Error()) case rekognition.ErrCodeProvisionedThroughputExceededException: fmt.Println(rekognition.ErrCodeProvisionedThroughputExceededException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) } return } fmt.Println(result) } // To stop an Amazon Rekognition Custom Labels model. // Stops a version of an Amazon Rekognition Custom Labels model. func ExampleRekognition_StopProjectVersion_shared00() { svc := rekognition.New(session.New()) input := &rekognition.StopProjectVersionInput{ ProjectVersionArn: aws.String("arn:aws:rekognition:us-east-1:111122223333:project/my-project/version/1/1690556751958"), } result, err := svc.StopProjectVersion(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case rekognition.ErrCodeResourceNotFoundException: fmt.Println(rekognition.ErrCodeResourceNotFoundException, aerr.Error()) case rekognition.ErrCodeResourceInUseException: fmt.Println(rekognition.ErrCodeResourceInUseException, aerr.Error()) case rekognition.ErrCodeInvalidParameterException: fmt.Println(rekognition.ErrCodeInvalidParameterException, aerr.Error()) case rekognition.ErrCodeAccessDeniedException: fmt.Println(rekognition.ErrCodeAccessDeniedException, aerr.Error()) case rekognition.ErrCodeInternalServerError: fmt.Println(rekognition.ErrCodeInternalServerError, aerr.Error()) case rekognition.ErrCodeThrottlingException: fmt.Println(rekognition.ErrCodeThrottlingException, aerr.Error()) case rekognition.ErrCodeProvisionedThroughputExceededException: fmt.Println(rekognition.ErrCodeProvisionedThroughputExceededException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) } return } fmt.Println(result) } // To-add dataset entries to an Amazon Rekognition Custom Labels dataset // Adds dataset entries to an Amazon Rekognition Custom Labels dataset. func ExampleRekognition_UpdateDatasetEntries_shared00() { svc := rekognition.New(session.New()) input := &rekognition.UpdateDatasetEntriesInput{ Changes: &rekognition.DatasetChanges{ GroundTruth: []byte("{\"source-ref\":\"s3://custom-labels-console-us-east-1-111111111/assets/flowers_1_test_dataset/mediterranean_spurge4.jpg\",\"mediterranean_spurge\":1,\"mediterranean_spurge-metadata\":{\"confidence\":1,\"job-name\":\"labeling-job/mediterranean_spurge\",\"class-name\":\"mediterranean_spurge\",\"human-annotated\":\"yes\",\"creation-date\":\"2021-07-11T03:33:42.025Z\",\"type\":\"groundtruth/image-classification\"},\"with_leaves\":1,\"with_leaves-metadata\":{\"confidence\":1,\"job-name\":\"labeling-job/with_leaves\",\"class-name\":\"with_leaves\",\"human-annotated\":\"yes\",\"creation-date\":\"2021-07-11T03:33:42.025Z\",\"type\":\"groundtruth/image-classification\"}}"), }, DatasetArn: aws.String("arn:aws:rekognition:us-east-1:111122223333:project/my-proj-2/dataset/train/1690564858106"), } result, err := svc.UpdateDatasetEntries(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case rekognition.ErrCodeInternalServerError: fmt.Println(rekognition.ErrCodeInternalServerError, aerr.Error()) case rekognition.ErrCodeThrottlingException: fmt.Println(rekognition.ErrCodeThrottlingException, aerr.Error()) case rekognition.ErrCodeProvisionedThroughputExceededException: fmt.Println(rekognition.ErrCodeProvisionedThroughputExceededException, aerr.Error()) case rekognition.ErrCodeInvalidParameterException: fmt.Println(rekognition.ErrCodeInvalidParameterException, aerr.Error()) case rekognition.ErrCodeAccessDeniedException: fmt.Println(rekognition.ErrCodeAccessDeniedException, aerr.Error()) case rekognition.ErrCodeLimitExceededException: fmt.Println(rekognition.ErrCodeLimitExceededException, aerr.Error()) case rekognition.ErrCodeResourceInUseException: fmt.Println(rekognition.ErrCodeResourceInUseException, aerr.Error()) case rekognition.ErrCodeResourceNotFoundException: fmt.Println(rekognition.ErrCodeResourceNotFoundException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) } return } fmt.Println(result) }