« blib/lib/Paws/MTurk/CreateAdditionalAssignmentsForHITResponse.pm
↑ Summary
blib/lib/Paws/MTurk/CreateHITResponse.pm »
| 1 | |||
| 2 | package Paws::MTurk::CreateHIT; | ||
| 3 | use Moose; | ||
| 4 | has AssignmentDurationInSeconds => (is => 'ro', isa => 'Int', required => 1); | ||
| 5 | has AssignmentReviewPolicy => (is => 'ro', isa => 'Paws::MTurk::ReviewPolicy'); | ||
| 6 | has AutoApprovalDelayInSeconds => (is => 'ro', isa => 'Int'); | ||
| 7 | has Description => (is => 'ro', isa => 'Str', required => 1); | ||
| 8 | has HITLayoutId => (is => 'ro', isa => 'Str'); | ||
| 9 | has HITLayoutParameters => (is => 'ro', isa => 'ArrayRef[Paws::MTurk::HITLayoutParameter]'); | ||
| 10 | has HITReviewPolicy => (is => 'ro', isa => 'Paws::MTurk::ReviewPolicy'); | ||
| 11 | has Keywords => (is => 'ro', isa => 'Str'); | ||
| 12 | has LifetimeInSeconds => (is => 'ro', isa => 'Int', required => 1); | ||
| 13 | has MaxAssignments => (is => 'ro', isa => 'Int'); | ||
| 14 | has QualificationRequirements => (is => 'ro', isa => 'ArrayRef[Paws::MTurk::QualificationRequirement]'); | ||
| 15 | has Question => (is => 'ro', isa => 'Str'); | ||
| 16 | has RequesterAnnotation => (is => 'ro', isa => 'Str'); | ||
| 17 | has Reward => (is => 'ro', isa => 'Str', required => 1); | ||
| 18 | has Title => (is => 'ro', isa => 'Str', required => 1); | ||
| 19 | has UniqueRequestToken => (is => 'ro', isa => 'Str'); | ||
| 20 | |||
| 21 | use MooseX::ClassAttribute; | ||
| 22 | |||
| 23 | class_has _api_call => (isa => 'Str', is => 'ro', default => 'CreateHIT'); | ||
| 24 | class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::MTurk::CreateHITResponse'); | ||
| 25 | class_has _result_key => (isa => 'Str', is => 'ro'); | ||
| 26 | 1; | ||
| 27 | |||
| 28 | ### main pod documentation begin ### | ||
| 29 | |||
| 30 | =head1 NAME | ||
| 31 | |||
| 32 | Paws::MTurk::CreateHIT - Arguments for method CreateHIT on L<Paws::MTurk> | ||
| 33 | |||
| 34 | =head1 DESCRIPTION | ||
| 35 | |||
| 36 | This class represents the parameters used for calling the method CreateHIT on the | ||
| 37 | L<Amazon Mechanical Turk|Paws::MTurk> service. Use the attributes of this class | ||
| 38 | as arguments to method CreateHIT. | ||
| 39 | |||
| 40 | You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to CreateHIT. | ||
| 41 | |||
| 42 | =head1 SYNOPSIS | ||
| 43 | |||
| 44 | my $mturk-requester = Paws->service('MTurk'); | ||
| 45 | my $CreateHITResponse = $mturk -requester->CreateHIT( | ||
| 46 | AssignmentDurationInSeconds => 1, | ||
| 47 | Description => 'MyString', | ||
| 48 | LifetimeInSeconds => 1, | ||
| 49 | Reward => 'MyCurrencyAmount', | ||
| 50 | Title => 'MyString', | ||
| 51 | AssignmentReviewPolicy => { | ||
| 52 | PolicyName => 'MyString', | ||
| 53 | Parameters => [ | ||
| 54 | { | ||
| 55 | Key => 'MyString', | ||
| 56 | MapEntries => [ | ||
| 57 | { | ||
| 58 | Key => 'MyString', | ||
| 59 | Values => [ 'MyString', ... ], # OPTIONAL | ||
| 60 | }, | ||
| 61 | ... | ||
| 62 | ], # OPTIONAL | ||
| 63 | Values => [ 'MyString', ... ], # OPTIONAL | ||
| 64 | }, | ||
| 65 | ... | ||
| 66 | ], # OPTIONAL | ||
| 67 | }, # OPTIONAL | ||
| 68 | AutoApprovalDelayInSeconds => 1, # OPTIONAL | ||
| 69 | HITLayoutId => 'MyEntityId', # OPTIONAL | ||
| 70 | HITLayoutParameters => [ | ||
| 71 | { | ||
| 72 | Name => 'MyString', | ||
| 73 | Value => 'MyString', | ||
| 74 | |||
| 75 | }, | ||
| 76 | ... | ||
| 77 | ], # OPTIONAL | ||
| 78 | HITReviewPolicy => { | ||
| 79 | PolicyName => 'MyString', | ||
| 80 | Parameters => [ | ||
| 81 | { | ||
| 82 | Key => 'MyString', | ||
| 83 | MapEntries => [ | ||
| 84 | { | ||
| 85 | Key => 'MyString', | ||
| 86 | Values => [ 'MyString', ... ], # OPTIONAL | ||
| 87 | }, | ||
| 88 | ... | ||
| 89 | ], # OPTIONAL | ||
| 90 | Values => [ 'MyString', ... ], # OPTIONAL | ||
| 91 | }, | ||
| 92 | ... | ||
| 93 | ], # OPTIONAL | ||
| 94 | }, # OPTIONAL | ||
| 95 | Keywords => 'MyString', # OPTIONAL | ||
| 96 | MaxAssignments => 1, # OPTIONAL | ||
| 97 | QualificationRequirements => [ | ||
| 98 | { | ||
| 99 | Comparator => 'LessThan' | ||
| 100 | , # values: LessThan, LessThanOrEqualTo, GreaterThan, GreaterThanOrEqualTo, EqualTo, NotEqualTo, Exists, DoesNotExist, In, NotIn | ||
| 101 | QualificationTypeId => 'MyString', | ||
| 102 | ActionsGuarded => 'Accept' | ||
| 103 | , # values: Accept, PreviewAndAccept, DiscoverPreviewAndAccept; OPTIONAL | ||
| 104 | IntegerValues => [ 1, ... ], # OPTIONAL | ||
| 105 | LocaleValues => [ | ||
| 106 | { | ||
| 107 | Country => 'MyCountryParameters', # min: 2, max: 2 | ||
| 108 | Subdivision => 'MyCountryParameters', # min: 2, max: 2 | ||
| 109 | }, | ||
| 110 | ... | ||
| 111 | ], # OPTIONAL | ||
| 112 | RequiredToPreview => 1, # OPTIONAL | ||
| 113 | }, | ||
| 114 | ... | ||
| 115 | ], # OPTIONAL | ||
| 116 | Question => 'MyString', # OPTIONAL | ||
| 117 | RequesterAnnotation => 'MyString', # OPTIONAL | ||
| 118 | UniqueRequestToken => 'MyIdempotencyToken', # OPTIONAL | ||
| 119 | ); | ||
| 120 | |||
| 121 | # Results: | ||
| 122 | my $HIT = $CreateHITResponse->HIT; | ||
| 123 | |||
| 124 | # Returns a L<Paws::MTurk::CreateHITResponse> object. | ||
| 125 | |||
| 126 | Values for attributes that are native types (Int, String, Float, etc) can passed as-is (scalar values). Values for complex Types (objects) can be passed as a HashRef. The keys and values of the hashref will be used to instance the underlying object. | ||
| 127 | For the AWS API documentation, see L<https://docs.aws.amazon.com/goto/WebAPI/mturk-requester/CreateHIT> | ||
| 128 | |||
| 129 | =head1 ATTRIBUTES | ||
| 130 | |||
| 131 | |||
| 132 | =head2 B<REQUIRED> AssignmentDurationInSeconds => Int | ||
| 133 | |||
| 134 | The amount of time, in seconds, that a Worker has to complete the HIT | ||
| 135 | after accepting it. If a Worker does not complete the assignment within | ||
| 136 | the specified duration, the assignment is considered abandoned. If the | ||
| 137 | HIT is still active (that is, its lifetime has not elapsed), the | ||
| 138 | assignment becomes available for other users to find and accept. | ||
| 139 | |||
| 140 | |||
| 141 | |||
| 142 | =head2 AssignmentReviewPolicy => L<Paws::MTurk::ReviewPolicy> | ||
| 143 | |||
| 144 | The Assignment-level Review Policy applies to the assignments under the | ||
| 145 | HIT. You can specify for Mechanical Turk to take various actions based | ||
| 146 | on the policy. | ||
| 147 | |||
| 148 | |||
| 149 | |||
| 150 | =head2 AutoApprovalDelayInSeconds => Int | ||
| 151 | |||
| 152 | The number of seconds after an assignment for the HIT has been | ||
| 153 | submitted, after which the assignment is considered Approved | ||
| 154 | automatically unless the Requester explicitly rejects it. | ||
| 155 | |||
| 156 | |||
| 157 | |||
| 158 | =head2 B<REQUIRED> Description => Str | ||
| 159 | |||
| 160 | A general description of the HIT. A description includes detailed | ||
| 161 | information about the kind of task the HIT contains. On the Amazon | ||
| 162 | Mechanical Turk web site, the HIT description appears in the expanded | ||
| 163 | view of search results, and in the HIT and assignment screens. A good | ||
| 164 | description gives the user enough information to evaluate the HIT | ||
| 165 | before accepting it. | ||
| 166 | |||
| 167 | |||
| 168 | |||
| 169 | =head2 HITLayoutId => Str | ||
| 170 | |||
| 171 | The HITLayoutId allows you to use a pre-existing HIT design with | ||
| 172 | placeholder values and create an additional HIT by providing those | ||
| 173 | values as HITLayoutParameters. | ||
| 174 | |||
| 175 | Constraints: Either a Question parameter or a HITLayoutId parameter | ||
| 176 | must be provided. | ||
| 177 | |||
| 178 | |||
| 179 | |||
| 180 | =head2 HITLayoutParameters => ArrayRef[L<Paws::MTurk::HITLayoutParameter>] | ||
| 181 | |||
| 182 | If the HITLayoutId is provided, any placeholder values must be filled | ||
| 183 | in with values using the HITLayoutParameter structure. For more | ||
| 184 | information, see HITLayout. | ||
| 185 | |||
| 186 | |||
| 187 | |||
| 188 | =head2 HITReviewPolicy => L<Paws::MTurk::ReviewPolicy> | ||
| 189 | |||
| 190 | The HIT-level Review Policy applies to the HIT. You can specify for | ||
| 191 | Mechanical Turk to take various actions based on the policy. | ||
| 192 | |||
| 193 | |||
| 194 | |||
| 195 | =head2 Keywords => Str | ||
| 196 | |||
| 197 | One or more words or phrases that describe the HIT, separated by | ||
| 198 | commas. These words are used in searches to find HITs. | ||
| 199 | |||
| 200 | |||
| 201 | |||
| 202 | =head2 B<REQUIRED> LifetimeInSeconds => Int | ||
| 203 | |||
| 204 | An amount of time, in seconds, after which the HIT is no longer | ||
| 205 | available for users to accept. After the lifetime of the HIT elapses, | ||
| 206 | the HIT no longer appears in HIT searches, even if not all of the | ||
| 207 | assignments for the HIT have been accepted. | ||
| 208 | |||
| 209 | |||
| 210 | |||
| 211 | =head2 MaxAssignments => Int | ||
| 212 | |||
| 213 | The number of times the HIT can be accepted and completed before the | ||
| 214 | HIT becomes unavailable. | ||
| 215 | |||
| 216 | |||
| 217 | |||
| 218 | =head2 QualificationRequirements => ArrayRef[L<Paws::MTurk::QualificationRequirement>] | ||
| 219 | |||
| 220 | Conditions that a Worker's Qualifications must meet in order to accept | ||
| 221 | the HIT. A HIT can have between zero and ten Qualification | ||
| 222 | requirements. All requirements must be met in order for a Worker to | ||
| 223 | accept the HIT. Additionally, other actions can be restricted using the | ||
| 224 | C<ActionsGuarded> field on each C<QualificationRequirement> structure. | ||
| 225 | |||
| 226 | |||
| 227 | |||
| 228 | =head2 Question => Str | ||
| 229 | |||
| 230 | The data the person completing the HIT uses to produce the results. | ||
| 231 | |||
| 232 | Constraints: Must be a QuestionForm data structure, an ExternalQuestion | ||
| 233 | data structure, or an HTMLQuestion data structure. The XML question | ||
| 234 | data must not be larger than 64 kilobytes (65,535 bytes) in size, | ||
| 235 | including whitespace. | ||
| 236 | |||
| 237 | Either a Question parameter or a HITLayoutId parameter must be | ||
| 238 | provided. | ||
| 239 | |||
| 240 | |||
| 241 | |||
| 242 | =head2 RequesterAnnotation => Str | ||
| 243 | |||
| 244 | An arbitrary data field. The RequesterAnnotation parameter lets your | ||
| 245 | application attach arbitrary data to the HIT for tracking purposes. For | ||
| 246 | example, this parameter could be an identifier internal to the | ||
| 247 | Requester's application that corresponds with the HIT. | ||
| 248 | |||
| 249 | The RequesterAnnotation parameter for a HIT is only visible to the | ||
| 250 | Requester who created the HIT. It is not shown to the Worker, or any | ||
| 251 | other Requester. | ||
| 252 | |||
| 253 | The RequesterAnnotation parameter may be different for each HIT you | ||
| 254 | submit. It does not affect how your HITs are grouped. | ||
| 255 | |||
| 256 | |||
| 257 | |||
| 258 | =head2 B<REQUIRED> Reward => Str | ||
| 259 | |||
| 260 | The amount of money the Requester will pay a Worker for successfully | ||
| 261 | completing the HIT. | ||
| 262 | |||
| 263 | |||
| 264 | |||
| 265 | =head2 B<REQUIRED> Title => Str | ||
| 266 | |||
| 267 | The title of the HIT. A title should be short and descriptive about the | ||
| 268 | kind of task the HIT contains. On the Amazon Mechanical Turk web site, | ||
| 269 | the HIT title appears in search results, and everywhere the HIT is | ||
| 270 | mentioned. | ||
| 271 | |||
| 272 | |||
| 273 | |||
| 274 | =head2 UniqueRequestToken => Str | ||
| 275 | |||
| 276 | A unique identifier for this request which allows you to retry the call | ||
| 277 | on error without creating duplicate HITs. This is useful in cases such | ||
| 278 | as network timeouts where it is unclear whether or not the call | ||
| 279 | succeeded on the server. If the HIT already exists in the system from a | ||
| 280 | previous call using the same UniqueRequestToken, subsequent calls will | ||
| 281 | return a AWS.MechanicalTurk.HitAlreadyExists error with a message | ||
| 282 | containing the HITId. | ||
| 283 | |||
| 284 | Note: It is your responsibility to ensure uniqueness of the token. The | ||
| 285 | unique token expires after 24 hours. Subsequent calls using the same | ||
| 286 | UniqueRequestToken made after the 24 hour limit could create duplicate | ||
| 287 | HITs. | ||
| 288 | |||
| 289 | |||
| 290 | |||
| 291 | |||
| 292 | =head1 SEE ALSO | ||
| 293 | |||
| 294 | This class forms part of L<Paws>, documenting arguments for method CreateHIT in L<Paws::MTurk> | ||
| 295 | |||
| 296 | =head1 BUGS and CONTRIBUTIONS | ||
| 297 | |||
| 298 | The source code is located here: L<https://github.com/pplu/aws-sdk-perl> | ||
| 299 | |||
| 300 | Please report bugs to: L<https://github.com/pplu/aws-sdk-perl/issues> | ||
| 301 | |||
| 302 | =cut | ||
| 303 |