mechturk

package module
Version: v0.0.0-...-58cc386 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 11, 2017 License: MIT Imports: 11 Imported by: 0

README

AWS Mechanical Turk SDK for Go

GoDoc Build Status (Linux) Build status (Windows) license

No longer under development

This package was developed at a time when there was no officially supported Mechanical Turk SDK for Go. AWS have since added support for Mechanical Turk to the AWS SDK for Go. This package is retained for backwards compatibility, but will not receive any further enhancements. For any new development, use the offically supported SDK instead.

SDK

Package mechturk provides a Go SDK for the AWS Mechanical Turk Requester API.

Here is a simple example that invokes the GetAccountBalance operation:

package main

import (
  "log"
  "github.com/jjeffery/mechturk"
)

func main() {
	mt := mechturk.New()
	result, err := mt.GetAccountBalance(&mechturk.GetAccountBalanceRequest{})
	if err != nil {
		log.Fatal(err)
	}
	log.Println(mechturk.Prettify(result))
}

This program will produce output similar to:

{
  Request: {
    IsValid: "True"
  },
  AvailableBalance: {
    Amount: 10000,
    CurrencyCode: "USD",
    FormattedPrice: "$10,000.00"
  }
}

CLI

The subdirectory cmd/mechturk contains a command line client. Not all Mechanical Turk commands are supported yet -- commands are added as they are needed. Pull requests are welcome.

Example usage:

$ mechturk --sandbox get-account-balance
{
  Request: {
    IsValid: "True"
  },
  AvailableBalance: {
    Amount: 10000,
    CurrencyCode: "USD",
    FormattedPrice: "$10,000.00"
  }
}

API Stability

This project is still under development, and there is currently no guarantee of API stability. If you are planning to make use of this code in any sort of production environment, please consider vendoring the version you are using with your project.

Documentation

Overview

Package mechturk is a Go language SDK for the AWS Mechanical Turk web service.

The SDK is documented at http://docs.aws.amazon.com/AWSMechTurk/latest/AWSMturkAPI. To quote from the that website, Amazon Mechanical Turk is a web service that provides an on-demand, scalable, human workforce to complete jobs that humans can do better than computers, for example, recognizing objects in photos.

This package uses the SOAP API defined in WSDL. Some of the code has been auto-generated from the WSDL, which is located in the wsdl subdirectory.

Index

Examples

Constants

View Source
const Version = "2012-03-25"

Version is the protocol version supported by this package.

Variables

View Source
var DefaultConfig = &Config{}

DefaultConfig is the default configuration used if not explicitly specified.

Functions

func Prettify

func Prettify(v interface{}) string

Prettify returns a string representation of the data structure v.

The current implementation uses the `awsutil.Prettify` function from the AWS SDK for Go (github.com/aws/aws-sdk-go).

Types

type ApproveAssignmentRequest

type ApproveAssignmentRequest struct {
	AssignmentId      string   `xml:"AssignmentId,omitempty"`
	ResponseGroup     []string `xml:"ResponseGroup,omitempty"`
	RequesterFeedback string   `xml:"RequesterFeedback,omitempty"`
}

type ApproveAssignmentResult

type ApproveAssignmentResult struct {
	Request *Request `xml:"Request,omitempty"`
}

type ApproveRejectedAssignmentRequest

type ApproveRejectedAssignmentRequest struct {
	AssignmentId      string   `xml:"AssignmentId,omitempty"`
	ResponseGroup     []string `xml:"ResponseGroup,omitempty"`
	RequesterFeedback string   `xml:"RequesterFeedback,omitempty"`
}

type ApproveRejectedAssignmentResult

type ApproveRejectedAssignmentResult struct {
	Request *Request `xml:"Request,omitempty"`
}

type Arguments

type Arguments struct {
	Argument struct {
		Name  string `xml:"Name,attr,omitempty"`
		Value string `xml:"Value,attr,omitempty"`
	} `xml:"Argument,omitempty"`
}

type AssignQualificationRequest

type AssignQualificationRequest struct {
	QualificationTypeId string   `xml:"QualificationTypeId,omitempty"`
	WorkerId            string   `xml:"WorkerId,omitempty"`
	IntegerValue        int32    `xml:"IntegerValue,omitempty"`
	SendNotification    bool     `xml:"SendNotification,omitempty"`
	ResponseGroup       []string `xml:"ResponseGroup,omitempty"`
}

type AssignQualificationResult

type AssignQualificationResult struct {
	Request *Request `xml:"Request,omitempty"`
}

type Assignment

type Assignment struct {
	Request           *Request          `xml:"Request,omitempty"`
	AssignmentId      string            `xml:"AssignmentId,omitempty"`
	WorkerId          string            `xml:"WorkerId,omitempty"`
	HITId             string            `xml:"HITId,omitempty"`
	AssignmentStatus  *AssignmentStatus `xml:"AssignmentStatus,omitempty"`
	AutoApprovalTime  time.Time         `xml:"AutoApprovalTime,omitempty"`
	AcceptTime        time.Time         `xml:"AcceptTime,omitempty"`
	SubmitTime        time.Time         `xml:"SubmitTime,omitempty"`
	ApprovalTime      time.Time         `xml:"ApprovalTime,omitempty"`
	RejectionTime     time.Time         `xml:"RejectionTime,omitempty"`
	Deadline          time.Time         `xml:"Deadline,omitempty"`
	Answer            string            `xml:"Answer,omitempty"`
	RequesterFeedback string            `xml:"RequesterFeedback,omitempty"`
}

type AssignmentStatus

type AssignmentStatus string
const (
	AssignmentStatusSubmitted AssignmentStatus = "Submitted"
	AssignmentStatusApproved  AssignmentStatus = "Approved"
	AssignmentStatusRejected  AssignmentStatus = "Rejected"
)

type BlockWorkerRequest

type BlockWorkerRequest struct {
	WorkerId      string   `xml:"WorkerId,omitempty"`
	Reason        string   `xml:"Reason,omitempty"`
	ResponseGroup []string `xml:"ResponseGroup,omitempty"`
}

type BlockWorkerResult

type BlockWorkerResult struct {
	Request *Request `xml:"Request,omitempty"`
}

type BonusPayment

type BonusPayment struct {
	Request      *Request  `xml:"Request,omitempty"`
	WorkerId     string    `xml:"WorkerId,omitempty"`
	BonusAmount  *Price    `xml:"BonusAmount,omitempty"`
	AssignmentId string    `xml:"AssignmentId,omitempty"`
	Reason       string    `xml:"Reason,omitempty"`
	GrantTime    time.Time `xml:"GrantTime,omitempty"`
}

type ChangeHITTypeOfHITRequest

type ChangeHITTypeOfHITRequest struct {
	HITId         string   `xml:"HITId,omitempty"`
	HITTypeId     string   `xml:"HITTypeId,omitempty"`
	ResponseGroup []string `xml:"ResponseGroup,omitempty"`
}

type ChangeHITTypeOfHITResult

type ChangeHITTypeOfHITResult struct {
	Request *Request `xml:"Request,omitempty"`
}

type Claim

type Claim struct {
	Type string `xml:"Type,omitempty"`
	Body string `xml:"Body,omitempty"`
}

type Comparator

type Comparator string
const (
	ComparatorLessThan             Comparator = "LessThan"
	ComparatorLessThanOrEqualTo    Comparator = "LessThanOrEqualTo"
	ComparatorGreaterThan          Comparator = "GreaterThan"
	ComparatorGreaterThanOrEqualTo Comparator = "GreaterThanOrEqualTo"
	ComparatorEqualTo              Comparator = "EqualTo"
	ComparatorNotEqualTo           Comparator = "NotEqualTo"
	ComparatorExists               Comparator = "Exists"
)

type Config

type Config struct {
	// The credentials object to use when signing requests. Defaults to
	// a chain of credential providers to search for credentials in environment
	// variables and the shared credential file.
	Credentials *credentials.Credentials

	// Sandbox indicates whether to use the AWS Mechanical Turk Sandbox.
	// If Endpoint is set, then it overrides this setting.
	Sandbox *bool

	// Endpoint for accessing Mechanical Turk. If set, overrides
	// the Sandbox setting.
	Endpoint *string

	// Logger for diagnostics
	Logger *log.Logger
}

A Config provides configuration for AWS Mechanical Turk clients.

func (*Config) Clone

func (c *Config) Clone() *Config

Clone returns a deep copy of the Config.

func (*Config) Merge

func (c *Config) Merge(other *Config) *Config

Merge returns a deep copy of the config merged with the other config.

func (*Config) WithCredentials

func (c *Config) WithCredentials(cred *credentials.Credentials) *Config

WithCredentials returns a copy of the config with the credentials set.

func (*Config) WithSandbox

func (c *Config) WithSandbox(sandbox bool) *Config

WithSandbox returns a copy of the config with the sandbox setting.

type CreateHITRequest

type CreateHITRequest struct {
	HITTypeId                   string                      `xml:"HITTypeId,omitempty"`
	MaxAssignments              int                         `xml:"MaxAssignments,omitempty"`
	AutoApprovalDelayInSeconds  int                         `xml:"AutoApprovalDelayInSeconds,omitempty"`
	LifetimeInSeconds           int                         `xml:"LifetimeInSeconds,omitempty"`
	AssignmentDurationInSeconds int                         `xml:"AssignmentDurationInSeconds,omitempty"`
	Reward                      *Price                      `xml:"Reward,omitempty"`
	Title                       string                      `xml:"Title,omitempty"`
	Keywords                    string                      `xml:"Keywords,omitempty"`
	Description                 string                      `xml:"Description,omitempty"`
	Question                    string                      `xml:"Question,omitempty"`
	RequesterAnnotation         string                      `xml:"RequesterAnnotation,omitempty"`
	QualificationRequirement    []*QualificationRequirement `xml:"QualificationRequirement,omitempty"`
	UniqueRequestToken          string                      `xml:"UniqueRequestToken,omitempty"`
	AssignmentReviewPolicy      *ReviewPolicy               `xml:"AssignmentReviewPolicy,omitempty"`
	HITReviewPolicy             *ReviewPolicy               `xml:"HITReviewPolicy,omitempty"`
	HITLayoutId                 string                      `xml:"HITLayoutId,omitempty"`
	HITLayoutParameter          []*HITLayoutParameter       `xml:"HITLayoutParameter,omitempty"`
	ResponseGroup               []string                    `xml:"ResponseGroup,omitempty"`
}

CreateHITRequest is the input to CreateHIT, which is documented at http://docs.aws.amazon.com/AWSMechTurk/latest/AWSMturkAPI/ApiReference_CreateHITOperation.html.

type CreateQualificationTypeRequest

type CreateQualificationTypeRequest struct {
	Name                    string                   `xml:"Name,omitempty"`
	Keywords                string                   `xml:"Keywords,omitempty"`
	Description             string                   `xml:"Description,omitempty"`
	QualificationTypeStatus *QualificationTypeStatus `xml:"QualificationTypeStatus,omitempty"`
	RetryDelayInSeconds     int                      `xml:"RetryDelayInSeconds,omitempty"`
	Test                    string                   `xml:"Test,omitempty"`
	AnswerKey               string                   `xml:"AnswerKey,omitempty"`
	TestDurationInSeconds   int                      `xml:"TestDurationInSeconds,omitempty"`
	AutoGranted             bool                     `xml:"AutoGranted,omitempty"`
	AutoGrantedValue        int32                    `xml:"AutoGrantedValue,omitempty"`
	ResponseGroup           []string                 `xml:"ResponseGroup,omitempty"`
}

type DataPoint

type DataPoint struct {
	Date        time.Time `xml:"Date,omitempty"`
	LongValue   int64     `xml:"LongValue,omitempty"`
	DoubleValue float64   `xml:"DoubleValue,omitempty"`
}

type DisableHITRequest

type DisableHITRequest struct {
	HITId         string   `xml:"HITId,omitempty"`
	ResponseGroup []string `xml:"ResponseGroup,omitempty"`
}

type DisableHITResult

type DisableHITResult struct {
	Request *Request `xml:"Request,omitempty"`
}

type DisposeHITRequest

type DisposeHITRequest struct {
	HITId         string   `xml:"HITId,omitempty"`
	ResponseGroup []string `xml:"ResponseGroup,omitempty"`
}

type DisposeHITResult

type DisposeHITResult struct {
	Request *Request `xml:"Request,omitempty"`
}

type DisposeQualificationTypeRequest

type DisposeQualificationTypeRequest struct {
	QualificationTypeId string `xml:"QualificationTypeId,omitempty"`
}

type DisposeQualificationTypeResult

type DisposeQualificationTypeResult struct {
	Request *Request `xml:"Request,omitempty"`
}

type Errors

type Errors struct {
	Error struct {
		Code    string          `xml:"Code,omitempty"`
		Message string          `xml:"Message,omitempty"`
		Data    []*KeyValuePair `xml:"Data,omitempty"`
	} `xml:"Error,omitempty"`
}

type EventType

type EventType string
const (
	EventTypeAssignmentAccepted  EventType = "AssignmentAccepted"
	EventTypeAssignmentAbandoned EventType = "AssignmentAbandoned"
	EventTypeAssignmentReturned  EventType = "AssignmentReturned"
	EventTypeAssignmentSubmitted EventType = "AssignmentSubmitted"
	EventTypeHITReviewable       EventType = "HITReviewable"
	EventTypeHITExpired          EventType = "HITExpired"
	EventTypePing                EventType = "Ping"
)

type ExtendHITRequest

type ExtendHITRequest struct {
	HITId                        string   `xml:"HITId,omitempty"`
	MaxAssignmentsIncrement      int      `xml:"MaxAssignmentsIncrement,omitempty"`
	ExpirationIncrementInSeconds int      `xml:"ExpirationIncrementInSeconds,omitempty"`
	UniqueRequestToken           string   `xml:"UniqueRequestToken,omitempty"`
	ResponseGroup                []string `xml:"ResponseGroup,omitempty"`
}

type ExtendHITResult

type ExtendHITResult struct {
	Request *Request `xml:"Request,omitempty"`
}

type ForceExpireHITRequest

type ForceExpireHITRequest struct {
	HITId         string   `xml:"HITId,omitempty"`
	ResponseGroup []string `xml:"ResponseGroup,omitempty"`
}

type ForceExpireHITResult

type ForceExpireHITResult struct {
	Request *Request `xml:"Request,omitempty"`
}

type GetAccountBalanceRequest

type GetAccountBalanceRequest struct {
	ResponseGroup []string `xml:"ResponseGroup,omitempty"`
	Unused        string   `xml:"Unused,omitempty"`
}

type GetAccountBalanceResult

type GetAccountBalanceResult struct {
	Request          *Request `xml:"Request,omitempty"`
	AvailableBalance *Price   `xml:"AvailableBalance,omitempty"`
	OnHoldBalance    *Price   `xml:"OnHoldBalance,omitempty"`
}

type GetAssignmentRequest

type GetAssignmentRequest struct {
	AssignmentId  string   `xml:"AssignmentId,omitempty"`
	ResponseGroup []string `xml:"ResponseGroup,omitempty"`
}

type GetAssignmentResult

type GetAssignmentResult struct {
	Request    *Request    `xml:"Request,omitempty"`
	Assignment *Assignment `xml:"Assignment,omitempty"`
	HIT        *HIT        `xml:"HIT,omitempty"`
}

type GetAssignmentsForHITRequest

type GetAssignmentsForHITRequest struct {
	HITId            string                            `xml:"HITId,omitempty"`
	SortDirection    *SortDirection                    `xml:"SortDirection,omitempty"`
	SortProperty     *GetAssignmentsForHITSortProperty `xml:"SortProperty,omitempty"`
	PageNumber       int                               `xml:"PageNumber,omitempty"`
	PageSize         int                               `xml:"PageSize,omitempty"`
	AssignmentStatus []*AssignmentStatus               `xml:"AssignmentStatus,omitempty"`
	ResponseGroup    []string                          `xml:"ResponseGroup,omitempty"`
}

type GetAssignmentsForHITResult

type GetAssignmentsForHITResult struct {
	Request         *Request      `xml:"Request,omitempty"`
	PageNumber      int           `xml:"PageNumber,omitempty"`
	NumResults      int           `xml:"NumResults,omitempty"`
	TotalNumResults int           `xml:"TotalNumResults,omitempty"`
	Assignment      []*Assignment `xml:"Assignment,omitempty"`
}

type GetAssignmentsForHITSortProperty

type GetAssignmentsForHITSortProperty string
const (
	GetAssignmentsForHITSortPropertyAcceptTime       GetAssignmentsForHITSortProperty = "AcceptTime"
	GetAssignmentsForHITSortPropertySubmitTime       GetAssignmentsForHITSortProperty = "SubmitTime"
	GetAssignmentsForHITSortPropertyAnswer           GetAssignmentsForHITSortProperty = "Answer"
	GetAssignmentsForHITSortPropertyAssignmentStatus GetAssignmentsForHITSortProperty = "AssignmentStatus"
)

type GetBlockedWorkersRequest

type GetBlockedWorkersRequest struct {
	PageNumber    int      `xml:"PageNumber,omitempty"`
	PageSize      int      `xml:"PageSize,omitempty"`
	ResponseGroup []string `xml:"ResponseGroup,omitempty"`
}

type GetBlockedWorkersResult

type GetBlockedWorkersResult struct {
	Request         *Request       `xml:"Request,omitempty"`
	PageNumber      int            `xml:"PageNumber,omitempty"`
	NumResults      int            `xml:"NumResults,omitempty"`
	TotalNumResults int            `xml:"TotalNumResults,omitempty"`
	WorkerBlock     []*WorkerBlock `xml:"WorkerBlock,omitempty"`
}

type GetBonusPaymentsRequest

type GetBonusPaymentsRequest struct {
	HITId         string   `xml:"HITId,omitempty"`
	AssignmentId  string   `xml:"AssignmentId,omitempty"`
	PageNumber    int      `xml:"PageNumber,omitempty"`
	PageSize      int      `xml:"PageSize,omitempty"`
	ResponseGroup []string `xml:"ResponseGroup,omitempty"`
}

type GetBonusPaymentsResult

type GetBonusPaymentsResult struct {
	Request         *Request        `xml:"Request,omitempty"`
	NumResults      int             `xml:"NumResults,omitempty"`
	PageNumber      int             `xml:"PageNumber,omitempty"`
	TotalNumResults int             `xml:"TotalNumResults,omitempty"`
	BonusPayment    []*BonusPayment `xml:"BonusPayment,omitempty"`
}

type GetFileUploadURLRequest

type GetFileUploadURLRequest struct {
	AssignmentId       string `xml:"AssignmentId,omitempty"`
	QuestionIdentifier string `xml:"QuestionIdentifier,omitempty"`
}

type GetFileUploadURLResult

type GetFileUploadURLResult struct {
	Request       *Request `xml:"Request,omitempty"`
	FileUploadURL string   `xml:"FileUploadURL,omitempty"`
}

type GetHITRequest

type GetHITRequest struct {
	HITId         string   `xml:"HITId,omitempty"`
	ResponseGroup []string `xml:"ResponseGroup,omitempty"`
}

type GetHITsForQualificationTypeRequest

type GetHITsForQualificationTypeRequest struct {
	QualificationTypeId string   `xml:"QualificationTypeId,omitempty"`
	PageNumber          int      `xml:"PageNumber,omitempty"`
	PageSize            int      `xml:"PageSize,omitempty"`
	ResponseGroup       []string `xml:"ResponseGroup,omitempty"`
}

type GetHITsForQualificationTypeResult

type GetHITsForQualificationTypeResult struct {
	Request         *Request `xml:"Request,omitempty"`
	PageNumber      int      `xml:"PageNumber,omitempty"`
	NumResults      int      `xml:"NumResults,omitempty"`
	TotalNumResults int      `xml:"TotalNumResults,omitempty"`
	HIT             []*HIT   `xml:"HIT,omitempty"`
}

type GetQualificationRequestsRequest

type GetQualificationRequestsRequest struct {
	QualificationTypeId string                                `xml:"QualificationTypeId,omitempty"`
	SortDirection       *SortDirection                        `xml:"SortDirection,omitempty"`
	SortProperty        *GetQualificationRequestsSortProperty `xml:"SortProperty,omitempty"`
	PageNumber          int                                   `xml:"PageNumber,omitempty"`
	PageSize            int                                   `xml:"PageSize,omitempty"`
	ResponseGroup       []string                              `xml:"ResponseGroup,omitempty"`
}

type GetQualificationRequestsResult

type GetQualificationRequestsResult struct {
	Request              *Request                `xml:"Request,omitempty"`
	NumResults           int                     `xml:"NumResults,omitempty"`
	TotalNumResults      int                     `xml:"TotalNumResults,omitempty"`
	PageNumber           int                     `xml:"PageNumber,omitempty"`
	QualificationRequest []*QualificationRequest `xml:"QualificationRequest,omitempty"`
}

type GetQualificationRequestsSortProperty

type GetQualificationRequestsSortProperty string
const (
	GetQualificationRequestsSortPropertyQualificationTypeId GetQualificationRequestsSortProperty = "QualificationTypeId"
	GetQualificationRequestsSortPropertySubmitTime          GetQualificationRequestsSortProperty = "SubmitTime"
)

type GetQualificationScoreRequest

type GetQualificationScoreRequest struct {
	QualificationTypeId string   `xml:"QualificationTypeId,omitempty"`
	SubjectId           string   `xml:"SubjectId,omitempty"`
	ResponseGroup       []string `xml:"ResponseGroup,omitempty"`
}

type GetQualificationTypeRequest

type GetQualificationTypeRequest struct {
	QualificationTypeId string   `xml:"QualificationTypeId,omitempty"`
	ResponseGroup       []string `xml:"ResponseGroup,omitempty"`
}

type GetQualificationsForQualificationTypeRequest

type GetQualificationsForQualificationTypeRequest struct {
	QualificationTypeId string               `xml:"QualificationTypeId,omitempty"`
	Status              *QualificationStatus `xml:"Status,omitempty"`
	PageNumber          int                  `xml:"PageNumber,omitempty"`
	PageSize            int                  `xml:"PageSize,omitempty"`
	ResponseGroup       []string             `xml:"ResponseGroup,omitempty"`
}

type GetQualificationsForQualificationTypeResult

type GetQualificationsForQualificationTypeResult struct {
	Request         *Request         `xml:"Request,omitempty"`
	PageNumber      int              `xml:"PageNumber,omitempty"`
	NumResults      int              `xml:"NumResults,omitempty"`
	TotalNumResults int              `xml:"TotalNumResults,omitempty"`
	Qualification   []*Qualification `xml:"Qualification,omitempty"`
}

type GetRequesterStatisticRequest

type GetRequesterStatisticRequest struct {
	Statistic     *RequesterStatistic `xml:"Statistic,omitempty"`
	TimePeriod    *TimePeriod         `xml:"TimePeriod,omitempty"`
	Count         int                 `xml:"Count,omitempty"`
	ResponseGroup []string            `xml:"ResponseGroup,omitempty"`
}

type GetRequesterWorkerStatisticRequest

type GetRequesterWorkerStatisticRequest struct {
	Statistic     *RequesterStatistic `xml:"Statistic,omitempty"`
	TimePeriod    *TimePeriod         `xml:"TimePeriod,omitempty"`
	WorkerId      string              `xml:"WorkerId,omitempty"`
	Count         int                 `xml:"Count,omitempty"`
	ResponseGroup []string            `xml:"ResponseGroup,omitempty"`
}

type GetReviewResultsForHITRequest

type GetReviewResultsForHITRequest struct {
	HITId           string               `xml:"HITId,omitempty"`
	PolicyLevel     []*ReviewPolicyLevel `xml:"PolicyLevel,omitempty"`
	RetrieveActions bool                 `xml:"RetrieveActions,omitempty"`
	RetrieveResults bool                 `xml:"RetrieveResults,omitempty"`
	PageNumber      int                  `xml:"PageNumber,omitempty"`
	PageSize        int                  `xml:"PageSize,omitempty"`
	ResponseGroup   []string             `xml:"ResponseGroup,omitempty"`
}

type GetReviewResultsForHITResult

type GetReviewResultsForHITResult struct {
	Request                *Request      `xml:"Request,omitempty"`
	HITId                  string        `xml:"HITId,omitempty"`
	AssignmentReviewPolicy *ReviewPolicy `xml:"AssignmentReviewPolicy,omitempty"`
	HITReviewPolicy        *ReviewPolicy `xml:"HITReviewPolicy,omitempty"`
	AssignmentReviewReport *ReviewReport `xml:"AssignmentReviewReport,omitempty"`
	HITReviewReport        *ReviewReport `xml:"HITReviewReport,omitempty"`
}

type GetReviewableHITsRequest

type GetReviewableHITsRequest struct {
	HITTypeId     string                         `xml:"HITTypeId,omitempty"`
	Status        *ReviewableHITStatus           `xml:"Status,omitempty"`
	SortDirection *SortDirection                 `xml:"SortDirection,omitempty"`
	SortProperty  *GetReviewableHITsSortProperty `xml:"SortProperty,omitempty"`
	PageNumber    int                            `xml:"PageNumber,omitempty"`
	PageSize      int                            `xml:"PageSize,omitempty"`
	ResponseGroup []string                       `xml:"ResponseGroup,omitempty"`
}

type GetReviewableHITsResult

type GetReviewableHITsResult struct {
	Request         *Request `xml:"Request,omitempty"`
	PageNumber      int      `xml:"PageNumber,omitempty"`
	NumResults      int      `xml:"NumResults,omitempty"`
	TotalNumResults int      `xml:"TotalNumResults,omitempty"`
	HIT             []*HIT   `xml:"HIT,omitempty"`
}

type GetReviewableHITsSortProperty

type GetReviewableHITsSortProperty string
const (
	GetReviewableHITsSortPropertyTitle        GetReviewableHITsSortProperty = "Title"
	GetReviewableHITsSortPropertyReward       GetReviewableHITsSortProperty = "Reward"
	GetReviewableHITsSortPropertyExpiration   GetReviewableHITsSortProperty = "Expiration"
	GetReviewableHITsSortPropertyCreationTime GetReviewableHITsSortProperty = "CreationTime"
	GetReviewableHITsSortPropertyEnumeration  GetReviewableHITsSortProperty = "Enumeration"
)

type GetStatisticResult

type GetStatisticResult struct {
	Request    *Request            `xml:"Request,omitempty"`
	DataPoint  []*DataPoint        `xml:"DataPoint,omitempty"`
	Statistic  *RequesterStatistic `xml:"Statistic,omitempty"`
	TimePeriod *TimePeriod         `xml:"TimePeriod,omitempty"`
	WorkerId   string              `xml:"WorkerId,omitempty"`
}

type GrantBonusRequest

type GrantBonusRequest struct {
	WorkerId           string   `xml:"WorkerId,omitempty"`
	BonusAmount        *Price   `xml:"BonusAmount,omitempty"`
	AssignmentId       string   `xml:"AssignmentId,omitempty"`
	Reason             string   `xml:"Reason,omitempty"`
	UniqueRequestToken string   `xml:"UniqueRequestToken,omitempty"`
	ResponseGroup      []string `xml:"ResponseGroup,omitempty"`
}

type GrantBonusResult

type GrantBonusResult struct {
	Request *Request `xml:"Request,omitempty"`
}

type GrantQualificationRequest

type GrantQualificationRequest struct {
	QualificationRequestId string   `xml:"QualificationRequestId,omitempty"`
	IntegerValue           int32    `xml:"IntegerValue,omitempty"`
	ResponseGroup          []string `xml:"ResponseGroup,omitempty"`
}

type GrantQualificationResult

type GrantQualificationResult struct {
	Request *Request `xml:"Request,omitempty"`
}

type HIT

type HIT struct {
	Request                      *Request                    `xml:"Request,omitempty"`
	HITId                        string                      `xml:"HITId,omitempty"`
	HITTypeId                    string                      `xml:"HITTypeId,omitempty"`
	HITGroupId                   string                      `xml:"HITGroupId,omitempty"`
	HITLayoutId                  string                      `xml:"HITLayoutId,omitempty"`
	CreationTime                 time.Time                   `xml:"CreationTime,omitempty"`
	Title                        string                      `xml:"Title,omitempty"`
	Description                  string                      `xml:"Description,omitempty"`
	Question                     string                      `xml:"Question,omitempty"`
	Keywords                     string                      `xml:"Keywords,omitempty"`
	HITStatus                    *HITStatus                  `xml:"HITStatus,omitempty"`
	MaxAssignments               int                         `xml:"MaxAssignments,omitempty"`
	Reward                       *Price                      `xml:"Reward,omitempty"`
	AutoApprovalDelayInSeconds   int                         `xml:"AutoApprovalDelayInSeconds,omitempty"`
	Expiration                   time.Time                   `xml:"Expiration,omitempty"`
	AssignmentDurationInSeconds  int                         `xml:"AssignmentDurationInSeconds,omitempty"`
	RequesterAnnotation          string                      `xml:"RequesterAnnotation,omitempty"`
	QualificationRequirement     []*QualificationRequirement `xml:"QualificationRequirement,omitempty"`
	HITReviewStatus              *HITReviewStatus            `xml:"HITReviewStatus,omitempty"`
	NumberOfAssignmentsPending   int                         `xml:"NumberOfAssignmentsPending,omitempty"`
	NumberOfAssignmentsAvailable int                         `xml:"NumberOfAssignmentsAvailable,omitempty"`
	NumberOfAssignmentsCompleted int                         `xml:"NumberOfAssignmentsCompleted,omitempty"`
}

type HITLayoutParameter

type HITLayoutParameter struct {
	Name  string `xml:"Name,omitempty"`
	Value string `xml:"Value,omitempty"`
}

type HITReviewStatus

type HITReviewStatus string
const (
	HITReviewStatusNotReviewed           HITReviewStatus = "NotReviewed"
	HITReviewStatusMarkedForReview       HITReviewStatus = "MarkedForReview"
	HITReviewStatusReviewedAppropriate   HITReviewStatus = "ReviewedAppropriate"
	HITReviewStatusReviewedInappropriate HITReviewStatus = "ReviewedInappropriate"
)

type HITStatus

type HITStatus string
const (
	HITStatusAssignable   HITStatus = "Assignable"
	HITStatusUnassignable HITStatus = "Unassignable"
	HITStatusReviewable   HITStatus = "Reviewable"
	HITStatusReviewing    HITStatus = "Reviewing"
	HITStatusDisposed     HITStatus = "Disposed"
)

type HTTPHeaders

type HTTPHeaders struct {
	Header struct {
		Name  string `xml:"Name,attr,omitempty"`
		Value string `xml:"Value,attr,omitempty"`
	} `xml:"Header,omitempty"`
}

type HelpRequest

type HelpRequest struct {
	About    []string `xml:"About,omitempty"`
	HelpType struct {
	} `xml:"HelpType,omitempty"`
	ResponseGroup []string `xml:"ResponseGroup,omitempty"`
}

type Information

type Information struct {
	Request                  *Request                    `xml:"Request,omitempty"`
	OperationInformation     []*OperationInformation     `xml:"OperationInformation,omitempty"`
	ResponseGroupInformation []*ResponseGroupInformation `xml:"ResponseGroupInformation,omitempty"`
}

type KeyValuePair

type KeyValuePair struct {
	Key   string `xml:"Key,omitempty"`
	Value string `xml:"Value,omitempty"`
}

type Locale

type Locale struct {
	Country string `xml:"Country,omitempty"`
}

type MechTurk

type MechTurk struct {
	Config *Config
}

MechTurk is an AWS Mechanical Turk Requester client.

func New

func New(configs ...*Config) *MechTurk

New returns a new AWS Mechanical Turk Requester client.

func (*MechTurk) GetAccountBalance

func (mt *MechTurk) GetAccountBalance(request *GetAccountBalanceRequest) (*GetAccountBalanceResult, error)

GetAccountBalance is documented at http://docs.aws.amazon.com/AWSMechTurk/latest/AWSMturkAPI/ApiReference_GetAccountBalanceOperation.html.

Example
package main

import (
	"log"

	"github.com/jjeffery/mechturk"
)

func main() {
	mt := mechturk.New()
	result, err := mt.GetAccountBalance(&mechturk.GetAccountBalanceRequest{})
	if err != nil {
		log.Fatal(err)
	}
	log.Println(mechturk.Prettify(result))
}
Output:

type NotificationSpecification

type NotificationSpecification struct {
	Destination string                 `xml:"Destination,omitempty"`
	Transport   *NotificationTransport `xml:"Transport,omitempty"`
	Version     string                 `xml:"Version,omitempty"`
	EventType   []*EventType           `xml:"EventType,omitempty"`
}

type NotificationTransport

type NotificationTransport string
const (
	NotificationTransportSOAP  NotificationTransport = "SOAP"
	NotificationTransportREST  NotificationTransport = "REST"
	NotificationTransportEmail NotificationTransport = "Email"
	NotificationTransportSQS   NotificationTransport = "SQS"
)

type NotifyWorkersFailureCode

type NotifyWorkersFailureCode string
const (
	NotifyWorkersFailureCodeSoftFailure NotifyWorkersFailureCode = "SoftFailure"
	NotifyWorkersFailureCodeHardFailure NotifyWorkersFailureCode = "HardFailure"
)

type NotifyWorkersFailureStatus

type NotifyWorkersFailureStatus struct {
	NotifyWorkersFailureCode    *NotifyWorkersFailureCode `xml:"NotifyWorkersFailureCode,omitempty"`
	NotifyWorkersFailureMessage string                    `xml:"NotifyWorkersFailureMessage,omitempty"`
	WorkerId                    string                    `xml:"WorkerId,omitempty"`
}

type NotifyWorkersRequest

type NotifyWorkersRequest struct {
	Subject       string   `xml:"Subject,omitempty"`
	MessageText   string   `xml:"MessageText,omitempty"`
	WorkerId      string   `xml:"WorkerId,omitempty"`
	ResponseGroup []string `xml:"ResponseGroup,omitempty"`
}

type NotifyWorkersResult

type NotifyWorkersResult struct {
	Request                    *Request                    `xml:"Request,omitempty"`
	NotifyWorkersFailureStatus *NotifyWorkersFailureStatus `xml:"NotifyWorkersFailureStatus,omitempty"`
}

type OperationInformation

type OperationInformation struct {
	Name               string `xml:"Name,omitempty"`
	Description        string `xml:"Description,omitempty"`
	RequiredParameters struct {
		Parameter []string `xml:"Parameter,omitempty"`
	} `xml:"RequiredParameters,omitempty"`
	AvailableParameters struct {
		Parameter []string `xml:"Parameter,omitempty"`
	} `xml:"AvailableParameters,omitempty"`
	DefaultResponseGroups struct {
		ResponseGroup []string `xml:"ResponseGroup,omitempty"`
	} `xml:"DefaultResponseGroups,omitempty"`
	AvailableResponseGroups struct {
		ResponseGroup []string `xml:"ResponseGroup,omitempty"`
	} `xml:"AvailableResponseGroups,omitempty"`
}

type OperationRequest

type OperationRequest struct {
	HTTPHeaders *HTTPHeaders `xml:"HTTPHeaders,omitempty"`
	RequestId   string       `xml:"RequestId,omitempty"`
	Arguments   *Arguments   `xml:"Arguments,omitempty"`
	Errors      *Errors      `xml:"Errors,omitempty"`
}

type ParameterMapEntry

type ParameterMapEntry struct {
	Key   string   `xml:"Key,omitempty"`
	Value []string `xml:"Value,omitempty"`
}

type PolicyParameter

type PolicyParameter struct {
	Key      string               `xml:"Key,omitempty"`
	Value    []string             `xml:"Value,omitempty"`
	MapEntry []*ParameterMapEntry `xml:"MapEntry,omitempty"`
}

type Price

type Price struct {
	Amount         float64 `xml:"Amount,omitempty"`
	CurrencyCode   string  `xml:"CurrencyCode,omitempty"`
	FormattedPrice string  `xml:"FormattedPrice,omitempty"`
}

type Qualification

type Qualification struct {
	Request             *Request             `xml:"Request,omitempty"`
	QualificationTypeId string               `xml:"QualificationTypeId,omitempty"`
	SubjectId           string               `xml:"SubjectId,omitempty"`
	GrantTime           time.Time            `xml:"GrantTime,omitempty"`
	IntegerValue        int32                `xml:"IntegerValue,omitempty"`
	LocaleValue         *Locale              `xml:"LocaleValue,omitempty"`
	Status              *QualificationStatus `xml:"Status,omitempty"`
}

type QualificationRequest

type QualificationRequest struct {
	QualificationRequestId string    `xml:"QualificationRequestId,omitempty"`
	QualificationTypeId    string    `xml:"QualificationTypeId,omitempty"`
	SubjectId              string    `xml:"SubjectId,omitempty"`
	Test                   string    `xml:"Test,omitempty"`
	Answer                 string    `xml:"Answer,omitempty"`
	SubmitTime             time.Time `xml:"SubmitTime,omitempty"`
}

type QualificationRequirement

type QualificationRequirement struct {
	QualificationTypeId string      `xml:"QualificationTypeId,omitempty"`
	Comparator          *Comparator `xml:"Comparator,omitempty"`
	IntegerValue        int32       `xml:"IntegerValue,omitempty"`
	LocaleValue         *Locale     `xml:"LocaleValue,omitempty"`
	RequiredToPreview   bool        `xml:"RequiredToPreview,omitempty"`
}

type QualificationStatus

type QualificationStatus string
const (
	QualificationStatusGranted QualificationStatus = "Granted"
	QualificationStatusRevoked QualificationStatus = "Revoked"
)

type QualificationType

type QualificationType struct {
	Request                 *Request                 `xml:"Request,omitempty"`
	QualificationTypeId     string                   `xml:"QualificationTypeId,omitempty"`
	CreationTime            time.Time                `xml:"CreationTime,omitempty"`
	Name                    string                   `xml:"Name,omitempty"`
	Description             string                   `xml:"Description,omitempty"`
	Keywords                string                   `xml:"Keywords,omitempty"`
	QualificationTypeStatus *QualificationTypeStatus `xml:"QualificationTypeStatus,omitempty"`
	Test                    string                   `xml:"Test,omitempty"`
	TestDurationInSeconds   int                      `xml:"TestDurationInSeconds,omitempty"`
	AnswerKey               string                   `xml:"AnswerKey,omitempty"`
	RetryDelayInSeconds     int                      `xml:"RetryDelayInSeconds,omitempty"`
	IsRequestable           bool                     `xml:"IsRequestable,omitempty"`
	AutoGranted             bool                     `xml:"AutoGranted,omitempty"`
	AutoGrantedValue        int32                    `xml:"AutoGrantedValue,omitempty"`
}

type QualificationTypeStatus

type QualificationTypeStatus string
const (
	QualificationTypeStatusActive   QualificationTypeStatus = "Active"
	QualificationTypeStatusInactive QualificationTypeStatus = "Inactive"
)

type RegisterHITTypeRequest

type RegisterHITTypeRequest struct {
	AutoApprovalDelayInSeconds  int                         `xml:"AutoApprovalDelayInSeconds,omitempty"`
	AssignmentDurationInSeconds int                         `xml:"AssignmentDurationInSeconds,omitempty"`
	Reward                      *Price                      `xml:"Reward,omitempty"`
	Title                       string                      `xml:"Title,omitempty"`
	Keywords                    string                      `xml:"Keywords,omitempty"`
	Description                 string                      `xml:"Description,omitempty"`
	QualificationRequirement    []*QualificationRequirement `xml:"QualificationRequirement,omitempty"`
	ResponseGroup               []string                    `xml:"ResponseGroup,omitempty"`
}

type RegisterHITTypeResult

type RegisterHITTypeResult struct {
	Request   *Request `xml:"Request,omitempty"`
	HITTypeId string   `xml:"HITTypeId,omitempty"`
}

type RejectAssignmentRequest

type RejectAssignmentRequest struct {
	AssignmentId      string   `xml:"AssignmentId,omitempty"`
	ResponseGroup     []string `xml:"ResponseGroup,omitempty"`
	RequesterFeedback string   `xml:"RequesterFeedback,omitempty"`
}

type RejectAssignmentResult

type RejectAssignmentResult struct {
	Request *Request `xml:"Request,omitempty"`
}

type RejectQualificationRequestRequest

type RejectQualificationRequestRequest struct {
	QualificationRequestId string   `xml:"QualificationRequestId,omitempty"`
	Reason                 string   `xml:"Reason,omitempty"`
	ResponseGroup          []string `xml:"ResponseGroup,omitempty"`
}

type RejectQualificationRequestResult

type RejectQualificationRequestResult struct {
	Request *Request `xml:"Request,omitempty"`
}

type Request

type Request struct {
	IsValid                                      string                                        `xml:"IsValid,omitempty"`
	CreateHITRequest                             *CreateHITRequest                             `xml:"CreateHITRequest,omitempty"`
	RegisterHITTypeRequest                       *RegisterHITTypeRequest                       `xml:"RegisterHITTypeRequest,omitempty"`
	DisposeHITRequest                            *DisposeHITRequest                            `xml:"DisposeHITRequest,omitempty"`
	DisableHITRequest                            *DisableHITRequest                            `xml:"DisableHITRequest,omitempty"`
	GetHITRequest                                *GetHITRequest                                `xml:"GetHITRequest,omitempty"`
	GetAssignmentRequest                         *GetAssignmentRequest                         `xml:"GetAssignmentRequest,omitempty"`
	GetReviewResultsForHITRequest                *GetReviewResultsForHITRequest                `xml:"GetReviewResultsForHITRequest,omitempty"`
	GetReviewableHITsRequest                     *GetReviewableHITsRequest                     `xml:"GetReviewableHITsRequest,omitempty"`
	GetHITsForQualificationTypeRequest           *GetHITsForQualificationTypeRequest           `xml:"GetHITsForQualificationTypeRequest,omitempty"`
	GetQualificationsForQualificationTypeRequest *GetQualificationsForQualificationTypeRequest `xml:"GetQualificationsForQualificationTypeRequest,omitempty"`
	SetHITAsReviewingRequest                     *SetHITAsReviewingRequest                     `xml:"SetHITAsReviewingRequest,omitempty"`
	SearchHITsRequest                            *SearchHITsRequest                            `xml:"SearchHITsRequest,omitempty"`
	ExtendHITRequest                             *ExtendHITRequest                             `xml:"ExtendHITRequest,omitempty"`
	ForceExpireHITRequest                        *ForceExpireHITRequest                        `xml:"ForceExpireHITRequest,omitempty"`
	ChangeHITTypeOfHITRequest                    *ChangeHITTypeOfHITRequest                    `xml:"ChangeHITTypeOfHITRequest,omitempty"`
	CreateQualificationTypeRequest               *CreateQualificationTypeRequest               `xml:"CreateQualificationTypeRequest,omitempty"`
	DisposeQualificationTypeRequest              *DisposeQualificationTypeRequest              `xml:"DisposeQualificationTypeRequest,omitempty"`
	GrantQualificationRequest                    *GrantQualificationRequest                    `xml:"GrantQualificationRequest,omitempty"`
	AssignQualificationRequest                   *AssignQualificationRequest                   `xml:"AssignQualificationRequest,omitempty"`
	RevokeQualificationRequest                   *RevokeQualificationRequest                   `xml:"RevokeQualificationRequest,omitempty"`
	GetQualificationRequestsRequest              *GetQualificationRequestsRequest              `xml:"GetQualificationRequestsRequest,omitempty"`
	RejectQualificationRequestRequest            *RejectQualificationRequestRequest            `xml:"RejectQualificationRequestRequest,omitempty"`
	GetQualificationTypeRequest                  *GetQualificationTypeRequest                  `xml:"GetQualificationTypeRequest,omitempty"`
	SearchQualificationTypesRequest              *SearchQualificationTypesRequest              `xml:"SearchQualificationTypesRequest,omitempty"`
	UpdateQualificationTypeRequest               *UpdateQualificationTypeRequest               `xml:"UpdateQualificationTypeRequest,omitempty"`
	ApproveAssignmentRequest                     *ApproveAssignmentRequest                     `xml:"ApproveAssignmentRequest,omitempty"`
	RejectAssignmentRequest                      *RejectAssignmentRequest                      `xml:"RejectAssignmentRequest,omitempty"`
	ApproveRejectedAssignmentRequest             *ApproveRejectedAssignmentRequest             `xml:"ApproveRejectedAssignmentRequest,omitempty"`
	GetAssignmentsForHIT                         *GetAssignmentsForHITRequest                  `xml:"GetAssignmentsForHIT,omitempty"`
	GetFileUploadURL                             *GetFileUploadURLRequest                      `xml:"GetFileUploadURL,omitempty"`
	GrantBonusRequest                            *GrantBonusRequest                            `xml:"GrantBonusRequest,omitempty"`
	GetBonusPaymentsRequest                      *GetBonusPaymentsRequest                      `xml:"GetBonusPaymentsRequest,omitempty"`
	GetAccountBalanceRequest                     *GetAccountBalanceRequest                     `xml:"GetAccountBalanceRequest,omitempty"`
	NotifyWorkersRequest                         *NotifyWorkersRequest                         `xml:"NotifyWorkersRequest,omitempty"`
	GetBlockedWorkersRequest                     *GetBlockedWorkersRequest                     `xml:"GetBlockedWorkersRequest,omitempty"`
	BlockWorkerRequest                           *BlockWorkerRequest                           `xml:"BlockWorkerRequest,omitempty"`
	UnblockWorkerRequest                         *UnblockWorkerRequest                         `xml:"UnblockWorkerRequest,omitempty"`
	GetRequesterStatistic                        *GetRequesterStatisticRequest                 `xml:"GetRequesterStatistic,omitempty"`
	GetRequesterWorkerStatistic                  *GetRequesterWorkerStatisticRequest           `xml:"GetRequesterWorkerStatistic,omitempty"`
	HelpRequest                                  *HelpRequest                                  `xml:"HelpRequest,omitempty"`
	Errors                                       *Errors                                       `xml:"Errors,omitempty"`
}

type RequesterStatistic

type RequesterStatistic string
const (
	RequesterStatisticNumberHITsAssignable            RequesterStatistic = "NumberHITsAssignable"
	RequesterStatisticNumberHITsReviewable            RequesterStatistic = "NumberHITsReviewable"
	RequesterStatisticNumberHITsCreated               RequesterStatistic = "NumberHITsCreated"
	RequesterStatisticNumberHITsCompleted             RequesterStatistic = "NumberHITsCompleted"
	RequesterStatisticTotalRewardPayout               RequesterStatistic = "TotalRewardPayout"
	RequesterStatisticTotalRewardFeePayout            RequesterStatistic = "TotalRewardFeePayout"
	RequesterStatisticTotalFeePayout                  RequesterStatistic = "TotalFeePayout"
	RequesterStatisticTotalRewardAndFeePayout         RequesterStatistic = "TotalRewardAndFeePayout"
	RequesterStatisticTotalBonusPayout                RequesterStatistic = "TotalBonusPayout"
	RequesterStatisticTotalBonusFeePayout             RequesterStatistic = "TotalBonusFeePayout"
	RequesterStatisticEstimatedFeeLiability           RequesterStatistic = "EstimatedFeeLiability"
	RequesterStatisticEstimatedRewardLiability        RequesterStatistic = "EstimatedRewardLiability"
	RequesterStatisticEstimatedTotalLiability         RequesterStatistic = "EstimatedTotalLiability"
	RequesterStatisticNumberAssignmentsAvailable      RequesterStatistic = "NumberAssignmentsAvailable"
	RequesterStatisticNumberAssignmentsAccepted       RequesterStatistic = "NumberAssignmentsAccepted"
	RequesterStatisticNumberAssignmentsPending        RequesterStatistic = "NumberAssignmentsPending"
	RequesterStatisticNumberAssignmentsApproved       RequesterStatistic = "NumberAssignmentsApproved"
	RequesterStatisticNumberAssignmentsRejected       RequesterStatistic = "NumberAssignmentsRejected"
	RequesterStatisticNumberAssignmentsReturned       RequesterStatistic = "NumberAssignmentsReturned"
	RequesterStatisticNumberAssignmentsAbandoned      RequesterStatistic = "NumberAssignmentsAbandoned"
	RequesterStatisticAverageRewardAmount             RequesterStatistic = "AverageRewardAmount"
	RequesterStatisticPercentAssignmentsApproved      RequesterStatistic = "PercentAssignmentsApproved"
	RequesterStatisticPercentAssignmentsRejected      RequesterStatistic = "PercentAssignmentsRejected"
	RequesterStatisticNumberKnownAnswersCorrect       RequesterStatistic = "NumberKnownAnswersCorrect"
	RequesterStatisticNumberKnownAnswersIncorrect     RequesterStatistic = "NumberKnownAnswersIncorrect"
	RequesterStatisticNumberKnownAnswersEvaluated     RequesterStatistic = "NumberKnownAnswersEvaluated"
	RequesterStatisticPercentKnownAnswersCorrect      RequesterStatistic = "PercentKnownAnswersCorrect"
	RequesterStatisticNumberPluralityAnswersCorrect   RequesterStatistic = "NumberPluralityAnswersCorrect"
	RequesterStatisticNumberPluralityAnswersIncorrect RequesterStatistic = "NumberPluralityAnswersIncorrect"
	RequesterStatisticNumberPluralityAnswersEvaluated RequesterStatistic = "NumberPluralityAnswersEvaluated"
	RequesterStatisticPercentPluralityAnswersCorrect  RequesterStatistic = "PercentPluralityAnswersCorrect"
)

type ResponseGroupInformation

type ResponseGroupInformation struct {
	Name            string `xml:"Name,omitempty"`
	CreationDate    string `xml:"CreationDate,omitempty"`
	ValidOperations struct {
		Operation []string `xml:"Operation,omitempty"`
	} `xml:"ValidOperations,omitempty"`
	Elements struct {
		Element []string `xml:"Element,omitempty"`
	} `xml:"Elements,omitempty"`
}

type ReviewActionDetail

type ReviewActionDetail struct {
	ActionId     string              `xml:"ActionId,omitempty"`
	ActionName   string              `xml:"ActionName,omitempty"`
	ObjectId     string              `xml:"ObjectId,omitempty"`
	ObjectType   string              `xml:"ObjectType,omitempty"`
	Status       *ReviewActionStatus `xml:"Status,omitempty"`
	CompleteTime time.Time           `xml:"CompleteTime,omitempty"`
	Result       string              `xml:"Result,omitempty"`
	ErrorCode    string              `xml:"ErrorCode,omitempty"`
}

type ReviewActionStatus

type ReviewActionStatus string
const (
	ReviewActionStatusIntended  ReviewActionStatus = "Intended"
	ReviewActionStatusSucceeded ReviewActionStatus = "Succeeded"
	ReviewActionStatusFailed    ReviewActionStatus = "Failed"
	ReviewActionStatusCancelled ReviewActionStatus = "Cancelled"
)

type ReviewPolicy

type ReviewPolicy struct {
	PolicyName string             `xml:"PolicyName,omitempty"`
	Parameter  []*PolicyParameter `xml:"Parameter,omitempty"`
}

type ReviewPolicyLevel

type ReviewPolicyLevel string
const (
	ReviewPolicyLevelAssignment ReviewPolicyLevel = "Assignment"
	ReviewPolicyLevelHIT        ReviewPolicyLevel = "HIT"
)

type ReviewReport

type ReviewReport struct {
	PageNumber      int                   `xml:"PageNumber,omitempty"`
	NumResults      int                   `xml:"NumResults,omitempty"`
	TotalNumResults int                   `xml:"TotalNumResults,omitempty"`
	ReviewResult    []*ReviewResultDetail `xml:"ReviewResult,omitempty"`
	ReviewAction    []*ReviewActionDetail `xml:"ReviewAction,omitempty"`
}

type ReviewResultDetail

type ReviewResultDetail struct {
	ActionId    string `xml:"ActionId,omitempty"`
	SubjectId   string `xml:"SubjectId,omitempty"`
	SubjectType string `xml:"SubjectType,omitempty"`
	QuestionId  string `xml:"QuestionId,omitempty"`
	Key         string `xml:"Key,omitempty"`
	Value       string `xml:"Value,omitempty"`
}

type ReviewableHITStatus

type ReviewableHITStatus string
const (
	ReviewableHITStatusReviewable ReviewableHITStatus = "Reviewable"
	ReviewableHITStatusReviewing  ReviewableHITStatus = "Reviewing"
)

type RevokeQualificationRequest

type RevokeQualificationRequest struct {
	SubjectId           string   `xml:"SubjectId,omitempty"`
	QualificationTypeId string   `xml:"QualificationTypeId,omitempty"`
	Reason              string   `xml:"Reason,omitempty"`
	ResponseGroup       []string `xml:"ResponseGroup,omitempty"`
}

type RevokeQualificationResult

type RevokeQualificationResult struct {
	Request *Request `xml:"Request,omitempty"`
}

type SearchHITsRequest

type SearchHITsRequest struct {
	SortDirection *SortDirection          `xml:"SortDirection,omitempty"`
	SortProperty  *SearchHITsSortProperty `xml:"SortProperty,omitempty"`
	PageNumber    int                     `xml:"PageNumber,omitempty"`
	PageSize      int                     `xml:"PageSize,omitempty"`
	ResponseGroup []string                `xml:"ResponseGroup,omitempty"`
}

type SearchHITsResult

type SearchHITsResult struct {
	Request         *Request `xml:"Request,omitempty"`
	PageNumber      int      `xml:"PageNumber,omitempty"`
	NumResults      int      `xml:"NumResults,omitempty"`
	TotalNumResults int      `xml:"TotalNumResults,omitempty"`
	HIT             []*HIT   `xml:"HIT,omitempty"`
}

type SearchHITsSortProperty

type SearchHITsSortProperty string
const (
	SearchHITsSortPropertyTitle        SearchHITsSortProperty = "Title"
	SearchHITsSortPropertyReward       SearchHITsSortProperty = "Reward"
	SearchHITsSortPropertyExpiration   SearchHITsSortProperty = "Expiration"
	SearchHITsSortPropertyCreationTime SearchHITsSortProperty = "CreationTime"
	SearchHITsSortPropertyEnumeration  SearchHITsSortProperty = "Enumeration"
)

type SearchQualificationTypesRequest

type SearchQualificationTypesRequest struct {
	Query               string                                `xml:"Query,omitempty"`
	MustBeRequestable   bool                                  `xml:"MustBeRequestable,omitempty"`
	MustBeOwnedByCaller bool                                  `xml:"MustBeOwnedByCaller,omitempty"`
	SortDirection       *SortDirection                        `xml:"SortDirection,omitempty"`
	SortProperty        *SearchQualificationTypesSortProperty `xml:"SortProperty,omitempty"`
	PageNumber          int                                   `xml:"PageNumber,omitempty"`
	PageSize            int                                   `xml:"PageSize,omitempty"`
	ResponseGroup       []string                              `xml:"ResponseGroup,omitempty"`
}

type SearchQualificationTypesResult

type SearchQualificationTypesResult struct {
	Request           *Request             `xml:"Request,omitempty"`
	NumResults        int                  `xml:"NumResults,omitempty"`
	TotalNumResults   int                  `xml:"TotalNumResults,omitempty"`
	PageNumber        int                  `xml:"PageNumber,omitempty"`
	QualificationType []*QualificationType `xml:"QualificationType,omitempty"`
}

type SearchQualificationTypesSortProperty

type SearchQualificationTypesSortProperty string
const (
	SearchQualificationTypesSortPropertyName SearchQualificationTypesSortProperty = "Name"
)

type SendTestEventNotificationRequest

type SendTestEventNotificationRequest struct {
	Notification  *NotificationSpecification `xml:"Notification,omitempty"`
	TestEventType *EventType                 `xml:"TestEventType,omitempty"`
}

type SendTestEventNotificationResult

type SendTestEventNotificationResult struct {
	Request *Request `xml:"Request,omitempty"`
}

type SetHITAsReviewingRequest

type SetHITAsReviewingRequest struct {
	HITId         string   `xml:"HITId,omitempty"`
	Revert        bool     `xml:"Revert,omitempty"`
	ResponseGroup []string `xml:"ResponseGroup,omitempty"`
}

type SetHITAsReviewingResult

type SetHITAsReviewingResult struct {
	Request *Request `xml:"Request,omitempty"`
}

type SetHITTypeNotificationRequest

type SetHITTypeNotificationRequest struct {
	HITTypeId    string                     `xml:"HITTypeId,omitempty"`
	Notification *NotificationSpecification `xml:"Notification,omitempty"`
	Active       bool                       `xml:"Active,omitempty"`
}

type SetHITTypeNotificationResult

type SetHITTypeNotificationResult struct {
	Request *Request `xml:"Request,omitempty"`
}

type SortDirection

type SortDirection string
const (
	SortDirectionAscending  SortDirection = "Ascending"
	SortDirectionDescending SortDirection = "Descending"
)

Sort directions

type TimePeriod

type TimePeriod string
const (
	TimePeriodOneDay     TimePeriod = "OneDay"
	TimePeriodSevenDays  TimePeriod = "SevenDays"
	TimePeriodThirtyDays TimePeriod = "ThirtyDays"
	TimePeriodLifeToDate TimePeriod = "LifeToDate"
)

type UnblockWorkerRequest

type UnblockWorkerRequest struct {
	WorkerId      string   `xml:"WorkerId,omitempty"`
	Reason        string   `xml:"Reason,omitempty"`
	ResponseGroup []string `xml:"ResponseGroup,omitempty"`
}

type UnblockWorkerResult

type UnblockWorkerResult struct {
	Request *Request `xml:"Request,omitempty"`
}

type UpdateQualificationScoreRequest

type UpdateQualificationScoreRequest struct {
	QualificationTypeId string   `xml:"QualificationTypeId,omitempty"`
	SubjectId           string   `xml:"SubjectId,omitempty"`
	IntegerValue        int32    `xml:"IntegerValue,omitempty"`
	ResponseGroup       []string `xml:"ResponseGroup,omitempty"`
}

type UpdateQualificationScoreResult

type UpdateQualificationScoreResult struct {
	Request *Request `xml:"Request,omitempty"`
}

type UpdateQualificationTypeRequest

type UpdateQualificationTypeRequest struct {
	QualificationTypeId     string                   `xml:"QualificationTypeId,omitempty"`
	Description             string                   `xml:"Description,omitempty"`
	QualificationTypeStatus *QualificationTypeStatus `xml:"QualificationTypeStatus,omitempty"`
	Test                    string                   `xml:"Test,omitempty"`
	AnswerKey               string                   `xml:"AnswerKey,omitempty"`
	TestDurationInSeconds   int                      `xml:"TestDurationInSeconds,omitempty"`
	RetryDelayInSeconds     int                      `xml:"RetryDelayInSeconds,omitempty"`
	AutoGranted             bool                     `xml:"AutoGranted,omitempty"`
	AutoGrantedValue        int32                    `xml:"AutoGrantedValue,omitempty"`
	ResponseGroup           []string                 `xml:"ResponseGroup,omitempty"`
}

type WorkerBlock

type WorkerBlock struct {
	WorkerId string `xml:"WorkerId,omitempty"`
	Reason   string `xml:"Reason,omitempty"`
}

Directories

Path Synopsis
cmd
mechturk/mtcmd
Package mtcmd provide support utilities for mechturk commands.
Package mtcmd provide support utilities for mechturk commands.
Package credentials provides credential retrieval and management.
Package credentials provides credential retrieval and management.
Package signer provides a signer type that signs Mechanical Turk requests.
Package signer provides a signer type that signs Mechanical Turk requests.
Package soap provides SOAP support.
Package soap provides SOAP support.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL