Update Go AWS SDK to the latest version

This commit is contained in:
Andrey Smirnov
2019-07-13 00:03:55 +03:00
committed by Andrey Smirnov
parent d08be990ef
commit 94a72b23ff
2183 changed files with 885887 additions and 228114 deletions
File diff suppressed because it is too large Load Diff
+30
View File
@@ -0,0 +1,30 @@
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
// Package textract provides the client and types for making API
// requests to Amazon Textract.
//
// Amazon Textract detects and analyzes text in documents and converts it into
// machine-readable text. This is the API reference documentation for Amazon
// Textract.
//
// See https://docs.aws.amazon.com/goto/WebAPI/textract-2018-06-27 for more information on this service.
//
// See textract package documentation for more information.
// https://docs.aws.amazon.com/sdk-for-go/api/service/textract/
//
// Using the Client
//
// To contact Amazon Textract with the SDK use the New function to create
// a new service client. With that client you can make API requests to the service.
// These clients are safe to use concurrently.
//
// See the SDK's documentation for more information on how to use the SDK.
// https://docs.aws.amazon.com/sdk-for-go/api/
//
// See aws.Config documentation for more information on configuring SDK clients.
// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config
//
// See the Amazon Textract client Textract for more
// information on creating client for this service.
// https://docs.aws.amazon.com/sdk-for-go/api/service/textract/#New
package textract
+93
View File
@@ -0,0 +1,93 @@
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package textract
const (
// ErrCodeAccessDeniedException for service response error code
// "AccessDeniedException".
//
// You aren't authorized to perform the action.
ErrCodeAccessDeniedException = "AccessDeniedException"
// ErrCodeBadDocumentException for service response error code
// "BadDocumentException".
//
// Amazon Textract isn't able to read the document.
ErrCodeBadDocumentException = "BadDocumentException"
// ErrCodeDocumentTooLargeException for service response error code
// "DocumentTooLargeException".
//
// The document can't be processed because it's too large. The maximum document
// size for synchronous operations 5 MB. The maximum document size for asynchronous
// operations is 500 MB for PDF format files.
ErrCodeDocumentTooLargeException = "DocumentTooLargeException"
// ErrCodeIdempotentParameterMismatchException for service response error code
// "IdempotentParameterMismatchException".
//
// A ClientRequestToken input parameter was reused with an operation, but at
// least one of the other input parameters is different from the previous call
// to the operation.
ErrCodeIdempotentParameterMismatchException = "IdempotentParameterMismatchException"
// ErrCodeInternalServerError for service response error code
// "InternalServerError".
//
// Amazon Textract experienced a service issue. Try your call again.
ErrCodeInternalServerError = "InternalServerError"
// ErrCodeInvalidJobIdException for service response error code
// "InvalidJobIdException".
//
// An invalid job identifier was passed to GetDocumentAnalysis or to GetDocumentAnalysis.
ErrCodeInvalidJobIdException = "InvalidJobIdException"
// ErrCodeInvalidParameterException for service response error code
// "InvalidParameterException".
//
// An input parameter violated a constraint. For example, in synchronous operations,
// an InvalidParameterException exception occurs when neither of the S3Object
// or Bytes values are supplied in the Document request parameter. Validate
// your parameter before calling the API operation again.
ErrCodeInvalidParameterException = "InvalidParameterException"
// ErrCodeInvalidS3ObjectException for service response error code
// "InvalidS3ObjectException".
//
// Amazon Textract is unable to access the S3 object that's specified in the
// request.
ErrCodeInvalidS3ObjectException = "InvalidS3ObjectException"
// ErrCodeLimitExceededException for service response error code
// "LimitExceededException".
//
// An Amazon Textract service limit was exceeded. For example, if you start
// too many asynchronous jobs concurrently, calls to start operations (StartDocumentTextDetection,
// for example) raise a LimitExceededException exception (HTTP status code:
// 400) until the number of concurrently running jobs is below the Amazon Textract
// service limit.
ErrCodeLimitExceededException = "LimitExceededException"
// ErrCodeProvisionedThroughputExceededException for service response error code
// "ProvisionedThroughputExceededException".
//
// The number of requests exceeded your throughput limit. If you want to increase
// this limit, contact Amazon Textract.
ErrCodeProvisionedThroughputExceededException = "ProvisionedThroughputExceededException"
// ErrCodeThrottlingException for service response error code
// "ThrottlingException".
//
// Amazon Textract is temporarily unable to process the request. Try your call
// again.
ErrCodeThrottlingException = "ThrottlingException"
// ErrCodeUnsupportedDocumentException for service response error code
// "UnsupportedDocumentException".
//
// The format of the input document isn't supported. Amazon Textract supports
// documents that are .png or .jpg format.
ErrCodeUnsupportedDocumentException = "UnsupportedDocumentException"
)
+97
View File
@@ -0,0 +1,97 @@
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package textract
import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/client"
"github.com/aws/aws-sdk-go/aws/client/metadata"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/aws/signer/v4"
"github.com/aws/aws-sdk-go/private/protocol/jsonrpc"
)
// Textract provides the API operation methods for making requests to
// Amazon Textract. See this package's package overview docs
// for details on the service.
//
// Textract methods are safe to use concurrently. It is not safe to
// modify mutate any of the struct's properties though.
type Textract struct {
*client.Client
}
// Used for custom client initialization logic
var initClient func(*client.Client)
// Used for custom request initialization logic
var initRequest func(*request.Request)
// Service information constants
const (
ServiceName = "Textract" // Name of service.
EndpointsID = "textract" // ID to lookup a service endpoint with.
ServiceID = "Textract" // ServiceID is a unique identifer of a specific service.
)
// New creates a new instance of the Textract client with a session.
// If additional configuration is needed for the client instance use the optional
// aws.Config parameter to add your extra config.
//
// Example:
// // Create a Textract client from just a session.
// svc := textract.New(mySession)
//
// // Create a Textract client with additional configuration
// svc := textract.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
func New(p client.ConfigProvider, cfgs ...*aws.Config) *Textract {
c := p.ClientConfig(EndpointsID, cfgs...)
return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName)
}
// newClient creates, initializes and returns a new service client instance.
func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *Textract {
svc := &Textract{
Client: client.New(
cfg,
metadata.ClientInfo{
ServiceName: ServiceName,
ServiceID: ServiceID,
SigningName: signingName,
SigningRegion: signingRegion,
Endpoint: endpoint,
APIVersion: "2018-06-27",
JSONVersion: "1.1",
TargetPrefix: "Textract",
},
handlers,
),
}
// Handlers
svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler)
svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler)
svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler)
svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler)
// Run custom client initialization if present
if initClient != nil {
initClient(svc.Client)
}
return svc
}
// newRequest creates a new request for a Textract operation and runs any
// custom request initialization.
func (c *Textract) newRequest(op *request.Operation, params, data interface{}) *request.Request {
req := c.NewRequest(op, params, data)
// Run custom request initialization if present
if initRequest != nil {
initRequest(req)
}
return req
}
@@ -0,0 +1,88 @@
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
// Package textractiface provides an interface to enable mocking the Amazon Textract service client
// for testing your code.
//
// It is important to note that this interface will have breaking changes
// when the service model is updated and adds new API operations, paginators,
// and waiters.
package textractiface
import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/service/textract"
)
// TextractAPI provides an interface to enable mocking the
// textract.Textract service client's API operation,
// paginators, and waiters. This make unit testing your code that calls out
// to the SDK's service client's calls easier.
//
// The best way to use this interface is so the SDK's service client's calls
// can be stubbed out for unit testing your code with the SDK without needing
// to inject custom request handlers into the SDK's request pipeline.
//
// // myFunc uses an SDK service client to make a request to
// // Amazon Textract.
// func myFunc(svc textractiface.TextractAPI) bool {
// // Make svc.AnalyzeDocument request
// }
//
// func main() {
// sess := session.New()
// svc := textract.New(sess)
//
// myFunc(svc)
// }
//
// In your _test.go file:
//
// // Define a mock struct to be used in your unit tests of myFunc.
// type mockTextractClient struct {
// textractiface.TextractAPI
// }
// func (m *mockTextractClient) AnalyzeDocument(input *textract.AnalyzeDocumentInput) (*textract.AnalyzeDocumentOutput, error) {
// // mock response/functionality
// }
//
// func TestMyFunc(t *testing.T) {
// // Setup Test
// mockSvc := &mockTextractClient{}
//
// myfunc(mockSvc)
//
// // Verify myFunc's functionality
// }
//
// It is important to note that this interface will have breaking changes
// when the service model is updated and adds new API operations, paginators,
// and waiters. Its suggested to use the pattern above for testing, or using
// tooling to generate mocks to satisfy the interfaces.
type TextractAPI interface {
AnalyzeDocument(*textract.AnalyzeDocumentInput) (*textract.AnalyzeDocumentOutput, error)
AnalyzeDocumentWithContext(aws.Context, *textract.AnalyzeDocumentInput, ...request.Option) (*textract.AnalyzeDocumentOutput, error)
AnalyzeDocumentRequest(*textract.AnalyzeDocumentInput) (*request.Request, *textract.AnalyzeDocumentOutput)
DetectDocumentText(*textract.DetectDocumentTextInput) (*textract.DetectDocumentTextOutput, error)
DetectDocumentTextWithContext(aws.Context, *textract.DetectDocumentTextInput, ...request.Option) (*textract.DetectDocumentTextOutput, error)
DetectDocumentTextRequest(*textract.DetectDocumentTextInput) (*request.Request, *textract.DetectDocumentTextOutput)
GetDocumentAnalysis(*textract.GetDocumentAnalysisInput) (*textract.GetDocumentAnalysisOutput, error)
GetDocumentAnalysisWithContext(aws.Context, *textract.GetDocumentAnalysisInput, ...request.Option) (*textract.GetDocumentAnalysisOutput, error)
GetDocumentAnalysisRequest(*textract.GetDocumentAnalysisInput) (*request.Request, *textract.GetDocumentAnalysisOutput)
GetDocumentTextDetection(*textract.GetDocumentTextDetectionInput) (*textract.GetDocumentTextDetectionOutput, error)
GetDocumentTextDetectionWithContext(aws.Context, *textract.GetDocumentTextDetectionInput, ...request.Option) (*textract.GetDocumentTextDetectionOutput, error)
GetDocumentTextDetectionRequest(*textract.GetDocumentTextDetectionInput) (*request.Request, *textract.GetDocumentTextDetectionOutput)
StartDocumentAnalysis(*textract.StartDocumentAnalysisInput) (*textract.StartDocumentAnalysisOutput, error)
StartDocumentAnalysisWithContext(aws.Context, *textract.StartDocumentAnalysisInput, ...request.Option) (*textract.StartDocumentAnalysisOutput, error)
StartDocumentAnalysisRequest(*textract.StartDocumentAnalysisInput) (*request.Request, *textract.StartDocumentAnalysisOutput)
StartDocumentTextDetection(*textract.StartDocumentTextDetectionInput) (*textract.StartDocumentTextDetectionOutput, error)
StartDocumentTextDetectionWithContext(aws.Context, *textract.StartDocumentTextDetectionInput, ...request.Option) (*textract.StartDocumentTextDetectionOutput, error)
StartDocumentTextDetectionRequest(*textract.StartDocumentTextDetectionInput) (*request.Request, *textract.StartDocumentTextDetectionOutput)
}
var _ TextractAPI = (*textract.Textract)(nil)