Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
11034 lines (9627 sloc) 382 KB
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package rekognition
import (
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awsutil"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/private/protocol"
"github.com/aws/aws-sdk-go/private/protocol/jsonrpc"
)
const opCompareFaces = "CompareFaces"
// CompareFacesRequest generates a "aws/request.Request" representing the
// client's request for the CompareFaces operation. The "output" return
// value will be populated with the request's response once the request completes
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See CompareFaces for more information on using the CompareFaces
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the CompareFacesRequest method.
// req, resp := client.CompareFacesRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
func (c *Rekognition) CompareFacesRequest(input *CompareFacesInput) (req *request.Request, output *CompareFacesOutput) {
op := &request.Operation{
Name: opCompareFaces,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &CompareFacesInput{}
}
output = &CompareFacesOutput{}
req = c.newRequest(op, input, output)
return
}
// CompareFaces API operation for Amazon Rekognition.
//
// Compares a face in the source input image with each of the 100 largest faces
// detected in the target input image.
//
// If the source image contains multiple faces, the service detects the largest
// face and compares it with each face detected in the target image.
//
// You pass the input and target images either as base64-encoded image bytes
// or as references to images in an Amazon S3 bucket. If you use the AWS CLI
// to call Amazon Rekognition operations, passing image bytes isn't supported.
// The image must be formatted as a PNG or JPEG 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 Comparing Faces in Images in the Amazon Rekognition Developer
// Guide.
//
// This operation requires permissions to perform the rekognition:CompareFaces
// action.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon Rekognition's
// API operation CompareFaces for usage and error information.
//
// Returned Error Codes:
// * ErrCodeInvalidParameterException "InvalidParameterException"
// Input parameter violated a constraint. Validate your parameter before calling
// the API operation again.
//
// * ErrCodeInvalidS3ObjectException "InvalidS3ObjectException"
// Amazon Rekognition is unable to access the S3 object specified in the request.
//
// * ErrCodeImageTooLargeException "ImageTooLargeException"
// The input image size exceeds the allowed limit. For more information, see
// Limits in Amazon Rekognition in the Amazon Rekognition Developer Guide.
//
// * ErrCodeAccessDeniedException "AccessDeniedException"
// You are not authorized to perform the action.
//
// * ErrCodeInternalServerError "InternalServerError"
// Amazon Rekognition experienced a service issue. Try your call again.
//
// * ErrCodeThrottlingException "ThrottlingException"
// Amazon Rekognition is temporarily unable to process the request. Try your
// call again.
//
// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException"
// The number of requests exceeded your throughput limit. If you want to increase
// this limit, contact Amazon Rekognition.
//
// * ErrCodeInvalidImageFormatException "InvalidImageFormatException"
// The provided image format is not supported.
//
func (c *Rekognition) CompareFaces(input *CompareFacesInput) (*CompareFacesOutput, error) {
req, out := c.CompareFacesRequest(input)
return out, req.Send()
}
// CompareFacesWithContext is the same as CompareFaces with the addition of
// the ability to pass a context and additional request options.
//
// See CompareFaces for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *Rekognition) CompareFacesWithContext(ctx aws.Context, input *CompareFacesInput, opts ...request.Option) (*CompareFacesOutput, error) {
req, out := c.CompareFacesRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opCreateCollection = "CreateCollection"
// CreateCollectionRequest generates a "aws/request.Request" representing the
// client's request for the CreateCollection operation. The "output" return
// value will be populated with the request's response once the request completes
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See CreateCollection for more information on using the CreateCollection
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the CreateCollectionRequest method.
// req, resp := client.CreateCollectionRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
func (c *Rekognition) CreateCollectionRequest(input *CreateCollectionInput) (req *request.Request, output *CreateCollectionOutput) {
op := &request.Operation{
Name: opCreateCollection,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &CreateCollectionInput{}
}
output = &CreateCollectionOutput{}
req = c.newRequest(op, input, output)
return
}
// CreateCollection API operation for Amazon Rekognition.
//
// Creates a collection in an AWS Region. You can add faces to the collection
// using the IndexFaces 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.
//
// When you create a collection, it is associated with the latest version of
// the face model version.
//
// Collection names are case-sensitive.
//
// This operation requires permissions to perform the rekognition:CreateCollection
// action.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon Rekognition's
// API operation CreateCollection for usage and error information.
//
// Returned Error Codes:
// * ErrCodeInvalidParameterException "InvalidParameterException"
// Input parameter violated a constraint. Validate your parameter before calling
// the API operation again.
//
// * ErrCodeAccessDeniedException "AccessDeniedException"
// You are not authorized to perform the action.
//
// * ErrCodeInternalServerError "InternalServerError"
// Amazon Rekognition experienced a service issue. Try your call again.
//
// * ErrCodeThrottlingException "ThrottlingException"
// Amazon Rekognition is temporarily unable to process the request. Try your
// call again.
//
// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException"
// The number of requests exceeded your throughput limit. If you want to increase
// this limit, contact Amazon Rekognition.
//
// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException"
// A collection with the specified ID already exists.
//
func (c *Rekognition) CreateCollection(input *CreateCollectionInput) (*CreateCollectionOutput, error) {
req, out := c.CreateCollectionRequest(input)
return out, req.Send()
}
// CreateCollectionWithContext is the same as CreateCollection with the addition of
// the ability to pass a context and additional request options.
//
// See CreateCollection for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *Rekognition) CreateCollectionWithContext(ctx aws.Context, input *CreateCollectionInput, opts ...request.Option) (*CreateCollectionOutput, error) {
req, out := c.CreateCollectionRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opCreateStreamProcessor = "CreateStreamProcessor"
// CreateStreamProcessorRequest generates a "aws/request.Request" representing the
// client's request for the CreateStreamProcessor operation. The "output" return
// value will be populated with the request's response once the request completes
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See CreateStreamProcessor for more information on using the CreateStreamProcessor
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the CreateStreamProcessorRequest method.
// req, resp := client.CreateStreamProcessorRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
func (c *Rekognition) CreateStreamProcessorRequest(input *CreateStreamProcessorInput) (req *request.Request, output *CreateStreamProcessorOutput) {
op := &request.Operation{
Name: opCreateStreamProcessor,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &CreateStreamProcessorInput{}
}
output = &CreateStreamProcessorOutput{}
req = c.newRequest(op, input, output)
return
}
// CreateStreamProcessor API operation for Amazon Rekognition.
//
// Creates an Amazon Rekognition stream processor that you can use to detect
// and recognize faces in a streaming video.
//
// Amazon Rekognition Video is a consumer of live video from Amazon Kinesis
// Video Streams. Amazon 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 StartStreamProcessor with the Name field.
//
// After you have finished analyzing a streaming video, use StopStreamProcessor
// to stop processing. You can delete the stream processor by calling DeleteStreamProcessor.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon Rekognition's
// API operation CreateStreamProcessor for usage and error information.
//
// Returned Error Codes:
// * ErrCodeAccessDeniedException "AccessDeniedException"
// You are not authorized to perform the action.
//
// * ErrCodeInternalServerError "InternalServerError"
// Amazon Rekognition experienced a service issue. Try your call again.
//
// * ErrCodeThrottlingException "ThrottlingException"
// Amazon Rekognition is temporarily unable to process the request. Try your
// call again.
//
// * ErrCodeInvalidParameterException "InvalidParameterException"
// Input parameter violated a constraint. Validate your parameter before calling
// the API operation again.
//
// * ErrCodeLimitExceededException "LimitExceededException"
// An Amazon Rekognition service limit was exceeded. For example, if you start
// too many Amazon Rekognition Video jobs concurrently, calls to start operations
// (StartLabelDetection, for example) will raise a LimitExceededException exception
// (HTTP status code: 400) until the number of concurrently running jobs is
// below the Amazon Rekognition service limit.
//
// * ErrCodeResourceInUseException "ResourceInUseException"
//
// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException"
// The number of requests exceeded your throughput limit. If you want to increase
// this limit, contact Amazon Rekognition.
//
func (c *Rekognition) CreateStreamProcessor(input *CreateStreamProcessorInput) (*CreateStreamProcessorOutput, error) {
req, out := c.CreateStreamProcessorRequest(input)
return out, req.Send()
}
// CreateStreamProcessorWithContext is the same as CreateStreamProcessor with the addition of
// the ability to pass a context and additional request options.
//
// See CreateStreamProcessor for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *Rekognition) CreateStreamProcessorWithContext(ctx aws.Context, input *CreateStreamProcessorInput, opts ...request.Option) (*CreateStreamProcessorOutput, error) {
req, out := c.CreateStreamProcessorRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opDeleteCollection = "DeleteCollection"
// DeleteCollectionRequest generates a "aws/request.Request" representing the
// client's request for the DeleteCollection operation. The "output" return
// value will be populated with the request's response once the request completes
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See DeleteCollection for more information on using the DeleteCollection
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the DeleteCollectionRequest method.
// req, resp := client.DeleteCollectionRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
func (c *Rekognition) DeleteCollectionRequest(input *DeleteCollectionInput) (req *request.Request, output *DeleteCollectionOutput) {
op := &request.Operation{
Name: opDeleteCollection,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DeleteCollectionInput{}
}
output = &DeleteCollectionOutput{}
req = c.newRequest(op, input, output)
return
}
// DeleteCollection API operation for Amazon Rekognition.
//
// Deletes the specified collection. Note that this operation removes all faces
// in the collection. For an example, see delete-collection-procedure.
//
// This operation requires permissions to perform the rekognition:DeleteCollection
// action.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon Rekognition's
// API operation DeleteCollection for usage and error information.
//
// Returned Error Codes:
// * ErrCodeInvalidParameterException "InvalidParameterException"
// Input parameter violated a constraint. Validate your parameter before calling
// the API operation again.
//
// * ErrCodeAccessDeniedException "AccessDeniedException"
// You are not authorized to perform the action.
//
// * ErrCodeInternalServerError "InternalServerError"
// Amazon Rekognition experienced a service issue. Try your call again.
//
// * ErrCodeThrottlingException "ThrottlingException"
// Amazon Rekognition is temporarily unable to process the request. Try your
// call again.
//
// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException"
// The number of requests exceeded your throughput limit. If you want to increase
// this limit, contact Amazon Rekognition.
//
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
// The collection specified in the request cannot be found.
//
func (c *Rekognition) DeleteCollection(input *DeleteCollectionInput) (*DeleteCollectionOutput, error) {
req, out := c.DeleteCollectionRequest(input)
return out, req.Send()
}
// DeleteCollectionWithContext is the same as DeleteCollection with the addition of
// the ability to pass a context and additional request options.
//
// See DeleteCollection for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *Rekognition) DeleteCollectionWithContext(ctx aws.Context, input *DeleteCollectionInput, opts ...request.Option) (*DeleteCollectionOutput, error) {
req, out := c.DeleteCollectionRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opDeleteFaces = "DeleteFaces"
// DeleteFacesRequest generates a "aws/request.Request" representing the
// client's request for the DeleteFaces operation. The "output" return
// value will be populated with the request's response once the request completes
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See DeleteFaces for more information on using the DeleteFaces
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the DeleteFacesRequest method.
// req, resp := client.DeleteFacesRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
func (c *Rekognition) DeleteFacesRequest(input *DeleteFacesInput) (req *request.Request, output *DeleteFacesOutput) {
op := &request.Operation{
Name: opDeleteFaces,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DeleteFacesInput{}
}
output = &DeleteFacesOutput{}
req = c.newRequest(op, input, output)
return
}
// DeleteFaces API operation for Amazon Rekognition.
//
// Deletes faces from a collection. You specify a collection ID and an array
// of face IDs to remove from the collection.
//
// This operation requires permissions to perform the rekognition:DeleteFaces
// action.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon Rekognition's
// API operation DeleteFaces for usage and error information.
//
// Returned Error Codes:
// * ErrCodeInvalidParameterException "InvalidParameterException"
// Input parameter violated a constraint. Validate your parameter before calling
// the API operation again.
//
// * ErrCodeAccessDeniedException "AccessDeniedException"
// You are not authorized to perform the action.
//
// * ErrCodeInternalServerError "InternalServerError"
// Amazon Rekognition experienced a service issue. Try your call again.
//
// * ErrCodeThrottlingException "ThrottlingException"
// Amazon Rekognition is temporarily unable to process the request. Try your
// call again.
//
// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException"
// The number of requests exceeded your throughput limit. If you want to increase
// this limit, contact Amazon Rekognition.
//
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
// The collection specified in the request cannot be found.
//
func (c *Rekognition) DeleteFaces(input *DeleteFacesInput) (*DeleteFacesOutput, error) {
req, out := c.DeleteFacesRequest(input)
return out, req.Send()
}
// DeleteFacesWithContext is the same as DeleteFaces with the addition of
// the ability to pass a context and additional request options.
//
// See DeleteFaces for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *Rekognition) DeleteFacesWithContext(ctx aws.Context, input *DeleteFacesInput, opts ...request.Option) (*DeleteFacesOutput, error) {
req, out := c.DeleteFacesRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opDeleteStreamProcessor = "DeleteStreamProcessor"
// DeleteStreamProcessorRequest generates a "aws/request.Request" representing the
// client's request for the DeleteStreamProcessor operation. The "output" return
// value will be populated with the request's response once the request completes
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See DeleteStreamProcessor for more information on using the DeleteStreamProcessor
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the DeleteStreamProcessorRequest method.
// req, resp := client.DeleteStreamProcessorRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
func (c *Rekognition) DeleteStreamProcessorRequest(input *DeleteStreamProcessorInput) (req *request.Request, output *DeleteStreamProcessorOutput) {
op := &request.Operation{
Name: opDeleteStreamProcessor,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DeleteStreamProcessorInput{}
}
output = &DeleteStreamProcessorOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
// DeleteStreamProcessor API operation for Amazon Rekognition.
//
// Deletes the stream processor identified by Name. You assign the value for
// Name when you create the stream processor with CreateStreamProcessor. You
// might not be able to use the same name for a stream processor for a few seconds
// after calling DeleteStreamProcessor.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon Rekognition's
// API operation DeleteStreamProcessor for usage and error information.
//
// Returned Error Codes:
// * ErrCodeAccessDeniedException "AccessDeniedException"
// You are not authorized to perform the action.
//
// * ErrCodeInternalServerError "InternalServerError"
// Amazon Rekognition experienced a service issue. Try your call again.
//
// * ErrCodeThrottlingException "ThrottlingException"
// Amazon Rekognition is temporarily unable to process the request. Try your
// call again.
//
// * ErrCodeInvalidParameterException "InvalidParameterException"
// Input parameter violated a constraint. Validate your parameter before calling
// the API operation again.
//
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
// The collection specified in the request cannot be found.
//
// * ErrCodeResourceInUseException "ResourceInUseException"
//
// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException"
// The number of requests exceeded your throughput limit. If you want to increase
// this limit, contact Amazon Rekognition.
//
func (c *Rekognition) DeleteStreamProcessor(input *DeleteStreamProcessorInput) (*DeleteStreamProcessorOutput, error) {
req, out := c.DeleteStreamProcessorRequest(input)
return out, req.Send()
}
// DeleteStreamProcessorWithContext is the same as DeleteStreamProcessor with the addition of
// the ability to pass a context and additional request options.
//
// See DeleteStreamProcessor for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *Rekognition) DeleteStreamProcessorWithContext(ctx aws.Context, input *DeleteStreamProcessorInput, opts ...request.Option) (*DeleteStreamProcessorOutput, error) {
req, out := c.DeleteStreamProcessorRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opDescribeCollection = "DescribeCollection"
// DescribeCollectionRequest generates a "aws/request.Request" representing the
// client's request for the DescribeCollection operation. The "output" return
// value will be populated with the request's response once the request completes
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See DescribeCollection for more information on using the DescribeCollection
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the DescribeCollectionRequest method.
// req, resp := client.DescribeCollectionRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
func (c *Rekognition) DescribeCollectionRequest(input *DescribeCollectionInput) (req *request.Request, output *DescribeCollectionOutput) {
op := &request.Operation{
Name: opDescribeCollection,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DescribeCollectionInput{}
}
output = &DescribeCollectionOutput{}
req = c.newRequest(op, input, output)
return
}
// DescribeCollection API operation for Amazon Rekognition.
//
// Describes the specified collection. You can use DescribeCollection to get
// information, such as the number of faces indexed into a collection and the
// version of the model used by the collection for face detection.
//
// For more information, see Describing a Collection in the Amazon Rekognition
// Developer Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon Rekognition's
// API operation DescribeCollection for usage and error information.
//
// Returned Error Codes:
// * ErrCodeInvalidParameterException "InvalidParameterException"
// Input parameter violated a constraint. Validate your parameter before calling
// the API operation again.
//
// * ErrCodeAccessDeniedException "AccessDeniedException"
// You are not authorized to perform the action.
//
// * ErrCodeInternalServerError "InternalServerError"
// Amazon Rekognition experienced a service issue. Try your call again.
//
// * ErrCodeThrottlingException "ThrottlingException"
// Amazon Rekognition is temporarily unable to process the request. Try your
// call again.
//
// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException"
// The number of requests exceeded your throughput limit. If you want to increase
// this limit, contact Amazon Rekognition.
//
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
// The collection specified in the request cannot be found.
//
func (c *Rekognition) DescribeCollection(input *DescribeCollectionInput) (*DescribeCollectionOutput, error) {
req, out := c.DescribeCollectionRequest(input)
return out, req.Send()
}
// DescribeCollectionWithContext is the same as DescribeCollection with the addition of
// the ability to pass a context and additional request options.
//
// See DescribeCollection for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *Rekognition) DescribeCollectionWithContext(ctx aws.Context, input *DescribeCollectionInput, opts ...request.Option) (*DescribeCollectionOutput, error) {
req, out := c.DescribeCollectionRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opDescribeStreamProcessor = "DescribeStreamProcessor"
// DescribeStreamProcessorRequest generates a "aws/request.Request" representing the
// client's request for the DescribeStreamProcessor operation. The "output" return
// value will be populated with the request's response once the request completes
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See DescribeStreamProcessor for more information on using the DescribeStreamProcessor
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the DescribeStreamProcessorRequest method.
// req, resp := client.DescribeStreamProcessorRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
func (c *Rekognition) DescribeStreamProcessorRequest(input *DescribeStreamProcessorInput) (req *request.Request, output *DescribeStreamProcessorOutput) {
op := &request.Operation{
Name: opDescribeStreamProcessor,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DescribeStreamProcessorInput{}
}
output = &DescribeStreamProcessorOutput{}
req = c.newRequest(op, input, output)
return
}
// DescribeStreamProcessor API operation for Amazon Rekognition.
//
// Provides information about a stream processor created by CreateStreamProcessor.
// You can get information about the input and output streams, the input parameters
// for the face recognition being performed, and the current status of the stream
// processor.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon Rekognition's
// API operation DescribeStreamProcessor for usage and error information.
//
// Returned Error Codes:
// * ErrCodeAccessDeniedException "AccessDeniedException"
// You are not authorized to perform the action.
//
// * ErrCodeInternalServerError "InternalServerError"
// Amazon Rekognition experienced a service issue. Try your call again.
//
// * ErrCodeThrottlingException "ThrottlingException"
// Amazon Rekognition is temporarily unable to process the request. Try your
// call again.
//
// * ErrCodeInvalidParameterException "InvalidParameterException"
// Input parameter violated a constraint. Validate your parameter before calling
// the API operation again.
//
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
// The collection specified in the request cannot be found.
//
// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException"
// The number of requests exceeded your throughput limit. If you want to increase
// this limit, contact Amazon Rekognition.
//
func (c *Rekognition) DescribeStreamProcessor(input *DescribeStreamProcessorInput) (*DescribeStreamProcessorOutput, error) {
req, out := c.DescribeStreamProcessorRequest(input)
return out, req.Send()
}
// DescribeStreamProcessorWithContext is the same as DescribeStreamProcessor with the addition of
// the ability to pass a context and additional request options.
//
// See DescribeStreamProcessor for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *Rekognition) DescribeStreamProcessorWithContext(ctx aws.Context, input *DescribeStreamProcessorInput, opts ...request.Option) (*DescribeStreamProcessorOutput, error) {
req, out := c.DescribeStreamProcessorRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opDetectFaces = "DetectFaces"
// DetectFacesRequest generates a "aws/request.Request" representing the
// client's request for the DetectFaces operation. The "output" return
// value will be populated with the request's response once the request completes
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See DetectFaces for more information on using the DetectFaces
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the DetectFacesRequest method.
// req, resp := client.DetectFacesRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
func (c *Rekognition) DetectFacesRequest(input *DetectFacesInput) (req *request.Request, output *DetectFacesOutput) {
op := &request.Operation{
Name: opDetectFaces,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DetectFacesInput{}
}
output = &DetectFacesOutput{}
req = c.newRequest(op, input, output)
return
}
// DetectFaces API operation for Amazon Rekognition.
//
// Detects faces within an image that is provided as input.
//
// DetectFaces detects the 100 largest faces in the image. For each face detected,
// the operation returns face details. These details include 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, and so on.
//
// The face-detection algorithm is most effective on frontal faces. For non-frontal
// or obscured faces, the algorithm might 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 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.
//
// This operation requires permissions to perform the rekognition:DetectFaces
// action.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon Rekognition's
// API operation DetectFaces for usage and error information.
//
// Returned Error Codes:
// * ErrCodeInvalidS3ObjectException "InvalidS3ObjectException"
// Amazon Rekognition is unable to access the S3 object specified in the request.
//
// * ErrCodeInvalidParameterException "InvalidParameterException"
// Input parameter violated a constraint. Validate your parameter before calling
// the API operation again.
//
// * ErrCodeImageTooLargeException "ImageTooLargeException"
// The input image size exceeds the allowed limit. For more information, see
// Limits in Amazon Rekognition in the Amazon Rekognition Developer Guide.
//
// * ErrCodeAccessDeniedException "AccessDeniedException"
// You are not authorized to perform the action.
//
// * ErrCodeInternalServerError "InternalServerError"
// Amazon Rekognition experienced a service issue. Try your call again.
//
// * ErrCodeThrottlingException "ThrottlingException"
// Amazon Rekognition is temporarily unable to process the request. Try your
// call again.
//
// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException"
// The number of requests exceeded your throughput limit. If you want to increase
// this limit, contact Amazon Rekognition.
//
// * ErrCodeInvalidImageFormatException "InvalidImageFormatException"
// The provided image format is not supported.
//
func (c *Rekognition) DetectFaces(input *DetectFacesInput) (*DetectFacesOutput, error) {
req, out := c.DetectFacesRequest(input)
return out, req.Send()
}
// DetectFacesWithContext is the same as DetectFaces with the addition of
// the ability to pass a context and additional request options.
//
// See DetectFaces for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *Rekognition) DetectFacesWithContext(ctx aws.Context, input *DetectFacesInput, opts ...request.Option) (*DetectFacesOutput, error) {
req, out := c.DetectFacesRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opDetectLabels = "DetectLabels"
// DetectLabelsRequest generates a "aws/request.Request" representing the
// client's request for the DetectLabels operation. The "output" return
// value will be populated with the request's response once the request completes
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See DetectLabels for more information on using the DetectLabels
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the DetectLabelsRequest method.
// req, resp := client.DetectLabelsRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
func (c *Rekognition) DetectLabelsRequest(input *DetectLabelsInput) (req *request.Request, output *DetectLabelsOutput) {
op := &request.Operation{
Name: opDetectLabels,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DetectLabelsInput{}
}
output = &DetectLabelsOutput{}
req = c.newRequest(op, input, output)
return
}
// DetectLabels API operation for Amazon Rekognition.
//
// Detects instances of real-world entities within an image (JPEG or PNG) provided
// as input. This includes objects like flower, tree, and table; events like
// wedding, graduation, and birthday party; and concepts like landscape, evening,
// and nature.
//
// For an example, see Analyzing Images Stored in an Amazon S3 Bucket in the
// Amazon Rekognition Developer Guide.
//
// DetectLabels does not support the detection of activities. However, activity
// detection is supported for label detection in videos. For more information,
// see StartLabelDetection in the Amazon Rekognition Developer Guide.
//
// 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 AWS 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 includes 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 55%. 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.
//
// DetectLabels returns bounding boxes for instances of common object labels
// in an array of Instance objects. An Instance object contains a BoundingBox
// object, for the location of the label on the image. It also includes the
// confidence by which the bounding box was detected.
//
// DetectLabels also returns a hierarchical taxonomy of detected labels. For
// example, a detected car might be assigned the label car. The label car has
// two parent labels: Vehicle (its parent) and Transportation (its grandparent).
// The response returns the entire list of ancestors for a label. Each ancestor
// is a unique label in the response. In the previous example, Car, Vehicle,
// and Transportation are returned as unique labels in the response.
//
// This is a stateless API operation. That is, the operation does not persist
// any data.
//
// This operation requires permissions to perform the rekognition:DetectLabels
// action.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon Rekognition's
// API operation DetectLabels for usage and error information.
//
// Returned Error Codes:
// * ErrCodeInvalidS3ObjectException "InvalidS3ObjectException"
// Amazon Rekognition is unable to access the S3 object specified in the request.
//
// * ErrCodeInvalidParameterException "InvalidParameterException"
// Input parameter violated a constraint. Validate your parameter before calling
// the API operation again.
//
// * ErrCodeImageTooLargeException "ImageTooLargeException"
// The input image size exceeds the allowed limit. For more information, see
// Limits in Amazon Rekognition in the Amazon Rekognition Developer Guide.
//
// * ErrCodeAccessDeniedException "AccessDeniedException"
// You are not authorized to perform the action.
//
// * ErrCodeInternalServerError "InternalServerError"
// Amazon Rekognition experienced a service issue. Try your call again.
//
// * ErrCodeThrottlingException "ThrottlingException"
// Amazon Rekognition is temporarily unable to process the request. Try your
// call again.
//
// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException"
// The number of requests exceeded your throughput limit. If you want to increase
// this limit, contact Amazon Rekognition.
//
// * ErrCodeInvalidImageFormatException "InvalidImageFormatException"
// The provided image format is not supported.
//
func (c *Rekognition) DetectLabels(input *DetectLabelsInput) (*DetectLabelsOutput, error) {
req, out := c.DetectLabelsRequest(input)
return out, req.Send()
}
// DetectLabelsWithContext is the same as DetectLabels with the addition of
// the ability to pass a context and additional request options.
//
// See DetectLabels for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *Rekognition) DetectLabelsWithContext(ctx aws.Context, input *DetectLabelsInput, opts ...request.Option) (*DetectLabelsOutput, error) {
req, out := c.DetectLabelsRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opDetectModerationLabels = "DetectModerationLabels"
// DetectModerationLabelsRequest generates a "aws/request.Request" representing the
// client's request for the DetectModerationLabels operation. The "output" return
// value will be populated with the request's response once the request completes
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See DetectModerationLabels for more information on using the DetectModerationLabels
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the DetectModerationLabelsRequest method.
// req, resp := client.DetectModerationLabelsRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
func (c *Rekognition) DetectModerationLabelsRequest(input *DetectModerationLabelsInput) (req *request.Request, output *DetectModerationLabelsOutput) {
op := &request.Operation{
Name: opDetectModerationLabels,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DetectModerationLabelsInput{}
}
output = &DetectModerationLabelsOutput{}
req = c.newRequest(op, input, output)
return
}
// DetectModerationLabels API operation for Amazon Rekognition.
//
// Detects explicit or suggestive adult content in a specified JPEG or PNG format
// image. Use DetectModerationLabels to moderate images depending on your requirements.
// For example, you might want to filter images that contain nudity, but not
// images containing suggestive content.
//
// To filter images, use the labels returned by DetectModerationLabels to determine
// which types of content are appropriate.
//
// For information about moderation labels, see Detecting Unsafe Content in
// the Amazon Rekognition Developer Guide.
//
// 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 AWS CLI to call Amazon
// Rekognition operations, passing image bytes is not supported. The image must
// be either a PNG or JPEG formatted file.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon Rekognition's
// API operation DetectModerationLabels for usage and error information.
//
// Returned Error Codes:
// * ErrCodeInvalidS3ObjectException "InvalidS3ObjectException"
// Amazon Rekognition is unable to access the S3 object specified in the request.
//
// * ErrCodeInvalidParameterException "InvalidParameterException"
// Input parameter violated a constraint. Validate your parameter before calling
// the API operation again.
//
// * ErrCodeImageTooLargeException "ImageTooLargeException"
// The input image size exceeds the allowed limit. For more information, see
// Limits in Amazon Rekognition in the Amazon Rekognition Developer Guide.
//
// * ErrCodeAccessDeniedException "AccessDeniedException"
// You are not authorized to perform the action.
//
// * ErrCodeInternalServerError "InternalServerError"
// Amazon Rekognition experienced a service issue. Try your call again.
//
// * ErrCodeThrottlingException "ThrottlingException"
// Amazon Rekognition is temporarily unable to process the request. Try your
// call again.
//
// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException"
// The number of requests exceeded your throughput limit. If you want to increase
// this limit, contact Amazon Rekognition.
//
// * ErrCodeInvalidImageFormatException "InvalidImageFormatException"
// The provided image format is not supported.
//
func (c *Rekognition) DetectModerationLabels(input *DetectModerationLabelsInput) (*DetectModerationLabelsOutput, error) {
req, out := c.DetectModerationLabelsRequest(input)
return out, req.Send()
}
// DetectModerationLabelsWithContext is the same as DetectModerationLabels with the addition of
// the ability to pass a context and additional request options.
//
// See DetectModerationLabels for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *Rekognition) DetectModerationLabelsWithContext(ctx aws.Context, input *DetectModerationLabelsInput, opts ...request.Option) (*DetectModerationLabelsOutput, error) {
req, out := c.DetectModerationLabelsRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opDetectText = "DetectText"
// DetectTextRequest generates a "aws/request.Request" representing the
// client's request for the DetectText operation. The "output" return
// value will be populated with the request's response once the request completes
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See DetectText for more information on using the DetectText
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the DetectTextRequest method.
// req, resp := client.DetectTextRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
func (c *Rekognition) DetectTextRequest(input *DetectTextInput) (req *request.Request, output *DetectTextOutput) {
op := &request.Operation{
Name: opDetectText,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DetectTextInput{}
}
output = &DetectTextOutput{}
req = c.newRequest(op, input, output)
return
}
// DetectText 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 TextDetection 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 +/- 90 degrees orientation of the horizontal
// axis.
//
// For more information, see DetectText in the Amazon Rekognition Developer
// Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon Rekognition's
// API operation DetectText for usage and error information.
//
// Returned Error Codes:
// * ErrCodeInvalidS3ObjectException "InvalidS3ObjectException"
// Amazon Rekognition is unable to access the S3 object specified in the request.
//
// * ErrCodeInvalidParameterException "InvalidParameterException"
// Input parameter violated a constraint. Validate your parameter before calling
// the API operation again.
//
// * ErrCodeImageTooLargeException "ImageTooLargeException"
// The input image size exceeds the allowed limit. For more information, see
// Limits in Amazon Rekognition in the Amazon Rekognition Developer Guide.
//
// * ErrCodeAccessDeniedException "AccessDeniedException"
// You are not authorized to perform the action.
//
// * ErrCodeInternalServerError "InternalServerError"
// Amazon Rekognition experienced a service issue. Try your call again.
//
// * ErrCodeThrottlingException "ThrottlingException"
// Amazon Rekognition is temporarily unable to process the request. Try your
// call again.
//
// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException"
// The number of requests exceeded your throughput limit. If you want to increase
// this limit, contact Amazon Rekognition.
//
// * ErrCodeInvalidImageFormatException "InvalidImageFormatException"
// The provided image format is not supported.
//
func (c *Rekognition) DetectText(input *DetectTextInput) (*DetectTextOutput, error) {
req, out := c.DetectTextRequest(input)
return out, req.Send()
}
// DetectTextWithContext is the same as DetectText with the addition of
// the ability to pass a context and additional request options.
//
// See DetectText for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *Rekognition) DetectTextWithContext(ctx aws.Context, input *DetectTextInput, opts ...request.Option) (*DetectTextOutput, error) {
req, out := c.DetectTextRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opGetCelebrityInfo = "GetCelebrityInfo"
// GetCelebrityInfoRequest generates a "aws/request.Request" representing the
// client's request for the GetCelebrityInfo operation. The "output" return
// value will be populated with the request's response once the request completes
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See GetCelebrityInfo for more information on using the GetCelebrityInfo
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the GetCelebrityInfoRequest method.
// req, resp := client.GetCelebrityInfoRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
func (c *Rekognition) GetCelebrityInfoRequest(input *GetCelebrityInfoInput) (req *request.Request, output *GetCelebrityInfoOutput) {
op := &request.Operation{
Name: opGetCelebrityInfo,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &GetCelebrityInfoInput{}
}
output = &GetCelebrityInfoOutput{}
req = c.newRequest(op, input, output)
return
}
// GetCelebrityInfo API operation for Amazon Rekognition.
//
// Gets the name and additional information about a celebrity based on his or
// her Amazon 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 Recognizing Celebrities in an Image in the Amazon
// Rekognition Developer Guide.
//
// This operation requires permissions to perform the rekognition:GetCelebrityInfo
// action.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon Rekognition's
// API operation GetCelebrityInfo for usage and error information.
//
// Returned Error Codes:
// * ErrCodeInvalidParameterException "InvalidParameterException"
// Input parameter violated a constraint. Validate your parameter before calling
// the API operation again.
//
// * ErrCodeAccessDeniedException "AccessDeniedException"
// You are not authorized to perform the action.
//
// * ErrCodeInternalServerError "InternalServerError"
// Amazon Rekognition experienced a service issue. Try your call again.
//
// * ErrCodeThrottlingException "ThrottlingException"
// Amazon Rekognition is temporarily unable to process the request. Try your
// call again.
//
// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException"
// The number of requests exceeded your throughput limit. If you want to increase
// this limit, contact Amazon Rekognition.
//
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
// The collection specified in the request cannot be found.
//
func (c *Rekognition) GetCelebrityInfo(input *GetCelebrityInfoInput) (*GetCelebrityInfoOutput, error) {
req, out := c.GetCelebrityInfoRequest(input)
return out, req.Send()
}
// GetCelebrityInfoWithContext is the same as GetCelebrityInfo with the addition of
// the ability to pass a context and additional request options.
//
// See GetCelebrityInfo for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *Rekognition) GetCelebrityInfoWithContext(ctx aws.Context, input *GetCelebrityInfoInput, opts ...request.Option) (*GetCelebrityInfoOutput, error) {
req, out := c.GetCelebrityInfoRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opGetCelebrityRecognition = "GetCelebrityRecognition"
// GetCelebrityRecognitionRequest generates a "aws/request.Request" representing the
// client's request for the GetCelebrityRecognition operation. The "output" return
// value will be populated with the request's response once the request completes
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See GetCelebrityRecognition for more information on using the GetCelebrityRecognition
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the GetCelebrityRecognitionRequest method.
// req, resp := client.GetCelebrityRecognitionRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
func (c *Rekognition) GetCelebrityRecognitionRequest(input *GetCelebrityRecognitionInput) (req *request.Request, output *GetCelebrityRecognitionOutput) {
op := &request.Operation{
Name: opGetCelebrityRecognition,
HTTPMethod: "POST",
HTTPPath: "/",
Paginator: &request.Paginator{
InputTokens: []string{"NextToken"},
OutputTokens: []string{"NextToken"},
LimitToken: "MaxResults",
TruncationToken: "",
},
}
if input == nil {
input = &GetCelebrityRecognitionInput{}
}
output = &GetCelebrityRecognitionOutput{}
req = c.newRequest(op, input, output)
return
}
// GetCelebrityRecognition API operation for Amazon Rekognition.
//
// Gets the celebrity recognition results for a Amazon Rekognition Video analysis
// started by StartCelebrityRecognition.
//
// Celebrity recognition in a video is an asynchronous operation. Analysis is
// started by a call to StartCelebrityRecognition which returns a job identifier
// (JobId). When the celebrity recognition operation finishes, Amazon 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 Working With Stored Videos in the Amazon Rekognition
// Developer Guide.
//
// GetCelebrityRecognition returns detected celebrities and the time(s) they
// are detected in an array (Celebrities) of CelebrityRecognition objects. Each
// CelebrityRecognition contains information about the celebrity in a CelebrityDetail
// object and the time, Timestamp, the celebrity was detected.
//
// GetCelebrityRecognition only returns the default facial attributes (BoundingBox,
// Confidence, Landmarks, Pose, and Quality). The other facial attributes listed
// in the Face object of the following response syntax are not returned. For
// more information, see FaceDetail in the Amazon Rekognition Developer Guide.
//
// 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 GetCelebrityInfo 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.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon Rekognition's
// API operation GetCelebrityRecognition for usage and error information.
//
// Returned Error Codes:
// * ErrCodeAccessDeniedException "AccessDeniedException"
// You are not authorized to perform the action.
//
// * ErrCodeInternalServerError "InternalServerError"
// Amazon Rekognition experienced a service issue. Try your call again.
//
// * ErrCodeInvalidParameterException "InvalidParameterException"
// Input parameter violated a constraint. Validate your parameter before calling
// the API operation again.
//
// * ErrCodeInvalidPaginationTokenException "InvalidPaginationTokenException"
// Pagination token in the request is not valid.
//
// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException"
// The number of requests exceeded your throughput limit. If you want to increase
// this limit, contact Amazon Rekognition.
//
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
// The collection specified in the request cannot be found.
//
// * ErrCodeThrottlingException "ThrottlingException"
// Amazon Rekognition is temporarily unable to process the request. Try your
// call again.
//
func (c *Rekognition) GetCelebrityRecognition(input *GetCelebrityRecognitionInput) (*GetCelebrityRecognitionOutput, error) {
req, out := c.GetCelebrityRecognitionRequest(input)
return out, req.Send()
}
// GetCelebrityRecognitionWithContext is the same as GetCelebrityRecognition with the addition of
// the ability to pass a context and additional request options.
//
// See GetCelebrityRecognition for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *Rekognition) GetCelebrityRecognitionWithContext(ctx aws.Context, input *GetCelebrityRecognitionInput, opts ...request.Option) (*GetCelebrityRecognitionOutput, error) {
req, out := c.GetCelebrityRecognitionRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
// GetCelebrityRecognitionPages iterates over the pages of a GetCelebrityRecognition operation,
// calling the "fn" function with the response data for each page. To stop
// iterating, return false from the fn function.
//
// See GetCelebrityRecognition method for more information on how to use this operation.
//
// Note: This operation can generate multiple requests to a service.
//
// // Example iterating over at most 3 pages of a GetCelebrityRecognition operation.
// pageNum := 0
// err := client.GetCelebrityRecognitionPages(params,
// func(page *rekognition.GetCelebrityRecognitionOutput, lastPage bool) bool {
// pageNum++
// fmt.Println(page)
// return pageNum <= 3
// })
//
func (c *Rekognition) GetCelebrityRecognitionPages(input *GetCelebrityRecognitionInput, fn func(*GetCelebrityRecognitionOutput, bool) bool) error {
return c.GetCelebrityRecognitionPagesWithContext(aws.BackgroundContext(), input, fn)
}
// GetCelebrityRecognitionPagesWithContext same as GetCelebrityRecognitionPages except
// it takes a Context and allows setting request options on the pages.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *Rekognition) GetCelebrityRecognitionPagesWithContext(ctx aws.Context, input *GetCelebrityRecognitionInput, fn func(*GetCelebrityRecognitionOutput, bool) bool, opts ...request.Option) error {
p := request.Pagination{
NewRequest: func() (*request.Request, error) {
var inCpy *GetCelebrityRecognitionInput
if input != nil {
tmp := *input
inCpy = &tmp
}
req, _ := c.GetCelebrityRecognitionRequest(inCpy)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
},
}
cont := true
for p.Next() && cont {
cont = fn(p.Page().(*GetCelebrityRecognitionOutput), !p.HasNextPage())
}
return p.Err()
}
const opGetContentModeration = "GetContentModeration"
// GetContentModerationRequest generates a "aws/request.Request" representing the
// client's request for the GetContentModeration operation. The "output" return
// value will be populated with the request's response once the request completes
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See GetContentModeration for more information on using the GetContentModeration
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the GetContentModerationRequest method.
// req, resp := client.GetContentModerationRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
func (c *Rekognition) GetContentModerationRequest(input *GetContentModerationInput) (req *request.Request, output *GetContentModerationOutput) {
op := &request.Operation{
Name: opGetContentModeration,
HTTPMethod: "POST",
HTTPPath: "/",
Paginator: &request.Paginator{
InputTokens: []string{"NextToken"},
OutputTokens: []string{"NextToken"},
LimitToken: "MaxResults",
TruncationToken: "",
},
}
if input == nil {
input = &GetContentModerationInput{}
}
output = &GetContentModerationOutput{}
req = c.newRequest(op, input, output)
return
}
// GetContentModeration API operation for Amazon Rekognition.
//
// Gets the content moderation analysis results for a Amazon Rekognition Video
// analysis started by StartContentModeration.
//
// Content moderation analysis of a video is an asynchronous operation. You
// start analysis by calling StartContentModeration which returns a job identifier
// (JobId). When analysis finishes, Amazon 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 GetContentModeration and pass the job
// identifier (JobId) from the initial call to StartContentModeration.
//
// For more information, see Working with Stored Videos in the Amazon Rekognition
// Devlopers Guide.
//
// GetContentModeration returns detected content moderation labels, and the
// time they are detected, in an array, ModerationLabels, of ContentModerationDetection
// 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 Detecting Unsafe Content in the Amazon Rekognition
// Developer Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon Rekognition's
// API operation GetContentModeration for usage and error information.
//
// Returned Error Codes:
// * ErrCodeAccessDeniedException "AccessDeniedException"
// You are not authorized to perform the action.
//
// * ErrCodeInternalServerError "InternalServerError"
// Amazon Rekognition experienced a service issue. Try your call again.
//
// * ErrCodeInvalidParameterException "InvalidParameterException"
// Input parameter violated a constraint. Validate your parameter before calling
// the API operation again.
//
// * ErrCodeInvalidPaginationTokenException "InvalidPaginationTokenException"
// Pagination token in the request is not valid.
//
// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException"
// The number of requests exceeded your throughput limit. If you want to increase
// this limit, contact Amazon Rekognition.
//
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
// The collection specified in the request cannot be found.
//
// * ErrCodeThrottlingException "ThrottlingException"
// Amazon Rekognition is temporarily unable to process the request. Try your
// call again.
//
func (c *Rekognition) GetContentModeration(input *GetContentModerationInput) (*GetContentModerationOutput, error) {
req, out := c.GetContentModerationRequest(input)
return out, req.Send()
}
// GetContentModerationWithContext is the same as GetContentModeration with the addition of
// the ability to pass a context and additional request options.
//
// See GetContentModeration for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *Rekognition) GetContentModerationWithContext(ctx aws.Context, input *GetContentModerationInput, opts ...request.Option) (*GetContentModerationOutput, error) {
req, out := c.GetContentModerationRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
// GetContentModerationPages iterates over the pages of a GetContentModeration operation,
// calling the "fn" function with the response data for each page. To stop
// iterating, return false from the fn function.
//
// See GetContentModeration method for more information on how to use this operation.
//
// Note: This operation can generate multiple requests to a service.
//
// // Example iterating over at most 3 pages of a GetContentModeration operation.
// pageNum := 0
// err := client.GetContentModerationPages(params,
// func(page *rekognition.GetContentModerationOutput, lastPage bool) bool {
// pageNum++
// fmt.Println(page)
// return pageNum <= 3
// })
//
func (c *Rekognition) GetContentModerationPages(input *GetContentModerationInput, fn func(*GetContentModerationOutput, bool) bool) error {
return c.GetContentModerationPagesWithContext(aws.BackgroundContext(), input, fn)
}
// GetContentModerationPagesWithContext same as GetContentModerationPages except
// it takes a Context and allows setting request options on the pages.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *Rekognition) GetContentModerationPagesWithContext(ctx aws.Context, input *GetContentModerationInput, fn func(*GetContentModerationOutput, bool) bool, opts ...request.Option) error {
p := request.Pagination{
NewRequest: func() (*request.Request, error) {
var inCpy *GetContentModerationInput
if input != nil {
tmp := *input
inCpy = &tmp
}
req, _ := c.GetContentModerationRequest(inCpy)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
},
}
cont := true
for p.Next() && cont {
cont = fn(p.Page().(*GetContentModerationOutput), !p.HasNextPage())
}
return p.Err()
}
const opGetFaceDetection = "GetFaceDetection"
// GetFaceDetectionRequest generates a "aws/request.Request" representing the
// client's request for the GetFaceDetection operation. The "output" return
// value will be populated with the request's response once the request completes
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See GetFaceDetection for more information on using the GetFaceDetection
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the GetFaceDetectionRequest method.
// req, resp := client.GetFaceDetectionRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
func (c *Rekognition) GetFaceDetectionRequest(input *GetFaceDetectionInput) (req *request.Request, output *GetFaceDetectionOutput) {
op := &request.Operation{
Name: opGetFaceDetection,
HTTPMethod: "POST",
HTTPPath: "/",
Paginator: &request.Paginator{
InputTokens: []string{"NextToken"},
OutputTokens: []string{"NextToken"},
LimitToken: "MaxResults",
TruncationToken: "",
},
}
if input == nil {
input = &GetFaceDetectionInput{}
}
output = &GetFaceDetectionOutput{}
req = c.newRequest(op, input, output)
return
}
// GetFaceDetection API operation for Amazon Rekognition.
//
// Gets face detection results for a Amazon Rekognition Video analysis started
// by StartFaceDetection.
//
// Face detection with Amazon Rekognition Video is an asynchronous operation.
// You start face detection by calling StartFaceDetection which returns a job
// identifier (JobId). When the face detection operation finishes, Amazon Rekognition
// Video publishes a completion status to the Amazon Simple Notification Service
// topic registered in the initial call to StartFaceDetection. To get the results
// of the face detection operation, first check that the status value published
// to the Amazon SNS topic is SUCCEEDED. If so, call GetFaceDetection and pass
// the job identifier (JobId) from the initial call to StartFaceDetection.
//
// GetFaceDetection returns an array of detected faces (Faces) sorted by the
// time the faces were detected.
//
// 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 GetFaceDetection and populate
// the NextToken request parameter with the token value returned from the previous
// call to GetFaceDetection.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon Rekognition's
// API operation GetFaceDetection for usage and error information.
//
// Returned Error Codes:
// * ErrCodeAccessDeniedException "AccessDeniedException"
// You are not authorized to perform the action.
//
// * ErrCodeInternalServerError "InternalServerError"
// Amazon Rekognition experienced a service issue. Try your call again.
//
// * ErrCodeInvalidParameterException "InvalidParameterException"
// Input parameter violated a constraint. Validate your parameter before calling
// the API operation again.
//
// * ErrCodeInvalidPaginationTokenException "InvalidPaginationTokenException"
// Pagination token in the request is not valid.
//
// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException"
// The number of requests exceeded your throughput limit. If you want to increase
// this limit, contact Amazon Rekognition.
//
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
// The collection specified in the request cannot be found.
//
// * ErrCodeThrottlingException "ThrottlingException"
// Amazon Rekognition is temporarily unable to process the request. Try your
// call again.
//
func (c *Rekognition) GetFaceDetection(input *GetFaceDetectionInput) (*GetFaceDetectionOutput, error) {
req, out := c.GetFaceDetectionRequest(input)
return out, req.Send()
}
// GetFaceDetectionWithContext is the same as GetFaceDetection with the addition of
// the ability to pass a context and additional request options.
//
// See GetFaceDetection for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *Rekognition) GetFaceDetectionWithContext(ctx aws.Context, input *GetFaceDetectionInput, opts ...request.Option) (*GetFaceDetectionOutput, error) {
req, out := c.GetFaceDetectionRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
// GetFaceDetectionPages iterates over the pages of a GetFaceDetection operation,
// calling the "fn" function with the response data for each page. To stop
// iterating, return false from the fn function.
//
// See GetFaceDetection method for more information on how to use this operation.
//
// Note: This operation can generate multiple requests to a service.
//
// // Example iterating over at most 3 pages of a GetFaceDetection operation.
// pageNum := 0
// err := client.GetFaceDetectionPages(params,
// func(page *rekognition.GetFaceDetectionOutput, lastPage bool) bool {
// pageNum++
// fmt.Println(page)
// return pageNum <= 3
// })
//
func (c *Rekognition) GetFaceDetectionPages(input *GetFaceDetectionInput, fn func(*GetFaceDetectionOutput, bool) bool) error {
return c.GetFaceDetectionPagesWithContext(aws.BackgroundContext(), input, fn)
}
// GetFaceDetectionPagesWithContext same as GetFaceDetectionPages except
// it takes a Context and allows setting request options on the pages.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *Rekognition) GetFaceDetectionPagesWithContext(ctx aws.Context, input *GetFaceDetectionInput, fn func(*GetFaceDetectionOutput, bool) bool, opts ...request.Option) error {
p := request.Pagination{
NewRequest: func() (*request.Request, error) {
var inCpy *GetFaceDetectionInput
if input != nil {
tmp := *input
inCpy = &tmp
}
req, _ := c.GetFaceDetectionRequest(inCpy)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
},
}
cont := true
for p.Next() && cont {
cont = fn(p.Page().(*GetFaceDetectionOutput), !p.HasNextPage())
}
return p.Err()
}
const opGetFaceSearch = "GetFaceSearch"
// GetFaceSearchRequest generates a "aws/request.Request" representing the
// client's request for the GetFaceSearch operation. The "output" return
// value will be populated with the request's response once the request completes
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See GetFaceSearch for more information on using the GetFaceSearch
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the GetFaceSearchRequest method.
// req, resp := client.GetFaceSearchRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
func (c *Rekognition) GetFaceSearchRequest(input *GetFaceSearchInput) (req *request.Request, output *GetFaceSearchOutput) {
op := &request.Operation{
Name: opGetFaceSearch,
HTTPMethod: "POST",
HTTPPath: "/",
Paginator: &request.Paginator{
InputTokens: []string{"NextToken"},
OutputTokens: []string{"NextToken"},
LimitToken: "MaxResults",
TruncationToken: "",
},
}
if input == nil {
input = &GetFaceSearchInput{}
}
output = &GetFaceSearchOutput{}
req = c.newRequest(op, input, output)
return
}
// GetFaceSearch API operation for Amazon Rekognition.
//
// Gets the face search results for Amazon Rekognition Video face search started
// by StartFaceSearch. The search returns faces in a collection that match the
// faces of persons detected in a video. It also includes the time(s) that faces
// are matched in the video.
//
// Face search in a video is an asynchronous operation. You start face search
// by calling to StartFaceSearch which returns a job identifier (JobId). When
// the search operation finishes, Amazon Rekognition Video publishes a completion
// status to the Amazon Simple Notification Service topic registered in the
// initial call to StartFaceSearch. To get the search results, first check that
// the status value published to the Amazon SNS topic is SUCCEEDED. If so, call
// GetFaceSearch and pass the job identifier (JobId) from the initial call to
// StartFaceSearch.
//
// For more information, see Searching Faces in a Collection in the Amazon Rekognition
// Developer Guide.
//
// The search results are retured in an array, Persons, of PersonMatch objects.
// EachPersonMatch element contains details about the matching faces in the
// input collection, person information (facial attributes, bounding boxes,
// and person identifer) for the matched person, and the time the person was
// matched in the video.
//
// GetFaceSearch only returns the default facial attributes (BoundingBox, Confidence,
// Landmarks, Pose, and Quality). The other facial attributes listed in the
// Face object of the following response syntax are not returned. For more information,
// see FaceDetail in the Amazon Rekognition Developer Guide.
//
// By default, the Persons array is sorted by the time, in milliseconds from
// the start of the video, persons are matched. You can also sort by persons
// by specifying INDEX for the SORTBY input parameter.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon Rekognition's
// API operation GetFaceSearch for usage and error information.
//
// Returned Error Codes:
// * ErrCodeAccessDeniedException "AccessDeniedException"
// You are not authorized to perform the action.
//
// * ErrCodeInternalServerError "InternalServerError"
// Amazon Rekognition experienced a service issue. Try your call again.
//
// * ErrCodeInvalidParameterException "InvalidParameterException"
// Input parameter violated a constraint. Validate your parameter before calling
// the API operation again.
//
// * ErrCodeInvalidPaginationTokenException "InvalidPaginationTokenException"
// Pagination token in the request is not valid.
//
// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException"
// The number of requests exceeded your throughput limit. If you want to increase
// this limit, contact Amazon Rekognition.
//
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
// The collection specified in the request cannot be found.
//
// * ErrCodeThrottlingException "ThrottlingException"
// Amazon Rekognition is temporarily unable to process the request. Try your
// call again.
//
func (c *Rekognition) GetFaceSearch(input *GetFaceSearchInput) (*GetFaceSearchOutput, error) {
req, out := c.GetFaceSearchRequest(input)
return out, req.Send()
}
// GetFaceSearchWithContext is the same as GetFaceSearch with the addition of
// the ability to pass a context and additional request options.
//
// See GetFaceSearch for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *Rekognition) GetFaceSearchWithContext(ctx aws.Context, input *GetFaceSearchInput, opts ...request.Option) (*GetFaceSearchOutput, error) {
req, out := c.GetFaceSearchRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
// GetFaceSearchPages iterates over the pages of a GetFaceSearch operation,
// calling the "fn" function with the response data for each page. To stop
// iterating, return false from the fn function.
//
// See GetFaceSearch method for more information on how to use this operation.
//
// Note: This operation can generate multiple requests to a service.
//
// // Example iterating over at most 3 pages of a GetFaceSearch operation.
// pageNum := 0
// err := client.GetFaceSearchPages(params,
// func(page *rekognition.GetFaceSearchOutput, lastPage bool) bool {
// pageNum++
// fmt.Println(page)
// return pageNum <= 3
// })
//
func (c *Rekognition) GetFaceSearchPages(input *GetFaceSearchInput, fn func(*GetFaceSearchOutput, bool) bool) error {
return c.GetFaceSearchPagesWithContext(aws.BackgroundContext(), input, fn)
}
// GetFaceSearchPagesWithContext same as GetFaceSearchPages except
// it takes a Context and allows setting request options on the pages.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *Rekognition) GetFaceSearchPagesWithContext(ctx aws.Context, input *GetFaceSearchInput, fn func(*GetFaceSearchOutput, bool) bool, opts ...request.Option) error {
p := request.Pagination{
NewRequest: func() (*request.Request, error) {
var inCpy *GetFaceSearchInput
if input != nil {
tmp := *input
inCpy = &tmp
}
req, _ := c.GetFaceSearchRequest(inCpy)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
},
}
cont := true
for p.Next() && cont {
cont = fn(p.Page().(*GetFaceSearchOutput), !p.HasNextPage())
}
return p.Err()
}
const opGetLabelDetection = "GetLabelDetection"
// GetLabelDetectionRequest generates a "aws/request.Request" representing the
// client's request for the GetLabelDetection operation. The "output" return
// value will be populated with the request's response once the request completes
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See GetLabelDetection for more information on using the GetLabelDetection
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the GetLabelDetectionRequest method.
// req, resp := client.GetLabelDetectionRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
func (c *Rekognition) GetLabelDetectionRequest(input *GetLabelDetectionInput) (req *request.Request, output *GetLabelDetectionOutput) {
op := &request.Operation{
Name: opGetLabelDetection,
HTTPMethod: "POST",
HTTPPath: "/",
Paginator: &request.Paginator{
InputTokens: []string{"NextToken"},
OutputTokens: []string{"NextToken"},
LimitToken: "MaxResults",
TruncationToken: "",
},
}
if input == nil {
input = &GetLabelDetectionInput{}
}
output = &GetLabelDetectionOutput{}
req = c.newRequest(op, input, output)
return
}
// GetLabelDetection API operation for Amazon Rekognition.
//
// Gets the label detection results of a Amazon Rekognition Video analysis started
// by StartLabelDetection.
//
// The label detection operation is started by a call to StartLabelDetection
// which returns a job identifier (JobId). When the label detection operation
// finishes, Amazon Rekognition publishes a completion status to the Amazon
// Simple Notification Service topic registered in the initial call to StartlabelDetection.
// To get the results of the label detection operation, first check that the
// status value published to the Amazon SNS topic is SUCCEEDED. If so, call
// GetLabelDetection and pass the job identifier (JobId) from the initial call
// to StartLabelDetection.
//
// GetLabelDetection returns an array of detected labels (Labels) sorted by
// the time the labels were detected. You can also sort by the label name by
// specifying NAME for the SortBy input parameter.
//
// The labels returned include the label name, the percentage confidence in
// the accuracy of the detected label, and the time the label was detected in
// the video.
//
// The returned labels also include bounding box information for common objects,
// a hierarchical taxonomy of detected labels, and the version of the label
// model used for detection.
//
// 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 GetlabelDetection and populate
// the NextToken request parameter with the token value returned from the previous
// call to GetLabelDetection.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon Rekognition's
// API operation GetLabelDetection for usage and error information.
//
// Returned Error Codes:
// * ErrCodeAccessDeniedException "AccessDeniedException"
// You are not authorized to perform the action.
//
// * ErrCodeInternalServerError "InternalServerError"
// Amazon Rekognition experienced a service issue. Try your call again.
//
// * ErrCodeInvalidParameterException "InvalidParameterException"
// Input parameter violated a constraint. Validate your parameter before calling
// the API operation again.
//
// * ErrCodeInvalidPaginationTokenException "InvalidPaginationTokenException"
// Pagination token in the request is not valid.
//
// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException"
// The number of requests exceeded your throughput limit. If you want to increase
// this limit, contact Amazon Rekognition.
//
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
// The collection specified in the request cannot be found.
//
// * ErrCodeThrottlingException "ThrottlingException"
// Amazon Rekognition is temporarily unable to process the request. Try your
// call again.
//
func (c *Rekognition) GetLabelDetection(input *GetLabelDetectionInput) (*GetLabelDetectionOutput, error) {
req, out := c.GetLabelDetectionRequest(input)
return out, req.Send()
}
// GetLabelDetectionWithContext is the same as GetLabelDetection with the addition of
// the ability to pass a context and additional request options.
//
// See GetLabelDetection for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *Rekognition) GetLabelDetectionWithContext(ctx aws.Context, input *GetLabelDetectionInput, opts ...request.Option) (*GetLabelDetectionOutput, error) {
req, out := c.GetLabelDetectionRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
// GetLabelDetectionPages iterates over the pages of a GetLabelDetection operation,
// calling the "fn" function with the response data for each page. To stop
// iterating, return false from the fn function.
//
// See GetLabelDetection method for more information on how to use this operation.
//
// Note: This operation can generate multiple requests to a service.
//
// // Example iterating over at most 3 pages of a GetLabelDetection operation.
// pageNum := 0
// err := client.GetLabelDetectionPages(params,
// func(page *rekognition.GetLabelDetectionOutput, lastPage bool) bool {
// pageNum++
// fmt.Println(page)
// return pageNum <= 3
// })
//
func (c *Rekognition) GetLabelDetectionPages(input *GetLabelDetectionInput, fn func(*GetLabelDetectionOutput, bool) bool) error {
return c.GetLabelDetectionPagesWithContext(aws.BackgroundContext(), input, fn)
}
// GetLabelDetectionPagesWithContext same as GetLabelDetectionPages except
// it takes a Context and allows setting request options on the pages.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *Rekognition) GetLabelDetectionPagesWithContext(ctx aws.Context, input *GetLabelDetectionInput, fn func(*GetLabelDetectionOutput, bool) bool, opts ...request.Option) error {
p := request.Pagination{
NewRequest: func() (*request.Request, error) {
var inCpy *GetLabelDetectionInput
if input != nil {
tmp := *input
inCpy = &tmp
}
req, _ := c.GetLabelDetectionRequest(inCpy)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
},
}
cont := true
for p.Next() && cont {
cont = fn(p.Page().(*GetLabelDetectionOutput), !p.HasNextPage())
}
return p.Err()
}
const opGetPersonTracking = "GetPersonTracking"
// GetPersonTrackingRequest generates a "aws/request.Request" representing the
// client's request for the GetPersonTracking operation. The "output" return
// value will be populated with the request's response once the request completes
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See GetPersonTracking for more information on using the GetPersonTracking
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the GetPersonTrackingRequest method.
// req, resp := client.GetPersonTrackingRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
func (c *Rekognition) GetPersonTrackingRequest(input *GetPersonTrackingInput) (req *request.Request, output *GetPersonTrackingOutput) {
op := &request.Operation{
Name: opGetPersonTracking,
HTTPMethod: "POST",
HTTPPath: "/",
Paginator: &request.Paginator{
InputTokens: []string{"NextToken"},
OutputTokens: []string{"NextToken"},
LimitToken: "MaxResults",
TruncationToken: "",
},
}
if input == nil {
input = &GetPersonTrackingInput{}
}
output = &GetPersonTrackingOutput{}
req = c.newRequest(op, input, output)
return
}
// GetPersonTracking API operation for Amazon Rekognition.
//
// Gets the path tracking results of a Amazon Rekognition Video analysis started
// by StartPersonTracking.
//
// The person path tracking operation is started by a call to StartPersonTracking
// which returns a job identifier (JobId). When the operation finishes, Amazon
// Rekognition Video publishes a completion status to the Amazon Simple Notification
// Service topic registered in the initial call to StartPersonTracking.
//
// To get the results of the person path tracking operation, first check that
// the status value published to the Amazon SNS topic is SUCCEEDED. If so, call
// GetPersonTracking and pass the job identifier (JobId) from the initial call
// to StartPersonTracking.
//
// GetPersonTracking returns an array, Persons, of tracked persons and the time(s)
// their paths were tracked in the video.
//
// GetPersonTracking only returns the default facial attributes (BoundingBox,
// Confidence, Landmarks, Pose, and Quality). The other facial attributes listed
// in the Face object of the following response syntax are not returned.
//
// For more information, see FaceDetail in the Amazon Rekognition Developer
// Guide.
//
// By default, the array is sorted by the time(s) a person's path is tracked
// in the video. You can sort by tracked persons by specifying INDEX for the
// SortBy input parameter.
//
// Use the MaxResults parameter to limit the number of items 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 GetPersonTracking and populate
// the NextToken request parameter with the token value returned from the previous
// call to GetPersonTracking.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon Rekognition's
// API operation GetPersonTracking for usage and error information.
//
// Returned Error Codes:
// * ErrCodeAccessDeniedException "AccessDeniedException"
// You are not authorized to perform the action.
//
// * ErrCodeInternalServerError "InternalServerError"
// Amazon Rekognition experienced a service issue. Try your call again.
//
// * ErrCodeInvalidParameterException "InvalidParameterException"
// Input parameter violated a constraint. Validate your parameter before calling
// the API operation again.
//
// * ErrCodeInvalidPaginationTokenException "InvalidPaginationTokenException"
// Pagination token in the request is not valid.
//
// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException"
// The number of requests exceeded your throughput limit. If you want to increase
// this limit, contact Amazon Rekognition.
//
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
// The collection specified in the request cannot be found.
//
// * ErrCodeThrottlingException "ThrottlingException"
// Amazon Rekognition is temporarily unable to process the request. Try your
// call again.
//
func (c *Rekognition) GetPersonTracking(input *GetPersonTrackingInput) (*GetPersonTrackingOutput, error) {
req, out := c.GetPersonTrackingRequest(input)
return out, req.Send()
}
// GetPersonTrackingWithContext is the same as GetPersonTracking with the addition of
// the ability to pass a context and additional request options.
//
// See GetPersonTracking for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *Rekognition) GetPersonTrackingWithContext(ctx aws.Context, input *GetPersonTrackingInput, opts ...request.Option) (*GetPersonTrackingOutput, error) {
req, out := c.GetPersonTrackingRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
// GetPersonTrackingPages iterates over the pages of a GetPersonTracking operation,
// calling the "fn" function with the response data for each page. To stop
// iterating, return false from the fn function.
//
// See GetPersonTracking method for more information on how to use this operation.
//
// Note: This operation can generate multiple requests to a service.
//
// // Example iterating over at most 3 pages of a GetPersonTracking operation.
// pageNum := 0
// err := client.GetPersonTrackingPages(params,
// func(page *rekognition.GetPersonTrackingOutput, lastPage bool) bool {
// pageNum++
// fmt.Println(page)
// return pageNum <= 3
// })
//
func (c *Rekognition) GetPersonTrackingPages(input *GetPersonTrackingInput, fn func(*GetPersonTrackingOutput, bool) bool) error {
return c.GetPersonTrackingPagesWithContext(aws.BackgroundContext(), input, fn)
}
// GetPersonTrackingPagesWithContext same as GetPersonTrackingPages except
// it takes a Context and allows setting request options on the pages.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *Rekognition) GetPersonTrackingPagesWithContext(ctx aws.Context, input *GetPersonTrackingInput, fn func(*GetPersonTrackingOutput, bool) bool, opts ...request.Option) error {
p := request.Pagination{
NewRequest: func() (*request.Request, error) {
var inCpy *GetPersonTrackingInput
if input != nil {
tmp := *input
inCpy = &tmp
}
req, _ := c.GetPersonTrackingRequest(inCpy)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
},
}
cont := true
for p.Next() && cont {
cont = fn(p.Page().(*GetPersonTrackingOutput), !p.HasNextPage())
}
return p.Err()
}
const opIndexFaces = "IndexFaces"
// IndexFacesRequest generates a "aws/request.Request" representing the
// client's request for the IndexFaces operation. The "output" return
// value will be populated with the request's response once the request completes
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See IndexFaces for more information on using the IndexFaces
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the IndexFacesRequest method.
// req, resp := client.IndexFacesRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
func (c *Rekognition) IndexFacesRequest(input *IndexFacesInput) (req *request.Request, output *IndexFacesOutput) {
op := &request.Operation{
Name: opIndexFaces,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &IndexFacesInput{}
}
output = &IndexFacesOutput{}
req = c.newRequest(op, input, output)
return
}
// IndexFaces API operation for Amazon Rekognition.
//
// Detects faces in the input image and adds them to the specified collection.
//
// Amazon Rekognition doesn't save the actual faces that are detected. Instead,
// the underlying detection algorithm first detects the faces in the input image.
// For each face, the algorithm extracts facial features into a feature vector,
// and stores it in the backend database. Amazon Rekognition uses feature vectors
// when it performs face match and search operations using the SearchFaces and
// SearchFacesByImage operations.
//
// For more information, see Adding Faces to a Collection in the Amazon Rekognition
// Developer Guide.
//
// To get the number of faces in a collection, call DescribeCollection.
//
// If you're using version 1.0 of the face detection model, IndexFaces indexes
// the 15 largest faces in the input image. Later versions of the face detection
// model index the 100 largest faces in the input image.
//
// If you're using version 4 or later of the face model, image orientation information
// is not returned in the OrientationCorrection field.
//
// To determine which version of the model you're using, call DescribeCollection
// and supply the collection ID. You can also get the model version from the
// value of FaceModelVersion in the response from IndexFaces
//
// For more information, see Model Versioning in the Amazon Rekognition Developer
// Guide.
//
// If you provide the optional ExternalImageID for the input image you provided,
// Amazon Rekognition associates this ID with all faces that it detects. When
// you call the ListFaces operation, the response returns the external ID. You
// can use this external image ID to create a client-side index to associate
// the faces with each image. You can then use the index to find all faces in
// an image.
//
// You can specify the maximum number of faces to index with the MaxFaces input
// parameter. This is useful when you want to index the largest faces in an
// image and don't want to index smaller faces, such as those belonging to people
// standing in the background.
//
// The QualityFilter input parameter allows you to filter out detected faces
// that don’t meet the required quality bar chosen by Amazon Rekognition.
// The quality bar is based on a variety of common use cases. By default, IndexFaces
// filters detected faces. You can also explicitly filter detected faces by
// specifying AUTO for the value of QualityFilter. If you do not want to filter
// detected faces, specify NONE.
//
// To use quality filtering, you need a collection associated with version 3
// of the face model. To get the version of the face model associated with a
// collection, call DescribeCollection.
//
// Information about faces detected in an image, but not indexed, is returned
// in an array of UnindexedFace objects, UnindexedFaces. Faces aren't indexed
// for reasons such as:
//
// * The number of faces detected exceeds the value of the MaxFaces request
// parameter.
//
// * The face is too small compared to the image dimensions.
//
// * The face is too blurry.
//
// * The image is too dark.
//
// * The face has an extreme pose.
//
// In response, the IndexFaces operation returns an array of metadata for all
// detected faces, FaceRecords. This includes:
//
// * The bounding box, BoundingBox, of the detected face.
//
// * A confidence value, Confidence, which indicates the confidence that
// the bounding box contains a face.
//
// * A face ID, FaceId, assigned by the service for each face that's detected
// and stored.
//
// * An image ID, ImageId, assigned by the service for the input image.
//
// If you request all facial attributes (by using the detectionAttributes parameter),
// Amazon Rekognition returns detailed facial attributes, such as facial landmarks
// (for example, location of eye and mouth) and other facial attributes like
// gender. If you provide the same image, specify the same collection, and use
// the same external ID in the IndexFaces operation, Amazon Rekognition doesn't
// save duplicate face metadata.
//
// The input image is passed either 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, passing image bytes isn't supported. The image must
// be formatted as a PNG or JPEG file.
//
// This operation requires permissions to perform the rekognition:IndexFaces
// action.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon Rekognition's
// API operation IndexFaces for usage and error information.
//
// Returned Error Codes:
// * ErrCodeInvalidS3ObjectException "InvalidS3ObjectException"
// Amazon Rekognition is unable to access the S3 object specified in the request.
//
// * ErrCodeInvalidParameterException "InvalidParameterException"
// Input parameter violated a constraint. Validate your parameter before calling
// the API operation again.
//
// * ErrCodeImageTooLargeException "ImageTooLargeException"
// The input image size exceeds the allowed limit. For more information, see
// Limits in Amazon Rekognition in the Amazon Rekognition Developer Guide.
//
// * ErrCodeAccessDeniedException "AccessDeniedException"
// You are not authorized to perform the action.
//
// * ErrCodeInternalServerError "InternalServerError"
// Amazon Rekognition experienced a service issue. Try your call again.
//
// * ErrCodeThrottlingException "ThrottlingException"
// Amazon Rekognition is temporarily unable to process the request. Try your
// call again.
//
// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException"
// The number of requests exceeded your throughput limit. If you want to increase
// this limit, contact Amazon Rekognition.
//
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
// The collection specified in the request cannot be found.
//
// * ErrCodeInvalidImageFormatException "InvalidImageFormatException"
// The provided image format is not supported.
//
func (c *Rekognition) IndexFaces(input *IndexFacesInput) (*IndexFacesOutput, error) {
req, out := c.IndexFacesRequest(input)
return out, req.Send()
}
// IndexFacesWithContext is the same as IndexFaces with the addition of
// the ability to pass a context and additional request options.
//
// See IndexFaces for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *Rekognition) IndexFacesWithContext(ctx aws.Context, input *IndexFacesInput, opts ...request.Option) (*IndexFacesOutput, error) {
req, out := c.IndexFacesRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opListCollections = "ListCollections"
// ListCollectionsRequest generates a "aws/request.Request" representing the
// client's request for the ListCollections operation. The "output" return
// value will be populated with the request's response once the request completes
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See ListCollections for more information on using the ListCollections
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the ListCollectionsRequest method.
// req, resp := client.ListCollectionsRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
func (c *Rekognition) ListCollectionsRequest(input *ListCollectionsInput) (req *request.Request, output *ListCollectionsOutput) {
op := &request.Operation{
Name: opListCollections,
HTTPMethod: "POST",
HTTPPath: "/",
Paginator: &request.Paginator{
InputTokens: []string{"NextToken"},
OutputTokens: []string{"NextToken"},
LimitToken: "MaxResults",
TruncationToken: "",
},
}
if input == nil {
input = &ListCollectionsInput{}
}
output = &ListCollectionsOutput{}
req = c.newRequest(op, input, output)
return
}
// ListCollections API operation for Amazon Rekognition.
//
// Returns list of collection IDs in your account. If the result is truncated,
// the response also provides a NextToken that you can use in the subsequent
// request to fetch the next set of collection IDs.
//
// For an example, see Listing Collections in the Amazon Rekognition Developer
// Guide.
//
// This operation requires permissions to perform the rekognition:ListCollections
// action.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon Rekognition's
// API operation ListCollections for usage and error information.
//
// Returned Error Codes:
// * ErrCodeInvalidParameterException "InvalidParameterException"
// Input parameter violated a constraint. Validate your parameter before calling
// the API operation again.
//
// * ErrCodeAccessDeniedException "AccessDeniedException"
// You are not authorized to perform the action.
//
// * ErrCodeInternalServerError "InternalServerError"
// Amazon Rekognition experienced a service issue. Try your call again.
//
// * ErrCodeThrottlingException "ThrottlingException"
// Amazon Rekognition is temporarily unable to process the request. Try your
// call again.
//
// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException"
// The number of requests exceeded your throughput limit. If you want to increase
// this limit, contact Amazon Rekognition.
//
// * ErrCodeInvalidPaginationTokenException "InvalidPaginationTokenException"
// Pagination token in the request is not valid.
//
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
// The collection specified in the request cannot be found.
//
func (c *Rekognition) ListCollections(input *ListCollectionsInput) (*ListCollectionsOutput, error) {
req, out := c.ListCollectionsRequest(input)
return out, req.Send()
}
// ListCollectionsWithContext is the same as ListCollections with the addition of
// the ability to pass a context and additional request options.
//
// See ListCollections for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *Rekognition) ListCollectionsWithContext(ctx aws.Context, input *ListCollectionsInput, opts ...request.Option) (*ListCollectionsOutput, error) {
req, out := c.ListCollectionsRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
// ListCollectionsPages iterates over the pages of a ListCollections operation,
// calling the "fn" function with the response data for each page. To stop
// iterating, return false from the fn function.
//
// See ListCollections method for more information on how to use this operation.
//
// Note: This operation can generate multiple requests to a service.
//
// // Example iterating over at most 3 pages of a ListCollections operation.
// pageNum := 0
// err := client.ListCollectionsPages(params,
// func(page *rekognition.ListCollectionsOutput, lastPage bool) bool {
// pageNum++
// fmt.Println(page)
// return pageNum <= 3
// })
//
func (c *Rekognition) ListCollectionsPages(input *ListCollectionsInput, fn func(*ListCollectionsOutput, bool) bool) error {
return c.ListCollectionsPagesWithContext(aws.BackgroundContext(), input, fn)
}
// ListCollectionsPagesWithContext same as ListCollectionsPages except
// it takes a Context and allows setting request options on the pages.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *Rekognition) ListCollectionsPagesWithContext(ctx aws.Context, input *ListCollectionsInput, fn func(*ListCollectionsOutput, bool) bool, opts ...request.Option) error {
p := request.Pagination{
NewRequest: func() (*request.Request, error) {
var inCpy *ListCollectionsInput
if input != nil {
tmp := *input
inCpy = &tmp
}
req, _ := c.ListCollectionsRequest(inCpy)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
},
}
cont := true
for p.Next() && cont {
cont = fn(p.Page().(*ListCollectionsOutput), !p.HasNextPage())
}
return p.Err()
}
const opListFaces = "ListFaces"
// ListFacesRequest generates a "aws/request.Request" representing the
// client's request for the ListFaces operation. The "output" return
// value will be populated with the request's response once the request completes
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See ListFaces for more information on using the ListFaces
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the ListFacesRequest method.
// req, resp := client.ListFacesRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
func (c *Rekognition) ListFacesRequest(input *ListFacesInput) (req *request.Request, output *ListFacesOutput) {
op := &request.Operation{
Name: opListFaces,
HTTPMethod: "POST",
HTTPPath: "/",
Paginator: &request.Paginator{
InputTokens: []string{"NextToken"},
OutputTokens: []string{"NextToken"},
LimitToken: "MaxResults",
TruncationToken: "",
},
}
if input == nil {
input = &ListFacesInput{}
}
output = &ListFacesOutput{}
req = c.newRequest(op, input, output)
return
}
// ListFaces API operation for Amazon Rekognition.
//
// Returns metadata for faces in the specified collection. This metadata includes
// information such as the bounding box coordinates, the confidence (that the
// bounding box contains a face), and face ID. For an example, see Listing Faces
// in a Collection in the Amazon Rekognition Developer Guide.
//
// This operation requires permissions to perform the rekognition:ListFaces
// action.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon Rekognition's
// API operation ListFaces for usage and error information.
//
// Returned Error Codes:
// * ErrCodeInvalidParameterException "InvalidParameterException"
// Input parameter violated a constraint. Validate your parameter before calling
// the API operation again.
//
// * ErrCodeAccessDeniedException "AccessDeniedException"
// You are not authorized to perform the action.
//
// * ErrCodeInternalServerError "InternalServerError"
// Amazon Rekognition experienced a service issue. Try your call again.
//
// * ErrCodeThrottlingException "ThrottlingException"
// Amazon Rekognition is temporarily unable to process the request. Try your
// call again.
//
// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException"
// The number of requests exceeded your throughput limit. If you want to increase
// this limit, contact Amazon Rekognition.
//
// * ErrCodeInvalidPaginationTokenException "InvalidPaginationTokenException"
// Pagination token in the request is not valid.
//
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
// The collection specified in the request cannot be found.
//
func (c *Rekognition) ListFaces(input *ListFacesInput) (*ListFacesOutput, error) {
req, out := c.ListFacesRequest(input)
return out, req.Send()
}
// ListFacesWithContext is the same as ListFaces with the addition of
// the ability to pass a context and additional request options.
//
// See ListFaces for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *Rekognition) ListFacesWithContext(ctx aws.Context, input *ListFacesInput, opts ...request.Option) (*ListFacesOutput, error) {
req, out := c.ListFacesRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
// ListFacesPages iterates over the pages of a ListFaces operation,
// calling the "fn" function with the response data for each page. To stop
// iterating, return false from the fn function.
//
// See ListFaces method for more information on how to use this operation.
//
// Note: This operation can generate multiple requests to a service.
//
// // Example iterating over at most 3 pages of a ListFaces operation.
// pageNum := 0
// err := client.ListFacesPages(params,
// func(page *rekognition.ListFacesOutput, lastPage bool) bool {
// pageNum++
// fmt.Println(page)
// return pageNum <= 3
// })
//
func (c *Rekognition) ListFacesPages(input *ListFacesInput, fn func(*ListFacesOutput, bool) bool) error {
return c.ListFacesPagesWithContext(aws.BackgroundContext(), input, fn)
}
// ListFacesPagesWithContext same as ListFacesPages except
// it takes a Context and allows setting request options on the pages.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *Rekognition) ListFacesPagesWithContext(ctx aws.Context, input *ListFacesInput, fn func(*ListFacesOutput, bool) bool, opts ...request.Option) error {
p := request.Pagination{
NewRequest: func() (*request.Request, error) {
var inCpy *ListFacesInput
if input != nil {
tmp := *input
inCpy = &tmp
}
req, _ := c.ListFacesRequest(inCpy)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
},
}
cont := true
for p.Next() && cont {
cont = fn(p.Page().(*ListFacesOutput), !p.HasNextPage())
}
return p.Err()
}
const opListStreamProcessors = "ListStreamProcessors"
// ListStreamProcessorsRequest generates a "aws/request.Request" representing the
// client's request for the ListStreamProcessors operation. The "output" return
// value will be populated with the request's response once the request completes
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See ListStreamProcessors for more information on using the ListStreamProcessors
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the ListStreamProcessorsRequest method.
// req, resp := client.ListStreamProcessorsRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
func (c *Rekognition) ListStreamProcessorsRequest(input *ListStreamProcessorsInput) (req *request.Request, output *ListStreamProcessorsOutput) {
op := &request.Operation{
Name: opListStreamProcessors,
HTTPMethod: "POST",
HTTPPath: "/",
Paginator: &request.Paginator{
InputTokens: []string{"NextToken"},
OutputTokens: []string{"NextToken"},
LimitToken: "MaxResults",
TruncationToken: "",
},
}
if input == nil {
input = &ListStreamProcessorsInput{}
}
output = &ListStreamProcessorsOutput{}
req = c.newRequest(op, input, output)
return
}
// ListStreamProcessors API operation for Amazon Rekognition.
//
// Gets a list of stream processors that you have created with CreateStreamProcessor.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon Rekognition's
// API operation ListStreamProcessors for usage and error information.
//
// Returned Error Codes:
// * ErrCodeAccessDeniedException "AccessDeniedException"
// You are not authorized to perform the action.
//
// * ErrCodeInternalServerError "InternalServerError"
// Amazon Rekognition experienced a service issue. Try your call again.
//
// * ErrCodeThrottlingException "ThrottlingException"
// Amazon Rekognition is temporarily unable to process the request. Try your
// call again.
//
// * ErrCodeInvalidParameterException "InvalidParameterException"
// Input parameter violated a constraint. Validate your parameter before calling
// the API operation again.
//
// * ErrCodeInvalidPaginationTokenException "InvalidPaginationTokenException"
// Pagination token in the request is not valid.
//
// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException"
// The number of requests exceeded your throughput limit. If you want to increase
// this limit, contact Amazon Rekognition.
//
func (c *Rekognition) ListStreamProcessors(input *ListStreamProcessorsInput) (*ListStreamProcessorsOutput, error) {
req, out := c.ListStreamProcessorsRequest(input)
return out, req.Send()
}
// ListStreamProcessorsWithContext is the same as ListStreamProcessors with the addition of
// the ability to pass a context and additional request options.
//
// See ListStreamProcessors for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *Rekognition) ListStreamProcessorsWithContext(ctx aws.Context, input *ListStreamProcessorsInput, opts ...request.Option) (*ListStreamProcessorsOutput, error) {
req, out := c.ListStreamProcessorsRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
// ListStreamProcessorsPages iterates over the pages of a ListStreamProcessors operation,
// calling the "fn" function with the response data for each page. To stop
// iterating, return false from the fn function.
//
// See ListStreamProcessors method for more information on how to use this operation.
//
// Note: This operation can generate multiple requests to a service.
//
// // Example iterating over at most 3 pages of a ListStreamProcessors operation.
// pageNum := 0
// err := client.ListStreamProcessorsPages(params,
// func(page *rekognition.ListStreamProcessorsOutput, lastPage bool) bool {
// pageNum++
// fmt.Println(page)
// return pageNum <= 3
// })
//
func (c *Rekognition) ListStreamProcessorsPages(input *ListStreamProcessorsInput, fn func(*ListStreamProcessorsOutput, bool) bool) error {
return c.ListStreamProcessorsPagesWithContext(aws.BackgroundContext(), input, fn)
}
// ListStreamProcessorsPagesWithContext same as ListStreamProcessorsPages except
// it takes a Context and allows setting request options on the pages.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *Rekognition) ListStreamProcessorsPagesWithContext(ctx aws.Context, input *ListStreamProcessorsInput, fn func(*ListStreamProcessorsOutput, bool) bool, opts ...request.Option) error {
p := request.Pagination{
NewRequest: func() (*request.Request, error) {
var inCpy *ListStreamProcessorsInput
if input != nil {
tmp := *input
inCpy = &tmp
}
req, _ := c.ListStreamProcessorsRequest(inCpy)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
},
}
cont := true
for p.Next() && cont {
cont = fn(p.Page().(*ListStreamProcessorsOutput), !p.HasNextPage())
}
return p.Err()
}
const opRecognizeCelebrities = "RecognizeCelebrities"
// RecognizeCelebritiesRequest generates a "aws/request.Request" representing the
// client's request for the RecognizeCelebrities operation. The "output" return
// value will be populated with the request's response once the request completes
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See RecognizeCelebrities for more information on using the RecognizeCelebrities
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the RecognizeCelebritiesRequest method.
// req, resp := client.RecognizeCelebritiesRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
func (c *Rekognition) RecognizeCelebritiesRequest(input *RecognizeCelebritiesInput) (req *request.Request, output *RecognizeCelebritiesOutput) {
op := &request.Operation{
Name: opRecognizeCelebrities,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &RecognizeCelebritiesInput{}
}
output = &RecognizeCelebritiesOutput{}
req = c.newRequest(op, input, output)
return
}
// RecognizeCelebrities API operation for Amazon Rekognition.
//
// Returns an array of celebrities recognized in the input image. For more information,
// see Recognizing Celebrities in the Amazon Rekognition Developer Guide.
//
// RecognizeCelebrities returns the 100 largest faces in the image. It lists
// recognized celebrities in the CelebrityFaces array and unrecognized faces
// in the UnrecognizedFaces array. RecognizeCelebrities doesn't return celebrities
// whose faces aren't among the largest 100 faces in the image.
//
// For each celebrity recognized, RecognizeCelebrities returns a Celebrity object.
// The Celebrity object contains the celebrity name, ID, URL links to additional
// information, match confidence, and a ComparedFace object that you can use
// to locate the celebrity's face on the image.
//
// Amazon Rekognition doesn't retain information about which images a celebrity
// has been recognized in. Your application must store this information and
// use the Celebrity ID property as a unique identifier for the celebrity. If
// you don't store the celebrity name or additional information URLs returned
// by RecognizeCelebrities, you will need the ID to identify the celebrity in
// a call to the GetCelebrityInfo operation.
//
// 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 AWS CLI to call Amazon
// Rekognition operations, passing image bytes is not supported. The image must
// be either a PNG or JPEG formatted file.
//
// For an example, see Recognizing Celebrities in an Image in the Amazon Rekognition
// Developer Guide.
//
// This operation requires permissions to perform the rekognition:RecognizeCelebrities
// operation.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon Rekognition's
// API operation RecognizeCelebrities for usage and error information.
//
// Returned Error Codes:
// * ErrCodeInvalidS3ObjectException "InvalidS3ObjectException"
// Amazon Rekognition is unable to access the S3 object specified in the request.
//
// * ErrCodeInvalidParameterException "InvalidParameterException"
// Input parameter violated a constraint. Validate your parameter before calling
// the API operation again.
//
// * ErrCodeInvalidImageFormatException "InvalidImageFormatException"
// The provided image format is not supported.
//
// * ErrCodeImageTooLargeException "ImageTooLargeException"
// The input image size exceeds the allowed limit. For more information, see
// Limits in Amazon Rekognition in the Amazon Rekognition Developer Guide.
//
// * ErrCodeAccessDeniedException "AccessDeniedException"
// You are not authorized to perform the action.
//
// * ErrCodeInternalServerError "InternalServerError"
// Amazon Rekognition experienced a service issue. Try your call again.
//
// * ErrCodeThrottlingException "ThrottlingException"
// Amazon Rekognition is temporarily unable to process the request. Try your
// call again.
//
// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException"
// The number of requests exceeded your throughput limit. If you want to increase
// this limit, contact Amazon Rekognition.
//
// * ErrCodeInvalidImageFormatException "InvalidImageFormatException"
// The provided image format is not supported.
//
func (c *Rekognition) RecognizeCelebrities(input *RecognizeCelebritiesInput) (*RecognizeCelebritiesOutput, error) {
req, out := c.RecognizeCelebritiesRequest(input)
return out, req.Send()
}
// RecognizeCelebritiesWithContext is the same as RecognizeCelebrities with the addition of
// the ability to pass a context and additional request options.
//
// See RecognizeCelebrities for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *Rekognition) RecognizeCelebritiesWithContext(ctx aws.Context, input *RecognizeCelebritiesInput, opts ...request.Option) (*RecognizeCelebritiesOutput, error) {
req, out := c.RecognizeCelebritiesRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opSearchFaces = "SearchFaces"
// SearchFacesRequest generates a "aws/request.Request" representing the
// client's request for the SearchFaces operation. The "output" return
// value will be populated with the request's response once the request completes
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See SearchFaces for more information on using the SearchFaces
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the SearchFacesRequest method.
// req, resp := client.SearchFacesRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
func (c *Rekognition) SearchFacesRequest(input *SearchFacesInput) (req *request.Request, output *SearchFacesOutput) {
op := &request.Operation{
Name: opSearchFaces,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &SearchFacesInput{}
}
output = &SearchFacesOutput{}
req = c.newRequest(op, input, output)
return
}
// SearchFaces API operation for Amazon Rekognition.
//
// For a given input face ID, searches for matching faces in the collection
// the face belongs to. You get a face ID when you add a face to the collection
// using the IndexFaces operation. The operation compares the features of the
// input face with faces in the specified collection.
//
// You can also search faces without indexing faces by using the SearchFacesByImage
// operation.
//
// The operation response returns an array of faces that match, ordered by similarity
// score with the highest similarity first. More specifically, it is an array
// of metadata for each face match that is found. Along with the metadata, the
// response also includes a confidence value for each face match, indicating
// the confidence that the specific face matches the input face.
//
// For an example, see Searching for a Face Using Its Face ID in the Amazon
// Rekognition Developer Guide.
//
// This operation requires permissions to perform the rekognition:SearchFaces
// action.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon Rekognition's
// API operation SearchFaces for usage and error information.
//
// Returned Error Codes:
// * ErrCodeInvalidParameterException "InvalidParameterException"
// Input parameter violated a constraint. Validate your parameter before calling
// the API operation again.
//
// * ErrCodeAccessDeniedException "AccessDeniedException"
// You are not authorized to perform the action.
//
// * ErrCodeInternalServerError "InternalServerError"
// Amazon Rekognition experienced a service issue. Try your call again.
//
// * ErrCodeThrottlingException "ThrottlingException"
// Amazon Rekognition is temporarily unable to process the request. Try your
// call again.
//
// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException"
// The number of requests exceeded your throughput limit. If you want to increase
// this limit, contact Amazon Rekognition.
//
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
// The collection specified in the request cannot be found.
//
func (c *Rekognition) SearchFaces(input *SearchFacesInput) (*SearchFacesOutput, error) {
req, out := c.SearchFacesRequest(input)
return out, req.Send()
}
// SearchFacesWithContext is the same as SearchFaces with the addition of
// the ability to pass a context and additional request options.
//
// See SearchFaces for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *Rekognition) SearchFacesWithContext(ctx aws.Context, input *SearchFacesInput, opts ...request.Option) (*SearchFacesOutput, error) {
req, out := c.SearchFacesRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opSearchFacesByImage = "SearchFacesByImage"
// SearchFacesByImageRequest generates a "aws/request.Request" representing the
// client's request for the SearchFacesByImage operation. The "output" return
// value will be populated with the request's response once the request completes
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See SearchFacesByImage for more information on using the SearchFacesByImage
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the SearchFacesByImageRequest method.
// req, resp := client.SearchFacesByImageRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
func (c *Rekognition) SearchFacesByImageRequest(input *SearchFacesByImageInput) (req *request.Request, output *SearchFacesByImageOutput) {
op := &request.Operation{