use std::error::Error;
use std::fmt;
#[allow(warnings)]
use futures::future;
use futures::Future;
use rusoto_core::credential::ProvideAwsCredentials;
use rusoto_core::region;
use rusoto_core::request::{BufferedHttpResponse, DispatchSignedRequest};
use rusoto_core::{Client, RusotoError, RusotoFuture};
use rusoto_core::proto;
use rusoto_core::signature::SignedRequest;
use serde_json;
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct AcceptQualificationRequestRequest {
#[serde(rename = "IntegerValue")]
#[serde(skip_serializing_if = "Option::is_none")]
pub integer_value: Option<i64>,
#[serde(rename = "QualificationRequestId")]
pub qualification_request_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct AcceptQualificationRequestResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ApproveAssignmentRequest {
#[serde(rename = "AssignmentId")]
pub assignment_id: String,
#[serde(rename = "OverrideRejection")]
#[serde(skip_serializing_if = "Option::is_none")]
pub override_rejection: Option<bool>,
#[serde(rename = "RequesterFeedback")]
#[serde(skip_serializing_if = "Option::is_none")]
pub requester_feedback: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ApproveAssignmentResponse {}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Assignment {
#[serde(rename = "AcceptTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept_time: Option<f64>,
#[serde(rename = "Answer")]
#[serde(skip_serializing_if = "Option::is_none")]
pub answer: Option<String>,
#[serde(rename = "ApprovalTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub approval_time: Option<f64>,
#[serde(rename = "AssignmentId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub assignment_id: Option<String>,
#[serde(rename = "AssignmentStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub assignment_status: Option<String>,
#[serde(rename = "AutoApprovalTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub auto_approval_time: Option<f64>,
#[serde(rename = "Deadline")]
#[serde(skip_serializing_if = "Option::is_none")]
pub deadline: Option<f64>,
#[serde(rename = "HITId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hit_id: Option<String>,
#[serde(rename = "RejectionTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub rejection_time: Option<f64>,
#[serde(rename = "RequesterFeedback")]
#[serde(skip_serializing_if = "Option::is_none")]
pub requester_feedback: Option<String>,
#[serde(rename = "SubmitTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub submit_time: Option<f64>,
#[serde(rename = "WorkerId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub worker_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct AssociateQualificationWithWorkerRequest {
#[serde(rename = "IntegerValue")]
#[serde(skip_serializing_if = "Option::is_none")]
pub integer_value: Option<i64>,
#[serde(rename = "QualificationTypeId")]
pub qualification_type_id: String,
#[serde(rename = "SendNotification")]
#[serde(skip_serializing_if = "Option::is_none")]
pub send_notification: Option<bool>,
#[serde(rename = "WorkerId")]
pub worker_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct AssociateQualificationWithWorkerResponse {}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct BonusPayment {
#[serde(rename = "AssignmentId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub assignment_id: Option<String>,
#[serde(rename = "BonusAmount")]
#[serde(skip_serializing_if = "Option::is_none")]
pub bonus_amount: Option<String>,
#[serde(rename = "GrantTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub grant_time: Option<f64>,
#[serde(rename = "Reason")]
#[serde(skip_serializing_if = "Option::is_none")]
pub reason: Option<String>,
#[serde(rename = "WorkerId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub worker_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateAdditionalAssignmentsForHITRequest {
#[serde(rename = "HITId")]
pub hit_id: String,
#[serde(rename = "NumberOfAdditionalAssignments")]
pub number_of_additional_assignments: i64,
#[serde(rename = "UniqueRequestToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub unique_request_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateAdditionalAssignmentsForHITResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateHITRequest {
#[serde(rename = "AssignmentDurationInSeconds")]
pub assignment_duration_in_seconds: i64,
#[serde(rename = "AssignmentReviewPolicy")]
#[serde(skip_serializing_if = "Option::is_none")]
pub assignment_review_policy: Option<ReviewPolicy>,
#[serde(rename = "AutoApprovalDelayInSeconds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub auto_approval_delay_in_seconds: Option<i64>,
#[serde(rename = "Description")]
pub description: String,
#[serde(rename = "HITLayoutId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hit_layout_id: Option<String>,
#[serde(rename = "HITLayoutParameters")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hit_layout_parameters: Option<Vec<HITLayoutParameter>>,
#[serde(rename = "HITReviewPolicy")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hit_review_policy: Option<ReviewPolicy>,
#[serde(rename = "Keywords")]
#[serde(skip_serializing_if = "Option::is_none")]
pub keywords: Option<String>,
#[serde(rename = "LifetimeInSeconds")]
pub lifetime_in_seconds: i64,
#[serde(rename = "MaxAssignments")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_assignments: Option<i64>,
#[serde(rename = "QualificationRequirements")]
#[serde(skip_serializing_if = "Option::is_none")]
pub qualification_requirements: Option<Vec<QualificationRequirement>>,
#[serde(rename = "Question")]
#[serde(skip_serializing_if = "Option::is_none")]
pub question: Option<String>,
#[serde(rename = "RequesterAnnotation")]
#[serde(skip_serializing_if = "Option::is_none")]
pub requester_annotation: Option<String>,
#[serde(rename = "Reward")]
pub reward: String,
#[serde(rename = "Title")]
pub title: String,
#[serde(rename = "UniqueRequestToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub unique_request_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateHITResponse {
#[serde(rename = "HIT")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hit: Option<HIT>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateHITTypeRequest {
#[serde(rename = "AssignmentDurationInSeconds")]
pub assignment_duration_in_seconds: i64,
#[serde(rename = "AutoApprovalDelayInSeconds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub auto_approval_delay_in_seconds: Option<i64>,
#[serde(rename = "Description")]
pub description: String,
#[serde(rename = "Keywords")]
#[serde(skip_serializing_if = "Option::is_none")]
pub keywords: Option<String>,
#[serde(rename = "QualificationRequirements")]
#[serde(skip_serializing_if = "Option::is_none")]
pub qualification_requirements: Option<Vec<QualificationRequirement>>,
#[serde(rename = "Reward")]
pub reward: String,
#[serde(rename = "Title")]
pub title: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateHITTypeResponse {
#[serde(rename = "HITTypeId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hit_type_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateHITWithHITTypeRequest {
#[serde(rename = "AssignmentReviewPolicy")]
#[serde(skip_serializing_if = "Option::is_none")]
pub assignment_review_policy: Option<ReviewPolicy>,
#[serde(rename = "HITLayoutId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hit_layout_id: Option<String>,
#[serde(rename = "HITLayoutParameters")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hit_layout_parameters: Option<Vec<HITLayoutParameter>>,
#[serde(rename = "HITReviewPolicy")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hit_review_policy: Option<ReviewPolicy>,
#[serde(rename = "HITTypeId")]
pub hit_type_id: String,
#[serde(rename = "LifetimeInSeconds")]
pub lifetime_in_seconds: i64,
#[serde(rename = "MaxAssignments")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_assignments: Option<i64>,
#[serde(rename = "Question")]
#[serde(skip_serializing_if = "Option::is_none")]
pub question: Option<String>,
#[serde(rename = "RequesterAnnotation")]
#[serde(skip_serializing_if = "Option::is_none")]
pub requester_annotation: Option<String>,
#[serde(rename = "UniqueRequestToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub unique_request_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateHITWithHITTypeResponse {
#[serde(rename = "HIT")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hit: Option<HIT>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateQualificationTypeRequest {
#[serde(rename = "AnswerKey")]
#[serde(skip_serializing_if = "Option::is_none")]
pub answer_key: Option<String>,
#[serde(rename = "AutoGranted")]
#[serde(skip_serializing_if = "Option::is_none")]
pub auto_granted: Option<bool>,
#[serde(rename = "AutoGrantedValue")]
#[serde(skip_serializing_if = "Option::is_none")]
pub auto_granted_value: Option<i64>,
#[serde(rename = "Description")]
pub description: String,
#[serde(rename = "Keywords")]
#[serde(skip_serializing_if = "Option::is_none")]
pub keywords: Option<String>,
#[serde(rename = "Name")]
pub name: String,
#[serde(rename = "QualificationTypeStatus")]
pub qualification_type_status: String,
#[serde(rename = "RetryDelayInSeconds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub retry_delay_in_seconds: Option<i64>,
#[serde(rename = "Test")]
#[serde(skip_serializing_if = "Option::is_none")]
pub test: Option<String>,
#[serde(rename = "TestDurationInSeconds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub test_duration_in_seconds: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateQualificationTypeResponse {
#[serde(rename = "QualificationType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub qualification_type: Option<QualificationType>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateWorkerBlockRequest {
#[serde(rename = "Reason")]
pub reason: String,
#[serde(rename = "WorkerId")]
pub worker_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateWorkerBlockResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteHITRequest {
#[serde(rename = "HITId")]
pub hit_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteHITResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteQualificationTypeRequest {
#[serde(rename = "QualificationTypeId")]
pub qualification_type_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteQualificationTypeResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteWorkerBlockRequest {
#[serde(rename = "Reason")]
#[serde(skip_serializing_if = "Option::is_none")]
pub reason: Option<String>,
#[serde(rename = "WorkerId")]
pub worker_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteWorkerBlockResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DisassociateQualificationFromWorkerRequest {
#[serde(rename = "QualificationTypeId")]
pub qualification_type_id: String,
#[serde(rename = "Reason")]
#[serde(skip_serializing_if = "Option::is_none")]
pub reason: Option<String>,
#[serde(rename = "WorkerId")]
pub worker_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DisassociateQualificationFromWorkerResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetAccountBalanceRequest {}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetAccountBalanceResponse {
#[serde(rename = "AvailableBalance")]
#[serde(skip_serializing_if = "Option::is_none")]
pub available_balance: Option<String>,
#[serde(rename = "OnHoldBalance")]
#[serde(skip_serializing_if = "Option::is_none")]
pub on_hold_balance: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetAssignmentRequest {
#[serde(rename = "AssignmentId")]
pub assignment_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetAssignmentResponse {
#[serde(rename = "Assignment")]
#[serde(skip_serializing_if = "Option::is_none")]
pub assignment: Option<Assignment>,
#[serde(rename = "HIT")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hit: Option<HIT>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetFileUploadURLRequest {
#[serde(rename = "AssignmentId")]
pub assignment_id: String,
#[serde(rename = "QuestionIdentifier")]
pub question_identifier: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetFileUploadURLResponse {
#[serde(rename = "FileUploadURL")]
#[serde(skip_serializing_if = "Option::is_none")]
pub file_upload_url: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetHITRequest {
#[serde(rename = "HITId")]
pub hit_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetHITResponse {
#[serde(rename = "HIT")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hit: Option<HIT>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetQualificationScoreRequest {
#[serde(rename = "QualificationTypeId")]
pub qualification_type_id: String,
#[serde(rename = "WorkerId")]
pub worker_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetQualificationScoreResponse {
#[serde(rename = "Qualification")]
#[serde(skip_serializing_if = "Option::is_none")]
pub qualification: Option<Qualification>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetQualificationTypeRequest {
#[serde(rename = "QualificationTypeId")]
pub qualification_type_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetQualificationTypeResponse {
#[serde(rename = "QualificationType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub qualification_type: Option<QualificationType>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct HIT {
#[serde(rename = "AssignmentDurationInSeconds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub assignment_duration_in_seconds: Option<i64>,
#[serde(rename = "AutoApprovalDelayInSeconds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub auto_approval_delay_in_seconds: Option<i64>,
#[serde(rename = "CreationTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_time: Option<f64>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "Expiration")]
#[serde(skip_serializing_if = "Option::is_none")]
pub expiration: Option<f64>,
#[serde(rename = "HITGroupId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hit_group_id: Option<String>,
#[serde(rename = "HITId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hit_id: Option<String>,
#[serde(rename = "HITLayoutId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hit_layout_id: Option<String>,
#[serde(rename = "HITReviewStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hit_review_status: Option<String>,
#[serde(rename = "HITStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hit_status: Option<String>,
#[serde(rename = "HITTypeId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hit_type_id: Option<String>,
#[serde(rename = "Keywords")]
#[serde(skip_serializing_if = "Option::is_none")]
pub keywords: Option<String>,
#[serde(rename = "MaxAssignments")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_assignments: Option<i64>,
#[serde(rename = "NumberOfAssignmentsAvailable")]
#[serde(skip_serializing_if = "Option::is_none")]
pub number_of_assignments_available: Option<i64>,
#[serde(rename = "NumberOfAssignmentsCompleted")]
#[serde(skip_serializing_if = "Option::is_none")]
pub number_of_assignments_completed: Option<i64>,
#[serde(rename = "NumberOfAssignmentsPending")]
#[serde(skip_serializing_if = "Option::is_none")]
pub number_of_assignments_pending: Option<i64>,
#[serde(rename = "QualificationRequirements")]
#[serde(skip_serializing_if = "Option::is_none")]
pub qualification_requirements: Option<Vec<QualificationRequirement>>,
#[serde(rename = "Question")]
#[serde(skip_serializing_if = "Option::is_none")]
pub question: Option<String>,
#[serde(rename = "RequesterAnnotation")]
#[serde(skip_serializing_if = "Option::is_none")]
pub requester_annotation: Option<String>,
#[serde(rename = "Reward")]
#[serde(skip_serializing_if = "Option::is_none")]
pub reward: Option<String>,
#[serde(rename = "Title")]
#[serde(skip_serializing_if = "Option::is_none")]
pub title: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct HITLayoutParameter {
#[serde(rename = "Name")]
pub name: String,
#[serde(rename = "Value")]
pub value: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListAssignmentsForHITRequest {
#[serde(rename = "AssignmentStatuses")]
#[serde(skip_serializing_if = "Option::is_none")]
pub assignment_statuses: Option<Vec<String>>,
#[serde(rename = "HITId")]
pub hit_id: String,
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListAssignmentsForHITResponse {
#[serde(rename = "Assignments")]
#[serde(skip_serializing_if = "Option::is_none")]
pub assignments: Option<Vec<Assignment>>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "NumResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub num_results: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListBonusPaymentsRequest {
#[serde(rename = "AssignmentId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub assignment_id: Option<String>,
#[serde(rename = "HITId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hit_id: Option<String>,
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListBonusPaymentsResponse {
#[serde(rename = "BonusPayments")]
#[serde(skip_serializing_if = "Option::is_none")]
pub bonus_payments: Option<Vec<BonusPayment>>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "NumResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub num_results: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListHITsForQualificationTypeRequest {
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "QualificationTypeId")]
pub qualification_type_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListHITsForQualificationTypeResponse {
#[serde(rename = "HITs")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hi_ts: Option<Vec<HIT>>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "NumResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub num_results: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListHITsRequest {
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListHITsResponse {
#[serde(rename = "HITs")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hi_ts: Option<Vec<HIT>>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "NumResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub num_results: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListQualificationRequestsRequest {
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "QualificationTypeId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub qualification_type_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListQualificationRequestsResponse {
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "NumResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub num_results: Option<i64>,
#[serde(rename = "QualificationRequests")]
#[serde(skip_serializing_if = "Option::is_none")]
pub qualification_requests: Option<Vec<QualificationRequest>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListQualificationTypesRequest {
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "MustBeOwnedByCaller")]
#[serde(skip_serializing_if = "Option::is_none")]
pub must_be_owned_by_caller: Option<bool>,
#[serde(rename = "MustBeRequestable")]
pub must_be_requestable: bool,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "Query")]
#[serde(skip_serializing_if = "Option::is_none")]
pub query: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListQualificationTypesResponse {
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "NumResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub num_results: Option<i64>,
#[serde(rename = "QualificationTypes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub qualification_types: Option<Vec<QualificationType>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListReviewPolicyResultsForHITRequest {
#[serde(rename = "HITId")]
pub hit_id: String,
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "PolicyLevels")]
#[serde(skip_serializing_if = "Option::is_none")]
pub policy_levels: Option<Vec<String>>,
#[serde(rename = "RetrieveActions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub retrieve_actions: Option<bool>,
#[serde(rename = "RetrieveResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub retrieve_results: Option<bool>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListReviewPolicyResultsForHITResponse {
#[serde(rename = "AssignmentReviewPolicy")]
#[serde(skip_serializing_if = "Option::is_none")]
pub assignment_review_policy: Option<ReviewPolicy>,
#[serde(rename = "AssignmentReviewReport")]
#[serde(skip_serializing_if = "Option::is_none")]
pub assignment_review_report: Option<ReviewReport>,
#[serde(rename = "HITId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hit_id: Option<String>,
#[serde(rename = "HITReviewPolicy")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hit_review_policy: Option<ReviewPolicy>,
#[serde(rename = "HITReviewReport")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hit_review_report: Option<ReviewReport>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListReviewableHITsRequest {
#[serde(rename = "HITTypeId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hit_type_id: Option<String>,
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "Status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListReviewableHITsResponse {
#[serde(rename = "HITs")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hi_ts: Option<Vec<HIT>>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "NumResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub num_results: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListWorkerBlocksRequest {
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListWorkerBlocksResponse {
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "NumResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub num_results: Option<i64>,
#[serde(rename = "WorkerBlocks")]
#[serde(skip_serializing_if = "Option::is_none")]
pub worker_blocks: Option<Vec<WorkerBlock>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListWorkersWithQualificationTypeRequest {
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "QualificationTypeId")]
pub qualification_type_id: String,
#[serde(rename = "Status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListWorkersWithQualificationTypeResponse {
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "NumResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub num_results: Option<i64>,
#[serde(rename = "Qualifications")]
#[serde(skip_serializing_if = "Option::is_none")]
pub qualifications: Option<Vec<Qualification>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Locale {
#[serde(rename = "Country")]
pub country: String,
#[serde(rename = "Subdivision")]
#[serde(skip_serializing_if = "Option::is_none")]
pub subdivision: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct NotificationSpecification {
#[serde(rename = "Destination")]
pub destination: String,
#[serde(rename = "EventTypes")]
pub event_types: Vec<String>,
#[serde(rename = "Transport")]
pub transport: String,
#[serde(rename = "Version")]
pub version: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct NotifyWorkersFailureStatus {
#[serde(rename = "NotifyWorkersFailureCode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub notify_workers_failure_code: Option<String>,
#[serde(rename = "NotifyWorkersFailureMessage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub notify_workers_failure_message: Option<String>,
#[serde(rename = "WorkerId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub worker_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct NotifyWorkersRequest {
#[serde(rename = "MessageText")]
pub message_text: String,
#[serde(rename = "Subject")]
pub subject: String,
#[serde(rename = "WorkerIds")]
pub worker_ids: Vec<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct NotifyWorkersResponse {
#[serde(rename = "NotifyWorkersFailureStatuses")]
#[serde(skip_serializing_if = "Option::is_none")]
pub notify_workers_failure_statuses: Option<Vec<NotifyWorkersFailureStatus>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ParameterMapEntry {
#[serde(rename = "Key")]
#[serde(skip_serializing_if = "Option::is_none")]
pub key: Option<String>,
#[serde(rename = "Values")]
#[serde(skip_serializing_if = "Option::is_none")]
pub values: Option<Vec<String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct PolicyParameter {
#[serde(rename = "Key")]
#[serde(skip_serializing_if = "Option::is_none")]
pub key: Option<String>,
#[serde(rename = "MapEntries")]
#[serde(skip_serializing_if = "Option::is_none")]
pub map_entries: Option<Vec<ParameterMapEntry>>,
#[serde(rename = "Values")]
#[serde(skip_serializing_if = "Option::is_none")]
pub values: Option<Vec<String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Qualification {
#[serde(rename = "GrantTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub grant_time: Option<f64>,
#[serde(rename = "IntegerValue")]
#[serde(skip_serializing_if = "Option::is_none")]
pub integer_value: Option<i64>,
#[serde(rename = "LocaleValue")]
#[serde(skip_serializing_if = "Option::is_none")]
pub locale_value: Option<Locale>,
#[serde(rename = "QualificationTypeId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub qualification_type_id: Option<String>,
#[serde(rename = "Status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
#[serde(rename = "WorkerId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub worker_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct QualificationRequest {
#[serde(rename = "Answer")]
#[serde(skip_serializing_if = "Option::is_none")]
pub answer: Option<String>,
#[serde(rename = "QualificationRequestId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub qualification_request_id: Option<String>,
#[serde(rename = "QualificationTypeId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub qualification_type_id: Option<String>,
#[serde(rename = "SubmitTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub submit_time: Option<f64>,
#[serde(rename = "Test")]
#[serde(skip_serializing_if = "Option::is_none")]
pub test: Option<String>,
#[serde(rename = "WorkerId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub worker_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct QualificationRequirement {
#[serde(rename = "ActionsGuarded")]
#[serde(skip_serializing_if = "Option::is_none")]
pub actions_guarded: Option<String>,
#[serde(rename = "Comparator")]
pub comparator: String,
#[serde(rename = "IntegerValues")]
#[serde(skip_serializing_if = "Option::is_none")]
pub integer_values: Option<Vec<i64>>,
#[serde(rename = "LocaleValues")]
#[serde(skip_serializing_if = "Option::is_none")]
pub locale_values: Option<Vec<Locale>>,
#[serde(rename = "QualificationTypeId")]
pub qualification_type_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct QualificationType {
#[serde(rename = "AnswerKey")]
#[serde(skip_serializing_if = "Option::is_none")]
pub answer_key: Option<String>,
#[serde(rename = "AutoGranted")]
#[serde(skip_serializing_if = "Option::is_none")]
pub auto_granted: Option<bool>,
#[serde(rename = "AutoGrantedValue")]
#[serde(skip_serializing_if = "Option::is_none")]
pub auto_granted_value: Option<i64>,
#[serde(rename = "CreationTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_time: Option<f64>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "IsRequestable")]
#[serde(skip_serializing_if = "Option::is_none")]
pub is_requestable: Option<bool>,
#[serde(rename = "Keywords")]
#[serde(skip_serializing_if = "Option::is_none")]
pub keywords: Option<String>,
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "QualificationTypeId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub qualification_type_id: Option<String>,
#[serde(rename = "QualificationTypeStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub qualification_type_status: Option<String>,
#[serde(rename = "RetryDelayInSeconds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub retry_delay_in_seconds: Option<i64>,
#[serde(rename = "Test")]
#[serde(skip_serializing_if = "Option::is_none")]
pub test: Option<String>,
#[serde(rename = "TestDurationInSeconds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub test_duration_in_seconds: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct RejectAssignmentRequest {
#[serde(rename = "AssignmentId")]
pub assignment_id: String,
#[serde(rename = "RequesterFeedback")]
pub requester_feedback: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct RejectAssignmentResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct RejectQualificationRequestRequest {
#[serde(rename = "QualificationRequestId")]
pub qualification_request_id: String,
#[serde(rename = "Reason")]
#[serde(skip_serializing_if = "Option::is_none")]
pub reason: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct RejectQualificationRequestResponse {}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ReviewActionDetail {
#[serde(rename = "ActionId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub action_id: Option<String>,
#[serde(rename = "ActionName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub action_name: Option<String>,
#[serde(rename = "CompleteTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub complete_time: Option<f64>,
#[serde(rename = "ErrorCode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub error_code: Option<String>,
#[serde(rename = "Result")]
#[serde(skip_serializing_if = "Option::is_none")]
pub result: Option<String>,
#[serde(rename = "Status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
#[serde(rename = "TargetId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub target_id: Option<String>,
#[serde(rename = "TargetType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub target_type: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ReviewPolicy {
#[serde(rename = "Parameters")]
#[serde(skip_serializing_if = "Option::is_none")]
pub parameters: Option<Vec<PolicyParameter>>,
#[serde(rename = "PolicyName")]
pub policy_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ReviewReport {
#[serde(rename = "ReviewActions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub review_actions: Option<Vec<ReviewActionDetail>>,
#[serde(rename = "ReviewResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub review_results: Option<Vec<ReviewResultDetail>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ReviewResultDetail {
#[serde(rename = "ActionId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub action_id: Option<String>,
#[serde(rename = "Key")]
#[serde(skip_serializing_if = "Option::is_none")]
pub key: Option<String>,
#[serde(rename = "QuestionId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub question_id: Option<String>,
#[serde(rename = "SubjectId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub subject_id: Option<String>,
#[serde(rename = "SubjectType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub subject_type: Option<String>,
#[serde(rename = "Value")]
#[serde(skip_serializing_if = "Option::is_none")]
pub value: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct SendBonusRequest {
#[serde(rename = "AssignmentId")]
pub assignment_id: String,
#[serde(rename = "BonusAmount")]
pub bonus_amount: String,
#[serde(rename = "Reason")]
pub reason: String,
#[serde(rename = "UniqueRequestToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub unique_request_token: Option<String>,
#[serde(rename = "WorkerId")]
pub worker_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct SendBonusResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct SendTestEventNotificationRequest {
#[serde(rename = "Notification")]
pub notification: NotificationSpecification,
#[serde(rename = "TestEventType")]
pub test_event_type: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct SendTestEventNotificationResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateExpirationForHITRequest {
#[serde(rename = "ExpireAt")]
pub expire_at: f64,
#[serde(rename = "HITId")]
pub hit_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateExpirationForHITResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateHITReviewStatusRequest {
#[serde(rename = "HITId")]
pub hit_id: String,
#[serde(rename = "Revert")]
#[serde(skip_serializing_if = "Option::is_none")]
pub revert: Option<bool>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateHITReviewStatusResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateHITTypeOfHITRequest {
#[serde(rename = "HITId")]
pub hit_id: String,
#[serde(rename = "HITTypeId")]
pub hit_type_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateHITTypeOfHITResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateNotificationSettingsRequest {
#[serde(rename = "Active")]
#[serde(skip_serializing_if = "Option::is_none")]
pub active: Option<bool>,
#[serde(rename = "HITTypeId")]
pub hit_type_id: String,
#[serde(rename = "Notification")]
#[serde(skip_serializing_if = "Option::is_none")]
pub notification: Option<NotificationSpecification>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateNotificationSettingsResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateQualificationTypeRequest {
#[serde(rename = "AnswerKey")]
#[serde(skip_serializing_if = "Option::is_none")]
pub answer_key: Option<String>,
#[serde(rename = "AutoGranted")]
#[serde(skip_serializing_if = "Option::is_none")]
pub auto_granted: Option<bool>,
#[serde(rename = "AutoGrantedValue")]
#[serde(skip_serializing_if = "Option::is_none")]
pub auto_granted_value: Option<i64>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "QualificationTypeId")]
pub qualification_type_id: String,
#[serde(rename = "QualificationTypeStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub qualification_type_status: Option<String>,
#[serde(rename = "RetryDelayInSeconds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub retry_delay_in_seconds: Option<i64>,
#[serde(rename = "Test")]
#[serde(skip_serializing_if = "Option::is_none")]
pub test: Option<String>,
#[serde(rename = "TestDurationInSeconds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub test_duration_in_seconds: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateQualificationTypeResponse {
#[serde(rename = "QualificationType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub qualification_type: Option<QualificationType>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct WorkerBlock {
#[serde(rename = "Reason")]
#[serde(skip_serializing_if = "Option::is_none")]
pub reason: Option<String>,
#[serde(rename = "WorkerId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub worker_id: Option<String>,
}
#[derive(Debug, PartialEq)]
pub enum AcceptQualificationRequestError {
RequestError(String),
ServiceFault(String),
}
impl AcceptQualificationRequestError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<AcceptQualificationRequestError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"RequestError" => {
return RusotoError::Service(AcceptQualificationRequestError::RequestError(
err.msg,
))
}
"ServiceFault" => {
return RusotoError::Service(AcceptQualificationRequestError::ServiceFault(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for AcceptQualificationRequestError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for AcceptQualificationRequestError {
fn description(&self) -> &str {
match *self {
AcceptQualificationRequestError::RequestError(ref cause) => cause,
AcceptQualificationRequestError::ServiceFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ApproveAssignmentError {
RequestError(String),
ServiceFault(String),
}
impl ApproveAssignmentError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ApproveAssignmentError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"RequestError" => {
return RusotoError::Service(ApproveAssignmentError::RequestError(err.msg))
}
"ServiceFault" => {
return RusotoError::Service(ApproveAssignmentError::ServiceFault(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ApproveAssignmentError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ApproveAssignmentError {
fn description(&self) -> &str {
match *self {
ApproveAssignmentError::RequestError(ref cause) => cause,
ApproveAssignmentError::ServiceFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum AssociateQualificationWithWorkerError {
RequestError(String),
ServiceFault(String),
}
impl AssociateQualificationWithWorkerError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<AssociateQualificationWithWorkerError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"RequestError" => {
return RusotoError::Service(
AssociateQualificationWithWorkerError::RequestError(err.msg),
)
}
"ServiceFault" => {
return RusotoError::Service(
AssociateQualificationWithWorkerError::ServiceFault(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for AssociateQualificationWithWorkerError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for AssociateQualificationWithWorkerError {
fn description(&self) -> &str {
match *self {
AssociateQualificationWithWorkerError::RequestError(ref cause) => cause,
AssociateQualificationWithWorkerError::ServiceFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateAdditionalAssignmentsForHITError {
RequestError(String),
ServiceFault(String),
}
impl CreateAdditionalAssignmentsForHITError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<CreateAdditionalAssignmentsForHITError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"RequestError" => {
return RusotoError::Service(
CreateAdditionalAssignmentsForHITError::RequestError(err.msg),
)
}
"ServiceFault" => {
return RusotoError::Service(
CreateAdditionalAssignmentsForHITError::ServiceFault(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CreateAdditionalAssignmentsForHITError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateAdditionalAssignmentsForHITError {
fn description(&self) -> &str {
match *self {
CreateAdditionalAssignmentsForHITError::RequestError(ref cause) => cause,
CreateAdditionalAssignmentsForHITError::ServiceFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateHITError {
RequestError(String),
ServiceFault(String),
}
impl CreateHITError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateHITError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"RequestError" => {
return RusotoError::Service(CreateHITError::RequestError(err.msg))
}
"ServiceFault" => {
return RusotoError::Service(CreateHITError::ServiceFault(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CreateHITError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateHITError {
fn description(&self) -> &str {
match *self {
CreateHITError::RequestError(ref cause) => cause,
CreateHITError::ServiceFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateHITTypeError {
RequestError(String),
ServiceFault(String),
}
impl CreateHITTypeError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateHITTypeError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"RequestError" => {
return RusotoError::Service(CreateHITTypeError::RequestError(err.msg))
}
"ServiceFault" => {
return RusotoError::Service(CreateHITTypeError::ServiceFault(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CreateHITTypeError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateHITTypeError {
fn description(&self) -> &str {
match *self {
CreateHITTypeError::RequestError(ref cause) => cause,
CreateHITTypeError::ServiceFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateHITWithHITTypeError {
RequestError(String),
ServiceFault(String),
}
impl CreateHITWithHITTypeError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateHITWithHITTypeError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"RequestError" => {
return RusotoError::Service(CreateHITWithHITTypeError::RequestError(err.msg))
}
"ServiceFault" => {
return RusotoError::Service(CreateHITWithHITTypeError::ServiceFault(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CreateHITWithHITTypeError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateHITWithHITTypeError {
fn description(&self) -> &str {
match *self {
CreateHITWithHITTypeError::RequestError(ref cause) => cause,
CreateHITWithHITTypeError::ServiceFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateQualificationTypeError {
RequestError(String),
ServiceFault(String),
}
impl CreateQualificationTypeError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateQualificationTypeError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"RequestError" => {
return RusotoError::Service(CreateQualificationTypeError::RequestError(
err.msg,
))
}
"ServiceFault" => {
return RusotoError::Service(CreateQualificationTypeError::ServiceFault(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CreateQualificationTypeError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateQualificationTypeError {
fn description(&self) -> &str {
match *self {
CreateQualificationTypeError::RequestError(ref cause) => cause,
CreateQualificationTypeError::ServiceFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateWorkerBlockError {
RequestError(String),
ServiceFault(String),
}
impl CreateWorkerBlockError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateWorkerBlockError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"RequestError" => {
return RusotoError::Service(CreateWorkerBlockError::RequestError(err.msg))
}
"ServiceFault" => {
return RusotoError::Service(CreateWorkerBlockError::ServiceFault(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CreateWorkerBlockError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateWorkerBlockError {
fn description(&self) -> &str {
match *self {
CreateWorkerBlockError::RequestError(ref cause) => cause,
CreateWorkerBlockError::ServiceFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteHITError {
RequestError(String),
ServiceFault(String),
}
impl DeleteHITError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteHITError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"RequestError" => {
return RusotoError::Service(DeleteHITError::RequestError(err.msg))
}
"ServiceFault" => {
return RusotoError::Service(DeleteHITError::ServiceFault(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteHITError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteHITError {
fn description(&self) -> &str {
match *self {
DeleteHITError::RequestError(ref cause) => cause,
DeleteHITError::ServiceFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteQualificationTypeError {
RequestError(String),
ServiceFault(String),
}
impl DeleteQualificationTypeError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteQualificationTypeError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"RequestError" => {
return RusotoError::Service(DeleteQualificationTypeError::RequestError(
err.msg,
))
}
"ServiceFault" => {
return RusotoError::Service(DeleteQualificationTypeError::ServiceFault(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteQualificationTypeError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteQualificationTypeError {
fn description(&self) -> &str {
match *self {
DeleteQualificationTypeError::RequestError(ref cause) => cause,
DeleteQualificationTypeError::ServiceFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteWorkerBlockError {
RequestError(String),
ServiceFault(String),
}
impl DeleteWorkerBlockError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteWorkerBlockError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"RequestError" => {
return RusotoError::Service(DeleteWorkerBlockError::RequestError(err.msg))
}
"ServiceFault" => {
return RusotoError::Service(DeleteWorkerBlockError::ServiceFault(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteWorkerBlockError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteWorkerBlockError {
fn description(&self) -> &str {
match *self {
DeleteWorkerBlockError::RequestError(ref cause) => cause,
DeleteWorkerBlockError::ServiceFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DisassociateQualificationFromWorkerError {
RequestError(String),
ServiceFault(String),
}
impl DisassociateQualificationFromWorkerError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<DisassociateQualificationFromWorkerError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"RequestError" => {
return RusotoError::Service(
DisassociateQualificationFromWorkerError::RequestError(err.msg),
)
}
"ServiceFault" => {
return RusotoError::Service(
DisassociateQualificationFromWorkerError::ServiceFault(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DisassociateQualificationFromWorkerError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DisassociateQualificationFromWorkerError {
fn description(&self) -> &str {
match *self {
DisassociateQualificationFromWorkerError::RequestError(ref cause) => cause,
DisassociateQualificationFromWorkerError::ServiceFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetAccountBalanceError {
RequestError(String),
ServiceFault(String),
}
impl GetAccountBalanceError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetAccountBalanceError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"RequestError" => {
return RusotoError::Service(GetAccountBalanceError::RequestError(err.msg))
}
"ServiceFault" => {
return RusotoError::Service(GetAccountBalanceError::ServiceFault(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetAccountBalanceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetAccountBalanceError {
fn description(&self) -> &str {
match *self {
GetAccountBalanceError::RequestError(ref cause) => cause,
GetAccountBalanceError::ServiceFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetAssignmentError {
RequestError(String),
ServiceFault(String),
}
impl GetAssignmentError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetAssignmentError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"RequestError" => {
return RusotoError::Service(GetAssignmentError::RequestError(err.msg))
}
"ServiceFault" => {
return RusotoError::Service(GetAssignmentError::ServiceFault(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetAssignmentError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetAssignmentError {
fn description(&self) -> &str {
match *self {
GetAssignmentError::RequestError(ref cause) => cause,
GetAssignmentError::ServiceFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetFileUploadURLError {
RequestError(String),
ServiceFault(String),
}
impl GetFileUploadURLError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetFileUploadURLError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"RequestError" => {
return RusotoError::Service(GetFileUploadURLError::RequestError(err.msg))
}
"ServiceFault" => {
return RusotoError::Service(GetFileUploadURLError::ServiceFault(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetFileUploadURLError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetFileUploadURLError {
fn description(&self) -> &str {
match *self {
GetFileUploadURLError::RequestError(ref cause) => cause,
GetFileUploadURLError::ServiceFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetHITError {
RequestError(String),
ServiceFault(String),
}
impl GetHITError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetHITError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"RequestError" => return RusotoError::Service(GetHITError::RequestError(err.msg)),
"ServiceFault" => return RusotoError::Service(GetHITError::ServiceFault(err.msg)),
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetHITError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetHITError {
fn description(&self) -> &str {
match *self {
GetHITError::RequestError(ref cause) => cause,
GetHITError::ServiceFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetQualificationScoreError {
RequestError(String),
ServiceFault(String),
}
impl GetQualificationScoreError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetQualificationScoreError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"RequestError" => {
return RusotoError::Service(GetQualificationScoreError::RequestError(err.msg))
}
"ServiceFault" => {
return RusotoError::Service(GetQualificationScoreError::ServiceFault(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetQualificationScoreError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetQualificationScoreError {
fn description(&self) -> &str {
match *self {
GetQualificationScoreError::RequestError(ref cause) => cause,
GetQualificationScoreError::ServiceFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetQualificationTypeError {
RequestError(String),
ServiceFault(String),
}
impl GetQualificationTypeError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetQualificationTypeError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"RequestError" => {
return RusotoError::Service(GetQualificationTypeError::RequestError(err.msg))
}
"ServiceFault" => {
return RusotoError::Service(GetQualificationTypeError::ServiceFault(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetQualificationTypeError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetQualificationTypeError {
fn description(&self) -> &str {
match *self {
GetQualificationTypeError::RequestError(ref cause) => cause,
GetQualificationTypeError::ServiceFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListAssignmentsForHITError {
RequestError(String),
ServiceFault(String),
}
impl ListAssignmentsForHITError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListAssignmentsForHITError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"RequestError" => {
return RusotoError::Service(ListAssignmentsForHITError::RequestError(err.msg))
}
"ServiceFault" => {
return RusotoError::Service(ListAssignmentsForHITError::ServiceFault(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListAssignmentsForHITError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListAssignmentsForHITError {
fn description(&self) -> &str {
match *self {
ListAssignmentsForHITError::RequestError(ref cause) => cause,
ListAssignmentsForHITError::ServiceFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListBonusPaymentsError {
RequestError(String),
ServiceFault(String),
}
impl ListBonusPaymentsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListBonusPaymentsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"RequestError" => {
return RusotoError::Service(ListBonusPaymentsError::RequestError(err.msg))
}
"ServiceFault" => {
return RusotoError::Service(ListBonusPaymentsError::ServiceFault(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListBonusPaymentsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListBonusPaymentsError {
fn description(&self) -> &str {
match *self {
ListBonusPaymentsError::RequestError(ref cause) => cause,
ListBonusPaymentsError::ServiceFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListHITsError {
RequestError(String),
ServiceFault(String),
}
impl ListHITsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListHITsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"RequestError" => {
return RusotoError::Service(ListHITsError::RequestError(err.msg))
}
"ServiceFault" => {
return RusotoError::Service(ListHITsError::ServiceFault(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListHITsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListHITsError {
fn description(&self) -> &str {
match *self {
ListHITsError::RequestError(ref cause) => cause,
ListHITsError::ServiceFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListHITsForQualificationTypeError {
RequestError(String),
ServiceFault(String),
}
impl ListHITsForQualificationTypeError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<ListHITsForQualificationTypeError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"RequestError" => {
return RusotoError::Service(ListHITsForQualificationTypeError::RequestError(
err.msg,
))
}
"ServiceFault" => {
return RusotoError::Service(ListHITsForQualificationTypeError::ServiceFault(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListHITsForQualificationTypeError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListHITsForQualificationTypeError {
fn description(&self) -> &str {
match *self {
ListHITsForQualificationTypeError::RequestError(ref cause) => cause,
ListHITsForQualificationTypeError::ServiceFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListQualificationRequestsError {
RequestError(String),
ServiceFault(String),
}
impl ListQualificationRequestsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListQualificationRequestsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"RequestError" => {
return RusotoError::Service(ListQualificationRequestsError::RequestError(
err.msg,
))
}
"ServiceFault" => {
return RusotoError::Service(ListQualificationRequestsError::ServiceFault(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListQualificationRequestsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListQualificationRequestsError {
fn description(&self) -> &str {
match *self {
ListQualificationRequestsError::RequestError(ref cause) => cause,
ListQualificationRequestsError::ServiceFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListQualificationTypesError {
RequestError(String),
ServiceFault(String),
}
impl ListQualificationTypesError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListQualificationTypesError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"RequestError" => {
return RusotoError::Service(ListQualificationTypesError::RequestError(err.msg))
}
"ServiceFault" => {
return RusotoError::Service(ListQualificationTypesError::ServiceFault(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListQualificationTypesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListQualificationTypesError {
fn description(&self) -> &str {
match *self {
ListQualificationTypesError::RequestError(ref cause) => cause,
ListQualificationTypesError::ServiceFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListReviewPolicyResultsForHITError {
RequestError(String),
ServiceFault(String),
}
impl ListReviewPolicyResultsForHITError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<ListReviewPolicyResultsForHITError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"RequestError" => {
return RusotoError::Service(ListReviewPolicyResultsForHITError::RequestError(
err.msg,
))
}
"ServiceFault" => {
return RusotoError::Service(ListReviewPolicyResultsForHITError::ServiceFault(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListReviewPolicyResultsForHITError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListReviewPolicyResultsForHITError {
fn description(&self) -> &str {
match *self {
ListReviewPolicyResultsForHITError::RequestError(ref cause) => cause,
ListReviewPolicyResultsForHITError::ServiceFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListReviewableHITsError {
RequestError(String),
ServiceFault(String),
}
impl ListReviewableHITsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListReviewableHITsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"RequestError" => {
return RusotoError::Service(ListReviewableHITsError::RequestError(err.msg))
}
"ServiceFault" => {
return RusotoError::Service(ListReviewableHITsError::ServiceFault(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListReviewableHITsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListReviewableHITsError {
fn description(&self) -> &str {
match *self {
ListReviewableHITsError::RequestError(ref cause) => cause,
ListReviewableHITsError::ServiceFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListWorkerBlocksError {
RequestError(String),
ServiceFault(String),
}
impl ListWorkerBlocksError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListWorkerBlocksError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"RequestError" => {
return RusotoError::Service(ListWorkerBlocksError::RequestError(err.msg))
}
"ServiceFault" => {
return RusotoError::Service(ListWorkerBlocksError::ServiceFault(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListWorkerBlocksError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListWorkerBlocksError {
fn description(&self) -> &str {
match *self {
ListWorkerBlocksError::RequestError(ref cause) => cause,
ListWorkerBlocksError::ServiceFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListWorkersWithQualificationTypeError {
RequestError(String),
ServiceFault(String),
}
impl ListWorkersWithQualificationTypeError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<ListWorkersWithQualificationTypeError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"RequestError" => {
return RusotoError::Service(
ListWorkersWithQualificationTypeError::RequestError(err.msg),
)
}
"ServiceFault" => {
return RusotoError::Service(
ListWorkersWithQualificationTypeError::ServiceFault(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListWorkersWithQualificationTypeError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListWorkersWithQualificationTypeError {
fn description(&self) -> &str {
match *self {
ListWorkersWithQualificationTypeError::RequestError(ref cause) => cause,
ListWorkersWithQualificationTypeError::ServiceFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum NotifyWorkersError {
RequestError(String),
ServiceFault(String),
}
impl NotifyWorkersError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<NotifyWorkersError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"RequestError" => {
return RusotoError::Service(NotifyWorkersError::RequestError(err.msg))
}
"ServiceFault" => {
return RusotoError::Service(NotifyWorkersError::ServiceFault(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for NotifyWorkersError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for NotifyWorkersError {
fn description(&self) -> &str {
match *self {
NotifyWorkersError::RequestError(ref cause) => cause,
NotifyWorkersError::ServiceFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum RejectAssignmentError {
RequestError(String),
ServiceFault(String),
}
impl RejectAssignmentError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<RejectAssignmentError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"RequestError" => {
return RusotoError::Service(RejectAssignmentError::RequestError(err.msg))
}
"ServiceFault" => {
return RusotoError::Service(RejectAssignmentError::ServiceFault(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for RejectAssignmentError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for RejectAssignmentError {
fn description(&self) -> &str {
match *self {
RejectAssignmentError::RequestError(ref cause) => cause,
RejectAssignmentError::ServiceFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum RejectQualificationRequestError {
RequestError(String),
ServiceFault(String),
}
impl RejectQualificationRequestError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<RejectQualificationRequestError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"RequestError" => {
return RusotoError::Service(RejectQualificationRequestError::RequestError(
err.msg,
))
}
"ServiceFault" => {
return RusotoError::Service(RejectQualificationRequestError::ServiceFault(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for RejectQualificationRequestError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for RejectQualificationRequestError {
fn description(&self) -> &str {
match *self {
RejectQualificationRequestError::RequestError(ref cause) => cause,
RejectQualificationRequestError::ServiceFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum SendBonusError {
RequestError(String),
ServiceFault(String),
}
impl SendBonusError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<SendBonusError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"RequestError" => {
return RusotoError::Service(SendBonusError::RequestError(err.msg))
}
"ServiceFault" => {
return RusotoError::Service(SendBonusError::ServiceFault(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for SendBonusError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for SendBonusError {
fn description(&self) -> &str {
match *self {
SendBonusError::RequestError(ref cause) => cause,
SendBonusError::ServiceFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum SendTestEventNotificationError {
RequestError(String),
ServiceFault(String),
}
impl SendTestEventNotificationError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<SendTestEventNotificationError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"RequestError" => {
return RusotoError::Service(SendTestEventNotificationError::RequestError(
err.msg,
))
}
"ServiceFault" => {
return RusotoError::Service(SendTestEventNotificationError::ServiceFault(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for SendTestEventNotificationError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for SendTestEventNotificationError {
fn description(&self) -> &str {
match *self {
SendTestEventNotificationError::RequestError(ref cause) => cause,
SendTestEventNotificationError::ServiceFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateExpirationForHITError {
RequestError(String),
ServiceFault(String),
}
impl UpdateExpirationForHITError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateExpirationForHITError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"RequestError" => {
return RusotoError::Service(UpdateExpirationForHITError::RequestError(err.msg))
}
"ServiceFault" => {
return RusotoError::Service(UpdateExpirationForHITError::ServiceFault(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UpdateExpirationForHITError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateExpirationForHITError {
fn description(&self) -> &str {
match *self {
UpdateExpirationForHITError::RequestError(ref cause) => cause,
UpdateExpirationForHITError::ServiceFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateHITReviewStatusError {
RequestError(String),
ServiceFault(String),
}
impl UpdateHITReviewStatusError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateHITReviewStatusError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"RequestError" => {
return RusotoError::Service(UpdateHITReviewStatusError::RequestError(err.msg))
}
"ServiceFault" => {
return RusotoError::Service(UpdateHITReviewStatusError::ServiceFault(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UpdateHITReviewStatusError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateHITReviewStatusError {
fn description(&self) -> &str {
match *self {
UpdateHITReviewStatusError::RequestError(ref cause) => cause,
UpdateHITReviewStatusError::ServiceFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateHITTypeOfHITError {
RequestError(String),
ServiceFault(String),
}
impl UpdateHITTypeOfHITError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateHITTypeOfHITError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"RequestError" => {
return RusotoError::Service(UpdateHITTypeOfHITError::RequestError(err.msg))
}
"ServiceFault" => {
return RusotoError::Service(UpdateHITTypeOfHITError::ServiceFault(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UpdateHITTypeOfHITError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateHITTypeOfHITError {
fn description(&self) -> &str {
match *self {
UpdateHITTypeOfHITError::RequestError(ref cause) => cause,
UpdateHITTypeOfHITError::ServiceFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateNotificationSettingsError {
RequestError(String),
ServiceFault(String),
}
impl UpdateNotificationSettingsError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<UpdateNotificationSettingsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"RequestError" => {
return RusotoError::Service(UpdateNotificationSettingsError::RequestError(
err.msg,
))
}
"ServiceFault" => {
return RusotoError::Service(UpdateNotificationSettingsError::ServiceFault(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UpdateNotificationSettingsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateNotificationSettingsError {
fn description(&self) -> &str {
match *self {
UpdateNotificationSettingsError::RequestError(ref cause) => cause,
UpdateNotificationSettingsError::ServiceFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateQualificationTypeError {
RequestError(String),
ServiceFault(String),
}
impl UpdateQualificationTypeError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateQualificationTypeError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"RequestError" => {
return RusotoError::Service(UpdateQualificationTypeError::RequestError(
err.msg,
))
}
"ServiceFault" => {
return RusotoError::Service(UpdateQualificationTypeError::ServiceFault(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UpdateQualificationTypeError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateQualificationTypeError {
fn description(&self) -> &str {
match *self {
UpdateQualificationTypeError::RequestError(ref cause) => cause,
UpdateQualificationTypeError::ServiceFault(ref cause) => cause,
}
}
}
pub trait MechanicalTurk {
fn accept_qualification_request(
&self,
input: AcceptQualificationRequestRequest,
) -> RusotoFuture<AcceptQualificationRequestResponse, AcceptQualificationRequestError>;
fn approve_assignment(
&self,
input: ApproveAssignmentRequest,
) -> RusotoFuture<ApproveAssignmentResponse, ApproveAssignmentError>;
fn associate_qualification_with_worker(
&self,
input: AssociateQualificationWithWorkerRequest,
) -> RusotoFuture<AssociateQualificationWithWorkerResponse, AssociateQualificationWithWorkerError>;
fn create_additional_assignments_for_hit(
&self,
input: CreateAdditionalAssignmentsForHITRequest,
) -> RusotoFuture<
CreateAdditionalAssignmentsForHITResponse,
CreateAdditionalAssignmentsForHITError,
>;
fn create_hit(
&self,
input: CreateHITRequest,
) -> RusotoFuture<CreateHITResponse, CreateHITError>;
fn create_hit_type(
&self,
input: CreateHITTypeRequest,
) -> RusotoFuture<CreateHITTypeResponse, CreateHITTypeError>;
fn create_hit_with_hit_type(
&self,
input: CreateHITWithHITTypeRequest,
) -> RusotoFuture<CreateHITWithHITTypeResponse, CreateHITWithHITTypeError>;
fn create_qualification_type(
&self,
input: CreateQualificationTypeRequest,
) -> RusotoFuture<CreateQualificationTypeResponse, CreateQualificationTypeError>;
fn create_worker_block(
&self,
input: CreateWorkerBlockRequest,
) -> RusotoFuture<CreateWorkerBlockResponse, CreateWorkerBlockError>;
fn delete_hit(
&self,
input: DeleteHITRequest,
) -> RusotoFuture<DeleteHITResponse, DeleteHITError>;
fn delete_qualification_type(
&self,
input: DeleteQualificationTypeRequest,
) -> RusotoFuture<DeleteQualificationTypeResponse, DeleteQualificationTypeError>;
fn delete_worker_block(
&self,
input: DeleteWorkerBlockRequest,
) -> RusotoFuture<DeleteWorkerBlockResponse, DeleteWorkerBlockError>;
fn disassociate_qualification_from_worker(
&self,
input: DisassociateQualificationFromWorkerRequest,
) -> RusotoFuture<
DisassociateQualificationFromWorkerResponse,
DisassociateQualificationFromWorkerError,
>;
fn get_account_balance(
&self,
) -> RusotoFuture<GetAccountBalanceResponse, GetAccountBalanceError>;
fn get_assignment(
&self,
input: GetAssignmentRequest,
) -> RusotoFuture<GetAssignmentResponse, GetAssignmentError>;
fn get_file_upload_url(
&self,
input: GetFileUploadURLRequest,
) -> RusotoFuture<GetFileUploadURLResponse, GetFileUploadURLError>;
fn get_hit(&self, input: GetHITRequest) -> RusotoFuture<GetHITResponse, GetHITError>;
fn get_qualification_score(
&self,
input: GetQualificationScoreRequest,
) -> RusotoFuture<GetQualificationScoreResponse, GetQualificationScoreError>;
fn get_qualification_type(
&self,
input: GetQualificationTypeRequest,
) -> RusotoFuture<GetQualificationTypeResponse, GetQualificationTypeError>;
fn list_assignments_for_hit(
&self,
input: ListAssignmentsForHITRequest,
) -> RusotoFuture<ListAssignmentsForHITResponse, ListAssignmentsForHITError>;
fn list_bonus_payments(
&self,
input: ListBonusPaymentsRequest,
) -> RusotoFuture<ListBonusPaymentsResponse, ListBonusPaymentsError>;
fn list_hi_ts(&self, input: ListHITsRequest) -> RusotoFuture<ListHITsResponse, ListHITsError>;
fn list_hi_ts_for_qualification_type(
&self,
input: ListHITsForQualificationTypeRequest,
) -> RusotoFuture<ListHITsForQualificationTypeResponse, ListHITsForQualificationTypeError>;
fn list_qualification_requests(
&self,
input: ListQualificationRequestsRequest,
) -> RusotoFuture<ListQualificationRequestsResponse, ListQualificationRequestsError>;
fn list_qualification_types(
&self,
input: ListQualificationTypesRequest,
) -> RusotoFuture<ListQualificationTypesResponse, ListQualificationTypesError>;
fn list_review_policy_results_for_hit(
&self,
input: ListReviewPolicyResultsForHITRequest,
) -> RusotoFuture<ListReviewPolicyResultsForHITResponse, ListReviewPolicyResultsForHITError>;
fn list_reviewable_hi_ts(
&self,
input: ListReviewableHITsRequest,
) -> RusotoFuture<ListReviewableHITsResponse, ListReviewableHITsError>;
fn list_worker_blocks(
&self,
input: ListWorkerBlocksRequest,
) -> RusotoFuture<ListWorkerBlocksResponse, ListWorkerBlocksError>;
fn list_workers_with_qualification_type(
&self,
input: ListWorkersWithQualificationTypeRequest,
) -> RusotoFuture<ListWorkersWithQualificationTypeResponse, ListWorkersWithQualificationTypeError>;
fn notify_workers(
&self,
input: NotifyWorkersRequest,
) -> RusotoFuture<NotifyWorkersResponse, NotifyWorkersError>;
fn reject_assignment(
&self,
input: RejectAssignmentRequest,
) -> RusotoFuture<RejectAssignmentResponse, RejectAssignmentError>;
fn reject_qualification_request(
&self,
input: RejectQualificationRequestRequest,
) -> RusotoFuture<RejectQualificationRequestResponse, RejectQualificationRequestError>;
fn send_bonus(
&self,
input: SendBonusRequest,
) -> RusotoFuture<SendBonusResponse, SendBonusError>;
fn send_test_event_notification(
&self,
input: SendTestEventNotificationRequest,
) -> RusotoFuture<SendTestEventNotificationResponse, SendTestEventNotificationError>;
fn update_expiration_for_hit(
&self,
input: UpdateExpirationForHITRequest,
) -> RusotoFuture<UpdateExpirationForHITResponse, UpdateExpirationForHITError>;
fn update_hit_review_status(
&self,
input: UpdateHITReviewStatusRequest,
) -> RusotoFuture<UpdateHITReviewStatusResponse, UpdateHITReviewStatusError>;
fn update_hit_type_of_hit(
&self,
input: UpdateHITTypeOfHITRequest,
) -> RusotoFuture<UpdateHITTypeOfHITResponse, UpdateHITTypeOfHITError>;
fn update_notification_settings(
&self,
input: UpdateNotificationSettingsRequest,
) -> RusotoFuture<UpdateNotificationSettingsResponse, UpdateNotificationSettingsError>;
fn update_qualification_type(
&self,
input: UpdateQualificationTypeRequest,
) -> RusotoFuture<UpdateQualificationTypeResponse, UpdateQualificationTypeError>;
}
#[derive(Clone)]
pub struct MechanicalTurkClient {
client: Client,
region: region::Region,
}
impl MechanicalTurkClient {
pub fn new(region: region::Region) -> MechanicalTurkClient {
MechanicalTurkClient {
client: Client::shared(),
region,
}
}
pub fn new_with<P, D>(
request_dispatcher: D,
credentials_provider: P,
region: region::Region,
) -> MechanicalTurkClient
where
P: ProvideAwsCredentials + Send + Sync + 'static,
P::Future: Send,
D: DispatchSignedRequest + Send + Sync + 'static,
D::Future: Send,
{
MechanicalTurkClient {
client: Client::new_with(credentials_provider, request_dispatcher),
region,
}
}
}
impl MechanicalTurk for MechanicalTurkClient {
fn accept_qualification_request(
&self,
input: AcceptQualificationRequestRequest,
) -> RusotoFuture<AcceptQualificationRequestResponse, AcceptQualificationRequestError> {
let mut request = SignedRequest::new("POST", "mturk-requester", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"MTurkRequesterServiceV20170117.AcceptQualificationRequest",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<AcceptQualificationRequestResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(AcceptQualificationRequestError::from_response(response))
}))
}
})
}
fn approve_assignment(
&self,
input: ApproveAssignmentRequest,
) -> RusotoFuture<ApproveAssignmentResponse, ApproveAssignmentError> {
let mut request = SignedRequest::new("POST", "mturk-requester", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"MTurkRequesterServiceV20170117.ApproveAssignment",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<ApproveAssignmentResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ApproveAssignmentError::from_response(response))),
)
}
})
}
fn associate_qualification_with_worker(
&self,
input: AssociateQualificationWithWorkerRequest,
) -> RusotoFuture<AssociateQualificationWithWorkerResponse, AssociateQualificationWithWorkerError>
{
let mut request = SignedRequest::new("POST", "mturk-requester", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"MTurkRequesterServiceV20170117.AssociateQualificationWithWorker",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<AssociateQualificationWithWorkerResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(AssociateQualificationWithWorkerError::from_response(
response,
))
}))
}
})
}
fn create_additional_assignments_for_hit(
&self,
input: CreateAdditionalAssignmentsForHITRequest,
) -> RusotoFuture<
CreateAdditionalAssignmentsForHITResponse,
CreateAdditionalAssignmentsForHITError,
> {
let mut request = SignedRequest::new("POST", "mturk-requester", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"MTurkRequesterServiceV20170117.CreateAdditionalAssignmentsForHIT",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<CreateAdditionalAssignmentsForHITResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(CreateAdditionalAssignmentsForHITError::from_response(
response,
))
}))
}
})
}
fn create_hit(
&self,
input: CreateHITRequest,
) -> RusotoFuture<CreateHITResponse, CreateHITError> {
let mut request = SignedRequest::new("POST", "mturk-requester", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "MTurkRequesterServiceV20170117.CreateHIT");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<CreateHITResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateHITError::from_response(response))),
)
}
})
}
fn create_hit_type(
&self,
input: CreateHITTypeRequest,
) -> RusotoFuture<CreateHITTypeResponse, CreateHITTypeError> {
let mut request = SignedRequest::new("POST", "mturk-requester", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"MTurkRequesterServiceV20170117.CreateHITType",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<CreateHITTypeResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateHITTypeError::from_response(response))),
)
}
})
}
fn create_hit_with_hit_type(
&self,
input: CreateHITWithHITTypeRequest,
) -> RusotoFuture<CreateHITWithHITTypeResponse, CreateHITWithHITTypeError> {
let mut request = SignedRequest::new("POST", "mturk-requester", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"MTurkRequesterServiceV20170117.CreateHITWithHITType",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<CreateHITWithHITTypeResponse, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(CreateHITWithHITTypeError::from_response(response))
}),
)
}
})
}
fn create_qualification_type(
&self,
input: CreateQualificationTypeRequest,
) -> RusotoFuture<CreateQualificationTypeResponse, CreateQualificationTypeError> {
let mut request = SignedRequest::new("POST", "mturk-requester", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"MTurkRequesterServiceV20170117.CreateQualificationType",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<CreateQualificationTypeResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(CreateQualificationTypeError::from_response(response))
}))
}
})
}
fn create_worker_block(
&self,
input: CreateWorkerBlockRequest,
) -> RusotoFuture<CreateWorkerBlockResponse, CreateWorkerBlockError> {
let mut request = SignedRequest::new("POST", "mturk-requester", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"MTurkRequesterServiceV20170117.CreateWorkerBlock",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<CreateWorkerBlockResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateWorkerBlockError::from_response(response))),
)
}
})
}
fn delete_hit(
&self,
input: DeleteHITRequest,
) -> RusotoFuture<DeleteHITResponse, DeleteHITError> {
let mut request = SignedRequest::new("POST", "mturk-requester", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "MTurkRequesterServiceV20170117.DeleteHIT");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DeleteHITResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteHITError::from_response(response))),
)
}
})
}
fn delete_qualification_type(
&self,
input: DeleteQualificationTypeRequest,
) -> RusotoFuture<DeleteQualificationTypeResponse, DeleteQualificationTypeError> {
let mut request = SignedRequest::new("POST", "mturk-requester", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"MTurkRequesterServiceV20170117.DeleteQualificationType",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DeleteQualificationTypeResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DeleteQualificationTypeError::from_response(response))
}))
}
})
}
fn delete_worker_block(
&self,
input: DeleteWorkerBlockRequest,
) -> RusotoFuture<DeleteWorkerBlockResponse, DeleteWorkerBlockError> {
let mut request = SignedRequest::new("POST", "mturk-requester", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"MTurkRequesterServiceV20170117.DeleteWorkerBlock",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DeleteWorkerBlockResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteWorkerBlockError::from_response(response))),
)
}
})
}
fn disassociate_qualification_from_worker(
&self,
input: DisassociateQualificationFromWorkerRequest,
) -> RusotoFuture<
DisassociateQualificationFromWorkerResponse,
DisassociateQualificationFromWorkerError,
> {
let mut request = SignedRequest::new("POST", "mturk-requester", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"MTurkRequesterServiceV20170117.DisassociateQualificationFromWorker",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DisassociateQualificationFromWorkerResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DisassociateQualificationFromWorkerError::from_response(
response,
))
}))
}
})
}
fn get_account_balance(
&self,
) -> RusotoFuture<GetAccountBalanceResponse, GetAccountBalanceError> {
let mut request = SignedRequest::new("POST", "mturk-requester", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"MTurkRequesterServiceV20170117.GetAccountBalance",
);
request.set_payload(Some(bytes::Bytes::from_static(b"{}")));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<GetAccountBalanceResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetAccountBalanceError::from_response(response))),
)
}
})
}
fn get_assignment(
&self,
input: GetAssignmentRequest,
) -> RusotoFuture<GetAssignmentResponse, GetAssignmentError> {
let mut request = SignedRequest::new("POST", "mturk-requester", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"MTurkRequesterServiceV20170117.GetAssignment",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<GetAssignmentResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetAssignmentError::from_response(response))),
)
}
})
}
fn get_file_upload_url(
&self,
input: GetFileUploadURLRequest,
) -> RusotoFuture<GetFileUploadURLResponse, GetFileUploadURLError> {
let mut request = SignedRequest::new("POST", "mturk-requester", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"MTurkRequesterServiceV20170117.GetFileUploadURL",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<GetFileUploadURLResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetFileUploadURLError::from_response(response))),
)
}
})
}
fn get_hit(&self, input: GetHITRequest) -> RusotoFuture<GetHITResponse, GetHITError> {
let mut request = SignedRequest::new("POST", "mturk-requester", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "MTurkRequesterServiceV20170117.GetHIT");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response).deserialize::<GetHITResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetHITError::from_response(response))),
)
}
})
}
fn get_qualification_score(
&self,
input: GetQualificationScoreRequest,
) -> RusotoFuture<GetQualificationScoreResponse, GetQualificationScoreError> {
let mut request = SignedRequest::new("POST", "mturk-requester", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"MTurkRequesterServiceV20170117.GetQualificationScore",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<GetQualificationScoreResponse, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(GetQualificationScoreError::from_response(response))
}),
)
}
})
}
fn get_qualification_type(
&self,
input: GetQualificationTypeRequest,
) -> RusotoFuture<GetQualificationTypeResponse, GetQualificationTypeError> {
let mut request = SignedRequest::new("POST", "mturk-requester", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"MTurkRequesterServiceV20170117.GetQualificationType",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<GetQualificationTypeResponse, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(GetQualificationTypeError::from_response(response))
}),
)
}
})
}
fn list_assignments_for_hit(
&self,
input: ListAssignmentsForHITRequest,
) -> RusotoFuture<ListAssignmentsForHITResponse, ListAssignmentsForHITError> {
let mut request = SignedRequest::new("POST", "mturk-requester", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"MTurkRequesterServiceV20170117.ListAssignmentsForHIT",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<ListAssignmentsForHITResponse, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(ListAssignmentsForHITError::from_response(response))
}),
)
}
})
}
fn list_bonus_payments(
&self,
input: ListBonusPaymentsRequest,
) -> RusotoFuture<ListBonusPaymentsResponse, ListBonusPaymentsError> {
let mut request = SignedRequest::new("POST", "mturk-requester", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"MTurkRequesterServiceV20170117.ListBonusPayments",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<ListBonusPaymentsResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListBonusPaymentsError::from_response(response))),
)
}
})
}
fn list_hi_ts(&self, input: ListHITsRequest) -> RusotoFuture<ListHITsResponse, ListHITsError> {
let mut request = SignedRequest::new("POST", "mturk-requester", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "MTurkRequesterServiceV20170117.ListHITs");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<ListHITsResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListHITsError::from_response(response))),
)
}
})
}
fn list_hi_ts_for_qualification_type(
&self,
input: ListHITsForQualificationTypeRequest,
) -> RusotoFuture<ListHITsForQualificationTypeResponse, ListHITsForQualificationTypeError> {
let mut request = SignedRequest::new("POST", "mturk-requester", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"MTurkRequesterServiceV20170117.ListHITsForQualificationType",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<ListHITsForQualificationTypeResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(ListHITsForQualificationTypeError::from_response(response))
}))
}
})
}
fn list_qualification_requests(
&self,
input: ListQualificationRequestsRequest,
) -> RusotoFuture<ListQualificationRequestsResponse, ListQualificationRequestsError> {
let mut request = SignedRequest::new("POST", "mturk-requester", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"MTurkRequesterServiceV20170117.ListQualificationRequests",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<ListQualificationRequestsResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(ListQualificationRequestsError::from_response(response))
}))
}
})
}
fn list_qualification_types(
&self,
input: ListQualificationTypesRequest,
) -> RusotoFuture<ListQualificationTypesResponse, ListQualificationTypesError> {
let mut request = SignedRequest::new("POST", "mturk-requester", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"MTurkRequesterServiceV20170117.ListQualificationTypes",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<ListQualificationTypesResponse, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(ListQualificationTypesError::from_response(response))
}),
)
}
})
}
fn list_review_policy_results_for_hit(
&self,
input: ListReviewPolicyResultsForHITRequest,
) -> RusotoFuture<ListReviewPolicyResultsForHITResponse, ListReviewPolicyResultsForHITError>
{
let mut request = SignedRequest::new("POST", "mturk-requester", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"MTurkRequesterServiceV20170117.ListReviewPolicyResultsForHIT",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<ListReviewPolicyResultsForHITResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(ListReviewPolicyResultsForHITError::from_response(response))
}))
}
})
}
fn list_reviewable_hi_ts(
&self,
input: ListReviewableHITsRequest,
) -> RusotoFuture<ListReviewableHITsResponse, ListReviewableHITsError> {
let mut request = SignedRequest::new("POST", "mturk-requester", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"MTurkRequesterServiceV20170117.ListReviewableHITs",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<ListReviewableHITsResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListReviewableHITsError::from_response(response))),
)
}
})
}
fn list_worker_blocks(
&self,
input: ListWorkerBlocksRequest,
) -> RusotoFuture<ListWorkerBlocksResponse, ListWorkerBlocksError> {
let mut request = SignedRequest::new("POST", "mturk-requester", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"MTurkRequesterServiceV20170117.ListWorkerBlocks",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<ListWorkerBlocksResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListWorkerBlocksError::from_response(response))),
)
}
})
}
fn list_workers_with_qualification_type(
&self,
input: ListWorkersWithQualificationTypeRequest,
) -> RusotoFuture<ListWorkersWithQualificationTypeResponse, ListWorkersWithQualificationTypeError>
{
let mut request = SignedRequest::new("POST", "mturk-requester", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"MTurkRequesterServiceV20170117.ListWorkersWithQualificationType",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<ListWorkersWithQualificationTypeResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(ListWorkersWithQualificationTypeError::from_response(
response,
))
}))
}
})
}
fn notify_workers(
&self,
input: NotifyWorkersRequest,
) -> RusotoFuture<NotifyWorkersResponse, NotifyWorkersError> {
let mut request = SignedRequest::new("POST", "mturk-requester", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"MTurkRequesterServiceV20170117.NotifyWorkers",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<NotifyWorkersResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(NotifyWorkersError::from_response(response))),
)
}
})
}
fn reject_assignment(
&self,
input: RejectAssignmentRequest,
) -> RusotoFuture<RejectAssignmentResponse, RejectAssignmentError> {
let mut request = SignedRequest::new("POST", "mturk-requester", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"MTurkRequesterServiceV20170117.RejectAssignment",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<RejectAssignmentResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(RejectAssignmentError::from_response(response))),
)
}
})
}
fn reject_qualification_request(
&self,
input: RejectQualificationRequestRequest,
) -> RusotoFuture<RejectQualificationRequestResponse, RejectQualificationRequestError> {
let mut request = SignedRequest::new("POST", "mturk-requester", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"MTurkRequesterServiceV20170117.RejectQualificationRequest",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<RejectQualificationRequestResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(RejectQualificationRequestError::from_response(response))
}))
}
})
}
fn send_bonus(
&self,
input: SendBonusRequest,
) -> RusotoFuture<SendBonusResponse, SendBonusError> {
let mut request = SignedRequest::new("POST", "mturk-requester", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "MTurkRequesterServiceV20170117.SendBonus");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<SendBonusResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(SendBonusError::from_response(response))),
)
}
})
}
fn send_test_event_notification(
&self,
input: SendTestEventNotificationRequest,
) -> RusotoFuture<SendTestEventNotificationResponse, SendTestEventNotificationError> {
let mut request = SignedRequest::new("POST", "mturk-requester", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"MTurkRequesterServiceV20170117.SendTestEventNotification",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<SendTestEventNotificationResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(SendTestEventNotificationError::from_response(response))
}))
}
})
}
fn update_expiration_for_hit(
&self,
input: UpdateExpirationForHITRequest,
) -> RusotoFuture<UpdateExpirationForHITResponse, UpdateExpirationForHITError> {
let mut request = SignedRequest::new("POST", "mturk-requester", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"MTurkRequesterServiceV20170117.UpdateExpirationForHIT",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<UpdateExpirationForHITResponse, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(UpdateExpirationForHITError::from_response(response))
}),
)
}
})
}
fn update_hit_review_status(
&self,
input: UpdateHITReviewStatusRequest,
) -> RusotoFuture<UpdateHITReviewStatusResponse, UpdateHITReviewStatusError> {
let mut request = SignedRequest::new("POST", "mturk-requester", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"MTurkRequesterServiceV20170117.UpdateHITReviewStatus",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<UpdateHITReviewStatusResponse, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(UpdateHITReviewStatusError::from_response(response))
}),
)
}
})
}
fn update_hit_type_of_hit(
&self,
input: UpdateHITTypeOfHITRequest,
) -> RusotoFuture<UpdateHITTypeOfHITResponse, UpdateHITTypeOfHITError> {
let mut request = SignedRequest::new("POST", "mturk-requester", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"MTurkRequesterServiceV20170117.UpdateHITTypeOfHIT",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<UpdateHITTypeOfHITResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(UpdateHITTypeOfHITError::from_response(response))),
)
}
})
}
fn update_notification_settings(
&self,
input: UpdateNotificationSettingsRequest,
) -> RusotoFuture<UpdateNotificationSettingsResponse, UpdateNotificationSettingsError> {
let mut request = SignedRequest::new("POST", "mturk-requester", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"MTurkRequesterServiceV20170117.UpdateNotificationSettings",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<UpdateNotificationSettingsResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(UpdateNotificationSettingsError::from_response(response))
}))
}
})
}
fn update_qualification_type(
&self,
input: UpdateQualificationTypeRequest,
) -> RusotoFuture<UpdateQualificationTypeResponse, UpdateQualificationTypeError> {
let mut request = SignedRequest::new("POST", "mturk-requester", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"MTurkRequesterServiceV20170117.UpdateQualificationType",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<UpdateQualificationTypeResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(UpdateQualificationTypeError::from_response(response))
}))
}
})
}
}