Switch to using the dep tool and update all the dependencies

This commit is contained in:
Nick Craig-Wood
2017-05-11 15:39:54 +01:00
parent 5135ff73cb
commit 98c2d2c41b
5321 changed files with 4483197 additions and 5918 deletions
File diff suppressed because it is too large Load Diff
+80
View File
@@ -0,0 +1,80 @@
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
// Package mturk provides the client and types for making API
// requests to Amazon Mechanical Turk.
//
// Amazon Mechanical Turk API Reference
//
// See https://docs.aws.amazon.com/goto/WebAPI/mturk-requester-2017-01-17 for more information on this service.
//
// See mturk package documentation for more information.
// https://docs.aws.amazon.com/sdk-for-go/api/service/mturk/
//
// Using the Client
//
// To use the client for Amazon Mechanical Turk you will first need
// to create a new instance of it.
//
// When creating a client for an AWS service you'll first need to have a Session
// already created. The Session provides configuration that can be shared
// between multiple service clients. Additional configuration can be applied to
// the Session and service's client when they are constructed. The aws package's
// Config type contains several fields such as Region for the AWS Region the
// client should make API requests too. The optional Config value can be provided
// as the variadic argument for Sessions and client creation.
//
// Once the service's client is created you can use it to make API requests the
// AWS service. These clients are safe to use concurrently.
//
// // Create a session to share configuration, and load external configuration.
// sess := session.Must(session.NewSession())
//
// // Create the service's client with the session.
// svc := mturk.New(sess)
//
// See the SDK's documentation for more information on how to use service clients.
// https://docs.aws.amazon.com/sdk-for-go/api/
//
// See aws package's Config type for more information on configuration options.
// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config
//
// See the Amazon Mechanical Turk client MTurk for more
// information on creating the service's client.
// https://docs.aws.amazon.com/sdk-for-go/api/service/mturk/#New
//
// Once the client is created you can make an API request to the service.
// Each API method takes a input parameter, and returns the service response
// and an error.
//
// The API method will document which error codes the service can be returned
// by the operation if the service models the API operation's errors. These
// errors will also be available as const strings prefixed with "ErrCode".
//
// result, err := svc.AcceptQualificationRequest(params)
// if err != nil {
// // Cast err to awserr.Error to handle specific error codes.
// aerr, ok := err.(awserr.Error)
// if ok && aerr.Code() == <error code to check for> {
// // Specific error code handling
// }
// return err
// }
//
// fmt.Println("AcceptQualificationRequest result:")
// fmt.Println(result)
//
// Using the Client with Context
//
// The service's client also provides methods to make API requests with a Context
// value. This allows you to control the timeout, and cancellation of pending
// requests. These methods also take request Option as variadic parameter to apply
// additional configuration to the API request.
//
// ctx := context.Background()
//
// result, err := svc.AcceptQualificationRequestWithContext(ctx, params)
//
// See the request package documentation for more information on using Context pattern
// with the SDK.
// https://docs.aws.amazon.com/sdk-for-go/api/aws/request/
package mturk
+19
View File
@@ -0,0 +1,19 @@
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package mturk
const (
// ErrCodeRequestError for service response error code
// "RequestError".
//
// Your request is invalid.
ErrCodeRequestError = "RequestError"
// ErrCodeServiceFault for service response error code
// "ServiceFault".
//
// Amazon Mechanical Turk is temporarily unable to process your request. Try
// your call again.
ErrCodeServiceFault = "ServiceFault"
)
File diff suppressed because it is too large Load Diff
+250
View File
@@ -0,0 +1,250 @@
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
// Package mturkiface provides an interface to enable mocking the Amazon Mechanical Turk 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 mturkiface
import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/service/mturk"
)
// MTurkAPI provides an interface to enable mocking the
// mturk.MTurk 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 the SDK's request pipeline.
//
// // myFunc uses an SDK service client to make a request to
// // Amazon Mechanical Turk.
// func myFunc(svc mturkiface.MTurkAPI) bool {
// // Make svc.AcceptQualificationRequest request
// }
//
// func main() {
// sess := session.New()
// svc := mturk.New(sess)
//
// myFunc(svc)
// }
//
// In your _test.go file:
//
// // Define a mock struct to be used in your unit tests of myFunc.
// type mockMTurkClient struct {
// mturkiface.MTurkAPI
// }
// func (m *mockMTurkClient) AcceptQualificationRequest(input *mturk.AcceptQualificationRequestInput) (*mturk.AcceptQualificationRequestOutput, error) {
// // mock response/functionality
// }
//
// func TestMyFunc(t *testing.T) {
// // Setup Test
// mockSvc := &mockMTurkClient{}
//
// 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 MTurkAPI interface {
AcceptQualificationRequest(*mturk.AcceptQualificationRequestInput) (*mturk.AcceptQualificationRequestOutput, error)
AcceptQualificationRequestWithContext(aws.Context, *mturk.AcceptQualificationRequestInput, ...request.Option) (*mturk.AcceptQualificationRequestOutput, error)
AcceptQualificationRequestRequest(*mturk.AcceptQualificationRequestInput) (*request.Request, *mturk.AcceptQualificationRequestOutput)
ApproveAssignment(*mturk.ApproveAssignmentInput) (*mturk.ApproveAssignmentOutput, error)
ApproveAssignmentWithContext(aws.Context, *mturk.ApproveAssignmentInput, ...request.Option) (*mturk.ApproveAssignmentOutput, error)
ApproveAssignmentRequest(*mturk.ApproveAssignmentInput) (*request.Request, *mturk.ApproveAssignmentOutput)
AssociateQualificationWithWorker(*mturk.AssociateQualificationWithWorkerInput) (*mturk.AssociateQualificationWithWorkerOutput, error)
AssociateQualificationWithWorkerWithContext(aws.Context, *mturk.AssociateQualificationWithWorkerInput, ...request.Option) (*mturk.AssociateQualificationWithWorkerOutput, error)
AssociateQualificationWithWorkerRequest(*mturk.AssociateQualificationWithWorkerInput) (*request.Request, *mturk.AssociateQualificationWithWorkerOutput)
CreateAdditionalAssignmentsForHIT(*mturk.CreateAdditionalAssignmentsForHITInput) (*mturk.CreateAdditionalAssignmentsForHITOutput, error)
CreateAdditionalAssignmentsForHITWithContext(aws.Context, *mturk.CreateAdditionalAssignmentsForHITInput, ...request.Option) (*mturk.CreateAdditionalAssignmentsForHITOutput, error)
CreateAdditionalAssignmentsForHITRequest(*mturk.CreateAdditionalAssignmentsForHITInput) (*request.Request, *mturk.CreateAdditionalAssignmentsForHITOutput)
CreateHIT(*mturk.CreateHITInput) (*mturk.CreateHITOutput, error)
CreateHITWithContext(aws.Context, *mturk.CreateHITInput, ...request.Option) (*mturk.CreateHITOutput, error)
CreateHITRequest(*mturk.CreateHITInput) (*request.Request, *mturk.CreateHITOutput)
CreateHITType(*mturk.CreateHITTypeInput) (*mturk.CreateHITTypeOutput, error)
CreateHITTypeWithContext(aws.Context, *mturk.CreateHITTypeInput, ...request.Option) (*mturk.CreateHITTypeOutput, error)
CreateHITTypeRequest(*mturk.CreateHITTypeInput) (*request.Request, *mturk.CreateHITTypeOutput)
CreateHITWithHITType(*mturk.CreateHITWithHITTypeInput) (*mturk.CreateHITWithHITTypeOutput, error)
CreateHITWithHITTypeWithContext(aws.Context, *mturk.CreateHITWithHITTypeInput, ...request.Option) (*mturk.CreateHITWithHITTypeOutput, error)
CreateHITWithHITTypeRequest(*mturk.CreateHITWithHITTypeInput) (*request.Request, *mturk.CreateHITWithHITTypeOutput)
CreateQualificationType(*mturk.CreateQualificationTypeInput) (*mturk.CreateQualificationTypeOutput, error)
CreateQualificationTypeWithContext(aws.Context, *mturk.CreateQualificationTypeInput, ...request.Option) (*mturk.CreateQualificationTypeOutput, error)
CreateQualificationTypeRequest(*mturk.CreateQualificationTypeInput) (*request.Request, *mturk.CreateQualificationTypeOutput)
CreateWorkerBlock(*mturk.CreateWorkerBlockInput) (*mturk.CreateWorkerBlockOutput, error)
CreateWorkerBlockWithContext(aws.Context, *mturk.CreateWorkerBlockInput, ...request.Option) (*mturk.CreateWorkerBlockOutput, error)
CreateWorkerBlockRequest(*mturk.CreateWorkerBlockInput) (*request.Request, *mturk.CreateWorkerBlockOutput)
DeleteHIT(*mturk.DeleteHITInput) (*mturk.DeleteHITOutput, error)
DeleteHITWithContext(aws.Context, *mturk.DeleteHITInput, ...request.Option) (*mturk.DeleteHITOutput, error)
DeleteHITRequest(*mturk.DeleteHITInput) (*request.Request, *mturk.DeleteHITOutput)
DeleteQualificationType(*mturk.DeleteQualificationTypeInput) (*mturk.DeleteQualificationTypeOutput, error)
DeleteQualificationTypeWithContext(aws.Context, *mturk.DeleteQualificationTypeInput, ...request.Option) (*mturk.DeleteQualificationTypeOutput, error)
DeleteQualificationTypeRequest(*mturk.DeleteQualificationTypeInput) (*request.Request, *mturk.DeleteQualificationTypeOutput)
DeleteWorkerBlock(*mturk.DeleteWorkerBlockInput) (*mturk.DeleteWorkerBlockOutput, error)
DeleteWorkerBlockWithContext(aws.Context, *mturk.DeleteWorkerBlockInput, ...request.Option) (*mturk.DeleteWorkerBlockOutput, error)
DeleteWorkerBlockRequest(*mturk.DeleteWorkerBlockInput) (*request.Request, *mturk.DeleteWorkerBlockOutput)
DisassociateQualificationFromWorker(*mturk.DisassociateQualificationFromWorkerInput) (*mturk.DisassociateQualificationFromWorkerOutput, error)
DisassociateQualificationFromWorkerWithContext(aws.Context, *mturk.DisassociateQualificationFromWorkerInput, ...request.Option) (*mturk.DisassociateQualificationFromWorkerOutput, error)
DisassociateQualificationFromWorkerRequest(*mturk.DisassociateQualificationFromWorkerInput) (*request.Request, *mturk.DisassociateQualificationFromWorkerOutput)
GetAccountBalance(*mturk.GetAccountBalanceInput) (*mturk.GetAccountBalanceOutput, error)
GetAccountBalanceWithContext(aws.Context, *mturk.GetAccountBalanceInput, ...request.Option) (*mturk.GetAccountBalanceOutput, error)
GetAccountBalanceRequest(*mturk.GetAccountBalanceInput) (*request.Request, *mturk.GetAccountBalanceOutput)
GetAssignment(*mturk.GetAssignmentInput) (*mturk.GetAssignmentOutput, error)
GetAssignmentWithContext(aws.Context, *mturk.GetAssignmentInput, ...request.Option) (*mturk.GetAssignmentOutput, error)
GetAssignmentRequest(*mturk.GetAssignmentInput) (*request.Request, *mturk.GetAssignmentOutput)
GetFileUploadURL(*mturk.GetFileUploadURLInput) (*mturk.GetFileUploadURLOutput, error)
GetFileUploadURLWithContext(aws.Context, *mturk.GetFileUploadURLInput, ...request.Option) (*mturk.GetFileUploadURLOutput, error)
GetFileUploadURLRequest(*mturk.GetFileUploadURLInput) (*request.Request, *mturk.GetFileUploadURLOutput)
GetHIT(*mturk.GetHITInput) (*mturk.GetHITOutput, error)
GetHITWithContext(aws.Context, *mturk.GetHITInput, ...request.Option) (*mturk.GetHITOutput, error)
GetHITRequest(*mturk.GetHITInput) (*request.Request, *mturk.GetHITOutput)
GetQualificationScore(*mturk.GetQualificationScoreInput) (*mturk.GetQualificationScoreOutput, error)
GetQualificationScoreWithContext(aws.Context, *mturk.GetQualificationScoreInput, ...request.Option) (*mturk.GetQualificationScoreOutput, error)
GetQualificationScoreRequest(*mturk.GetQualificationScoreInput) (*request.Request, *mturk.GetQualificationScoreOutput)
GetQualificationType(*mturk.GetQualificationTypeInput) (*mturk.GetQualificationTypeOutput, error)
GetQualificationTypeWithContext(aws.Context, *mturk.GetQualificationTypeInput, ...request.Option) (*mturk.GetQualificationTypeOutput, error)
GetQualificationTypeRequest(*mturk.GetQualificationTypeInput) (*request.Request, *mturk.GetQualificationTypeOutput)
ListAssignmentsForHIT(*mturk.ListAssignmentsForHITInput) (*mturk.ListAssignmentsForHITOutput, error)
ListAssignmentsForHITWithContext(aws.Context, *mturk.ListAssignmentsForHITInput, ...request.Option) (*mturk.ListAssignmentsForHITOutput, error)
ListAssignmentsForHITRequest(*mturk.ListAssignmentsForHITInput) (*request.Request, *mturk.ListAssignmentsForHITOutput)
ListAssignmentsForHITPages(*mturk.ListAssignmentsForHITInput, func(*mturk.ListAssignmentsForHITOutput, bool) bool) error
ListAssignmentsForHITPagesWithContext(aws.Context, *mturk.ListAssignmentsForHITInput, func(*mturk.ListAssignmentsForHITOutput, bool) bool, ...request.Option) error
ListBonusPayments(*mturk.ListBonusPaymentsInput) (*mturk.ListBonusPaymentsOutput, error)
ListBonusPaymentsWithContext(aws.Context, *mturk.ListBonusPaymentsInput, ...request.Option) (*mturk.ListBonusPaymentsOutput, error)
ListBonusPaymentsRequest(*mturk.ListBonusPaymentsInput) (*request.Request, *mturk.ListBonusPaymentsOutput)
ListBonusPaymentsPages(*mturk.ListBonusPaymentsInput, func(*mturk.ListBonusPaymentsOutput, bool) bool) error
ListBonusPaymentsPagesWithContext(aws.Context, *mturk.ListBonusPaymentsInput, func(*mturk.ListBonusPaymentsOutput, bool) bool, ...request.Option) error
ListHITs(*mturk.ListHITsInput) (*mturk.ListHITsOutput, error)
ListHITsWithContext(aws.Context, *mturk.ListHITsInput, ...request.Option) (*mturk.ListHITsOutput, error)
ListHITsRequest(*mturk.ListHITsInput) (*request.Request, *mturk.ListHITsOutput)
ListHITsPages(*mturk.ListHITsInput, func(*mturk.ListHITsOutput, bool) bool) error
ListHITsPagesWithContext(aws.Context, *mturk.ListHITsInput, func(*mturk.ListHITsOutput, bool) bool, ...request.Option) error
ListHITsForQualificationType(*mturk.ListHITsForQualificationTypeInput) (*mturk.ListHITsForQualificationTypeOutput, error)
ListHITsForQualificationTypeWithContext(aws.Context, *mturk.ListHITsForQualificationTypeInput, ...request.Option) (*mturk.ListHITsForQualificationTypeOutput, error)
ListHITsForQualificationTypeRequest(*mturk.ListHITsForQualificationTypeInput) (*request.Request, *mturk.ListHITsForQualificationTypeOutput)
ListHITsForQualificationTypePages(*mturk.ListHITsForQualificationTypeInput, func(*mturk.ListHITsForQualificationTypeOutput, bool) bool) error
ListHITsForQualificationTypePagesWithContext(aws.Context, *mturk.ListHITsForQualificationTypeInput, func(*mturk.ListHITsForQualificationTypeOutput, bool) bool, ...request.Option) error
ListQualificationRequests(*mturk.ListQualificationRequestsInput) (*mturk.ListQualificationRequestsOutput, error)
ListQualificationRequestsWithContext(aws.Context, *mturk.ListQualificationRequestsInput, ...request.Option) (*mturk.ListQualificationRequestsOutput, error)
ListQualificationRequestsRequest(*mturk.ListQualificationRequestsInput) (*request.Request, *mturk.ListQualificationRequestsOutput)
ListQualificationRequestsPages(*mturk.ListQualificationRequestsInput, func(*mturk.ListQualificationRequestsOutput, bool) bool) error
ListQualificationRequestsPagesWithContext(aws.Context, *mturk.ListQualificationRequestsInput, func(*mturk.ListQualificationRequestsOutput, bool) bool, ...request.Option) error
ListQualificationTypes(*mturk.ListQualificationTypesInput) (*mturk.ListQualificationTypesOutput, error)
ListQualificationTypesWithContext(aws.Context, *mturk.ListQualificationTypesInput, ...request.Option) (*mturk.ListQualificationTypesOutput, error)
ListQualificationTypesRequest(*mturk.ListQualificationTypesInput) (*request.Request, *mturk.ListQualificationTypesOutput)
ListQualificationTypesPages(*mturk.ListQualificationTypesInput, func(*mturk.ListQualificationTypesOutput, bool) bool) error
ListQualificationTypesPagesWithContext(aws.Context, *mturk.ListQualificationTypesInput, func(*mturk.ListQualificationTypesOutput, bool) bool, ...request.Option) error
ListReviewPolicyResultsForHIT(*mturk.ListReviewPolicyResultsForHITInput) (*mturk.ListReviewPolicyResultsForHITOutput, error)
ListReviewPolicyResultsForHITWithContext(aws.Context, *mturk.ListReviewPolicyResultsForHITInput, ...request.Option) (*mturk.ListReviewPolicyResultsForHITOutput, error)
ListReviewPolicyResultsForHITRequest(*mturk.ListReviewPolicyResultsForHITInput) (*request.Request, *mturk.ListReviewPolicyResultsForHITOutput)
ListReviewPolicyResultsForHITPages(*mturk.ListReviewPolicyResultsForHITInput, func(*mturk.ListReviewPolicyResultsForHITOutput, bool) bool) error
ListReviewPolicyResultsForHITPagesWithContext(aws.Context, *mturk.ListReviewPolicyResultsForHITInput, func(*mturk.ListReviewPolicyResultsForHITOutput, bool) bool, ...request.Option) error
ListReviewableHITs(*mturk.ListReviewableHITsInput) (*mturk.ListReviewableHITsOutput, error)
ListReviewableHITsWithContext(aws.Context, *mturk.ListReviewableHITsInput, ...request.Option) (*mturk.ListReviewableHITsOutput, error)
ListReviewableHITsRequest(*mturk.ListReviewableHITsInput) (*request.Request, *mturk.ListReviewableHITsOutput)
ListReviewableHITsPages(*mturk.ListReviewableHITsInput, func(*mturk.ListReviewableHITsOutput, bool) bool) error
ListReviewableHITsPagesWithContext(aws.Context, *mturk.ListReviewableHITsInput, func(*mturk.ListReviewableHITsOutput, bool) bool, ...request.Option) error
ListWorkerBlocks(*mturk.ListWorkerBlocksInput) (*mturk.ListWorkerBlocksOutput, error)
ListWorkerBlocksWithContext(aws.Context, *mturk.ListWorkerBlocksInput, ...request.Option) (*mturk.ListWorkerBlocksOutput, error)
ListWorkerBlocksRequest(*mturk.ListWorkerBlocksInput) (*request.Request, *mturk.ListWorkerBlocksOutput)
ListWorkerBlocksPages(*mturk.ListWorkerBlocksInput, func(*mturk.ListWorkerBlocksOutput, bool) bool) error
ListWorkerBlocksPagesWithContext(aws.Context, *mturk.ListWorkerBlocksInput, func(*mturk.ListWorkerBlocksOutput, bool) bool, ...request.Option) error
ListWorkersWithQualificationType(*mturk.ListWorkersWithQualificationTypeInput) (*mturk.ListWorkersWithQualificationTypeOutput, error)
ListWorkersWithQualificationTypeWithContext(aws.Context, *mturk.ListWorkersWithQualificationTypeInput, ...request.Option) (*mturk.ListWorkersWithQualificationTypeOutput, error)
ListWorkersWithQualificationTypeRequest(*mturk.ListWorkersWithQualificationTypeInput) (*request.Request, *mturk.ListWorkersWithQualificationTypeOutput)
ListWorkersWithQualificationTypePages(*mturk.ListWorkersWithQualificationTypeInput, func(*mturk.ListWorkersWithQualificationTypeOutput, bool) bool) error
ListWorkersWithQualificationTypePagesWithContext(aws.Context, *mturk.ListWorkersWithQualificationTypeInput, func(*mturk.ListWorkersWithQualificationTypeOutput, bool) bool, ...request.Option) error
NotifyWorkers(*mturk.NotifyWorkersInput) (*mturk.NotifyWorkersOutput, error)
NotifyWorkersWithContext(aws.Context, *mturk.NotifyWorkersInput, ...request.Option) (*mturk.NotifyWorkersOutput, error)
NotifyWorkersRequest(*mturk.NotifyWorkersInput) (*request.Request, *mturk.NotifyWorkersOutput)
RejectAssignment(*mturk.RejectAssignmentInput) (*mturk.RejectAssignmentOutput, error)
RejectAssignmentWithContext(aws.Context, *mturk.RejectAssignmentInput, ...request.Option) (*mturk.RejectAssignmentOutput, error)
RejectAssignmentRequest(*mturk.RejectAssignmentInput) (*request.Request, *mturk.RejectAssignmentOutput)
RejectQualificationRequest(*mturk.RejectQualificationRequestInput) (*mturk.RejectQualificationRequestOutput, error)
RejectQualificationRequestWithContext(aws.Context, *mturk.RejectQualificationRequestInput, ...request.Option) (*mturk.RejectQualificationRequestOutput, error)
RejectQualificationRequestRequest(*mturk.RejectQualificationRequestInput) (*request.Request, *mturk.RejectQualificationRequestOutput)
SendBonus(*mturk.SendBonusInput) (*mturk.SendBonusOutput, error)
SendBonusWithContext(aws.Context, *mturk.SendBonusInput, ...request.Option) (*mturk.SendBonusOutput, error)
SendBonusRequest(*mturk.SendBonusInput) (*request.Request, *mturk.SendBonusOutput)
SendTestEventNotification(*mturk.SendTestEventNotificationInput) (*mturk.SendTestEventNotificationOutput, error)
SendTestEventNotificationWithContext(aws.Context, *mturk.SendTestEventNotificationInput, ...request.Option) (*mturk.SendTestEventNotificationOutput, error)
SendTestEventNotificationRequest(*mturk.SendTestEventNotificationInput) (*request.Request, *mturk.SendTestEventNotificationOutput)
UpdateExpirationForHIT(*mturk.UpdateExpirationForHITInput) (*mturk.UpdateExpirationForHITOutput, error)
UpdateExpirationForHITWithContext(aws.Context, *mturk.UpdateExpirationForHITInput, ...request.Option) (*mturk.UpdateExpirationForHITOutput, error)
UpdateExpirationForHITRequest(*mturk.UpdateExpirationForHITInput) (*request.Request, *mturk.UpdateExpirationForHITOutput)
UpdateHITReviewStatus(*mturk.UpdateHITReviewStatusInput) (*mturk.UpdateHITReviewStatusOutput, error)
UpdateHITReviewStatusWithContext(aws.Context, *mturk.UpdateHITReviewStatusInput, ...request.Option) (*mturk.UpdateHITReviewStatusOutput, error)
UpdateHITReviewStatusRequest(*mturk.UpdateHITReviewStatusInput) (*request.Request, *mturk.UpdateHITReviewStatusOutput)
UpdateHITTypeOfHIT(*mturk.UpdateHITTypeOfHITInput) (*mturk.UpdateHITTypeOfHITOutput, error)
UpdateHITTypeOfHITWithContext(aws.Context, *mturk.UpdateHITTypeOfHITInput, ...request.Option) (*mturk.UpdateHITTypeOfHITOutput, error)
UpdateHITTypeOfHITRequest(*mturk.UpdateHITTypeOfHITInput) (*request.Request, *mturk.UpdateHITTypeOfHITOutput)
UpdateNotificationSettings(*mturk.UpdateNotificationSettingsInput) (*mturk.UpdateNotificationSettingsOutput, error)
UpdateNotificationSettingsWithContext(aws.Context, *mturk.UpdateNotificationSettingsInput, ...request.Option) (*mturk.UpdateNotificationSettingsOutput, error)
UpdateNotificationSettingsRequest(*mturk.UpdateNotificationSettingsInput) (*request.Request, *mturk.UpdateNotificationSettingsOutput)
UpdateQualificationType(*mturk.UpdateQualificationTypeInput) (*mturk.UpdateQualificationTypeOutput, error)
UpdateQualificationTypeWithContext(aws.Context, *mturk.UpdateQualificationTypeInput, ...request.Option) (*mturk.UpdateQualificationTypeOutput, error)
UpdateQualificationTypeRequest(*mturk.UpdateQualificationTypeInput) (*request.Request, *mturk.UpdateQualificationTypeOutput)
}
var _ MTurkAPI = (*mturk.MTurk)(nil)
+95
View File
@@ -0,0 +1,95 @@
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package mturk
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"
)
// MTurk provides the API operation methods for making requests to
// Amazon Mechanical Turk. See this package's package overview docs
// for details on the service.
//
// MTurk methods are safe to use concurrently. It is not safe to
// modify mutate any of the struct's properties though.
type MTurk 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 = "mturk-requester" // Service endpoint prefix API calls made to.
EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
)
// New creates a new instance of the MTurk 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 MTurk client from just a session.
// svc := mturk.New(mySession)
//
// // Create a MTurk client with additional configuration
// svc := mturk.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
func New(p client.ConfigProvider, cfgs ...*aws.Config) *MTurk {
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) *MTurk {
svc := &MTurk{
Client: client.New(
cfg,
metadata.ClientInfo{
ServiceName: ServiceName,
SigningName: signingName,
SigningRegion: signingRegion,
Endpoint: endpoint,
APIVersion: "2017-01-17",
JSONVersion: "1.1",
TargetPrefix: "MTurkRequesterServiceV20170117",
},
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 MTurk operation and runs any
// custom request initialization.
func (c *MTurk) 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
}