use std::error::Error;
use std::fmt;
use std::io;
#[allow(warnings)]
use futures::future;
use futures::Future;
use rusoto_core::region;
use rusoto_core::request::{BufferedHttpResponse, DispatchSignedRequest};
use rusoto_core::{Client, RusotoFuture};
use rusoto_core::credential::{CredentialsError, ProvideAwsCredentials};
use rusoto_core::request::HttpDispatchError;
use rusoto_core::signature::SignedRequest;
use serde_json;
use serde_json::from_slice;
use serde_json::Value as SerdeJsonValue;
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct AddTagsInput {
#[serde(rename = "ResourceArn")]
pub resource_arn: String,
#[serde(rename = "Tags")]
pub tags: Vec<Tag>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct AddTagsOutput {
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct AlgorithmSpecification {
#[serde(rename = "AlgorithmName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub algorithm_name: Option<String>,
#[serde(rename = "MetricDefinitions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub metric_definitions: Option<Vec<MetricDefinition>>,
#[serde(rename = "TrainingImage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub training_image: Option<String>,
#[serde(rename = "TrainingInputMode")]
pub training_input_mode: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct AlgorithmStatusDetails {
#[serde(rename = "ImageScanStatuses")]
#[serde(skip_serializing_if = "Option::is_none")]
pub image_scan_statuses: Option<Vec<AlgorithmStatusItem>>,
#[serde(rename = "ValidationStatuses")]
#[serde(skip_serializing_if = "Option::is_none")]
pub validation_statuses: Option<Vec<AlgorithmStatusItem>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct AlgorithmStatusItem {
#[serde(rename = "FailureReason")]
#[serde(skip_serializing_if = "Option::is_none")]
pub failure_reason: Option<String>,
#[serde(rename = "Name")]
pub name: String,
#[serde(rename = "Status")]
pub status: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct AlgorithmSummary {
#[serde(rename = "AlgorithmArn")]
pub algorithm_arn: String,
#[serde(rename = "AlgorithmDescription")]
#[serde(skip_serializing_if = "Option::is_none")]
pub algorithm_description: Option<String>,
#[serde(rename = "AlgorithmName")]
pub algorithm_name: String,
#[serde(rename = "AlgorithmStatus")]
pub algorithm_status: String,
#[serde(rename = "CreationTime")]
pub creation_time: f64,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct AlgorithmValidationProfile {
#[serde(rename = "ProfileName")]
pub profile_name: String,
#[serde(rename = "TrainingJobDefinition")]
pub training_job_definition: TrainingJobDefinition,
#[serde(rename = "TransformJobDefinition")]
#[serde(skip_serializing_if = "Option::is_none")]
pub transform_job_definition: Option<TransformJobDefinition>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct AlgorithmValidationSpecification {
#[serde(rename = "ValidationProfiles")]
pub validation_profiles: Vec<AlgorithmValidationProfile>,
#[serde(rename = "ValidationRole")]
pub validation_role: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct AnnotationConsolidationConfig {
#[serde(rename = "AnnotationConsolidationLambdaArn")]
pub annotation_consolidation_lambda_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct CategoricalParameterRange {
#[serde(rename = "Name")]
pub name: String,
#[serde(rename = "Values")]
pub values: Vec<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct CategoricalParameterRangeSpecification {
#[serde(rename = "Values")]
pub values: Vec<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Channel {
#[serde(rename = "ChannelName")]
pub channel_name: String,
#[serde(rename = "CompressionType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub compression_type: Option<String>,
#[serde(rename = "ContentType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub content_type: Option<String>,
#[serde(rename = "DataSource")]
pub data_source: DataSource,
#[serde(rename = "InputMode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub input_mode: Option<String>,
#[serde(rename = "RecordWrapperType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub record_wrapper_type: Option<String>,
#[serde(rename = "ShuffleConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub shuffle_config: Option<ShuffleConfig>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ChannelSpecification {
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "IsRequired")]
#[serde(skip_serializing_if = "Option::is_none")]
pub is_required: Option<bool>,
#[serde(rename = "Name")]
pub name: String,
#[serde(rename = "SupportedCompressionTypes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub supported_compression_types: Option<Vec<String>>,
#[serde(rename = "SupportedContentTypes")]
pub supported_content_types: Vec<String>,
#[serde(rename = "SupportedInputModes")]
pub supported_input_modes: Vec<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CodeRepositorySummary {
#[serde(rename = "CodeRepositoryArn")]
pub code_repository_arn: String,
#[serde(rename = "CodeRepositoryName")]
pub code_repository_name: String,
#[serde(rename = "CreationTime")]
pub creation_time: f64,
#[serde(rename = "GitConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub git_config: Option<GitConfig>,
#[serde(rename = "LastModifiedTime")]
pub last_modified_time: f64,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct CognitoMemberDefinition {
#[serde(rename = "ClientId")]
pub client_id: String,
#[serde(rename = "UserGroup")]
pub user_group: String,
#[serde(rename = "UserPool")]
pub user_pool: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CompilationJobSummary {
#[serde(rename = "CompilationEndTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub compilation_end_time: Option<f64>,
#[serde(rename = "CompilationJobArn")]
pub compilation_job_arn: String,
#[serde(rename = "CompilationJobName")]
pub compilation_job_name: String,
#[serde(rename = "CompilationJobStatus")]
pub compilation_job_status: String,
#[serde(rename = "CompilationStartTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub compilation_start_time: Option<f64>,
#[serde(rename = "CompilationTargetDevice")]
pub compilation_target_device: String,
#[serde(rename = "CreationTime")]
pub creation_time: f64,
#[serde(rename = "LastModifiedTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_modified_time: Option<f64>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ContainerDefinition {
#[serde(rename = "ContainerHostname")]
#[serde(skip_serializing_if = "Option::is_none")]
pub container_hostname: Option<String>,
#[serde(rename = "Environment")]
#[serde(skip_serializing_if = "Option::is_none")]
pub environment: Option<::std::collections::HashMap<String, String>>,
#[serde(rename = "Image")]
#[serde(skip_serializing_if = "Option::is_none")]
pub image: Option<String>,
#[serde(rename = "ModelDataUrl")]
#[serde(skip_serializing_if = "Option::is_none")]
pub model_data_url: Option<String>,
#[serde(rename = "ModelPackageName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub model_package_name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ContinuousParameterRange {
#[serde(rename = "MaxValue")]
pub max_value: String,
#[serde(rename = "MinValue")]
pub min_value: String,
#[serde(rename = "Name")]
pub name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ContinuousParameterRangeSpecification {
#[serde(rename = "MaxValue")]
pub max_value: String,
#[serde(rename = "MinValue")]
pub min_value: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateAlgorithmInput {
#[serde(rename = "AlgorithmDescription")]
#[serde(skip_serializing_if = "Option::is_none")]
pub algorithm_description: Option<String>,
#[serde(rename = "AlgorithmName")]
pub algorithm_name: String,
#[serde(rename = "CertifyForMarketplace")]
#[serde(skip_serializing_if = "Option::is_none")]
pub certify_for_marketplace: Option<bool>,
#[serde(rename = "InferenceSpecification")]
#[serde(skip_serializing_if = "Option::is_none")]
pub inference_specification: Option<InferenceSpecification>,
#[serde(rename = "TrainingSpecification")]
pub training_specification: TrainingSpecification,
#[serde(rename = "ValidationSpecification")]
#[serde(skip_serializing_if = "Option::is_none")]
pub validation_specification: Option<AlgorithmValidationSpecification>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateAlgorithmOutput {
#[serde(rename = "AlgorithmArn")]
pub algorithm_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateCodeRepositoryInput {
#[serde(rename = "CodeRepositoryName")]
pub code_repository_name: String,
#[serde(rename = "GitConfig")]
pub git_config: GitConfig,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateCodeRepositoryOutput {
#[serde(rename = "CodeRepositoryArn")]
pub code_repository_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateCompilationJobRequest {
#[serde(rename = "CompilationJobName")]
pub compilation_job_name: String,
#[serde(rename = "InputConfig")]
pub input_config: InputConfig,
#[serde(rename = "OutputConfig")]
pub output_config: OutputConfig,
#[serde(rename = "RoleArn")]
pub role_arn: String,
#[serde(rename = "StoppingCondition")]
pub stopping_condition: StoppingCondition,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateCompilationJobResponse {
#[serde(rename = "CompilationJobArn")]
pub compilation_job_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateEndpointConfigInput {
#[serde(rename = "EndpointConfigName")]
pub endpoint_config_name: String,
#[serde(rename = "KmsKeyId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub kms_key_id: Option<String>,
#[serde(rename = "ProductionVariants")]
pub production_variants: Vec<ProductionVariant>,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateEndpointConfigOutput {
#[serde(rename = "EndpointConfigArn")]
pub endpoint_config_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateEndpointInput {
#[serde(rename = "EndpointConfigName")]
pub endpoint_config_name: String,
#[serde(rename = "EndpointName")]
pub endpoint_name: String,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateEndpointOutput {
#[serde(rename = "EndpointArn")]
pub endpoint_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateHyperParameterTuningJobRequest {
#[serde(rename = "HyperParameterTuningJobConfig")]
pub hyper_parameter_tuning_job_config: HyperParameterTuningJobConfig,
#[serde(rename = "HyperParameterTuningJobName")]
pub hyper_parameter_tuning_job_name: String,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
#[serde(rename = "TrainingJobDefinition")]
pub training_job_definition: HyperParameterTrainingJobDefinition,
#[serde(rename = "WarmStartConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub warm_start_config: Option<HyperParameterTuningJobWarmStartConfig>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateHyperParameterTuningJobResponse {
#[serde(rename = "HyperParameterTuningJobArn")]
pub hyper_parameter_tuning_job_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateLabelingJobRequest {
#[serde(rename = "HumanTaskConfig")]
pub human_task_config: HumanTaskConfig,
#[serde(rename = "InputConfig")]
pub input_config: LabelingJobInputConfig,
#[serde(rename = "LabelAttributeName")]
pub label_attribute_name: String,
#[serde(rename = "LabelCategoryConfigS3Uri")]
#[serde(skip_serializing_if = "Option::is_none")]
pub label_category_config_s3_uri: Option<String>,
#[serde(rename = "LabelingJobAlgorithmsConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub labeling_job_algorithms_config: Option<LabelingJobAlgorithmsConfig>,
#[serde(rename = "LabelingJobName")]
pub labeling_job_name: String,
#[serde(rename = "OutputConfig")]
pub output_config: LabelingJobOutputConfig,
#[serde(rename = "RoleArn")]
pub role_arn: String,
#[serde(rename = "StoppingConditions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub stopping_conditions: Option<LabelingJobStoppingConditions>,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateLabelingJobResponse {
#[serde(rename = "LabelingJobArn")]
pub labeling_job_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateModelInput {
#[serde(rename = "Containers")]
#[serde(skip_serializing_if = "Option::is_none")]
pub containers: Option<Vec<ContainerDefinition>>,
#[serde(rename = "EnableNetworkIsolation")]
#[serde(skip_serializing_if = "Option::is_none")]
pub enable_network_isolation: Option<bool>,
#[serde(rename = "ExecutionRoleArn")]
pub execution_role_arn: String,
#[serde(rename = "ModelName")]
pub model_name: String,
#[serde(rename = "PrimaryContainer")]
#[serde(skip_serializing_if = "Option::is_none")]
pub primary_container: Option<ContainerDefinition>,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
#[serde(rename = "VpcConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub vpc_config: Option<VpcConfig>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateModelOutput {
#[serde(rename = "ModelArn")]
pub model_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateModelPackageInput {
#[serde(rename = "CertifyForMarketplace")]
#[serde(skip_serializing_if = "Option::is_none")]
pub certify_for_marketplace: Option<bool>,
#[serde(rename = "InferenceSpecification")]
#[serde(skip_serializing_if = "Option::is_none")]
pub inference_specification: Option<InferenceSpecification>,
#[serde(rename = "ModelPackageDescription")]
#[serde(skip_serializing_if = "Option::is_none")]
pub model_package_description: Option<String>,
#[serde(rename = "ModelPackageName")]
pub model_package_name: String,
#[serde(rename = "SourceAlgorithmSpecification")]
#[serde(skip_serializing_if = "Option::is_none")]
pub source_algorithm_specification: Option<SourceAlgorithmSpecification>,
#[serde(rename = "ValidationSpecification")]
#[serde(skip_serializing_if = "Option::is_none")]
pub validation_specification: Option<ModelPackageValidationSpecification>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateModelPackageOutput {
#[serde(rename = "ModelPackageArn")]
pub model_package_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateNotebookInstanceInput {
#[serde(rename = "AcceleratorTypes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accelerator_types: Option<Vec<String>>,
#[serde(rename = "AdditionalCodeRepositories")]
#[serde(skip_serializing_if = "Option::is_none")]
pub additional_code_repositories: Option<Vec<String>>,
#[serde(rename = "DefaultCodeRepository")]
#[serde(skip_serializing_if = "Option::is_none")]
pub default_code_repository: Option<String>,
#[serde(rename = "DirectInternetAccess")]
#[serde(skip_serializing_if = "Option::is_none")]
pub direct_internet_access: Option<String>,
#[serde(rename = "InstanceType")]
pub instance_type: String,
#[serde(rename = "KmsKeyId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub kms_key_id: Option<String>,
#[serde(rename = "LifecycleConfigName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub lifecycle_config_name: Option<String>,
#[serde(rename = "NotebookInstanceName")]
pub notebook_instance_name: String,
#[serde(rename = "RoleArn")]
pub role_arn: String,
#[serde(rename = "SecurityGroupIds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub security_group_ids: Option<Vec<String>>,
#[serde(rename = "SubnetId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub subnet_id: Option<String>,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
#[serde(rename = "VolumeSizeInGB")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_size_in_gb: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateNotebookInstanceLifecycleConfigInput {
#[serde(rename = "NotebookInstanceLifecycleConfigName")]
pub notebook_instance_lifecycle_config_name: String,
#[serde(rename = "OnCreate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub on_create: Option<Vec<NotebookInstanceLifecycleHook>>,
#[serde(rename = "OnStart")]
#[serde(skip_serializing_if = "Option::is_none")]
pub on_start: Option<Vec<NotebookInstanceLifecycleHook>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateNotebookInstanceLifecycleConfigOutput {
#[serde(rename = "NotebookInstanceLifecycleConfigArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub notebook_instance_lifecycle_config_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateNotebookInstanceOutput {
#[serde(rename = "NotebookInstanceArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub notebook_instance_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreatePresignedNotebookInstanceUrlInput {
#[serde(rename = "NotebookInstanceName")]
pub notebook_instance_name: String,
#[serde(rename = "SessionExpirationDurationInSeconds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub session_expiration_duration_in_seconds: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreatePresignedNotebookInstanceUrlOutput {
#[serde(rename = "AuthorizedUrl")]
#[serde(skip_serializing_if = "Option::is_none")]
pub authorized_url: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateTrainingJobRequest {
#[serde(rename = "AlgorithmSpecification")]
pub algorithm_specification: AlgorithmSpecification,
#[serde(rename = "EnableInterContainerTrafficEncryption")]
#[serde(skip_serializing_if = "Option::is_none")]
pub enable_inter_container_traffic_encryption: Option<bool>,
#[serde(rename = "EnableNetworkIsolation")]
#[serde(skip_serializing_if = "Option::is_none")]
pub enable_network_isolation: Option<bool>,
#[serde(rename = "HyperParameters")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hyper_parameters: Option<::std::collections::HashMap<String, String>>,
#[serde(rename = "InputDataConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub input_data_config: Option<Vec<Channel>>,
#[serde(rename = "OutputDataConfig")]
pub output_data_config: OutputDataConfig,
#[serde(rename = "ResourceConfig")]
pub resource_config: ResourceConfig,
#[serde(rename = "RoleArn")]
pub role_arn: String,
#[serde(rename = "StoppingCondition")]
pub stopping_condition: StoppingCondition,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
#[serde(rename = "TrainingJobName")]
pub training_job_name: String,
#[serde(rename = "VpcConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub vpc_config: Option<VpcConfig>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateTrainingJobResponse {
#[serde(rename = "TrainingJobArn")]
pub training_job_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateTransformJobRequest {
#[serde(rename = "BatchStrategy")]
#[serde(skip_serializing_if = "Option::is_none")]
pub batch_strategy: Option<String>,
#[serde(rename = "Environment")]
#[serde(skip_serializing_if = "Option::is_none")]
pub environment: Option<::std::collections::HashMap<String, String>>,
#[serde(rename = "MaxConcurrentTransforms")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_concurrent_transforms: Option<i64>,
#[serde(rename = "MaxPayloadInMB")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_payload_in_mb: Option<i64>,
#[serde(rename = "ModelName")]
pub model_name: String,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
#[serde(rename = "TransformInput")]
pub transform_input: TransformInput,
#[serde(rename = "TransformJobName")]
pub transform_job_name: String,
#[serde(rename = "TransformOutput")]
pub transform_output: TransformOutput,
#[serde(rename = "TransformResources")]
pub transform_resources: TransformResources,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateTransformJobResponse {
#[serde(rename = "TransformJobArn")]
pub transform_job_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateWorkteamRequest {
#[serde(rename = "Description")]
pub description: String,
#[serde(rename = "MemberDefinitions")]
pub member_definitions: Vec<MemberDefinition>,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
#[serde(rename = "WorkteamName")]
pub workteam_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateWorkteamResponse {
#[serde(rename = "WorkteamArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub workteam_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct DataSource {
#[serde(rename = "S3DataSource")]
pub s3_data_source: S3DataSource,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteAlgorithmInput {
#[serde(rename = "AlgorithmName")]
pub algorithm_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteCodeRepositoryInput {
#[serde(rename = "CodeRepositoryName")]
pub code_repository_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteEndpointConfigInput {
#[serde(rename = "EndpointConfigName")]
pub endpoint_config_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteEndpointInput {
#[serde(rename = "EndpointName")]
pub endpoint_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteModelInput {
#[serde(rename = "ModelName")]
pub model_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteModelPackageInput {
#[serde(rename = "ModelPackageName")]
pub model_package_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteNotebookInstanceInput {
#[serde(rename = "NotebookInstanceName")]
pub notebook_instance_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteNotebookInstanceLifecycleConfigInput {
#[serde(rename = "NotebookInstanceLifecycleConfigName")]
pub notebook_instance_lifecycle_config_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteTagsInput {
#[serde(rename = "ResourceArn")]
pub resource_arn: String,
#[serde(rename = "TagKeys")]
pub tag_keys: Vec<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteTagsOutput {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteWorkteamRequest {
#[serde(rename = "WorkteamName")]
pub workteam_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteWorkteamResponse {
#[serde(rename = "Success")]
pub success: bool,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeployedImage {
#[serde(rename = "ResolutionTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resolution_time: Option<f64>,
#[serde(rename = "ResolvedImage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resolved_image: Option<String>,
#[serde(rename = "SpecifiedImage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub specified_image: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeAlgorithmInput {
#[serde(rename = "AlgorithmName")]
pub algorithm_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeAlgorithmOutput {
#[serde(rename = "AlgorithmArn")]
pub algorithm_arn: String,
#[serde(rename = "AlgorithmDescription")]
#[serde(skip_serializing_if = "Option::is_none")]
pub algorithm_description: Option<String>,
#[serde(rename = "AlgorithmName")]
pub algorithm_name: String,
#[serde(rename = "AlgorithmStatus")]
pub algorithm_status: String,
#[serde(rename = "AlgorithmStatusDetails")]
pub algorithm_status_details: AlgorithmStatusDetails,
#[serde(rename = "CertifyForMarketplace")]
#[serde(skip_serializing_if = "Option::is_none")]
pub certify_for_marketplace: Option<bool>,
#[serde(rename = "CreationTime")]
pub creation_time: f64,
#[serde(rename = "InferenceSpecification")]
#[serde(skip_serializing_if = "Option::is_none")]
pub inference_specification: Option<InferenceSpecification>,
#[serde(rename = "ProductId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub product_id: Option<String>,
#[serde(rename = "TrainingSpecification")]
pub training_specification: TrainingSpecification,
#[serde(rename = "ValidationSpecification")]
#[serde(skip_serializing_if = "Option::is_none")]
pub validation_specification: Option<AlgorithmValidationSpecification>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeCodeRepositoryInput {
#[serde(rename = "CodeRepositoryName")]
pub code_repository_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeCodeRepositoryOutput {
#[serde(rename = "CodeRepositoryArn")]
pub code_repository_arn: String,
#[serde(rename = "CodeRepositoryName")]
pub code_repository_name: String,
#[serde(rename = "CreationTime")]
pub creation_time: f64,
#[serde(rename = "GitConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub git_config: Option<GitConfig>,
#[serde(rename = "LastModifiedTime")]
pub last_modified_time: f64,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeCompilationJobRequest {
#[serde(rename = "CompilationJobName")]
pub compilation_job_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeCompilationJobResponse {
#[serde(rename = "CompilationEndTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub compilation_end_time: Option<f64>,
#[serde(rename = "CompilationJobArn")]
pub compilation_job_arn: String,
#[serde(rename = "CompilationJobName")]
pub compilation_job_name: String,
#[serde(rename = "CompilationJobStatus")]
pub compilation_job_status: String,
#[serde(rename = "CompilationStartTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub compilation_start_time: Option<f64>,
#[serde(rename = "CreationTime")]
pub creation_time: f64,
#[serde(rename = "FailureReason")]
pub failure_reason: String,
#[serde(rename = "InputConfig")]
pub input_config: InputConfig,
#[serde(rename = "LastModifiedTime")]
pub last_modified_time: f64,
#[serde(rename = "ModelArtifacts")]
pub model_artifacts: ModelArtifacts,
#[serde(rename = "OutputConfig")]
pub output_config: OutputConfig,
#[serde(rename = "RoleArn")]
pub role_arn: String,
#[serde(rename = "StoppingCondition")]
pub stopping_condition: StoppingCondition,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeEndpointConfigInput {
#[serde(rename = "EndpointConfigName")]
pub endpoint_config_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeEndpointConfigOutput {
#[serde(rename = "CreationTime")]
pub creation_time: f64,
#[serde(rename = "EndpointConfigArn")]
pub endpoint_config_arn: String,
#[serde(rename = "EndpointConfigName")]
pub endpoint_config_name: String,
#[serde(rename = "KmsKeyId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub kms_key_id: Option<String>,
#[serde(rename = "ProductionVariants")]
pub production_variants: Vec<ProductionVariant>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeEndpointInput {
#[serde(rename = "EndpointName")]
pub endpoint_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeEndpointOutput {
#[serde(rename = "CreationTime")]
pub creation_time: f64,
#[serde(rename = "EndpointArn")]
pub endpoint_arn: String,
#[serde(rename = "EndpointConfigName")]
pub endpoint_config_name: String,
#[serde(rename = "EndpointName")]
pub endpoint_name: String,
#[serde(rename = "EndpointStatus")]
pub endpoint_status: String,
#[serde(rename = "FailureReason")]
#[serde(skip_serializing_if = "Option::is_none")]
pub failure_reason: Option<String>,
#[serde(rename = "LastModifiedTime")]
pub last_modified_time: f64,
#[serde(rename = "ProductionVariants")]
#[serde(skip_serializing_if = "Option::is_none")]
pub production_variants: Option<Vec<ProductionVariantSummary>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeHyperParameterTuningJobRequest {
#[serde(rename = "HyperParameterTuningJobName")]
pub hyper_parameter_tuning_job_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeHyperParameterTuningJobResponse {
#[serde(rename = "BestTrainingJob")]
#[serde(skip_serializing_if = "Option::is_none")]
pub best_training_job: Option<HyperParameterTrainingJobSummary>,
#[serde(rename = "CreationTime")]
pub creation_time: f64,
#[serde(rename = "FailureReason")]
#[serde(skip_serializing_if = "Option::is_none")]
pub failure_reason: Option<String>,
#[serde(rename = "HyperParameterTuningEndTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hyper_parameter_tuning_end_time: Option<f64>,
#[serde(rename = "HyperParameterTuningJobArn")]
pub hyper_parameter_tuning_job_arn: String,
#[serde(rename = "HyperParameterTuningJobConfig")]
pub hyper_parameter_tuning_job_config: HyperParameterTuningJobConfig,
#[serde(rename = "HyperParameterTuningJobName")]
pub hyper_parameter_tuning_job_name: String,
#[serde(rename = "HyperParameterTuningJobStatus")]
pub hyper_parameter_tuning_job_status: String,
#[serde(rename = "LastModifiedTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_modified_time: Option<f64>,
#[serde(rename = "ObjectiveStatusCounters")]
pub objective_status_counters: ObjectiveStatusCounters,
#[serde(rename = "OverallBestTrainingJob")]
#[serde(skip_serializing_if = "Option::is_none")]
pub overall_best_training_job: Option<HyperParameterTrainingJobSummary>,
#[serde(rename = "TrainingJobDefinition")]
pub training_job_definition: HyperParameterTrainingJobDefinition,
#[serde(rename = "TrainingJobStatusCounters")]
pub training_job_status_counters: TrainingJobStatusCounters,
#[serde(rename = "WarmStartConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub warm_start_config: Option<HyperParameterTuningJobWarmStartConfig>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeLabelingJobRequest {
#[serde(rename = "LabelingJobName")]
pub labeling_job_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeLabelingJobResponse {
#[serde(rename = "CreationTime")]
pub creation_time: f64,
#[serde(rename = "FailureReason")]
#[serde(skip_serializing_if = "Option::is_none")]
pub failure_reason: Option<String>,
#[serde(rename = "HumanTaskConfig")]
pub human_task_config: HumanTaskConfig,
#[serde(rename = "InputConfig")]
pub input_config: LabelingJobInputConfig,
#[serde(rename = "JobReferenceCode")]
pub job_reference_code: String,
#[serde(rename = "LabelAttributeName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub label_attribute_name: Option<String>,
#[serde(rename = "LabelCategoryConfigS3Uri")]
#[serde(skip_serializing_if = "Option::is_none")]
pub label_category_config_s3_uri: Option<String>,
#[serde(rename = "LabelCounters")]
pub label_counters: LabelCounters,
#[serde(rename = "LabelingJobAlgorithmsConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub labeling_job_algorithms_config: Option<LabelingJobAlgorithmsConfig>,
#[serde(rename = "LabelingJobArn")]
pub labeling_job_arn: String,
#[serde(rename = "LabelingJobName")]
pub labeling_job_name: String,
#[serde(rename = "LabelingJobOutput")]
#[serde(skip_serializing_if = "Option::is_none")]
pub labeling_job_output: Option<LabelingJobOutput>,
#[serde(rename = "LabelingJobStatus")]
pub labeling_job_status: String,
#[serde(rename = "LastModifiedTime")]
pub last_modified_time: f64,
#[serde(rename = "OutputConfig")]
pub output_config: LabelingJobOutputConfig,
#[serde(rename = "RoleArn")]
pub role_arn: String,
#[serde(rename = "StoppingConditions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub stopping_conditions: Option<LabelingJobStoppingConditions>,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeModelInput {
#[serde(rename = "ModelName")]
pub model_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeModelOutput {
#[serde(rename = "Containers")]
#[serde(skip_serializing_if = "Option::is_none")]
pub containers: Option<Vec<ContainerDefinition>>,
#[serde(rename = "CreationTime")]
pub creation_time: f64,
#[serde(rename = "EnableNetworkIsolation")]
#[serde(skip_serializing_if = "Option::is_none")]
pub enable_network_isolation: Option<bool>,
#[serde(rename = "ExecutionRoleArn")]
pub execution_role_arn: String,
#[serde(rename = "ModelArn")]
pub model_arn: String,
#[serde(rename = "ModelName")]
pub model_name: String,
#[serde(rename = "PrimaryContainer")]
#[serde(skip_serializing_if = "Option::is_none")]
pub primary_container: Option<ContainerDefinition>,
#[serde(rename = "VpcConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub vpc_config: Option<VpcConfig>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeModelPackageInput {
#[serde(rename = "ModelPackageName")]
pub model_package_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeModelPackageOutput {
#[serde(rename = "CertifyForMarketplace")]
#[serde(skip_serializing_if = "Option::is_none")]
pub certify_for_marketplace: Option<bool>,
#[serde(rename = "CreationTime")]
pub creation_time: f64,
#[serde(rename = "InferenceSpecification")]
#[serde(skip_serializing_if = "Option::is_none")]
pub inference_specification: Option<InferenceSpecification>,
#[serde(rename = "ModelPackageArn")]
pub model_package_arn: String,
#[serde(rename = "ModelPackageDescription")]
#[serde(skip_serializing_if = "Option::is_none")]
pub model_package_description: Option<String>,
#[serde(rename = "ModelPackageName")]
pub model_package_name: String,
#[serde(rename = "ModelPackageStatus")]
pub model_package_status: String,
#[serde(rename = "ModelPackageStatusDetails")]
pub model_package_status_details: ModelPackageStatusDetails,
#[serde(rename = "SourceAlgorithmSpecification")]
#[serde(skip_serializing_if = "Option::is_none")]
pub source_algorithm_specification: Option<SourceAlgorithmSpecification>,
#[serde(rename = "ValidationSpecification")]
#[serde(skip_serializing_if = "Option::is_none")]
pub validation_specification: Option<ModelPackageValidationSpecification>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeNotebookInstanceInput {
#[serde(rename = "NotebookInstanceName")]
pub notebook_instance_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeNotebookInstanceLifecycleConfigInput {
#[serde(rename = "NotebookInstanceLifecycleConfigName")]
pub notebook_instance_lifecycle_config_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeNotebookInstanceLifecycleConfigOutput {
#[serde(rename = "CreationTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_time: Option<f64>,
#[serde(rename = "LastModifiedTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_modified_time: Option<f64>,
#[serde(rename = "NotebookInstanceLifecycleConfigArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub notebook_instance_lifecycle_config_arn: Option<String>,
#[serde(rename = "NotebookInstanceLifecycleConfigName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub notebook_instance_lifecycle_config_name: Option<String>,
#[serde(rename = "OnCreate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub on_create: Option<Vec<NotebookInstanceLifecycleHook>>,
#[serde(rename = "OnStart")]
#[serde(skip_serializing_if = "Option::is_none")]
pub on_start: Option<Vec<NotebookInstanceLifecycleHook>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeNotebookInstanceOutput {
#[serde(rename = "AcceleratorTypes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accelerator_types: Option<Vec<String>>,
#[serde(rename = "AdditionalCodeRepositories")]
#[serde(skip_serializing_if = "Option::is_none")]
pub additional_code_repositories: Option<Vec<String>>,
#[serde(rename = "CreationTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_time: Option<f64>,
#[serde(rename = "DefaultCodeRepository")]
#[serde(skip_serializing_if = "Option::is_none")]
pub default_code_repository: Option<String>,
#[serde(rename = "DirectInternetAccess")]
#[serde(skip_serializing_if = "Option::is_none")]
pub direct_internet_access: Option<String>,
#[serde(rename = "FailureReason")]
#[serde(skip_serializing_if = "Option::is_none")]
pub failure_reason: Option<String>,
#[serde(rename = "InstanceType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instance_type: Option<String>,
#[serde(rename = "KmsKeyId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub kms_key_id: Option<String>,
#[serde(rename = "LastModifiedTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_modified_time: Option<f64>,
#[serde(rename = "NetworkInterfaceId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub network_interface_id: Option<String>,
#[serde(rename = "NotebookInstanceArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub notebook_instance_arn: Option<String>,
#[serde(rename = "NotebookInstanceLifecycleConfigName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub notebook_instance_lifecycle_config_name: Option<String>,
#[serde(rename = "NotebookInstanceName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub notebook_instance_name: Option<String>,
#[serde(rename = "NotebookInstanceStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub notebook_instance_status: Option<String>,
#[serde(rename = "RoleArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub role_arn: Option<String>,
#[serde(rename = "SecurityGroups")]
#[serde(skip_serializing_if = "Option::is_none")]
pub security_groups: Option<Vec<String>>,
#[serde(rename = "SubnetId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub subnet_id: Option<String>,
#[serde(rename = "Url")]
#[serde(skip_serializing_if = "Option::is_none")]
pub url: Option<String>,
#[serde(rename = "VolumeSizeInGB")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_size_in_gb: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeSubscribedWorkteamRequest {
#[serde(rename = "WorkteamArn")]
pub workteam_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeSubscribedWorkteamResponse {
#[serde(rename = "SubscribedWorkteam")]
pub subscribed_workteam: SubscribedWorkteam,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeTrainingJobRequest {
#[serde(rename = "TrainingJobName")]
pub training_job_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeTrainingJobResponse {
#[serde(rename = "AlgorithmSpecification")]
pub algorithm_specification: AlgorithmSpecification,
#[serde(rename = "CreationTime")]
pub creation_time: f64,
#[serde(rename = "EnableInterContainerTrafficEncryption")]
#[serde(skip_serializing_if = "Option::is_none")]
pub enable_inter_container_traffic_encryption: Option<bool>,
#[serde(rename = "EnableNetworkIsolation")]
#[serde(skip_serializing_if = "Option::is_none")]
pub enable_network_isolation: Option<bool>,
#[serde(rename = "FailureReason")]
#[serde(skip_serializing_if = "Option::is_none")]
pub failure_reason: Option<String>,
#[serde(rename = "FinalMetricDataList")]
#[serde(skip_serializing_if = "Option::is_none")]
pub final_metric_data_list: Option<Vec<MetricData>>,
#[serde(rename = "HyperParameters")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hyper_parameters: Option<::std::collections::HashMap<String, String>>,
#[serde(rename = "InputDataConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub input_data_config: Option<Vec<Channel>>,
#[serde(rename = "LabelingJobArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub labeling_job_arn: Option<String>,
#[serde(rename = "LastModifiedTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_modified_time: Option<f64>,
#[serde(rename = "ModelArtifacts")]
pub model_artifacts: ModelArtifacts,
#[serde(rename = "OutputDataConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub output_data_config: Option<OutputDataConfig>,
#[serde(rename = "ResourceConfig")]
pub resource_config: ResourceConfig,
#[serde(rename = "RoleArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub role_arn: Option<String>,
#[serde(rename = "SecondaryStatus")]
pub secondary_status: String,
#[serde(rename = "SecondaryStatusTransitions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub secondary_status_transitions: Option<Vec<SecondaryStatusTransition>>,
#[serde(rename = "StoppingCondition")]
pub stopping_condition: StoppingCondition,
#[serde(rename = "TrainingEndTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub training_end_time: Option<f64>,
#[serde(rename = "TrainingJobArn")]
pub training_job_arn: String,
#[serde(rename = "TrainingJobName")]
pub training_job_name: String,
#[serde(rename = "TrainingJobStatus")]
pub training_job_status: String,
#[serde(rename = "TrainingStartTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub training_start_time: Option<f64>,
#[serde(rename = "TuningJobArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tuning_job_arn: Option<String>,
#[serde(rename = "VpcConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub vpc_config: Option<VpcConfig>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeTransformJobRequest {
#[serde(rename = "TransformJobName")]
pub transform_job_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeTransformJobResponse {
#[serde(rename = "BatchStrategy")]
#[serde(skip_serializing_if = "Option::is_none")]
pub batch_strategy: Option<String>,
#[serde(rename = "CreationTime")]
pub creation_time: f64,
#[serde(rename = "Environment")]
#[serde(skip_serializing_if = "Option::is_none")]
pub environment: Option<::std::collections::HashMap<String, String>>,
#[serde(rename = "FailureReason")]
#[serde(skip_serializing_if = "Option::is_none")]
pub failure_reason: Option<String>,
#[serde(rename = "LabelingJobArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub labeling_job_arn: Option<String>,
#[serde(rename = "MaxConcurrentTransforms")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_concurrent_transforms: Option<i64>,
#[serde(rename = "MaxPayloadInMB")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_payload_in_mb: Option<i64>,
#[serde(rename = "ModelName")]
pub model_name: String,
#[serde(rename = "TransformEndTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub transform_end_time: Option<f64>,
#[serde(rename = "TransformInput")]
pub transform_input: TransformInput,
#[serde(rename = "TransformJobArn")]
pub transform_job_arn: String,
#[serde(rename = "TransformJobName")]
pub transform_job_name: String,
#[serde(rename = "TransformJobStatus")]
pub transform_job_status: String,
#[serde(rename = "TransformOutput")]
#[serde(skip_serializing_if = "Option::is_none")]
pub transform_output: Option<TransformOutput>,
#[serde(rename = "TransformResources")]
pub transform_resources: TransformResources,
#[serde(rename = "TransformStartTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub transform_start_time: Option<f64>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeWorkteamRequest {
#[serde(rename = "WorkteamName")]
pub workteam_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeWorkteamResponse {
#[serde(rename = "Workteam")]
pub workteam: Workteam,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DesiredWeightAndCapacity {
#[serde(rename = "DesiredInstanceCount")]
#[serde(skip_serializing_if = "Option::is_none")]
pub desired_instance_count: Option<i64>,
#[serde(rename = "DesiredWeight")]
#[serde(skip_serializing_if = "Option::is_none")]
pub desired_weight: Option<f32>,
#[serde(rename = "VariantName")]
pub variant_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct EndpointConfigSummary {
#[serde(rename = "CreationTime")]
pub creation_time: f64,
#[serde(rename = "EndpointConfigArn")]
pub endpoint_config_arn: String,
#[serde(rename = "EndpointConfigName")]
pub endpoint_config_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct EndpointSummary {
#[serde(rename = "CreationTime")]
pub creation_time: f64,
#[serde(rename = "EndpointArn")]
pub endpoint_arn: String,
#[serde(rename = "EndpointName")]
pub endpoint_name: String,
#[serde(rename = "EndpointStatus")]
pub endpoint_status: String,
#[serde(rename = "LastModifiedTime")]
pub last_modified_time: f64,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct Filter {
#[serde(rename = "Name")]
pub name: String,
#[serde(rename = "Operator")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operator: Option<String>,
#[serde(rename = "Value")]
#[serde(skip_serializing_if = "Option::is_none")]
pub value: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct FinalHyperParameterTuningJobObjectiveMetric {
#[serde(rename = "MetricName")]
pub metric_name: String,
#[serde(rename = "Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub type_: Option<String>,
#[serde(rename = "Value")]
pub value: f32,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetSearchSuggestionsRequest {
#[serde(rename = "Resource")]
pub resource: String,
#[serde(rename = "SuggestionQuery")]
#[serde(skip_serializing_if = "Option::is_none")]
pub suggestion_query: Option<SuggestionQuery>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetSearchSuggestionsResponse {
#[serde(rename = "PropertyNameSuggestions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub property_name_suggestions: Option<Vec<PropertyNameSuggestion>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct GitConfig {
#[serde(rename = "Branch")]
#[serde(skip_serializing_if = "Option::is_none")]
pub branch: Option<String>,
#[serde(rename = "RepositoryUrl")]
pub repository_url: String,
#[serde(rename = "SecretArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub secret_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GitConfigForUpdate {
#[serde(rename = "SecretArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub secret_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct HumanTaskConfig {
#[serde(rename = "AnnotationConsolidationConfig")]
pub annotation_consolidation_config: AnnotationConsolidationConfig,
#[serde(rename = "MaxConcurrentTaskCount")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_concurrent_task_count: Option<i64>,
#[serde(rename = "NumberOfHumanWorkersPerDataObject")]
pub number_of_human_workers_per_data_object: i64,
#[serde(rename = "PreHumanTaskLambdaArn")]
pub pre_human_task_lambda_arn: String,
#[serde(rename = "PublicWorkforceTaskPrice")]
#[serde(skip_serializing_if = "Option::is_none")]
pub public_workforce_task_price: Option<PublicWorkforceTaskPrice>,
#[serde(rename = "TaskAvailabilityLifetimeInSeconds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub task_availability_lifetime_in_seconds: Option<i64>,
#[serde(rename = "TaskDescription")]
pub task_description: String,
#[serde(rename = "TaskKeywords")]
#[serde(skip_serializing_if = "Option::is_none")]
pub task_keywords: Option<Vec<String>>,
#[serde(rename = "TaskTimeLimitInSeconds")]
pub task_time_limit_in_seconds: i64,
#[serde(rename = "TaskTitle")]
pub task_title: String,
#[serde(rename = "UiConfig")]
pub ui_config: UiConfig,
#[serde(rename = "WorkteamArn")]
pub workteam_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct HyperParameterAlgorithmSpecification {
#[serde(rename = "AlgorithmName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub algorithm_name: Option<String>,
#[serde(rename = "MetricDefinitions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub metric_definitions: Option<Vec<MetricDefinition>>,
#[serde(rename = "TrainingImage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub training_image: Option<String>,
#[serde(rename = "TrainingInputMode")]
pub training_input_mode: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct HyperParameterSpecification {
#[serde(rename = "DefaultValue")]
#[serde(skip_serializing_if = "Option::is_none")]
pub default_value: Option<String>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "IsRequired")]
#[serde(skip_serializing_if = "Option::is_none")]
pub is_required: Option<bool>,
#[serde(rename = "IsTunable")]
#[serde(skip_serializing_if = "Option::is_none")]
pub is_tunable: Option<bool>,
#[serde(rename = "Name")]
pub name: String,
#[serde(rename = "Range")]
#[serde(skip_serializing_if = "Option::is_none")]
pub range: Option<ParameterRange>,
#[serde(rename = "Type")]
pub type_: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct HyperParameterTrainingJobDefinition {
#[serde(rename = "AlgorithmSpecification")]
pub algorithm_specification: HyperParameterAlgorithmSpecification,
#[serde(rename = "EnableInterContainerTrafficEncryption")]
#[serde(skip_serializing_if = "Option::is_none")]
pub enable_inter_container_traffic_encryption: Option<bool>,
#[serde(rename = "EnableNetworkIsolation")]
#[serde(skip_serializing_if = "Option::is_none")]
pub enable_network_isolation: Option<bool>,
#[serde(rename = "InputDataConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub input_data_config: Option<Vec<Channel>>,
#[serde(rename = "OutputDataConfig")]
pub output_data_config: OutputDataConfig,
#[serde(rename = "ResourceConfig")]
pub resource_config: ResourceConfig,
#[serde(rename = "RoleArn")]
pub role_arn: String,
#[serde(rename = "StaticHyperParameters")]
#[serde(skip_serializing_if = "Option::is_none")]
pub static_hyper_parameters: Option<::std::collections::HashMap<String, String>>,
#[serde(rename = "StoppingCondition")]
pub stopping_condition: StoppingCondition,
#[serde(rename = "VpcConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub vpc_config: Option<VpcConfig>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct HyperParameterTrainingJobSummary {
#[serde(rename = "CreationTime")]
pub creation_time: f64,
#[serde(rename = "FailureReason")]
#[serde(skip_serializing_if = "Option::is_none")]
pub failure_reason: Option<String>,
#[serde(rename = "FinalHyperParameterTuningJobObjectiveMetric")]
#[serde(skip_serializing_if = "Option::is_none")]
pub final_hyper_parameter_tuning_job_objective_metric:
Option<FinalHyperParameterTuningJobObjectiveMetric>,
#[serde(rename = "ObjectiveStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub objective_status: Option<String>,
#[serde(rename = "TrainingEndTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub training_end_time: Option<f64>,
#[serde(rename = "TrainingJobArn")]
pub training_job_arn: String,
#[serde(rename = "TrainingJobName")]
pub training_job_name: String,
#[serde(rename = "TrainingJobStatus")]
pub training_job_status: String,
#[serde(rename = "TrainingStartTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub training_start_time: Option<f64>,
#[serde(rename = "TunedHyperParameters")]
pub tuned_hyper_parameters: ::std::collections::HashMap<String, String>,
#[serde(rename = "TuningJobName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tuning_job_name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct HyperParameterTuningJobConfig {
#[serde(rename = "HyperParameterTuningJobObjective")]
pub hyper_parameter_tuning_job_objective: HyperParameterTuningJobObjective,
#[serde(rename = "ParameterRanges")]
pub parameter_ranges: ParameterRanges,
#[serde(rename = "ResourceLimits")]
pub resource_limits: ResourceLimits,
#[serde(rename = "Strategy")]
pub strategy: String,
#[serde(rename = "TrainingJobEarlyStoppingType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub training_job_early_stopping_type: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct HyperParameterTuningJobObjective {
#[serde(rename = "MetricName")]
pub metric_name: String,
#[serde(rename = "Type")]
pub type_: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct HyperParameterTuningJobSummary {
#[serde(rename = "CreationTime")]
pub creation_time: f64,
#[serde(rename = "HyperParameterTuningEndTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hyper_parameter_tuning_end_time: Option<f64>,
#[serde(rename = "HyperParameterTuningJobArn")]
pub hyper_parameter_tuning_job_arn: String,
#[serde(rename = "HyperParameterTuningJobName")]
pub hyper_parameter_tuning_job_name: String,
#[serde(rename = "HyperParameterTuningJobStatus")]
pub hyper_parameter_tuning_job_status: String,
#[serde(rename = "LastModifiedTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_modified_time: Option<f64>,
#[serde(rename = "ObjectiveStatusCounters")]
pub objective_status_counters: ObjectiveStatusCounters,
#[serde(rename = "ResourceLimits")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_limits: Option<ResourceLimits>,
#[serde(rename = "Strategy")]
pub strategy: String,
#[serde(rename = "TrainingJobStatusCounters")]
pub training_job_status_counters: TrainingJobStatusCounters,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct HyperParameterTuningJobWarmStartConfig {
#[serde(rename = "ParentHyperParameterTuningJobs")]
pub parent_hyper_parameter_tuning_jobs: Vec<ParentHyperParameterTuningJob>,
#[serde(rename = "WarmStartType")]
pub warm_start_type: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct InferenceSpecification {
#[serde(rename = "Containers")]
pub containers: Vec<ModelPackageContainerDefinition>,
#[serde(rename = "SupportedContentTypes")]
pub supported_content_types: Vec<String>,
#[serde(rename = "SupportedRealtimeInferenceInstanceTypes")]
pub supported_realtime_inference_instance_types: Vec<String>,
#[serde(rename = "SupportedResponseMIMETypes")]
pub supported_response_mime_types: Vec<String>,
#[serde(rename = "SupportedTransformInstanceTypes")]
pub supported_transform_instance_types: Vec<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct InputConfig {
#[serde(rename = "DataInputConfig")]
pub data_input_config: String,
#[serde(rename = "Framework")]
pub framework: String,
#[serde(rename = "S3Uri")]
pub s3_uri: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct IntegerParameterRange {
#[serde(rename = "MaxValue")]
pub max_value: String,
#[serde(rename = "MinValue")]
pub min_value: String,
#[serde(rename = "Name")]
pub name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct IntegerParameterRangeSpecification {
#[serde(rename = "MaxValue")]
pub max_value: String,
#[serde(rename = "MinValue")]
pub min_value: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct LabelCounters {
#[serde(rename = "FailedNonRetryableError")]
#[serde(skip_serializing_if = "Option::is_none")]
pub failed_non_retryable_error: Option<i64>,
#[serde(rename = "HumanLabeled")]
#[serde(skip_serializing_if = "Option::is_none")]
pub human_labeled: Option<i64>,
#[serde(rename = "MachineLabeled")]
#[serde(skip_serializing_if = "Option::is_none")]
pub machine_labeled: Option<i64>,
#[serde(rename = "TotalLabeled")]
#[serde(skip_serializing_if = "Option::is_none")]
pub total_labeled: Option<i64>,
#[serde(rename = "Unlabeled")]
#[serde(skip_serializing_if = "Option::is_none")]
pub unlabeled: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct LabelCountersForWorkteam {
#[serde(rename = "HumanLabeled")]
#[serde(skip_serializing_if = "Option::is_none")]
pub human_labeled: Option<i64>,
#[serde(rename = "PendingHuman")]
#[serde(skip_serializing_if = "Option::is_none")]
pub pending_human: Option<i64>,
#[serde(rename = "Total")]
#[serde(skip_serializing_if = "Option::is_none")]
pub total: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct LabelingJobAlgorithmsConfig {
#[serde(rename = "InitialActiveLearningModelArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub initial_active_learning_model_arn: Option<String>,
#[serde(rename = "LabelingJobAlgorithmSpecificationArn")]
pub labeling_job_algorithm_specification_arn: String,
#[serde(rename = "LabelingJobResourceConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub labeling_job_resource_config: Option<LabelingJobResourceConfig>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct LabelingJobDataAttributes {
#[serde(rename = "ContentClassifiers")]
#[serde(skip_serializing_if = "Option::is_none")]
pub content_classifiers: Option<Vec<String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct LabelingJobDataSource {
#[serde(rename = "S3DataSource")]
pub s3_data_source: LabelingJobS3DataSource,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct LabelingJobForWorkteamSummary {
#[serde(rename = "CreationTime")]
pub creation_time: f64,
#[serde(rename = "JobReferenceCode")]
pub job_reference_code: String,
#[serde(rename = "LabelCounters")]
#[serde(skip_serializing_if = "Option::is_none")]
pub label_counters: Option<LabelCountersForWorkteam>,
#[serde(rename = "LabelingJobName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub labeling_job_name: Option<String>,
#[serde(rename = "WorkRequesterAccountId")]
pub work_requester_account_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct LabelingJobInputConfig {
#[serde(rename = "DataAttributes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub data_attributes: Option<LabelingJobDataAttributes>,
#[serde(rename = "DataSource")]
pub data_source: LabelingJobDataSource,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct LabelingJobOutput {
#[serde(rename = "FinalActiveLearningModelArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub final_active_learning_model_arn: Option<String>,
#[serde(rename = "OutputDatasetS3Uri")]
pub output_dataset_s3_uri: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct LabelingJobOutputConfig {
#[serde(rename = "KmsKeyId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub kms_key_id: Option<String>,
#[serde(rename = "S3OutputPath")]
pub s3_output_path: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct LabelingJobResourceConfig {
#[serde(rename = "VolumeKmsKeyId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_kms_key_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct LabelingJobS3DataSource {
#[serde(rename = "ManifestS3Uri")]
pub manifest_s3_uri: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct LabelingJobStoppingConditions {
#[serde(rename = "MaxHumanLabeledObjectCount")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_human_labeled_object_count: Option<i64>,
#[serde(rename = "MaxPercentageOfInputDatasetLabeled")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_percentage_of_input_dataset_labeled: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct LabelingJobSummary {
#[serde(rename = "AnnotationConsolidationLambdaArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub annotation_consolidation_lambda_arn: Option<String>,
#[serde(rename = "CreationTime")]
pub creation_time: f64,
#[serde(rename = "FailureReason")]
#[serde(skip_serializing_if = "Option::is_none")]
pub failure_reason: Option<String>,
#[serde(rename = "InputConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub input_config: Option<LabelingJobInputConfig>,
#[serde(rename = "LabelCounters")]
pub label_counters: LabelCounters,
#[serde(rename = "LabelingJobArn")]
pub labeling_job_arn: String,
#[serde(rename = "LabelingJobName")]
pub labeling_job_name: String,
#[serde(rename = "LabelingJobOutput")]
#[serde(skip_serializing_if = "Option::is_none")]
pub labeling_job_output: Option<LabelingJobOutput>,
#[serde(rename = "LabelingJobStatus")]
pub labeling_job_status: String,
#[serde(rename = "LastModifiedTime")]
pub last_modified_time: f64,
#[serde(rename = "PreHumanTaskLambdaArn")]
pub pre_human_task_lambda_arn: String,
#[serde(rename = "WorkteamArn")]
pub workteam_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListAlgorithmsInput {
#[serde(rename = "CreationTimeAfter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_time_after: Option<f64>,
#[serde(rename = "CreationTimeBefore")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_time_before: Option<f64>,
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NameContains")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name_contains: Option<String>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "SortBy")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sort_by: Option<String>,
#[serde(rename = "SortOrder")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sort_order: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListAlgorithmsOutput {
#[serde(rename = "AlgorithmSummaryList")]
pub algorithm_summary_list: Vec<AlgorithmSummary>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListCodeRepositoriesInput {
#[serde(rename = "CreationTimeAfter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_time_after: Option<f64>,
#[serde(rename = "CreationTimeBefore")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_time_before: Option<f64>,
#[serde(rename = "LastModifiedTimeAfter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_modified_time_after: Option<f64>,
#[serde(rename = "LastModifiedTimeBefore")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_modified_time_before: Option<f64>,
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NameContains")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name_contains: Option<String>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "SortBy")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sort_by: Option<String>,
#[serde(rename = "SortOrder")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sort_order: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListCodeRepositoriesOutput {
#[serde(rename = "CodeRepositorySummaryList")]
pub code_repository_summary_list: Vec<CodeRepositorySummary>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListCompilationJobsRequest {
#[serde(rename = "CreationTimeAfter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_time_after: Option<f64>,
#[serde(rename = "CreationTimeBefore")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_time_before: Option<f64>,
#[serde(rename = "LastModifiedTimeAfter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_modified_time_after: Option<f64>,
#[serde(rename = "LastModifiedTimeBefore")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_modified_time_before: Option<f64>,
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NameContains")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name_contains: Option<String>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "SortBy")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sort_by: Option<String>,
#[serde(rename = "SortOrder")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sort_order: Option<String>,
#[serde(rename = "StatusEquals")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status_equals: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListCompilationJobsResponse {
#[serde(rename = "CompilationJobSummaries")]
pub compilation_job_summaries: Vec<CompilationJobSummary>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListEndpointConfigsInput {
#[serde(rename = "CreationTimeAfter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_time_after: Option<f64>,
#[serde(rename = "CreationTimeBefore")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_time_before: Option<f64>,
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NameContains")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name_contains: Option<String>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "SortBy")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sort_by: Option<String>,
#[serde(rename = "SortOrder")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sort_order: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListEndpointConfigsOutput {
#[serde(rename = "EndpointConfigs")]
pub endpoint_configs: Vec<EndpointConfigSummary>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListEndpointsInput {
#[serde(rename = "CreationTimeAfter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_time_after: Option<f64>,
#[serde(rename = "CreationTimeBefore")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_time_before: Option<f64>,
#[serde(rename = "LastModifiedTimeAfter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_modified_time_after: Option<f64>,
#[serde(rename = "LastModifiedTimeBefore")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_modified_time_before: Option<f64>,
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NameContains")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name_contains: Option<String>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "SortBy")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sort_by: Option<String>,
#[serde(rename = "SortOrder")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sort_order: Option<String>,
#[serde(rename = "StatusEquals")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status_equals: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListEndpointsOutput {
#[serde(rename = "Endpoints")]
pub endpoints: Vec<EndpointSummary>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListHyperParameterTuningJobsRequest {
#[serde(rename = "CreationTimeAfter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_time_after: Option<f64>,
#[serde(rename = "CreationTimeBefore")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_time_before: Option<f64>,
#[serde(rename = "LastModifiedTimeAfter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_modified_time_after: Option<f64>,
#[serde(rename = "LastModifiedTimeBefore")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_modified_time_before: Option<f64>,
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NameContains")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name_contains: Option<String>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "SortBy")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sort_by: Option<String>,
#[serde(rename = "SortOrder")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sort_order: Option<String>,
#[serde(rename = "StatusEquals")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status_equals: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListHyperParameterTuningJobsResponse {
#[serde(rename = "HyperParameterTuningJobSummaries")]
pub hyper_parameter_tuning_job_summaries: Vec<HyperParameterTuningJobSummary>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListLabelingJobsForWorkteamRequest {
#[serde(rename = "CreationTimeAfter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_time_after: Option<f64>,
#[serde(rename = "CreationTimeBefore")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_time_before: Option<f64>,
#[serde(rename = "JobReferenceCodeContains")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_reference_code_contains: 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 = "SortBy")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sort_by: Option<String>,
#[serde(rename = "SortOrder")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sort_order: Option<String>,
#[serde(rename = "WorkteamArn")]
pub workteam_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListLabelingJobsForWorkteamResponse {
#[serde(rename = "LabelingJobSummaryList")]
pub labeling_job_summary_list: Vec<LabelingJobForWorkteamSummary>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListLabelingJobsRequest {
#[serde(rename = "CreationTimeAfter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_time_after: Option<f64>,
#[serde(rename = "CreationTimeBefore")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_time_before: Option<f64>,
#[serde(rename = "LastModifiedTimeAfter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_modified_time_after: Option<f64>,
#[serde(rename = "LastModifiedTimeBefore")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_modified_time_before: Option<f64>,
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NameContains")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name_contains: Option<String>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "SortBy")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sort_by: Option<String>,
#[serde(rename = "SortOrder")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sort_order: Option<String>,
#[serde(rename = "StatusEquals")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status_equals: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListLabelingJobsResponse {
#[serde(rename = "LabelingJobSummaryList")]
#[serde(skip_serializing_if = "Option::is_none")]
pub labeling_job_summary_list: Option<Vec<LabelingJobSummary>>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListModelPackagesInput {
#[serde(rename = "CreationTimeAfter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_time_after: Option<f64>,
#[serde(rename = "CreationTimeBefore")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_time_before: Option<f64>,
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NameContains")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name_contains: Option<String>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "SortBy")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sort_by: Option<String>,
#[serde(rename = "SortOrder")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sort_order: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListModelPackagesOutput {
#[serde(rename = "ModelPackageSummaryList")]
pub model_package_summary_list: Vec<ModelPackageSummary>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListModelsInput {
#[serde(rename = "CreationTimeAfter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_time_after: Option<f64>,
#[serde(rename = "CreationTimeBefore")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_time_before: Option<f64>,
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NameContains")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name_contains: Option<String>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "SortBy")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sort_by: Option<String>,
#[serde(rename = "SortOrder")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sort_order: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListModelsOutput {
#[serde(rename = "Models")]
pub models: Vec<ModelSummary>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListNotebookInstanceLifecycleConfigsInput {
#[serde(rename = "CreationTimeAfter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_time_after: Option<f64>,
#[serde(rename = "CreationTimeBefore")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_time_before: Option<f64>,
#[serde(rename = "LastModifiedTimeAfter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_modified_time_after: Option<f64>,
#[serde(rename = "LastModifiedTimeBefore")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_modified_time_before: Option<f64>,
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NameContains")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name_contains: Option<String>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "SortBy")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sort_by: Option<String>,
#[serde(rename = "SortOrder")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sort_order: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListNotebookInstanceLifecycleConfigsOutput {
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "NotebookInstanceLifecycleConfigs")]
#[serde(skip_serializing_if = "Option::is_none")]
pub notebook_instance_lifecycle_configs: Option<Vec<NotebookInstanceLifecycleConfigSummary>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListNotebookInstancesInput {
#[serde(rename = "AdditionalCodeRepositoryEquals")]
#[serde(skip_serializing_if = "Option::is_none")]
pub additional_code_repository_equals: Option<String>,
#[serde(rename = "CreationTimeAfter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_time_after: Option<f64>,
#[serde(rename = "CreationTimeBefore")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_time_before: Option<f64>,
#[serde(rename = "DefaultCodeRepositoryContains")]
#[serde(skip_serializing_if = "Option::is_none")]
pub default_code_repository_contains: Option<String>,
#[serde(rename = "LastModifiedTimeAfter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_modified_time_after: Option<f64>,
#[serde(rename = "LastModifiedTimeBefore")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_modified_time_before: Option<f64>,
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NameContains")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name_contains: Option<String>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "NotebookInstanceLifecycleConfigNameContains")]
#[serde(skip_serializing_if = "Option::is_none")]
pub notebook_instance_lifecycle_config_name_contains: Option<String>,
#[serde(rename = "SortBy")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sort_by: Option<String>,
#[serde(rename = "SortOrder")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sort_order: Option<String>,
#[serde(rename = "StatusEquals")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status_equals: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListNotebookInstancesOutput {
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "NotebookInstances")]
#[serde(skip_serializing_if = "Option::is_none")]
pub notebook_instances: Option<Vec<NotebookInstanceSummary>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListSubscribedWorkteamsRequest {
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NameContains")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name_contains: Option<String>,
#[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 ListSubscribedWorkteamsResponse {
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "SubscribedWorkteams")]
pub subscribed_workteams: Vec<SubscribedWorkteam>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListTagsInput {
#[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 = "ResourceArn")]
pub resource_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListTagsOutput {
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListTrainingJobsForHyperParameterTuningJobRequest {
#[serde(rename = "HyperParameterTuningJobName")]
pub hyper_parameter_tuning_job_name: 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 = "SortBy")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sort_by: Option<String>,
#[serde(rename = "SortOrder")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sort_order: Option<String>,
#[serde(rename = "StatusEquals")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status_equals: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListTrainingJobsForHyperParameterTuningJobResponse {
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "TrainingJobSummaries")]
pub training_job_summaries: Vec<HyperParameterTrainingJobSummary>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListTrainingJobsRequest {
#[serde(rename = "CreationTimeAfter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_time_after: Option<f64>,
#[serde(rename = "CreationTimeBefore")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_time_before: Option<f64>,
#[serde(rename = "LastModifiedTimeAfter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_modified_time_after: Option<f64>,
#[serde(rename = "LastModifiedTimeBefore")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_modified_time_before: Option<f64>,
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NameContains")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name_contains: Option<String>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "SortBy")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sort_by: Option<String>,
#[serde(rename = "SortOrder")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sort_order: Option<String>,
#[serde(rename = "StatusEquals")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status_equals: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListTrainingJobsResponse {
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "TrainingJobSummaries")]
pub training_job_summaries: Vec<TrainingJobSummary>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListTransformJobsRequest {
#[serde(rename = "CreationTimeAfter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_time_after: Option<f64>,
#[serde(rename = "CreationTimeBefore")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_time_before: Option<f64>,
#[serde(rename = "LastModifiedTimeAfter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_modified_time_after: Option<f64>,
#[serde(rename = "LastModifiedTimeBefore")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_modified_time_before: Option<f64>,
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NameContains")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name_contains: Option<String>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "SortBy")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sort_by: Option<String>,
#[serde(rename = "SortOrder")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sort_order: Option<String>,
#[serde(rename = "StatusEquals")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status_equals: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListTransformJobsResponse {
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "TransformJobSummaries")]
pub transform_job_summaries: Vec<TransformJobSummary>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListWorkteamsRequest {
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NameContains")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name_contains: Option<String>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "SortBy")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sort_by: Option<String>,
#[serde(rename = "SortOrder")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sort_order: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListWorkteamsResponse {
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "Workteams")]
pub workteams: Vec<Workteam>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct MemberDefinition {
#[serde(rename = "CognitoMemberDefinition")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cognito_member_definition: Option<CognitoMemberDefinition>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct MetricData {
#[serde(rename = "MetricName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub metric_name: Option<String>,
#[serde(rename = "Timestamp")]
#[serde(skip_serializing_if = "Option::is_none")]
pub timestamp: Option<f64>,
#[serde(rename = "Value")]
#[serde(skip_serializing_if = "Option::is_none")]
pub value: Option<f32>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct MetricDefinition {
#[serde(rename = "Name")]
pub name: String,
#[serde(rename = "Regex")]
pub regex: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ModelArtifacts {
#[serde(rename = "S3ModelArtifacts")]
pub s3_model_artifacts: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ModelPackageContainerDefinition {
#[serde(rename = "ContainerHostname")]
#[serde(skip_serializing_if = "Option::is_none")]
pub container_hostname: Option<String>,
#[serde(rename = "Image")]
pub image: String,
#[serde(rename = "ImageDigest")]
#[serde(skip_serializing_if = "Option::is_none")]
pub image_digest: Option<String>,
#[serde(rename = "ModelDataUrl")]
#[serde(skip_serializing_if = "Option::is_none")]
pub model_data_url: Option<String>,
#[serde(rename = "ProductId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub product_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ModelPackageStatusDetails {
#[serde(rename = "ImageScanStatuses")]
#[serde(skip_serializing_if = "Option::is_none")]
pub image_scan_statuses: Option<Vec<ModelPackageStatusItem>>,
#[serde(rename = "ValidationStatuses")]
pub validation_statuses: Vec<ModelPackageStatusItem>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ModelPackageStatusItem {
#[serde(rename = "FailureReason")]
#[serde(skip_serializing_if = "Option::is_none")]
pub failure_reason: Option<String>,
#[serde(rename = "Name")]
pub name: String,
#[serde(rename = "Status")]
pub status: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ModelPackageSummary {
#[serde(rename = "CreationTime")]
pub creation_time: f64,
#[serde(rename = "ModelPackageArn")]
pub model_package_arn: String,
#[serde(rename = "ModelPackageDescription")]
#[serde(skip_serializing_if = "Option::is_none")]
pub model_package_description: Option<String>,
#[serde(rename = "ModelPackageName")]
pub model_package_name: String,
#[serde(rename = "ModelPackageStatus")]
pub model_package_status: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ModelPackageValidationProfile {
#[serde(rename = "ProfileName")]
pub profile_name: String,
#[serde(rename = "TransformJobDefinition")]
pub transform_job_definition: TransformJobDefinition,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ModelPackageValidationSpecification {
#[serde(rename = "ValidationProfiles")]
pub validation_profiles: Vec<ModelPackageValidationProfile>,
#[serde(rename = "ValidationRole")]
pub validation_role: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ModelSummary {
#[serde(rename = "CreationTime")]
pub creation_time: f64,
#[serde(rename = "ModelArn")]
pub model_arn: String,
#[serde(rename = "ModelName")]
pub model_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct NestedFilters {
#[serde(rename = "Filters")]
pub filters: Vec<Filter>,
#[serde(rename = "NestedPropertyName")]
pub nested_property_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct NotebookInstanceLifecycleConfigSummary {
#[serde(rename = "CreationTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_time: Option<f64>,
#[serde(rename = "LastModifiedTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_modified_time: Option<f64>,
#[serde(rename = "NotebookInstanceLifecycleConfigArn")]
pub notebook_instance_lifecycle_config_arn: String,
#[serde(rename = "NotebookInstanceLifecycleConfigName")]
pub notebook_instance_lifecycle_config_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct NotebookInstanceLifecycleHook {
#[serde(rename = "Content")]
#[serde(skip_serializing_if = "Option::is_none")]
pub content: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct NotebookInstanceSummary {
#[serde(rename = "AdditionalCodeRepositories")]
#[serde(skip_serializing_if = "Option::is_none")]
pub additional_code_repositories: Option<Vec<String>>,
#[serde(rename = "CreationTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_time: Option<f64>,
#[serde(rename = "DefaultCodeRepository")]
#[serde(skip_serializing_if = "Option::is_none")]
pub default_code_repository: Option<String>,
#[serde(rename = "InstanceType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instance_type: Option<String>,
#[serde(rename = "LastModifiedTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_modified_time: Option<f64>,
#[serde(rename = "NotebookInstanceArn")]
pub notebook_instance_arn: String,
#[serde(rename = "NotebookInstanceLifecycleConfigName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub notebook_instance_lifecycle_config_name: Option<String>,
#[serde(rename = "NotebookInstanceName")]
pub notebook_instance_name: String,
#[serde(rename = "NotebookInstanceStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub notebook_instance_status: Option<String>,
#[serde(rename = "Url")]
#[serde(skip_serializing_if = "Option::is_none")]
pub url: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ObjectiveStatusCounters {
#[serde(rename = "Failed")]
#[serde(skip_serializing_if = "Option::is_none")]
pub failed: Option<i64>,
#[serde(rename = "Pending")]
#[serde(skip_serializing_if = "Option::is_none")]
pub pending: Option<i64>,
#[serde(rename = "Succeeded")]
#[serde(skip_serializing_if = "Option::is_none")]
pub succeeded: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct OutputConfig {
#[serde(rename = "S3OutputLocation")]
pub s3_output_location: String,
#[serde(rename = "TargetDevice")]
pub target_device: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct OutputDataConfig {
#[serde(rename = "KmsKeyId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub kms_key_id: Option<String>,
#[serde(rename = "S3OutputPath")]
pub s3_output_path: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ParameterRange {
#[serde(rename = "CategoricalParameterRangeSpecification")]
#[serde(skip_serializing_if = "Option::is_none")]
pub categorical_parameter_range_specification: Option<CategoricalParameterRangeSpecification>,
#[serde(rename = "ContinuousParameterRangeSpecification")]
#[serde(skip_serializing_if = "Option::is_none")]
pub continuous_parameter_range_specification: Option<ContinuousParameterRangeSpecification>,
#[serde(rename = "IntegerParameterRangeSpecification")]
#[serde(skip_serializing_if = "Option::is_none")]
pub integer_parameter_range_specification: Option<IntegerParameterRangeSpecification>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ParameterRanges {
#[serde(rename = "CategoricalParameterRanges")]
#[serde(skip_serializing_if = "Option::is_none")]
pub categorical_parameter_ranges: Option<Vec<CategoricalParameterRange>>,
#[serde(rename = "ContinuousParameterRanges")]
#[serde(skip_serializing_if = "Option::is_none")]
pub continuous_parameter_ranges: Option<Vec<ContinuousParameterRange>>,
#[serde(rename = "IntegerParameterRanges")]
#[serde(skip_serializing_if = "Option::is_none")]
pub integer_parameter_ranges: Option<Vec<IntegerParameterRange>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ParentHyperParameterTuningJob {
#[serde(rename = "HyperParameterTuningJobName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hyper_parameter_tuning_job_name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ProductionVariant {
#[serde(rename = "AcceleratorType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accelerator_type: Option<String>,
#[serde(rename = "InitialInstanceCount")]
pub initial_instance_count: i64,
#[serde(rename = "InitialVariantWeight")]
#[serde(skip_serializing_if = "Option::is_none")]
pub initial_variant_weight: Option<f32>,
#[serde(rename = "InstanceType")]
pub instance_type: String,
#[serde(rename = "ModelName")]
pub model_name: String,
#[serde(rename = "VariantName")]
pub variant_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ProductionVariantSummary {
#[serde(rename = "CurrentInstanceCount")]
#[serde(skip_serializing_if = "Option::is_none")]
pub current_instance_count: Option<i64>,
#[serde(rename = "CurrentWeight")]
#[serde(skip_serializing_if = "Option::is_none")]
pub current_weight: Option<f32>,
#[serde(rename = "DeployedImages")]
#[serde(skip_serializing_if = "Option::is_none")]
pub deployed_images: Option<Vec<DeployedImage>>,
#[serde(rename = "DesiredInstanceCount")]
#[serde(skip_serializing_if = "Option::is_none")]
pub desired_instance_count: Option<i64>,
#[serde(rename = "DesiredWeight")]
#[serde(skip_serializing_if = "Option::is_none")]
pub desired_weight: Option<f32>,
#[serde(rename = "VariantName")]
pub variant_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct PropertyNameQuery {
#[serde(rename = "PropertyNameHint")]
pub property_name_hint: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct PropertyNameSuggestion {
#[serde(rename = "PropertyName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub property_name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct PublicWorkforceTaskPrice {
#[serde(rename = "AmountInUsd")]
#[serde(skip_serializing_if = "Option::is_none")]
pub amount_in_usd: Option<USD>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct RenderUiTemplateRequest {
#[serde(rename = "RoleArn")]
pub role_arn: String,
#[serde(rename = "Task")]
pub task: RenderableTask,
#[serde(rename = "UiTemplate")]
pub ui_template: UiTemplate,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct RenderUiTemplateResponse {
#[serde(rename = "Errors")]
pub errors: Vec<RenderingError>,
#[serde(rename = "RenderedContent")]
pub rendered_content: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct RenderableTask {
#[serde(rename = "Input")]
pub input: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct RenderingError {
#[serde(rename = "Code")]
pub code: String,
#[serde(rename = "Message")]
pub message: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ResourceConfig {
#[serde(rename = "InstanceCount")]
pub instance_count: i64,
#[serde(rename = "InstanceType")]
pub instance_type: String,
#[serde(rename = "VolumeKmsKeyId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_kms_key_id: Option<String>,
#[serde(rename = "VolumeSizeInGB")]
pub volume_size_in_gb: i64,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ResourceLimits {
#[serde(rename = "MaxNumberOfTrainingJobs")]
pub max_number_of_training_jobs: i64,
#[serde(rename = "MaxParallelTrainingJobs")]
pub max_parallel_training_jobs: i64,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct S3DataSource {
#[serde(rename = "AttributeNames")]
#[serde(skip_serializing_if = "Option::is_none")]
pub attribute_names: Option<Vec<String>>,
#[serde(rename = "S3DataDistributionType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub s3_data_distribution_type: Option<String>,
#[serde(rename = "S3DataType")]
pub s3_data_type: String,
#[serde(rename = "S3Uri")]
pub s3_uri: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct SearchExpression {
#[serde(rename = "Filters")]
#[serde(skip_serializing_if = "Option::is_none")]
pub filters: Option<Vec<Filter>>,
#[serde(rename = "NestedFilters")]
#[serde(skip_serializing_if = "Option::is_none")]
pub nested_filters: Option<Vec<NestedFilters>>,
#[serde(rename = "Operator")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operator: Option<String>,
#[serde(rename = "SubExpressions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sub_expressions: Option<Vec<SearchExpression>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct SearchRecord {
#[serde(rename = "TrainingJob")]
#[serde(skip_serializing_if = "Option::is_none")]
pub training_job: Option<TrainingJob>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct SearchRequest {
#[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 = "Resource")]
pub resource: String,
#[serde(rename = "SearchExpression")]
#[serde(skip_serializing_if = "Option::is_none")]
pub search_expression: Option<SearchExpression>,
#[serde(rename = "SortBy")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sort_by: Option<String>,
#[serde(rename = "SortOrder")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sort_order: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct SearchResponse {
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "Results")]
#[serde(skip_serializing_if = "Option::is_none")]
pub results: Option<Vec<SearchRecord>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct SecondaryStatusTransition {
#[serde(rename = "EndTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub end_time: Option<f64>,
#[serde(rename = "StartTime")]
pub start_time: f64,
#[serde(rename = "Status")]
pub status: String,
#[serde(rename = "StatusMessage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status_message: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ShuffleConfig {
#[serde(rename = "Seed")]
pub seed: i64,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SourceAlgorithm {
#[serde(rename = "AlgorithmName")]
pub algorithm_name: String,
#[serde(rename = "ModelDataUrl")]
#[serde(skip_serializing_if = "Option::is_none")]
pub model_data_url: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SourceAlgorithmSpecification {
#[serde(rename = "SourceAlgorithms")]
pub source_algorithms: Vec<SourceAlgorithm>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct StartNotebookInstanceInput {
#[serde(rename = "NotebookInstanceName")]
pub notebook_instance_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct StopCompilationJobRequest {
#[serde(rename = "CompilationJobName")]
pub compilation_job_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct StopHyperParameterTuningJobRequest {
#[serde(rename = "HyperParameterTuningJobName")]
pub hyper_parameter_tuning_job_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct StopLabelingJobRequest {
#[serde(rename = "LabelingJobName")]
pub labeling_job_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct StopNotebookInstanceInput {
#[serde(rename = "NotebookInstanceName")]
pub notebook_instance_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct StopTrainingJobRequest {
#[serde(rename = "TrainingJobName")]
pub training_job_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct StopTransformJobRequest {
#[serde(rename = "TransformJobName")]
pub transform_job_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct StoppingCondition {
#[serde(rename = "MaxRuntimeInSeconds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_runtime_in_seconds: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct SubscribedWorkteam {
#[serde(rename = "ListingId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub listing_id: Option<String>,
#[serde(rename = "MarketplaceDescription")]
#[serde(skip_serializing_if = "Option::is_none")]
pub marketplace_description: Option<String>,
#[serde(rename = "MarketplaceTitle")]
#[serde(skip_serializing_if = "Option::is_none")]
pub marketplace_title: Option<String>,
#[serde(rename = "SellerName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub seller_name: Option<String>,
#[serde(rename = "WorkteamArn")]
pub workteam_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct SuggestionQuery {
#[serde(rename = "PropertyNameQuery")]
#[serde(skip_serializing_if = "Option::is_none")]
pub property_name_query: Option<PropertyNameQuery>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Tag {
#[serde(rename = "Key")]
pub key: String,
#[serde(rename = "Value")]
pub value: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct TrainingJob {
#[serde(rename = "AlgorithmSpecification")]
#[serde(skip_serializing_if = "Option::is_none")]
pub algorithm_specification: Option<AlgorithmSpecification>,
#[serde(rename = "CreationTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_time: Option<f64>,
#[serde(rename = "EnableNetworkIsolation")]
#[serde(skip_serializing_if = "Option::is_none")]
pub enable_network_isolation: Option<bool>,
#[serde(rename = "FailureReason")]
#[serde(skip_serializing_if = "Option::is_none")]
pub failure_reason: Option<String>,
#[serde(rename = "FinalMetricDataList")]
#[serde(skip_serializing_if = "Option::is_none")]
pub final_metric_data_list: Option<Vec<MetricData>>,
#[serde(rename = "HyperParameters")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hyper_parameters: Option<::std::collections::HashMap<String, String>>,
#[serde(rename = "InputDataConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub input_data_config: Option<Vec<Channel>>,
#[serde(rename = "LabelingJobArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub labeling_job_arn: Option<String>,
#[serde(rename = "LastModifiedTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_modified_time: Option<f64>,
#[serde(rename = "ModelArtifacts")]
#[serde(skip_serializing_if = "Option::is_none")]
pub model_artifacts: Option<ModelArtifacts>,
#[serde(rename = "OutputDataConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub output_data_config: Option<OutputDataConfig>,
#[serde(rename = "ResourceConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_config: Option<ResourceConfig>,
#[serde(rename = "RoleArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub role_arn: Option<String>,
#[serde(rename = "SecondaryStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub secondary_status: Option<String>,
#[serde(rename = "SecondaryStatusTransitions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub secondary_status_transitions: Option<Vec<SecondaryStatusTransition>>,
#[serde(rename = "StoppingCondition")]
#[serde(skip_serializing_if = "Option::is_none")]
pub stopping_condition: Option<StoppingCondition>,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
#[serde(rename = "TrainingEndTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub training_end_time: Option<f64>,
#[serde(rename = "TrainingJobArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub training_job_arn: Option<String>,
#[serde(rename = "TrainingJobName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub training_job_name: Option<String>,
#[serde(rename = "TrainingJobStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub training_job_status: Option<String>,
#[serde(rename = "TrainingStartTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub training_start_time: Option<f64>,
#[serde(rename = "TuningJobArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tuning_job_arn: Option<String>,
#[serde(rename = "VpcConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub vpc_config: Option<VpcConfig>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct TrainingJobDefinition {
#[serde(rename = "HyperParameters")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hyper_parameters: Option<::std::collections::HashMap<String, String>>,
#[serde(rename = "InputDataConfig")]
pub input_data_config: Vec<Channel>,
#[serde(rename = "OutputDataConfig")]
pub output_data_config: OutputDataConfig,
#[serde(rename = "ResourceConfig")]
pub resource_config: ResourceConfig,
#[serde(rename = "StoppingCondition")]
pub stopping_condition: StoppingCondition,
#[serde(rename = "TrainingInputMode")]
pub training_input_mode: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct TrainingJobStatusCounters {
#[serde(rename = "Completed")]
#[serde(skip_serializing_if = "Option::is_none")]
pub completed: Option<i64>,
#[serde(rename = "InProgress")]
#[serde(skip_serializing_if = "Option::is_none")]
pub in_progress: Option<i64>,
#[serde(rename = "NonRetryableError")]
#[serde(skip_serializing_if = "Option::is_none")]
pub non_retryable_error: Option<i64>,
#[serde(rename = "RetryableError")]
#[serde(skip_serializing_if = "Option::is_none")]
pub retryable_error: Option<i64>,
#[serde(rename = "Stopped")]
#[serde(skip_serializing_if = "Option::is_none")]
pub stopped: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct TrainingJobSummary {
#[serde(rename = "CreationTime")]
pub creation_time: f64,
#[serde(rename = "LastModifiedTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_modified_time: Option<f64>,
#[serde(rename = "TrainingEndTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub training_end_time: Option<f64>,
#[serde(rename = "TrainingJobArn")]
pub training_job_arn: String,
#[serde(rename = "TrainingJobName")]
pub training_job_name: String,
#[serde(rename = "TrainingJobStatus")]
pub training_job_status: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct TrainingSpecification {
#[serde(rename = "MetricDefinitions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub metric_definitions: Option<Vec<MetricDefinition>>,
#[serde(rename = "SupportedHyperParameters")]
#[serde(skip_serializing_if = "Option::is_none")]
pub supported_hyper_parameters: Option<Vec<HyperParameterSpecification>>,
#[serde(rename = "SupportedTrainingInstanceTypes")]
pub supported_training_instance_types: Vec<String>,
#[serde(rename = "SupportedTuningJobObjectiveMetrics")]
#[serde(skip_serializing_if = "Option::is_none")]
pub supported_tuning_job_objective_metrics: Option<Vec<HyperParameterTuningJobObjective>>,
#[serde(rename = "SupportsDistributedTraining")]
#[serde(skip_serializing_if = "Option::is_none")]
pub supports_distributed_training: Option<bool>,
#[serde(rename = "TrainingChannels")]
pub training_channels: Vec<ChannelSpecification>,
#[serde(rename = "TrainingImage")]
pub training_image: String,
#[serde(rename = "TrainingImageDigest")]
#[serde(skip_serializing_if = "Option::is_none")]
pub training_image_digest: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct TransformDataSource {
#[serde(rename = "S3DataSource")]
pub s3_data_source: TransformS3DataSource,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct TransformInput {
#[serde(rename = "CompressionType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub compression_type: Option<String>,
#[serde(rename = "ContentType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub content_type: Option<String>,
#[serde(rename = "DataSource")]
pub data_source: TransformDataSource,
#[serde(rename = "SplitType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub split_type: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct TransformJobDefinition {
#[serde(rename = "BatchStrategy")]
#[serde(skip_serializing_if = "Option::is_none")]
pub batch_strategy: Option<String>,
#[serde(rename = "Environment")]
#[serde(skip_serializing_if = "Option::is_none")]
pub environment: Option<::std::collections::HashMap<String, String>>,
#[serde(rename = "MaxConcurrentTransforms")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_concurrent_transforms: Option<i64>,
#[serde(rename = "MaxPayloadInMB")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_payload_in_mb: Option<i64>,
#[serde(rename = "TransformInput")]
pub transform_input: TransformInput,
#[serde(rename = "TransformOutput")]
pub transform_output: TransformOutput,
#[serde(rename = "TransformResources")]
pub transform_resources: TransformResources,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct TransformJobSummary {
#[serde(rename = "CreationTime")]
pub creation_time: f64,
#[serde(rename = "FailureReason")]
#[serde(skip_serializing_if = "Option::is_none")]
pub failure_reason: Option<String>,
#[serde(rename = "LastModifiedTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_modified_time: Option<f64>,
#[serde(rename = "TransformEndTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub transform_end_time: Option<f64>,
#[serde(rename = "TransformJobArn")]
pub transform_job_arn: String,
#[serde(rename = "TransformJobName")]
pub transform_job_name: String,
#[serde(rename = "TransformJobStatus")]
pub transform_job_status: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct TransformOutput {
#[serde(rename = "Accept")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept: Option<String>,
#[serde(rename = "AssembleWith")]
#[serde(skip_serializing_if = "Option::is_none")]
pub assemble_with: Option<String>,
#[serde(rename = "KmsKeyId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub kms_key_id: Option<String>,
#[serde(rename = "S3OutputPath")]
pub s3_output_path: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct TransformResources {
#[serde(rename = "InstanceCount")]
pub instance_count: i64,
#[serde(rename = "InstanceType")]
pub instance_type: String,
#[serde(rename = "VolumeKmsKeyId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_kms_key_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct TransformS3DataSource {
#[serde(rename = "S3DataType")]
pub s3_data_type: String,
#[serde(rename = "S3Uri")]
pub s3_uri: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct USD {
#[serde(rename = "Cents")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cents: Option<i64>,
#[serde(rename = "Dollars")]
#[serde(skip_serializing_if = "Option::is_none")]
pub dollars: Option<i64>,
#[serde(rename = "TenthFractionsOfACent")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tenth_fractions_of_a_cent: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct UiConfig {
#[serde(rename = "UiTemplateS3Uri")]
pub ui_template_s3_uri: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UiTemplate {
#[serde(rename = "Content")]
pub content: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateCodeRepositoryInput {
#[serde(rename = "CodeRepositoryName")]
pub code_repository_name: String,
#[serde(rename = "GitConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub git_config: Option<GitConfigForUpdate>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateCodeRepositoryOutput {
#[serde(rename = "CodeRepositoryArn")]
pub code_repository_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateEndpointInput {
#[serde(rename = "EndpointConfigName")]
pub endpoint_config_name: String,
#[serde(rename = "EndpointName")]
pub endpoint_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateEndpointOutput {
#[serde(rename = "EndpointArn")]
pub endpoint_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateEndpointWeightsAndCapacitiesInput {
#[serde(rename = "DesiredWeightsAndCapacities")]
pub desired_weights_and_capacities: Vec<DesiredWeightAndCapacity>,
#[serde(rename = "EndpointName")]
pub endpoint_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateEndpointWeightsAndCapacitiesOutput {
#[serde(rename = "EndpointArn")]
pub endpoint_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateNotebookInstanceInput {
#[serde(rename = "AcceleratorTypes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accelerator_types: Option<Vec<String>>,
#[serde(rename = "AdditionalCodeRepositories")]
#[serde(skip_serializing_if = "Option::is_none")]
pub additional_code_repositories: Option<Vec<String>>,
#[serde(rename = "DefaultCodeRepository")]
#[serde(skip_serializing_if = "Option::is_none")]
pub default_code_repository: Option<String>,
#[serde(rename = "DisassociateAcceleratorTypes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub disassociate_accelerator_types: Option<bool>,
#[serde(rename = "DisassociateAdditionalCodeRepositories")]
#[serde(skip_serializing_if = "Option::is_none")]
pub disassociate_additional_code_repositories: Option<bool>,
#[serde(rename = "DisassociateDefaultCodeRepository")]
#[serde(skip_serializing_if = "Option::is_none")]
pub disassociate_default_code_repository: Option<bool>,
#[serde(rename = "DisassociateLifecycleConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub disassociate_lifecycle_config: Option<bool>,
#[serde(rename = "InstanceType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instance_type: Option<String>,
#[serde(rename = "LifecycleConfigName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub lifecycle_config_name: Option<String>,
#[serde(rename = "NotebookInstanceName")]
pub notebook_instance_name: String,
#[serde(rename = "RoleArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub role_arn: Option<String>,
#[serde(rename = "VolumeSizeInGB")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_size_in_gb: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateNotebookInstanceLifecycleConfigInput {
#[serde(rename = "NotebookInstanceLifecycleConfigName")]
pub notebook_instance_lifecycle_config_name: String,
#[serde(rename = "OnCreate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub on_create: Option<Vec<NotebookInstanceLifecycleHook>>,
#[serde(rename = "OnStart")]
#[serde(skip_serializing_if = "Option::is_none")]
pub on_start: Option<Vec<NotebookInstanceLifecycleHook>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateNotebookInstanceLifecycleConfigOutput {}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateNotebookInstanceOutput {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateWorkteamRequest {
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "MemberDefinitions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub member_definitions: Option<Vec<MemberDefinition>>,
#[serde(rename = "WorkteamName")]
pub workteam_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateWorkteamResponse {
#[serde(rename = "Workteam")]
pub workteam: Workteam,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct VpcConfig {
#[serde(rename = "SecurityGroupIds")]
pub security_group_ids: Vec<String>,
#[serde(rename = "Subnets")]
pub subnets: Vec<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Workteam {
#[serde(rename = "CreateDate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub create_date: Option<f64>,
#[serde(rename = "Description")]
pub description: String,
#[serde(rename = "LastUpdatedDate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_updated_date: Option<f64>,
#[serde(rename = "MemberDefinitions")]
pub member_definitions: Vec<MemberDefinition>,
#[serde(rename = "ProductListingIds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub product_listing_ids: Option<Vec<String>>,
#[serde(rename = "SubDomain")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sub_domain: Option<String>,
#[serde(rename = "WorkteamArn")]
pub workteam_arn: String,
#[serde(rename = "WorkteamName")]
pub workteam_name: String,
}
#[derive(Debug, PartialEq)]
pub enum AddTagsError {
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl AddTagsError {
pub fn from_response(res: BufferedHttpResponse) -> AddTagsError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ValidationException" => return AddTagsError::Validation(error_message.to_string()),
_ => {}
}
}
return AddTagsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for AddTagsError {
fn from(err: serde_json::error::Error) -> AddTagsError {
AddTagsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for AddTagsError {
fn from(err: CredentialsError) -> AddTagsError {
AddTagsError::Credentials(err)
}
}
impl From<HttpDispatchError> for AddTagsError {
fn from(err: HttpDispatchError) -> AddTagsError {
AddTagsError::HttpDispatch(err)
}
}
impl From<io::Error> for AddTagsError {
fn from(err: io::Error) -> AddTagsError {
AddTagsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for AddTagsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for AddTagsError {
fn description(&self) -> &str {
match *self {
AddTagsError::Validation(ref cause) => cause,
AddTagsError::Credentials(ref err) => err.description(),
AddTagsError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
AddTagsError::ParseError(ref cause) => cause,
AddTagsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateAlgorithmError {
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl CreateAlgorithmError {
pub fn from_response(res: BufferedHttpResponse) -> CreateAlgorithmError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ValidationException" => {
return CreateAlgorithmError::Validation(error_message.to_string());
}
_ => {}
}
}
return CreateAlgorithmError::Unknown(res);
}
}
impl From<serde_json::error::Error> for CreateAlgorithmError {
fn from(err: serde_json::error::Error) -> CreateAlgorithmError {
CreateAlgorithmError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for CreateAlgorithmError {
fn from(err: CredentialsError) -> CreateAlgorithmError {
CreateAlgorithmError::Credentials(err)
}
}
impl From<HttpDispatchError> for CreateAlgorithmError {
fn from(err: HttpDispatchError) -> CreateAlgorithmError {
CreateAlgorithmError::HttpDispatch(err)
}
}
impl From<io::Error> for CreateAlgorithmError {
fn from(err: io::Error) -> CreateAlgorithmError {
CreateAlgorithmError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for CreateAlgorithmError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateAlgorithmError {
fn description(&self) -> &str {
match *self {
CreateAlgorithmError::Validation(ref cause) => cause,
CreateAlgorithmError::Credentials(ref err) => err.description(),
CreateAlgorithmError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
CreateAlgorithmError::ParseError(ref cause) => cause,
CreateAlgorithmError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateCodeRepositoryError {
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl CreateCodeRepositoryError {
pub fn from_response(res: BufferedHttpResponse) -> CreateCodeRepositoryError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ValidationException" => {
return CreateCodeRepositoryError::Validation(error_message.to_string());
}
_ => {}
}
}
return CreateCodeRepositoryError::Unknown(res);
}
}
impl From<serde_json::error::Error> for CreateCodeRepositoryError {
fn from(err: serde_json::error::Error) -> CreateCodeRepositoryError {
CreateCodeRepositoryError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for CreateCodeRepositoryError {
fn from(err: CredentialsError) -> CreateCodeRepositoryError {
CreateCodeRepositoryError::Credentials(err)
}
}
impl From<HttpDispatchError> for CreateCodeRepositoryError {
fn from(err: HttpDispatchError) -> CreateCodeRepositoryError {
CreateCodeRepositoryError::HttpDispatch(err)
}
}
impl From<io::Error> for CreateCodeRepositoryError {
fn from(err: io::Error) -> CreateCodeRepositoryError {
CreateCodeRepositoryError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for CreateCodeRepositoryError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateCodeRepositoryError {
fn description(&self) -> &str {
match *self {
CreateCodeRepositoryError::Validation(ref cause) => cause,
CreateCodeRepositoryError::Credentials(ref err) => err.description(),
CreateCodeRepositoryError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
CreateCodeRepositoryError::ParseError(ref cause) => cause,
CreateCodeRepositoryError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateCompilationJobError {
ResourceInUse(String),
ResourceLimitExceeded(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl CreateCompilationJobError {
pub fn from_response(res: BufferedHttpResponse) -> CreateCompilationJobError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ResourceInUse" => {
return CreateCompilationJobError::ResourceInUse(String::from(error_message));
}
"ResourceLimitExceeded" => {
return CreateCompilationJobError::ResourceLimitExceeded(String::from(
error_message,
));
}
"ValidationException" => {
return CreateCompilationJobError::Validation(error_message.to_string());
}
_ => {}
}
}
return CreateCompilationJobError::Unknown(res);
}
}
impl From<serde_json::error::Error> for CreateCompilationJobError {
fn from(err: serde_json::error::Error) -> CreateCompilationJobError {
CreateCompilationJobError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for CreateCompilationJobError {
fn from(err: CredentialsError) -> CreateCompilationJobError {
CreateCompilationJobError::Credentials(err)
}
}
impl From<HttpDispatchError> for CreateCompilationJobError {
fn from(err: HttpDispatchError) -> CreateCompilationJobError {
CreateCompilationJobError::HttpDispatch(err)
}
}
impl From<io::Error> for CreateCompilationJobError {
fn from(err: io::Error) -> CreateCompilationJobError {
CreateCompilationJobError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for CreateCompilationJobError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateCompilationJobError {
fn description(&self) -> &str {
match *self {
CreateCompilationJobError::ResourceInUse(ref cause) => cause,
CreateCompilationJobError::ResourceLimitExceeded(ref cause) => cause,
CreateCompilationJobError::Validation(ref cause) => cause,
CreateCompilationJobError::Credentials(ref err) => err.description(),
CreateCompilationJobError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
CreateCompilationJobError::ParseError(ref cause) => cause,
CreateCompilationJobError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateEndpointError {
ResourceLimitExceeded(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl CreateEndpointError {
pub fn from_response(res: BufferedHttpResponse) -> CreateEndpointError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ResourceLimitExceeded" => {
return CreateEndpointError::ResourceLimitExceeded(String::from(error_message));
}
"ValidationException" => {
return CreateEndpointError::Validation(error_message.to_string());
}
_ => {}
}
}
return CreateEndpointError::Unknown(res);
}
}
impl From<serde_json::error::Error> for CreateEndpointError {
fn from(err: serde_json::error::Error) -> CreateEndpointError {
CreateEndpointError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for CreateEndpointError {
fn from(err: CredentialsError) -> CreateEndpointError {
CreateEndpointError::Credentials(err)
}
}
impl From<HttpDispatchError> for CreateEndpointError {
fn from(err: HttpDispatchError) -> CreateEndpointError {
CreateEndpointError::HttpDispatch(err)
}
}
impl From<io::Error> for CreateEndpointError {
fn from(err: io::Error) -> CreateEndpointError {
CreateEndpointError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for CreateEndpointError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateEndpointError {
fn description(&self) -> &str {
match *self {
CreateEndpointError::ResourceLimitExceeded(ref cause) => cause,
CreateEndpointError::Validation(ref cause) => cause,
CreateEndpointError::Credentials(ref err) => err.description(),
CreateEndpointError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
CreateEndpointError::ParseError(ref cause) => cause,
CreateEndpointError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateEndpointConfigError {
ResourceLimitExceeded(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl CreateEndpointConfigError {
pub fn from_response(res: BufferedHttpResponse) -> CreateEndpointConfigError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ResourceLimitExceeded" => {
return CreateEndpointConfigError::ResourceLimitExceeded(String::from(
error_message,
));
}
"ValidationException" => {
return CreateEndpointConfigError::Validation(error_message.to_string());
}
_ => {}
}
}
return CreateEndpointConfigError::Unknown(res);
}
}
impl From<serde_json::error::Error> for CreateEndpointConfigError {
fn from(err: serde_json::error::Error) -> CreateEndpointConfigError {
CreateEndpointConfigError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for CreateEndpointConfigError {
fn from(err: CredentialsError) -> CreateEndpointConfigError {
CreateEndpointConfigError::Credentials(err)
}
}
impl From<HttpDispatchError> for CreateEndpointConfigError {
fn from(err: HttpDispatchError) -> CreateEndpointConfigError {
CreateEndpointConfigError::HttpDispatch(err)
}
}
impl From<io::Error> for CreateEndpointConfigError {
fn from(err: io::Error) -> CreateEndpointConfigError {
CreateEndpointConfigError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for CreateEndpointConfigError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateEndpointConfigError {
fn description(&self) -> &str {
match *self {
CreateEndpointConfigError::ResourceLimitExceeded(ref cause) => cause,
CreateEndpointConfigError::Validation(ref cause) => cause,
CreateEndpointConfigError::Credentials(ref err) => err.description(),
CreateEndpointConfigError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
CreateEndpointConfigError::ParseError(ref cause) => cause,
CreateEndpointConfigError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateHyperParameterTuningJobError {
ResourceInUse(String),
ResourceLimitExceeded(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl CreateHyperParameterTuningJobError {
pub fn from_response(res: BufferedHttpResponse) -> CreateHyperParameterTuningJobError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ResourceInUse" => {
return CreateHyperParameterTuningJobError::ResourceInUse(String::from(
error_message,
));
}
"ResourceLimitExceeded" => {
return CreateHyperParameterTuningJobError::ResourceLimitExceeded(String::from(
error_message,
));
}
"ValidationException" => {
return CreateHyperParameterTuningJobError::Validation(error_message.to_string());
}
_ => {}
}
}
return CreateHyperParameterTuningJobError::Unknown(res);
}
}
impl From<serde_json::error::Error> for CreateHyperParameterTuningJobError {
fn from(err: serde_json::error::Error) -> CreateHyperParameterTuningJobError {
CreateHyperParameterTuningJobError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for CreateHyperParameterTuningJobError {
fn from(err: CredentialsError) -> CreateHyperParameterTuningJobError {
CreateHyperParameterTuningJobError::Credentials(err)
}
}
impl From<HttpDispatchError> for CreateHyperParameterTuningJobError {
fn from(err: HttpDispatchError) -> CreateHyperParameterTuningJobError {
CreateHyperParameterTuningJobError::HttpDispatch(err)
}
}
impl From<io::Error> for CreateHyperParameterTuningJobError {
fn from(err: io::Error) -> CreateHyperParameterTuningJobError {
CreateHyperParameterTuningJobError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for CreateHyperParameterTuningJobError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateHyperParameterTuningJobError {
fn description(&self) -> &str {
match *self {
CreateHyperParameterTuningJobError::ResourceInUse(ref cause) => cause,
CreateHyperParameterTuningJobError::ResourceLimitExceeded(ref cause) => cause,
CreateHyperParameterTuningJobError::Validation(ref cause) => cause,
CreateHyperParameterTuningJobError::Credentials(ref err) => err.description(),
CreateHyperParameterTuningJobError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
CreateHyperParameterTuningJobError::ParseError(ref cause) => cause,
CreateHyperParameterTuningJobError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateLabelingJobError {
ResourceInUse(String),
ResourceLimitExceeded(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl CreateLabelingJobError {
pub fn from_response(res: BufferedHttpResponse) -> CreateLabelingJobError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ResourceInUse" => {
return CreateLabelingJobError::ResourceInUse(String::from(error_message));
}
"ResourceLimitExceeded" => {
return CreateLabelingJobError::ResourceLimitExceeded(String::from(
error_message,
));
}
"ValidationException" => {
return CreateLabelingJobError::Validation(error_message.to_string());
}
_ => {}
}
}
return CreateLabelingJobError::Unknown(res);
}
}
impl From<serde_json::error::Error> for CreateLabelingJobError {
fn from(err: serde_json::error::Error) -> CreateLabelingJobError {
CreateLabelingJobError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for CreateLabelingJobError {
fn from(err: CredentialsError) -> CreateLabelingJobError {
CreateLabelingJobError::Credentials(err)
}
}
impl From<HttpDispatchError> for CreateLabelingJobError {
fn from(err: HttpDispatchError) -> CreateLabelingJobError {
CreateLabelingJobError::HttpDispatch(err)
}
}
impl From<io::Error> for CreateLabelingJobError {
fn from(err: io::Error) -> CreateLabelingJobError {
CreateLabelingJobError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for CreateLabelingJobError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateLabelingJobError {
fn description(&self) -> &str {
match *self {
CreateLabelingJobError::ResourceInUse(ref cause) => cause,
CreateLabelingJobError::ResourceLimitExceeded(ref cause) => cause,
CreateLabelingJobError::Validation(ref cause) => cause,
CreateLabelingJobError::Credentials(ref err) => err.description(),
CreateLabelingJobError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
CreateLabelingJobError::ParseError(ref cause) => cause,
CreateLabelingJobError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateModelError {
ResourceLimitExceeded(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl CreateModelError {
pub fn from_response(res: BufferedHttpResponse) -> CreateModelError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ResourceLimitExceeded" => {
return CreateModelError::ResourceLimitExceeded(String::from(error_message));
}
"ValidationException" => {
return CreateModelError::Validation(error_message.to_string());
}
_ => {}
}
}
return CreateModelError::Unknown(res);
}
}
impl From<serde_json::error::Error> for CreateModelError {
fn from(err: serde_json::error::Error) -> CreateModelError {
CreateModelError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for CreateModelError {
fn from(err: CredentialsError) -> CreateModelError {
CreateModelError::Credentials(err)
}
}
impl From<HttpDispatchError> for CreateModelError {
fn from(err: HttpDispatchError) -> CreateModelError {
CreateModelError::HttpDispatch(err)
}
}
impl From<io::Error> for CreateModelError {
fn from(err: io::Error) -> CreateModelError {
CreateModelError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for CreateModelError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateModelError {
fn description(&self) -> &str {
match *self {
CreateModelError::ResourceLimitExceeded(ref cause) => cause,
CreateModelError::Validation(ref cause) => cause,
CreateModelError::Credentials(ref err) => err.description(),
CreateModelError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
CreateModelError::ParseError(ref cause) => cause,
CreateModelError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateModelPackageError {
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl CreateModelPackageError {
pub fn from_response(res: BufferedHttpResponse) -> CreateModelPackageError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ValidationException" => {
return CreateModelPackageError::Validation(error_message.to_string());
}
_ => {}
}
}
return CreateModelPackageError::Unknown(res);
}
}
impl From<serde_json::error::Error> for CreateModelPackageError {
fn from(err: serde_json::error::Error) -> CreateModelPackageError {
CreateModelPackageError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for CreateModelPackageError {
fn from(err: CredentialsError) -> CreateModelPackageError {
CreateModelPackageError::Credentials(err)
}
}
impl From<HttpDispatchError> for CreateModelPackageError {
fn from(err: HttpDispatchError) -> CreateModelPackageError {
CreateModelPackageError::HttpDispatch(err)
}
}
impl From<io::Error> for CreateModelPackageError {
fn from(err: io::Error) -> CreateModelPackageError {
CreateModelPackageError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for CreateModelPackageError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateModelPackageError {
fn description(&self) -> &str {
match *self {
CreateModelPackageError::Validation(ref cause) => cause,
CreateModelPackageError::Credentials(ref err) => err.description(),
CreateModelPackageError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
CreateModelPackageError::ParseError(ref cause) => cause,
CreateModelPackageError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateNotebookInstanceError {
ResourceLimitExceeded(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl CreateNotebookInstanceError {
pub fn from_response(res: BufferedHttpResponse) -> CreateNotebookInstanceError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ResourceLimitExceeded" => {
return CreateNotebookInstanceError::ResourceLimitExceeded(String::from(
error_message,
));
}
"ValidationException" => {
return CreateNotebookInstanceError::Validation(error_message.to_string());
}
_ => {}
}
}
return CreateNotebookInstanceError::Unknown(res);
}
}
impl From<serde_json::error::Error> for CreateNotebookInstanceError {
fn from(err: serde_json::error::Error) -> CreateNotebookInstanceError {
CreateNotebookInstanceError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for CreateNotebookInstanceError {
fn from(err: CredentialsError) -> CreateNotebookInstanceError {
CreateNotebookInstanceError::Credentials(err)
}
}
impl From<HttpDispatchError> for CreateNotebookInstanceError {
fn from(err: HttpDispatchError) -> CreateNotebookInstanceError {
CreateNotebookInstanceError::HttpDispatch(err)
}
}
impl From<io::Error> for CreateNotebookInstanceError {
fn from(err: io::Error) -> CreateNotebookInstanceError {
CreateNotebookInstanceError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for CreateNotebookInstanceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateNotebookInstanceError {
fn description(&self) -> &str {
match *self {
CreateNotebookInstanceError::ResourceLimitExceeded(ref cause) => cause,
CreateNotebookInstanceError::Validation(ref cause) => cause,
CreateNotebookInstanceError::Credentials(ref err) => err.description(),
CreateNotebookInstanceError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
CreateNotebookInstanceError::ParseError(ref cause) => cause,
CreateNotebookInstanceError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateNotebookInstanceLifecycleConfigError {
ResourceLimitExceeded(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl CreateNotebookInstanceLifecycleConfigError {
pub fn from_response(res: BufferedHttpResponse) -> CreateNotebookInstanceLifecycleConfigError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ResourceLimitExceeded" => {
return CreateNotebookInstanceLifecycleConfigError::ResourceLimitExceeded(
String::from(error_message),
);
}
"ValidationException" => {
return CreateNotebookInstanceLifecycleConfigError::Validation(
error_message.to_string(),
);
}
_ => {}
}
}
return CreateNotebookInstanceLifecycleConfigError::Unknown(res);
}
}
impl From<serde_json::error::Error> for CreateNotebookInstanceLifecycleConfigError {
fn from(err: serde_json::error::Error) -> CreateNotebookInstanceLifecycleConfigError {
CreateNotebookInstanceLifecycleConfigError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for CreateNotebookInstanceLifecycleConfigError {
fn from(err: CredentialsError) -> CreateNotebookInstanceLifecycleConfigError {
CreateNotebookInstanceLifecycleConfigError::Credentials(err)
}
}
impl From<HttpDispatchError> for CreateNotebookInstanceLifecycleConfigError {
fn from(err: HttpDispatchError) -> CreateNotebookInstanceLifecycleConfigError {
CreateNotebookInstanceLifecycleConfigError::HttpDispatch(err)
}
}
impl From<io::Error> for CreateNotebookInstanceLifecycleConfigError {
fn from(err: io::Error) -> CreateNotebookInstanceLifecycleConfigError {
CreateNotebookInstanceLifecycleConfigError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for CreateNotebookInstanceLifecycleConfigError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateNotebookInstanceLifecycleConfigError {
fn description(&self) -> &str {
match *self {
CreateNotebookInstanceLifecycleConfigError::ResourceLimitExceeded(ref cause) => cause,
CreateNotebookInstanceLifecycleConfigError::Validation(ref cause) => cause,
CreateNotebookInstanceLifecycleConfigError::Credentials(ref err) => err.description(),
CreateNotebookInstanceLifecycleConfigError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
CreateNotebookInstanceLifecycleConfigError::ParseError(ref cause) => cause,
CreateNotebookInstanceLifecycleConfigError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreatePresignedNotebookInstanceUrlError {
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl CreatePresignedNotebookInstanceUrlError {
pub fn from_response(res: BufferedHttpResponse) -> CreatePresignedNotebookInstanceUrlError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ValidationException" => {
return CreatePresignedNotebookInstanceUrlError::Validation(
error_message.to_string(),
);
}
_ => {}
}
}
return CreatePresignedNotebookInstanceUrlError::Unknown(res);
}
}
impl From<serde_json::error::Error> for CreatePresignedNotebookInstanceUrlError {
fn from(err: serde_json::error::Error) -> CreatePresignedNotebookInstanceUrlError {
CreatePresignedNotebookInstanceUrlError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for CreatePresignedNotebookInstanceUrlError {
fn from(err: CredentialsError) -> CreatePresignedNotebookInstanceUrlError {
CreatePresignedNotebookInstanceUrlError::Credentials(err)
}
}
impl From<HttpDispatchError> for CreatePresignedNotebookInstanceUrlError {
fn from(err: HttpDispatchError) -> CreatePresignedNotebookInstanceUrlError {
CreatePresignedNotebookInstanceUrlError::HttpDispatch(err)
}
}
impl From<io::Error> for CreatePresignedNotebookInstanceUrlError {
fn from(err: io::Error) -> CreatePresignedNotebookInstanceUrlError {
CreatePresignedNotebookInstanceUrlError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for CreatePresignedNotebookInstanceUrlError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreatePresignedNotebookInstanceUrlError {
fn description(&self) -> &str {
match *self {
CreatePresignedNotebookInstanceUrlError::Validation(ref cause) => cause,
CreatePresignedNotebookInstanceUrlError::Credentials(ref err) => err.description(),
CreatePresignedNotebookInstanceUrlError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
CreatePresignedNotebookInstanceUrlError::ParseError(ref cause) => cause,
CreatePresignedNotebookInstanceUrlError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateTrainingJobError {
ResourceInUse(String),
ResourceLimitExceeded(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl CreateTrainingJobError {
pub fn from_response(res: BufferedHttpResponse) -> CreateTrainingJobError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ResourceInUse" => {
return CreateTrainingJobError::ResourceInUse(String::from(error_message));
}
"ResourceLimitExceeded" => {
return CreateTrainingJobError::ResourceLimitExceeded(String::from(
error_message,
));
}
"ValidationException" => {
return CreateTrainingJobError::Validation(error_message.to_string());
}
_ => {}
}
}
return CreateTrainingJobError::Unknown(res);
}
}
impl From<serde_json::error::Error> for CreateTrainingJobError {
fn from(err: serde_json::error::Error) -> CreateTrainingJobError {
CreateTrainingJobError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for CreateTrainingJobError {
fn from(err: CredentialsError) -> CreateTrainingJobError {
CreateTrainingJobError::Credentials(err)
}
}
impl From<HttpDispatchError> for CreateTrainingJobError {
fn from(err: HttpDispatchError) -> CreateTrainingJobError {
CreateTrainingJobError::HttpDispatch(err)
}
}
impl From<io::Error> for CreateTrainingJobError {
fn from(err: io::Error) -> CreateTrainingJobError {
CreateTrainingJobError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for CreateTrainingJobError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateTrainingJobError {
fn description(&self) -> &str {
match *self {
CreateTrainingJobError::ResourceInUse(ref cause) => cause,
CreateTrainingJobError::ResourceLimitExceeded(ref cause) => cause,
CreateTrainingJobError::Validation(ref cause) => cause,
CreateTrainingJobError::Credentials(ref err) => err.description(),
CreateTrainingJobError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
CreateTrainingJobError::ParseError(ref cause) => cause,
CreateTrainingJobError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateTransformJobError {
ResourceInUse(String),
ResourceLimitExceeded(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl CreateTransformJobError {
pub fn from_response(res: BufferedHttpResponse) -> CreateTransformJobError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ResourceInUse" => {
return CreateTransformJobError::ResourceInUse(String::from(error_message));
}
"ResourceLimitExceeded" => {
return CreateTransformJobError::ResourceLimitExceeded(String::from(
error_message,
));
}
"ValidationException" => {
return CreateTransformJobError::Validation(error_message.to_string());
}
_ => {}
}
}
return CreateTransformJobError::Unknown(res);
}
}
impl From<serde_json::error::Error> for CreateTransformJobError {
fn from(err: serde_json::error::Error) -> CreateTransformJobError {
CreateTransformJobError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for CreateTransformJobError {
fn from(err: CredentialsError) -> CreateTransformJobError {
CreateTransformJobError::Credentials(err)
}
}
impl From<HttpDispatchError> for CreateTransformJobError {
fn from(err: HttpDispatchError) -> CreateTransformJobError {
CreateTransformJobError::HttpDispatch(err)
}
}
impl From<io::Error> for CreateTransformJobError {
fn from(err: io::Error) -> CreateTransformJobError {
CreateTransformJobError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for CreateTransformJobError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateTransformJobError {
fn description(&self) -> &str {
match *self {
CreateTransformJobError::ResourceInUse(ref cause) => cause,
CreateTransformJobError::ResourceLimitExceeded(ref cause) => cause,
CreateTransformJobError::Validation(ref cause) => cause,
CreateTransformJobError::Credentials(ref err) => err.description(),
CreateTransformJobError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
CreateTransformJobError::ParseError(ref cause) => cause,
CreateTransformJobError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateWorkteamError {
ResourceInUse(String),
ResourceLimitExceeded(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl CreateWorkteamError {
pub fn from_response(res: BufferedHttpResponse) -> CreateWorkteamError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ResourceInUse" => {
return CreateWorkteamError::ResourceInUse(String::from(error_message));
}
"ResourceLimitExceeded" => {
return CreateWorkteamError::ResourceLimitExceeded(String::from(error_message));
}
"ValidationException" => {
return CreateWorkteamError::Validation(error_message.to_string());
}
_ => {}
}
}
return CreateWorkteamError::Unknown(res);
}
}
impl From<serde_json::error::Error> for CreateWorkteamError {
fn from(err: serde_json::error::Error) -> CreateWorkteamError {
CreateWorkteamError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for CreateWorkteamError {
fn from(err: CredentialsError) -> CreateWorkteamError {
CreateWorkteamError::Credentials(err)
}
}
impl From<HttpDispatchError> for CreateWorkteamError {
fn from(err: HttpDispatchError) -> CreateWorkteamError {
CreateWorkteamError::HttpDispatch(err)
}
}
impl From<io::Error> for CreateWorkteamError {
fn from(err: io::Error) -> CreateWorkteamError {
CreateWorkteamError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for CreateWorkteamError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateWorkteamError {
fn description(&self) -> &str {
match *self {
CreateWorkteamError::ResourceInUse(ref cause) => cause,
CreateWorkteamError::ResourceLimitExceeded(ref cause) => cause,
CreateWorkteamError::Validation(ref cause) => cause,
CreateWorkteamError::Credentials(ref err) => err.description(),
CreateWorkteamError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
CreateWorkteamError::ParseError(ref cause) => cause,
CreateWorkteamError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteAlgorithmError {
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DeleteAlgorithmError {
pub fn from_response(res: BufferedHttpResponse) -> DeleteAlgorithmError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ValidationException" => {
return DeleteAlgorithmError::Validation(error_message.to_string());
}
_ => {}
}
}
return DeleteAlgorithmError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DeleteAlgorithmError {
fn from(err: serde_json::error::Error) -> DeleteAlgorithmError {
DeleteAlgorithmError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DeleteAlgorithmError {
fn from(err: CredentialsError) -> DeleteAlgorithmError {
DeleteAlgorithmError::Credentials(err)
}
}
impl From<HttpDispatchError> for DeleteAlgorithmError {
fn from(err: HttpDispatchError) -> DeleteAlgorithmError {
DeleteAlgorithmError::HttpDispatch(err)
}
}
impl From<io::Error> for DeleteAlgorithmError {
fn from(err: io::Error) -> DeleteAlgorithmError {
DeleteAlgorithmError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DeleteAlgorithmError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteAlgorithmError {
fn description(&self) -> &str {
match *self {
DeleteAlgorithmError::Validation(ref cause) => cause,
DeleteAlgorithmError::Credentials(ref err) => err.description(),
DeleteAlgorithmError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
DeleteAlgorithmError::ParseError(ref cause) => cause,
DeleteAlgorithmError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteCodeRepositoryError {
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DeleteCodeRepositoryError {
pub fn from_response(res: BufferedHttpResponse) -> DeleteCodeRepositoryError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ValidationException" => {
return DeleteCodeRepositoryError::Validation(error_message.to_string());
}
_ => {}
}
}
return DeleteCodeRepositoryError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DeleteCodeRepositoryError {
fn from(err: serde_json::error::Error) -> DeleteCodeRepositoryError {
DeleteCodeRepositoryError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DeleteCodeRepositoryError {
fn from(err: CredentialsError) -> DeleteCodeRepositoryError {
DeleteCodeRepositoryError::Credentials(err)
}
}
impl From<HttpDispatchError> for DeleteCodeRepositoryError {
fn from(err: HttpDispatchError) -> DeleteCodeRepositoryError {
DeleteCodeRepositoryError::HttpDispatch(err)
}
}
impl From<io::Error> for DeleteCodeRepositoryError {
fn from(err: io::Error) -> DeleteCodeRepositoryError {
DeleteCodeRepositoryError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DeleteCodeRepositoryError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteCodeRepositoryError {
fn description(&self) -> &str {
match *self {
DeleteCodeRepositoryError::Validation(ref cause) => cause,
DeleteCodeRepositoryError::Credentials(ref err) => err.description(),
DeleteCodeRepositoryError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DeleteCodeRepositoryError::ParseError(ref cause) => cause,
DeleteCodeRepositoryError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteEndpointError {
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DeleteEndpointError {
pub fn from_response(res: BufferedHttpResponse) -> DeleteEndpointError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ValidationException" => {
return DeleteEndpointError::Validation(error_message.to_string());
}
_ => {}
}
}
return DeleteEndpointError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DeleteEndpointError {
fn from(err: serde_json::error::Error) -> DeleteEndpointError {
DeleteEndpointError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DeleteEndpointError {
fn from(err: CredentialsError) -> DeleteEndpointError {
DeleteEndpointError::Credentials(err)
}
}
impl From<HttpDispatchError> for DeleteEndpointError {
fn from(err: HttpDispatchError) -> DeleteEndpointError {
DeleteEndpointError::HttpDispatch(err)
}
}
impl From<io::Error> for DeleteEndpointError {
fn from(err: io::Error) -> DeleteEndpointError {
DeleteEndpointError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DeleteEndpointError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteEndpointError {
fn description(&self) -> &str {
match *self {
DeleteEndpointError::Validation(ref cause) => cause,
DeleteEndpointError::Credentials(ref err) => err.description(),
DeleteEndpointError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
DeleteEndpointError::ParseError(ref cause) => cause,
DeleteEndpointError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteEndpointConfigError {
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DeleteEndpointConfigError {
pub fn from_response(res: BufferedHttpResponse) -> DeleteEndpointConfigError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ValidationException" => {
return DeleteEndpointConfigError::Validation(error_message.to_string());
}
_ => {}
}
}
return DeleteEndpointConfigError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DeleteEndpointConfigError {
fn from(err: serde_json::error::Error) -> DeleteEndpointConfigError {
DeleteEndpointConfigError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DeleteEndpointConfigError {
fn from(err: CredentialsError) -> DeleteEndpointConfigError {
DeleteEndpointConfigError::Credentials(err)
}
}
impl From<HttpDispatchError> for DeleteEndpointConfigError {
fn from(err: HttpDispatchError) -> DeleteEndpointConfigError {
DeleteEndpointConfigError::HttpDispatch(err)
}
}
impl From<io::Error> for DeleteEndpointConfigError {
fn from(err: io::Error) -> DeleteEndpointConfigError {
DeleteEndpointConfigError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DeleteEndpointConfigError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteEndpointConfigError {
fn description(&self) -> &str {
match *self {
DeleteEndpointConfigError::Validation(ref cause) => cause,
DeleteEndpointConfigError::Credentials(ref err) => err.description(),
DeleteEndpointConfigError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DeleteEndpointConfigError::ParseError(ref cause) => cause,
DeleteEndpointConfigError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteModelError {
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DeleteModelError {
pub fn from_response(res: BufferedHttpResponse) -> DeleteModelError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ValidationException" => {
return DeleteModelError::Validation(error_message.to_string());
}
_ => {}
}
}
return DeleteModelError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DeleteModelError {
fn from(err: serde_json::error::Error) -> DeleteModelError {
DeleteModelError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DeleteModelError {
fn from(err: CredentialsError) -> DeleteModelError {
DeleteModelError::Credentials(err)
}
}
impl From<HttpDispatchError> for DeleteModelError {
fn from(err: HttpDispatchError) -> DeleteModelError {
DeleteModelError::HttpDispatch(err)
}
}
impl From<io::Error> for DeleteModelError {
fn from(err: io::Error) -> DeleteModelError {
DeleteModelError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DeleteModelError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteModelError {
fn description(&self) -> &str {
match *self {
DeleteModelError::Validation(ref cause) => cause,
DeleteModelError::Credentials(ref err) => err.description(),
DeleteModelError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
DeleteModelError::ParseError(ref cause) => cause,
DeleteModelError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteModelPackageError {
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DeleteModelPackageError {
pub fn from_response(res: BufferedHttpResponse) -> DeleteModelPackageError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ValidationException" => {
return DeleteModelPackageError::Validation(error_message.to_string());
}
_ => {}
}
}
return DeleteModelPackageError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DeleteModelPackageError {
fn from(err: serde_json::error::Error) -> DeleteModelPackageError {
DeleteModelPackageError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DeleteModelPackageError {
fn from(err: CredentialsError) -> DeleteModelPackageError {
DeleteModelPackageError::Credentials(err)
}
}
impl From<HttpDispatchError> for DeleteModelPackageError {
fn from(err: HttpDispatchError) -> DeleteModelPackageError {
DeleteModelPackageError::HttpDispatch(err)
}
}
impl From<io::Error> for DeleteModelPackageError {
fn from(err: io::Error) -> DeleteModelPackageError {
DeleteModelPackageError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DeleteModelPackageError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteModelPackageError {
fn description(&self) -> &str {
match *self {
DeleteModelPackageError::Validation(ref cause) => cause,
DeleteModelPackageError::Credentials(ref err) => err.description(),
DeleteModelPackageError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DeleteModelPackageError::ParseError(ref cause) => cause,
DeleteModelPackageError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteNotebookInstanceError {
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DeleteNotebookInstanceError {
pub fn from_response(res: BufferedHttpResponse) -> DeleteNotebookInstanceError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ValidationException" => {
return DeleteNotebookInstanceError::Validation(error_message.to_string());
}
_ => {}
}
}
return DeleteNotebookInstanceError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DeleteNotebookInstanceError {
fn from(err: serde_json::error::Error) -> DeleteNotebookInstanceError {
DeleteNotebookInstanceError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DeleteNotebookInstanceError {
fn from(err: CredentialsError) -> DeleteNotebookInstanceError {
DeleteNotebookInstanceError::Credentials(err)
}
}
impl From<HttpDispatchError> for DeleteNotebookInstanceError {
fn from(err: HttpDispatchError) -> DeleteNotebookInstanceError {
DeleteNotebookInstanceError::HttpDispatch(err)
}
}
impl From<io::Error> for DeleteNotebookInstanceError {
fn from(err: io::Error) -> DeleteNotebookInstanceError {
DeleteNotebookInstanceError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DeleteNotebookInstanceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteNotebookInstanceError {
fn description(&self) -> &str {
match *self {
DeleteNotebookInstanceError::Validation(ref cause) => cause,
DeleteNotebookInstanceError::Credentials(ref err) => err.description(),
DeleteNotebookInstanceError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DeleteNotebookInstanceError::ParseError(ref cause) => cause,
DeleteNotebookInstanceError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteNotebookInstanceLifecycleConfigError {
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DeleteNotebookInstanceLifecycleConfigError {
pub fn from_response(res: BufferedHttpResponse) -> DeleteNotebookInstanceLifecycleConfigError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ValidationException" => {
return DeleteNotebookInstanceLifecycleConfigError::Validation(
error_message.to_string(),
);
}
_ => {}
}
}
return DeleteNotebookInstanceLifecycleConfigError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DeleteNotebookInstanceLifecycleConfigError {
fn from(err: serde_json::error::Error) -> DeleteNotebookInstanceLifecycleConfigError {
DeleteNotebookInstanceLifecycleConfigError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DeleteNotebookInstanceLifecycleConfigError {
fn from(err: CredentialsError) -> DeleteNotebookInstanceLifecycleConfigError {
DeleteNotebookInstanceLifecycleConfigError::Credentials(err)
}
}
impl From<HttpDispatchError> for DeleteNotebookInstanceLifecycleConfigError {
fn from(err: HttpDispatchError) -> DeleteNotebookInstanceLifecycleConfigError {
DeleteNotebookInstanceLifecycleConfigError::HttpDispatch(err)
}
}
impl From<io::Error> for DeleteNotebookInstanceLifecycleConfigError {
fn from(err: io::Error) -> DeleteNotebookInstanceLifecycleConfigError {
DeleteNotebookInstanceLifecycleConfigError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DeleteNotebookInstanceLifecycleConfigError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteNotebookInstanceLifecycleConfigError {
fn description(&self) -> &str {
match *self {
DeleteNotebookInstanceLifecycleConfigError::Validation(ref cause) => cause,
DeleteNotebookInstanceLifecycleConfigError::Credentials(ref err) => err.description(),
DeleteNotebookInstanceLifecycleConfigError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DeleteNotebookInstanceLifecycleConfigError::ParseError(ref cause) => cause,
DeleteNotebookInstanceLifecycleConfigError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteTagsError {
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DeleteTagsError {
pub fn from_response(res: BufferedHttpResponse) -> DeleteTagsError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ValidationException" => {
return DeleteTagsError::Validation(error_message.to_string());
}
_ => {}
}
}
return DeleteTagsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DeleteTagsError {
fn from(err: serde_json::error::Error) -> DeleteTagsError {
DeleteTagsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DeleteTagsError {
fn from(err: CredentialsError) -> DeleteTagsError {
DeleteTagsError::Credentials(err)
}
}
impl From<HttpDispatchError> for DeleteTagsError {
fn from(err: HttpDispatchError) -> DeleteTagsError {
DeleteTagsError::HttpDispatch(err)
}
}
impl From<io::Error> for DeleteTagsError {
fn from(err: io::Error) -> DeleteTagsError {
DeleteTagsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DeleteTagsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteTagsError {
fn description(&self) -> &str {
match *self {
DeleteTagsError::Validation(ref cause) => cause,
DeleteTagsError::Credentials(ref err) => err.description(),
DeleteTagsError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
DeleteTagsError::ParseError(ref cause) => cause,
DeleteTagsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteWorkteamError {
ResourceLimitExceeded(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DeleteWorkteamError {
pub fn from_response(res: BufferedHttpResponse) -> DeleteWorkteamError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ResourceLimitExceeded" => {
return DeleteWorkteamError::ResourceLimitExceeded(String::from(error_message));
}
"ValidationException" => {
return DeleteWorkteamError::Validation(error_message.to_string());
}
_ => {}
}
}
return DeleteWorkteamError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DeleteWorkteamError {
fn from(err: serde_json::error::Error) -> DeleteWorkteamError {
DeleteWorkteamError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DeleteWorkteamError {
fn from(err: CredentialsError) -> DeleteWorkteamError {
DeleteWorkteamError::Credentials(err)
}
}
impl From<HttpDispatchError> for DeleteWorkteamError {
fn from(err: HttpDispatchError) -> DeleteWorkteamError {
DeleteWorkteamError::HttpDispatch(err)
}
}
impl From<io::Error> for DeleteWorkteamError {
fn from(err: io::Error) -> DeleteWorkteamError {
DeleteWorkteamError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DeleteWorkteamError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteWorkteamError {
fn description(&self) -> &str {
match *self {
DeleteWorkteamError::ResourceLimitExceeded(ref cause) => cause,
DeleteWorkteamError::Validation(ref cause) => cause,
DeleteWorkteamError::Credentials(ref err) => err.description(),
DeleteWorkteamError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
DeleteWorkteamError::ParseError(ref cause) => cause,
DeleteWorkteamError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeAlgorithmError {
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DescribeAlgorithmError {
pub fn from_response(res: BufferedHttpResponse) -> DescribeAlgorithmError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ValidationException" => {
return DescribeAlgorithmError::Validation(error_message.to_string());
}
_ => {}
}
}
return DescribeAlgorithmError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DescribeAlgorithmError {
fn from(err: serde_json::error::Error) -> DescribeAlgorithmError {
DescribeAlgorithmError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeAlgorithmError {
fn from(err: CredentialsError) -> DescribeAlgorithmError {
DescribeAlgorithmError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeAlgorithmError {
fn from(err: HttpDispatchError) -> DescribeAlgorithmError {
DescribeAlgorithmError::HttpDispatch(err)
}
}
impl From<io::Error> for DescribeAlgorithmError {
fn from(err: io::Error) -> DescribeAlgorithmError {
DescribeAlgorithmError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DescribeAlgorithmError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeAlgorithmError {
fn description(&self) -> &str {
match *self {
DescribeAlgorithmError::Validation(ref cause) => cause,
DescribeAlgorithmError::Credentials(ref err) => err.description(),
DescribeAlgorithmError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DescribeAlgorithmError::ParseError(ref cause) => cause,
DescribeAlgorithmError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeCodeRepositoryError {
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DescribeCodeRepositoryError {
pub fn from_response(res: BufferedHttpResponse) -> DescribeCodeRepositoryError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ValidationException" => {
return DescribeCodeRepositoryError::Validation(error_message.to_string());
}
_ => {}
}
}
return DescribeCodeRepositoryError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DescribeCodeRepositoryError {
fn from(err: serde_json::error::Error) -> DescribeCodeRepositoryError {
DescribeCodeRepositoryError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeCodeRepositoryError {
fn from(err: CredentialsError) -> DescribeCodeRepositoryError {
DescribeCodeRepositoryError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeCodeRepositoryError {
fn from(err: HttpDispatchError) -> DescribeCodeRepositoryError {
DescribeCodeRepositoryError::HttpDispatch(err)
}
}
impl From<io::Error> for DescribeCodeRepositoryError {
fn from(err: io::Error) -> DescribeCodeRepositoryError {
DescribeCodeRepositoryError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DescribeCodeRepositoryError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeCodeRepositoryError {
fn description(&self) -> &str {
match *self {
DescribeCodeRepositoryError::Validation(ref cause) => cause,
DescribeCodeRepositoryError::Credentials(ref err) => err.description(),
DescribeCodeRepositoryError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DescribeCodeRepositoryError::ParseError(ref cause) => cause,
DescribeCodeRepositoryError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeCompilationJobError {
ResourceNotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DescribeCompilationJobError {
pub fn from_response(res: BufferedHttpResponse) -> DescribeCompilationJobError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ResourceNotFound" => {
return DescribeCompilationJobError::ResourceNotFound(String::from(
error_message,
));
}
"ValidationException" => {
return DescribeCompilationJobError::Validation(error_message.to_string());
}
_ => {}
}
}
return DescribeCompilationJobError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DescribeCompilationJobError {
fn from(err: serde_json::error::Error) -> DescribeCompilationJobError {
DescribeCompilationJobError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeCompilationJobError {
fn from(err: CredentialsError) -> DescribeCompilationJobError {
DescribeCompilationJobError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeCompilationJobError {
fn from(err: HttpDispatchError) -> DescribeCompilationJobError {
DescribeCompilationJobError::HttpDispatch(err)
}
}
impl From<io::Error> for DescribeCompilationJobError {
fn from(err: io::Error) -> DescribeCompilationJobError {
DescribeCompilationJobError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DescribeCompilationJobError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeCompilationJobError {
fn description(&self) -> &str {
match *self {
DescribeCompilationJobError::ResourceNotFound(ref cause) => cause,
DescribeCompilationJobError::Validation(ref cause) => cause,
DescribeCompilationJobError::Credentials(ref err) => err.description(),
DescribeCompilationJobError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DescribeCompilationJobError::ParseError(ref cause) => cause,
DescribeCompilationJobError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeEndpointError {
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DescribeEndpointError {
pub fn from_response(res: BufferedHttpResponse) -> DescribeEndpointError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ValidationException" => {
return DescribeEndpointError::Validation(error_message.to_string());
}
_ => {}
}
}
return DescribeEndpointError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DescribeEndpointError {
fn from(err: serde_json::error::Error) -> DescribeEndpointError {
DescribeEndpointError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeEndpointError {
fn from(err: CredentialsError) -> DescribeEndpointError {
DescribeEndpointError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeEndpointError {
fn from(err: HttpDispatchError) -> DescribeEndpointError {
DescribeEndpointError::HttpDispatch(err)
}
}
impl From<io::Error> for DescribeEndpointError {
fn from(err: io::Error) -> DescribeEndpointError {
DescribeEndpointError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DescribeEndpointError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeEndpointError {
fn description(&self) -> &str {
match *self {
DescribeEndpointError::Validation(ref cause) => cause,
DescribeEndpointError::Credentials(ref err) => err.description(),
DescribeEndpointError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
DescribeEndpointError::ParseError(ref cause) => cause,
DescribeEndpointError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeEndpointConfigError {
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DescribeEndpointConfigError {
pub fn from_response(res: BufferedHttpResponse) -> DescribeEndpointConfigError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ValidationException" => {
return DescribeEndpointConfigError::Validation(error_message.to_string());
}
_ => {}
}
}
return DescribeEndpointConfigError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DescribeEndpointConfigError {
fn from(err: serde_json::error::Error) -> DescribeEndpointConfigError {
DescribeEndpointConfigError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeEndpointConfigError {
fn from(err: CredentialsError) -> DescribeEndpointConfigError {
DescribeEndpointConfigError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeEndpointConfigError {
fn from(err: HttpDispatchError) -> DescribeEndpointConfigError {
DescribeEndpointConfigError::HttpDispatch(err)
}
}
impl From<io::Error> for DescribeEndpointConfigError {
fn from(err: io::Error) -> DescribeEndpointConfigError {
DescribeEndpointConfigError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DescribeEndpointConfigError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeEndpointConfigError {
fn description(&self) -> &str {
match *self {
DescribeEndpointConfigError::Validation(ref cause) => cause,
DescribeEndpointConfigError::Credentials(ref err) => err.description(),
DescribeEndpointConfigError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DescribeEndpointConfigError::ParseError(ref cause) => cause,
DescribeEndpointConfigError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeHyperParameterTuningJobError {
ResourceNotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DescribeHyperParameterTuningJobError {
pub fn from_response(res: BufferedHttpResponse) -> DescribeHyperParameterTuningJobError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ResourceNotFound" => {
return DescribeHyperParameterTuningJobError::ResourceNotFound(String::from(
error_message,
));
}
"ValidationException" => {
return DescribeHyperParameterTuningJobError::Validation(
error_message.to_string(),
);
}
_ => {}
}
}
return DescribeHyperParameterTuningJobError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DescribeHyperParameterTuningJobError {
fn from(err: serde_json::error::Error) -> DescribeHyperParameterTuningJobError {
DescribeHyperParameterTuningJobError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeHyperParameterTuningJobError {
fn from(err: CredentialsError) -> DescribeHyperParameterTuningJobError {
DescribeHyperParameterTuningJobError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeHyperParameterTuningJobError {
fn from(err: HttpDispatchError) -> DescribeHyperParameterTuningJobError {
DescribeHyperParameterTuningJobError::HttpDispatch(err)
}
}
impl From<io::Error> for DescribeHyperParameterTuningJobError {
fn from(err: io::Error) -> DescribeHyperParameterTuningJobError {
DescribeHyperParameterTuningJobError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DescribeHyperParameterTuningJobError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeHyperParameterTuningJobError {
fn description(&self) -> &str {
match *self {
DescribeHyperParameterTuningJobError::ResourceNotFound(ref cause) => cause,
DescribeHyperParameterTuningJobError::Validation(ref cause) => cause,
DescribeHyperParameterTuningJobError::Credentials(ref err) => err.description(),
DescribeHyperParameterTuningJobError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DescribeHyperParameterTuningJobError::ParseError(ref cause) => cause,
DescribeHyperParameterTuningJobError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeLabelingJobError {
ResourceNotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DescribeLabelingJobError {
pub fn from_response(res: BufferedHttpResponse) -> DescribeLabelingJobError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ResourceNotFound" => {
return DescribeLabelingJobError::ResourceNotFound(String::from(error_message));
}
"ValidationException" => {
return DescribeLabelingJobError::Validation(error_message.to_string());
}
_ => {}
}
}
return DescribeLabelingJobError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DescribeLabelingJobError {
fn from(err: serde_json::error::Error) -> DescribeLabelingJobError {
DescribeLabelingJobError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeLabelingJobError {
fn from(err: CredentialsError) -> DescribeLabelingJobError {
DescribeLabelingJobError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeLabelingJobError {
fn from(err: HttpDispatchError) -> DescribeLabelingJobError {
DescribeLabelingJobError::HttpDispatch(err)
}
}
impl From<io::Error> for DescribeLabelingJobError {
fn from(err: io::Error) -> DescribeLabelingJobError {
DescribeLabelingJobError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DescribeLabelingJobError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeLabelingJobError {
fn description(&self) -> &str {
match *self {
DescribeLabelingJobError::ResourceNotFound(ref cause) => cause,
DescribeLabelingJobError::Validation(ref cause) => cause,
DescribeLabelingJobError::Credentials(ref err) => err.description(),
DescribeLabelingJobError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DescribeLabelingJobError::ParseError(ref cause) => cause,
DescribeLabelingJobError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeModelError {
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DescribeModelError {
pub fn from_response(res: BufferedHttpResponse) -> DescribeModelError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ValidationException" => {
return DescribeModelError::Validation(error_message.to_string());
}
_ => {}
}
}
return DescribeModelError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DescribeModelError {
fn from(err: serde_json::error::Error) -> DescribeModelError {
DescribeModelError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeModelError {
fn from(err: CredentialsError) -> DescribeModelError {
DescribeModelError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeModelError {
fn from(err: HttpDispatchError) -> DescribeModelError {
DescribeModelError::HttpDispatch(err)
}
}
impl From<io::Error> for DescribeModelError {
fn from(err: io::Error) -> DescribeModelError {
DescribeModelError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DescribeModelError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeModelError {
fn description(&self) -> &str {
match *self {
DescribeModelError::Validation(ref cause) => cause,
DescribeModelError::Credentials(ref err) => err.description(),
DescribeModelError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
DescribeModelError::ParseError(ref cause) => cause,
DescribeModelError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeModelPackageError {
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DescribeModelPackageError {
pub fn from_response(res: BufferedHttpResponse) -> DescribeModelPackageError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ValidationException" => {
return DescribeModelPackageError::Validation(error_message.to_string());
}
_ => {}
}
}
return DescribeModelPackageError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DescribeModelPackageError {
fn from(err: serde_json::error::Error) -> DescribeModelPackageError {
DescribeModelPackageError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeModelPackageError {
fn from(err: CredentialsError) -> DescribeModelPackageError {
DescribeModelPackageError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeModelPackageError {
fn from(err: HttpDispatchError) -> DescribeModelPackageError {
DescribeModelPackageError::HttpDispatch(err)
}
}
impl From<io::Error> for DescribeModelPackageError {
fn from(err: io::Error) -> DescribeModelPackageError {
DescribeModelPackageError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DescribeModelPackageError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeModelPackageError {
fn description(&self) -> &str {
match *self {
DescribeModelPackageError::Validation(ref cause) => cause,
DescribeModelPackageError::Credentials(ref err) => err.description(),
DescribeModelPackageError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DescribeModelPackageError::ParseError(ref cause) => cause,
DescribeModelPackageError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeNotebookInstanceError {
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DescribeNotebookInstanceError {
pub fn from_response(res: BufferedHttpResponse) -> DescribeNotebookInstanceError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ValidationException" => {
return DescribeNotebookInstanceError::Validation(error_message.to_string());
}
_ => {}
}
}
return DescribeNotebookInstanceError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DescribeNotebookInstanceError {
fn from(err: serde_json::error::Error) -> DescribeNotebookInstanceError {
DescribeNotebookInstanceError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeNotebookInstanceError {
fn from(err: CredentialsError) -> DescribeNotebookInstanceError {
DescribeNotebookInstanceError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeNotebookInstanceError {
fn from(err: HttpDispatchError) -> DescribeNotebookInstanceError {
DescribeNotebookInstanceError::HttpDispatch(err)
}
}
impl From<io::Error> for DescribeNotebookInstanceError {
fn from(err: io::Error) -> DescribeNotebookInstanceError {
DescribeNotebookInstanceError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DescribeNotebookInstanceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeNotebookInstanceError {
fn description(&self) -> &str {
match *self {
DescribeNotebookInstanceError::Validation(ref cause) => cause,
DescribeNotebookInstanceError::Credentials(ref err) => err.description(),
DescribeNotebookInstanceError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DescribeNotebookInstanceError::ParseError(ref cause) => cause,
DescribeNotebookInstanceError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeNotebookInstanceLifecycleConfigError {
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DescribeNotebookInstanceLifecycleConfigError {
pub fn from_response(
res: BufferedHttpResponse,
) -> DescribeNotebookInstanceLifecycleConfigError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ValidationException" => {
return DescribeNotebookInstanceLifecycleConfigError::Validation(
error_message.to_string(),
);
}
_ => {}
}
}
return DescribeNotebookInstanceLifecycleConfigError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DescribeNotebookInstanceLifecycleConfigError {
fn from(err: serde_json::error::Error) -> DescribeNotebookInstanceLifecycleConfigError {
DescribeNotebookInstanceLifecycleConfigError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeNotebookInstanceLifecycleConfigError {
fn from(err: CredentialsError) -> DescribeNotebookInstanceLifecycleConfigError {
DescribeNotebookInstanceLifecycleConfigError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeNotebookInstanceLifecycleConfigError {
fn from(err: HttpDispatchError) -> DescribeNotebookInstanceLifecycleConfigError {
DescribeNotebookInstanceLifecycleConfigError::HttpDispatch(err)
}
}
impl From<io::Error> for DescribeNotebookInstanceLifecycleConfigError {
fn from(err: io::Error) -> DescribeNotebookInstanceLifecycleConfigError {
DescribeNotebookInstanceLifecycleConfigError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DescribeNotebookInstanceLifecycleConfigError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeNotebookInstanceLifecycleConfigError {
fn description(&self) -> &str {
match *self {
DescribeNotebookInstanceLifecycleConfigError::Validation(ref cause) => cause,
DescribeNotebookInstanceLifecycleConfigError::Credentials(ref err) => err.description(),
DescribeNotebookInstanceLifecycleConfigError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DescribeNotebookInstanceLifecycleConfigError::ParseError(ref cause) => cause,
DescribeNotebookInstanceLifecycleConfigError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeSubscribedWorkteamError {
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DescribeSubscribedWorkteamError {
pub fn from_response(res: BufferedHttpResponse) -> DescribeSubscribedWorkteamError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ValidationException" => {
return DescribeSubscribedWorkteamError::Validation(error_message.to_string());
}
_ => {}
}
}
return DescribeSubscribedWorkteamError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DescribeSubscribedWorkteamError {
fn from(err: serde_json::error::Error) -> DescribeSubscribedWorkteamError {
DescribeSubscribedWorkteamError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeSubscribedWorkteamError {
fn from(err: CredentialsError) -> DescribeSubscribedWorkteamError {
DescribeSubscribedWorkteamError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeSubscribedWorkteamError {
fn from(err: HttpDispatchError) -> DescribeSubscribedWorkteamError {
DescribeSubscribedWorkteamError::HttpDispatch(err)
}
}
impl From<io::Error> for DescribeSubscribedWorkteamError {
fn from(err: io::Error) -> DescribeSubscribedWorkteamError {
DescribeSubscribedWorkteamError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DescribeSubscribedWorkteamError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeSubscribedWorkteamError {
fn description(&self) -> &str {
match *self {
DescribeSubscribedWorkteamError::Validation(ref cause) => cause,
DescribeSubscribedWorkteamError::Credentials(ref err) => err.description(),
DescribeSubscribedWorkteamError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DescribeSubscribedWorkteamError::ParseError(ref cause) => cause,
DescribeSubscribedWorkteamError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeTrainingJobError {
ResourceNotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DescribeTrainingJobError {
pub fn from_response(res: BufferedHttpResponse) -> DescribeTrainingJobError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ResourceNotFound" => {
return DescribeTrainingJobError::ResourceNotFound(String::from(error_message));
}
"ValidationException" => {
return DescribeTrainingJobError::Validation(error_message.to_string());
}
_ => {}
}
}
return DescribeTrainingJobError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DescribeTrainingJobError {
fn from(err: serde_json::error::Error) -> DescribeTrainingJobError {
DescribeTrainingJobError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeTrainingJobError {
fn from(err: CredentialsError) -> DescribeTrainingJobError {
DescribeTrainingJobError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeTrainingJobError {
fn from(err: HttpDispatchError) -> DescribeTrainingJobError {
DescribeTrainingJobError::HttpDispatch(err)
}
}
impl From<io::Error> for DescribeTrainingJobError {
fn from(err: io::Error) -> DescribeTrainingJobError {
DescribeTrainingJobError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DescribeTrainingJobError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeTrainingJobError {
fn description(&self) -> &str {
match *self {
DescribeTrainingJobError::ResourceNotFound(ref cause) => cause,
DescribeTrainingJobError::Validation(ref cause) => cause,
DescribeTrainingJobError::Credentials(ref err) => err.description(),
DescribeTrainingJobError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DescribeTrainingJobError::ParseError(ref cause) => cause,
DescribeTrainingJobError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeTransformJobError {
ResourceNotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DescribeTransformJobError {
pub fn from_response(res: BufferedHttpResponse) -> DescribeTransformJobError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ResourceNotFound" => {
return DescribeTransformJobError::ResourceNotFound(String::from(error_message));
}
"ValidationException" => {
return DescribeTransformJobError::Validation(error_message.to_string());
}
_ => {}
}
}
return DescribeTransformJobError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DescribeTransformJobError {
fn from(err: serde_json::error::Error) -> DescribeTransformJobError {
DescribeTransformJobError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeTransformJobError {
fn from(err: CredentialsError) -> DescribeTransformJobError {
DescribeTransformJobError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeTransformJobError {
fn from(err: HttpDispatchError) -> DescribeTransformJobError {
DescribeTransformJobError::HttpDispatch(err)
}
}
impl From<io::Error> for DescribeTransformJobError {
fn from(err: io::Error) -> DescribeTransformJobError {
DescribeTransformJobError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DescribeTransformJobError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeTransformJobError {
fn description(&self) -> &str {
match *self {
DescribeTransformJobError::ResourceNotFound(ref cause) => cause,
DescribeTransformJobError::Validation(ref cause) => cause,
DescribeTransformJobError::Credentials(ref err) => err.description(),
DescribeTransformJobError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DescribeTransformJobError::ParseError(ref cause) => cause,
DescribeTransformJobError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeWorkteamError {
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DescribeWorkteamError {
pub fn from_response(res: BufferedHttpResponse) -> DescribeWorkteamError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ValidationException" => {
return DescribeWorkteamError::Validation(error_message.to_string());
}
_ => {}
}
}
return DescribeWorkteamError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DescribeWorkteamError {
fn from(err: serde_json::error::Error) -> DescribeWorkteamError {
DescribeWorkteamError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeWorkteamError {
fn from(err: CredentialsError) -> DescribeWorkteamError {
DescribeWorkteamError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeWorkteamError {
fn from(err: HttpDispatchError) -> DescribeWorkteamError {
DescribeWorkteamError::HttpDispatch(err)
}
}
impl From<io::Error> for DescribeWorkteamError {
fn from(err: io::Error) -> DescribeWorkteamError {
DescribeWorkteamError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DescribeWorkteamError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeWorkteamError {
fn description(&self) -> &str {
match *self {
DescribeWorkteamError::Validation(ref cause) => cause,
DescribeWorkteamError::Credentials(ref err) => err.description(),
DescribeWorkteamError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
DescribeWorkteamError::ParseError(ref cause) => cause,
DescribeWorkteamError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetSearchSuggestionsError {
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetSearchSuggestionsError {
pub fn from_response(res: BufferedHttpResponse) -> GetSearchSuggestionsError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ValidationException" => {
return GetSearchSuggestionsError::Validation(error_message.to_string());
}
_ => {}
}
}
return GetSearchSuggestionsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetSearchSuggestionsError {
fn from(err: serde_json::error::Error) -> GetSearchSuggestionsError {
GetSearchSuggestionsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetSearchSuggestionsError {
fn from(err: CredentialsError) -> GetSearchSuggestionsError {
GetSearchSuggestionsError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetSearchSuggestionsError {
fn from(err: HttpDispatchError) -> GetSearchSuggestionsError {
GetSearchSuggestionsError::HttpDispatch(err)
}
}
impl From<io::Error> for GetSearchSuggestionsError {
fn from(err: io::Error) -> GetSearchSuggestionsError {
GetSearchSuggestionsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetSearchSuggestionsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetSearchSuggestionsError {
fn description(&self) -> &str {
match *self {
GetSearchSuggestionsError::Validation(ref cause) => cause,
GetSearchSuggestionsError::Credentials(ref err) => err.description(),
GetSearchSuggestionsError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
GetSearchSuggestionsError::ParseError(ref cause) => cause,
GetSearchSuggestionsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListAlgorithmsError {
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListAlgorithmsError {
pub fn from_response(res: BufferedHttpResponse) -> ListAlgorithmsError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ValidationException" => {
return ListAlgorithmsError::Validation(error_message.to_string());
}
_ => {}
}
}
return ListAlgorithmsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListAlgorithmsError {
fn from(err: serde_json::error::Error) -> ListAlgorithmsError {
ListAlgorithmsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListAlgorithmsError {
fn from(err: CredentialsError) -> ListAlgorithmsError {
ListAlgorithmsError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListAlgorithmsError {
fn from(err: HttpDispatchError) -> ListAlgorithmsError {
ListAlgorithmsError::HttpDispatch(err)
}
}
impl From<io::Error> for ListAlgorithmsError {
fn from(err: io::Error) -> ListAlgorithmsError {
ListAlgorithmsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListAlgorithmsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListAlgorithmsError {
fn description(&self) -> &str {
match *self {
ListAlgorithmsError::Validation(ref cause) => cause,
ListAlgorithmsError::Credentials(ref err) => err.description(),
ListAlgorithmsError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
ListAlgorithmsError::ParseError(ref cause) => cause,
ListAlgorithmsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListCodeRepositoriesError {
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListCodeRepositoriesError {
pub fn from_response(res: BufferedHttpResponse) -> ListCodeRepositoriesError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ValidationException" => {
return ListCodeRepositoriesError::Validation(error_message.to_string());
}
_ => {}
}
}
return ListCodeRepositoriesError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListCodeRepositoriesError {
fn from(err: serde_json::error::Error) -> ListCodeRepositoriesError {
ListCodeRepositoriesError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListCodeRepositoriesError {
fn from(err: CredentialsError) -> ListCodeRepositoriesError {
ListCodeRepositoriesError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListCodeRepositoriesError {
fn from(err: HttpDispatchError) -> ListCodeRepositoriesError {
ListCodeRepositoriesError::HttpDispatch(err)
}
}
impl From<io::Error> for ListCodeRepositoriesError {
fn from(err: io::Error) -> ListCodeRepositoriesError {
ListCodeRepositoriesError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListCodeRepositoriesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListCodeRepositoriesError {
fn description(&self) -> &str {
match *self {
ListCodeRepositoriesError::Validation(ref cause) => cause,
ListCodeRepositoriesError::Credentials(ref err) => err.description(),
ListCodeRepositoriesError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
ListCodeRepositoriesError::ParseError(ref cause) => cause,
ListCodeRepositoriesError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListCompilationJobsError {
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListCompilationJobsError {
pub fn from_response(res: BufferedHttpResponse) -> ListCompilationJobsError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ValidationException" => {
return ListCompilationJobsError::Validation(error_message.to_string());
}
_ => {}
}
}
return ListCompilationJobsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListCompilationJobsError {
fn from(err: serde_json::error::Error) -> ListCompilationJobsError {
ListCompilationJobsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListCompilationJobsError {
fn from(err: CredentialsError) -> ListCompilationJobsError {
ListCompilationJobsError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListCompilationJobsError {
fn from(err: HttpDispatchError) -> ListCompilationJobsError {
ListCompilationJobsError::HttpDispatch(err)
}
}
impl From<io::Error> for ListCompilationJobsError {
fn from(err: io::Error) -> ListCompilationJobsError {
ListCompilationJobsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListCompilationJobsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListCompilationJobsError {
fn description(&self) -> &str {
match *self {
ListCompilationJobsError::Validation(ref cause) => cause,
ListCompilationJobsError::Credentials(ref err) => err.description(),
ListCompilationJobsError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
ListCompilationJobsError::ParseError(ref cause) => cause,
ListCompilationJobsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListEndpointConfigsError {
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListEndpointConfigsError {
pub fn from_response(res: BufferedHttpResponse) -> ListEndpointConfigsError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ValidationException" => {
return ListEndpointConfigsError::Validation(error_message.to_string());
}
_ => {}
}
}
return ListEndpointConfigsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListEndpointConfigsError {
fn from(err: serde_json::error::Error) -> ListEndpointConfigsError {
ListEndpointConfigsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListEndpointConfigsError {
fn from(err: CredentialsError) -> ListEndpointConfigsError {
ListEndpointConfigsError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListEndpointConfigsError {
fn from(err: HttpDispatchError) -> ListEndpointConfigsError {
ListEndpointConfigsError::HttpDispatch(err)
}
}
impl From<io::Error> for ListEndpointConfigsError {
fn from(err: io::Error) -> ListEndpointConfigsError {
ListEndpointConfigsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListEndpointConfigsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListEndpointConfigsError {
fn description(&self) -> &str {
match *self {
ListEndpointConfigsError::Validation(ref cause) => cause,
ListEndpointConfigsError::Credentials(ref err) => err.description(),
ListEndpointConfigsError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
ListEndpointConfigsError::ParseError(ref cause) => cause,
ListEndpointConfigsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListEndpointsError {
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListEndpointsError {
pub fn from_response(res: BufferedHttpResponse) -> ListEndpointsError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ValidationException" => {
return ListEndpointsError::Validation(error_message.to_string());
}
_ => {}
}
}
return ListEndpointsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListEndpointsError {
fn from(err: serde_json::error::Error) -> ListEndpointsError {
ListEndpointsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListEndpointsError {
fn from(err: CredentialsError) -> ListEndpointsError {
ListEndpointsError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListEndpointsError {
fn from(err: HttpDispatchError) -> ListEndpointsError {
ListEndpointsError::HttpDispatch(err)
}
}
impl From<io::Error> for ListEndpointsError {
fn from(err: io::Error) -> ListEndpointsError {
ListEndpointsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListEndpointsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListEndpointsError {
fn description(&self) -> &str {
match *self {
ListEndpointsError::Validation(ref cause) => cause,
ListEndpointsError::Credentials(ref err) => err.description(),
ListEndpointsError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
ListEndpointsError::ParseError(ref cause) => cause,
ListEndpointsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListHyperParameterTuningJobsError {
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListHyperParameterTuningJobsError {
pub fn from_response(res: BufferedHttpResponse) -> ListHyperParameterTuningJobsError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ValidationException" => {
return ListHyperParameterTuningJobsError::Validation(error_message.to_string());
}
_ => {}
}
}
return ListHyperParameterTuningJobsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListHyperParameterTuningJobsError {
fn from(err: serde_json::error::Error) -> ListHyperParameterTuningJobsError {
ListHyperParameterTuningJobsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListHyperParameterTuningJobsError {
fn from(err: CredentialsError) -> ListHyperParameterTuningJobsError {
ListHyperParameterTuningJobsError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListHyperParameterTuningJobsError {
fn from(err: HttpDispatchError) -> ListHyperParameterTuningJobsError {
ListHyperParameterTuningJobsError::HttpDispatch(err)
}
}
impl From<io::Error> for ListHyperParameterTuningJobsError {
fn from(err: io::Error) -> ListHyperParameterTuningJobsError {
ListHyperParameterTuningJobsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListHyperParameterTuningJobsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListHyperParameterTuningJobsError {
fn description(&self) -> &str {
match *self {
ListHyperParameterTuningJobsError::Validation(ref cause) => cause,
ListHyperParameterTuningJobsError::Credentials(ref err) => err.description(),
ListHyperParameterTuningJobsError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
ListHyperParameterTuningJobsError::ParseError(ref cause) => cause,
ListHyperParameterTuningJobsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListLabelingJobsError {
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListLabelingJobsError {
pub fn from_response(res: BufferedHttpResponse) -> ListLabelingJobsError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ValidationException" => {
return ListLabelingJobsError::Validation(error_message.to_string());
}
_ => {}
}
}
return ListLabelingJobsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListLabelingJobsError {
fn from(err: serde_json::error::Error) -> ListLabelingJobsError {
ListLabelingJobsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListLabelingJobsError {
fn from(err: CredentialsError) -> ListLabelingJobsError {
ListLabelingJobsError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListLabelingJobsError {
fn from(err: HttpDispatchError) -> ListLabelingJobsError {
ListLabelingJobsError::HttpDispatch(err)
}
}
impl From<io::Error> for ListLabelingJobsError {
fn from(err: io::Error) -> ListLabelingJobsError {
ListLabelingJobsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListLabelingJobsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListLabelingJobsError {
fn description(&self) -> &str {
match *self {
ListLabelingJobsError::Validation(ref cause) => cause,
ListLabelingJobsError::Credentials(ref err) => err.description(),
ListLabelingJobsError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
ListLabelingJobsError::ParseError(ref cause) => cause,
ListLabelingJobsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListLabelingJobsForWorkteamError {
ResourceNotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListLabelingJobsForWorkteamError {
pub fn from_response(res: BufferedHttpResponse) -> ListLabelingJobsForWorkteamError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ResourceNotFound" => {
return ListLabelingJobsForWorkteamError::ResourceNotFound(String::from(
error_message,
));
}
"ValidationException" => {
return ListLabelingJobsForWorkteamError::Validation(error_message.to_string());
}
_ => {}
}
}
return ListLabelingJobsForWorkteamError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListLabelingJobsForWorkteamError {
fn from(err: serde_json::error::Error) -> ListLabelingJobsForWorkteamError {
ListLabelingJobsForWorkteamError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListLabelingJobsForWorkteamError {
fn from(err: CredentialsError) -> ListLabelingJobsForWorkteamError {
ListLabelingJobsForWorkteamError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListLabelingJobsForWorkteamError {
fn from(err: HttpDispatchError) -> ListLabelingJobsForWorkteamError {
ListLabelingJobsForWorkteamError::HttpDispatch(err)
}
}
impl From<io::Error> for ListLabelingJobsForWorkteamError {
fn from(err: io::Error) -> ListLabelingJobsForWorkteamError {
ListLabelingJobsForWorkteamError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListLabelingJobsForWorkteamError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListLabelingJobsForWorkteamError {
fn description(&self) -> &str {
match *self {
ListLabelingJobsForWorkteamError::ResourceNotFound(ref cause) => cause,
ListLabelingJobsForWorkteamError::Validation(ref cause) => cause,
ListLabelingJobsForWorkteamError::Credentials(ref err) => err.description(),
ListLabelingJobsForWorkteamError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
ListLabelingJobsForWorkteamError::ParseError(ref cause) => cause,
ListLabelingJobsForWorkteamError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListModelPackagesError {
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListModelPackagesError {
pub fn from_response(res: BufferedHttpResponse) -> ListModelPackagesError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ValidationException" => {
return ListModelPackagesError::Validation(error_message.to_string());
}
_ => {}
}
}
return ListModelPackagesError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListModelPackagesError {
fn from(err: serde_json::error::Error) -> ListModelPackagesError {
ListModelPackagesError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListModelPackagesError {
fn from(err: CredentialsError) -> ListModelPackagesError {
ListModelPackagesError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListModelPackagesError {
fn from(err: HttpDispatchError) -> ListModelPackagesError {
ListModelPackagesError::HttpDispatch(err)
}
}
impl From<io::Error> for ListModelPackagesError {
fn from(err: io::Error) -> ListModelPackagesError {
ListModelPackagesError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListModelPackagesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListModelPackagesError {
fn description(&self) -> &str {
match *self {
ListModelPackagesError::Validation(ref cause) => cause,
ListModelPackagesError::Credentials(ref err) => err.description(),
ListModelPackagesError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
ListModelPackagesError::ParseError(ref cause) => cause,
ListModelPackagesError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListModelsError {
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListModelsError {
pub fn from_response(res: BufferedHttpResponse) -> ListModelsError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ValidationException" => {
return ListModelsError::Validation(error_message.to_string());
}
_ => {}
}
}
return ListModelsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListModelsError {
fn from(err: serde_json::error::Error) -> ListModelsError {
ListModelsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListModelsError {
fn from(err: CredentialsError) -> ListModelsError {
ListModelsError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListModelsError {
fn from(err: HttpDispatchError) -> ListModelsError {
ListModelsError::HttpDispatch(err)
}
}
impl From<io::Error> for ListModelsError {
fn from(err: io::Error) -> ListModelsError {
ListModelsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListModelsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListModelsError {
fn description(&self) -> &str {
match *self {
ListModelsError::Validation(ref cause) => cause,
ListModelsError::Credentials(ref err) => err.description(),
ListModelsError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
ListModelsError::ParseError(ref cause) => cause,
ListModelsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListNotebookInstanceLifecycleConfigsError {
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListNotebookInstanceLifecycleConfigsError {
pub fn from_response(res: BufferedHttpResponse) -> ListNotebookInstanceLifecycleConfigsError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ValidationException" => {
return ListNotebookInstanceLifecycleConfigsError::Validation(
error_message.to_string(),
);
}
_ => {}
}
}
return ListNotebookInstanceLifecycleConfigsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListNotebookInstanceLifecycleConfigsError {
fn from(err: serde_json::error::Error) -> ListNotebookInstanceLifecycleConfigsError {
ListNotebookInstanceLifecycleConfigsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListNotebookInstanceLifecycleConfigsError {
fn from(err: CredentialsError) -> ListNotebookInstanceLifecycleConfigsError {
ListNotebookInstanceLifecycleConfigsError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListNotebookInstanceLifecycleConfigsError {
fn from(err: HttpDispatchError) -> ListNotebookInstanceLifecycleConfigsError {
ListNotebookInstanceLifecycleConfigsError::HttpDispatch(err)
}
}
impl From<io::Error> for ListNotebookInstanceLifecycleConfigsError {
fn from(err: io::Error) -> ListNotebookInstanceLifecycleConfigsError {
ListNotebookInstanceLifecycleConfigsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListNotebookInstanceLifecycleConfigsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListNotebookInstanceLifecycleConfigsError {
fn description(&self) -> &str {
match *self {
ListNotebookInstanceLifecycleConfigsError::Validation(ref cause) => cause,
ListNotebookInstanceLifecycleConfigsError::Credentials(ref err) => err.description(),
ListNotebookInstanceLifecycleConfigsError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
ListNotebookInstanceLifecycleConfigsError::ParseError(ref cause) => cause,
ListNotebookInstanceLifecycleConfigsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListNotebookInstancesError {
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListNotebookInstancesError {
pub fn from_response(res: BufferedHttpResponse) -> ListNotebookInstancesError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ValidationException" => {
return ListNotebookInstancesError::Validation(error_message.to_string());
}
_ => {}
}
}
return ListNotebookInstancesError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListNotebookInstancesError {
fn from(err: serde_json::error::Error) -> ListNotebookInstancesError {
ListNotebookInstancesError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListNotebookInstancesError {
fn from(err: CredentialsError) -> ListNotebookInstancesError {
ListNotebookInstancesError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListNotebookInstancesError {
fn from(err: HttpDispatchError) -> ListNotebookInstancesError {
ListNotebookInstancesError::HttpDispatch(err)
}
}
impl From<io::Error> for ListNotebookInstancesError {
fn from(err: io::Error) -> ListNotebookInstancesError {
ListNotebookInstancesError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListNotebookInstancesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListNotebookInstancesError {
fn description(&self) -> &str {
match *self {
ListNotebookInstancesError::Validation(ref cause) => cause,
ListNotebookInstancesError::Credentials(ref err) => err.description(),
ListNotebookInstancesError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
ListNotebookInstancesError::ParseError(ref cause) => cause,
ListNotebookInstancesError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListSubscribedWorkteamsError {
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListSubscribedWorkteamsError {
pub fn from_response(res: BufferedHttpResponse) -> ListSubscribedWorkteamsError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ValidationException" => {
return ListSubscribedWorkteamsError::Validation(error_message.to_string());
}
_ => {}
}
}
return ListSubscribedWorkteamsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListSubscribedWorkteamsError {
fn from(err: serde_json::error::Error) -> ListSubscribedWorkteamsError {
ListSubscribedWorkteamsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListSubscribedWorkteamsError {
fn from(err: CredentialsError) -> ListSubscribedWorkteamsError {
ListSubscribedWorkteamsError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListSubscribedWorkteamsError {
fn from(err: HttpDispatchError) -> ListSubscribedWorkteamsError {
ListSubscribedWorkteamsError::HttpDispatch(err)
}
}
impl From<io::Error> for ListSubscribedWorkteamsError {
fn from(err: io::Error) -> ListSubscribedWorkteamsError {
ListSubscribedWorkteamsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListSubscribedWorkteamsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListSubscribedWorkteamsError {
fn description(&self) -> &str {
match *self {
ListSubscribedWorkteamsError::Validation(ref cause) => cause,
ListSubscribedWorkteamsError::Credentials(ref err) => err.description(),
ListSubscribedWorkteamsError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
ListSubscribedWorkteamsError::ParseError(ref cause) => cause,
ListSubscribedWorkteamsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListTagsError {
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListTagsError {
pub fn from_response(res: BufferedHttpResponse) -> ListTagsError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ValidationException" => {
return ListTagsError::Validation(error_message.to_string());
}
_ => {}
}
}
return ListTagsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListTagsError {
fn from(err: serde_json::error::Error) -> ListTagsError {
ListTagsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListTagsError {
fn from(err: CredentialsError) -> ListTagsError {
ListTagsError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListTagsError {
fn from(err: HttpDispatchError) -> ListTagsError {
ListTagsError::HttpDispatch(err)
}
}
impl From<io::Error> for ListTagsError {
fn from(err: io::Error) -> ListTagsError {
ListTagsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListTagsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListTagsError {
fn description(&self) -> &str {
match *self {
ListTagsError::Validation(ref cause) => cause,
ListTagsError::Credentials(ref err) => err.description(),
ListTagsError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
ListTagsError::ParseError(ref cause) => cause,
ListTagsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListTrainingJobsError {
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListTrainingJobsError {
pub fn from_response(res: BufferedHttpResponse) -> ListTrainingJobsError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ValidationException" => {
return ListTrainingJobsError::Validation(error_message.to_string());
}
_ => {}
}
}
return ListTrainingJobsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListTrainingJobsError {
fn from(err: serde_json::error::Error) -> ListTrainingJobsError {
ListTrainingJobsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListTrainingJobsError {
fn from(err: CredentialsError) -> ListTrainingJobsError {
ListTrainingJobsError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListTrainingJobsError {
fn from(err: HttpDispatchError) -> ListTrainingJobsError {
ListTrainingJobsError::HttpDispatch(err)
}
}
impl From<io::Error> for ListTrainingJobsError {
fn from(err: io::Error) -> ListTrainingJobsError {
ListTrainingJobsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListTrainingJobsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListTrainingJobsError {
fn description(&self) -> &str {
match *self {
ListTrainingJobsError::Validation(ref cause) => cause,
ListTrainingJobsError::Credentials(ref err) => err.description(),
ListTrainingJobsError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
ListTrainingJobsError::ParseError(ref cause) => cause,
ListTrainingJobsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListTrainingJobsForHyperParameterTuningJobError {
ResourceNotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListTrainingJobsForHyperParameterTuningJobError {
pub fn from_response(
res: BufferedHttpResponse,
) -> ListTrainingJobsForHyperParameterTuningJobError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ResourceNotFound" => {
return ListTrainingJobsForHyperParameterTuningJobError::ResourceNotFound(
String::from(error_message),
);
}
"ValidationException" => {
return ListTrainingJobsForHyperParameterTuningJobError::Validation(
error_message.to_string(),
);
}
_ => {}
}
}
return ListTrainingJobsForHyperParameterTuningJobError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListTrainingJobsForHyperParameterTuningJobError {
fn from(err: serde_json::error::Error) -> ListTrainingJobsForHyperParameterTuningJobError {
ListTrainingJobsForHyperParameterTuningJobError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListTrainingJobsForHyperParameterTuningJobError {
fn from(err: CredentialsError) -> ListTrainingJobsForHyperParameterTuningJobError {
ListTrainingJobsForHyperParameterTuningJobError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListTrainingJobsForHyperParameterTuningJobError {
fn from(err: HttpDispatchError) -> ListTrainingJobsForHyperParameterTuningJobError {
ListTrainingJobsForHyperParameterTuningJobError::HttpDispatch(err)
}
}
impl From<io::Error> for ListTrainingJobsForHyperParameterTuningJobError {
fn from(err: io::Error) -> ListTrainingJobsForHyperParameterTuningJobError {
ListTrainingJobsForHyperParameterTuningJobError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListTrainingJobsForHyperParameterTuningJobError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListTrainingJobsForHyperParameterTuningJobError {
fn description(&self) -> &str {
match *self {
ListTrainingJobsForHyperParameterTuningJobError::ResourceNotFound(ref cause) => cause,
ListTrainingJobsForHyperParameterTuningJobError::Validation(ref cause) => cause,
ListTrainingJobsForHyperParameterTuningJobError::Credentials(ref err) => {
err.description()
}
ListTrainingJobsForHyperParameterTuningJobError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
ListTrainingJobsForHyperParameterTuningJobError::ParseError(ref cause) => cause,
ListTrainingJobsForHyperParameterTuningJobError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListTransformJobsError {
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListTransformJobsError {
pub fn from_response(res: BufferedHttpResponse) -> ListTransformJobsError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ValidationException" => {
return ListTransformJobsError::Validation(error_message.to_string());
}
_ => {}
}
}
return ListTransformJobsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListTransformJobsError {
fn from(err: serde_json::error::Error) -> ListTransformJobsError {
ListTransformJobsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListTransformJobsError {
fn from(err: CredentialsError) -> ListTransformJobsError {
ListTransformJobsError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListTransformJobsError {
fn from(err: HttpDispatchError) -> ListTransformJobsError {
ListTransformJobsError::HttpDispatch(err)
}
}
impl From<io::Error> for ListTransformJobsError {
fn from(err: io::Error) -> ListTransformJobsError {
ListTransformJobsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListTransformJobsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListTransformJobsError {
fn description(&self) -> &str {
match *self {
ListTransformJobsError::Validation(ref cause) => cause,
ListTransformJobsError::Credentials(ref err) => err.description(),
ListTransformJobsError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
ListTransformJobsError::ParseError(ref cause) => cause,
ListTransformJobsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListWorkteamsError {
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListWorkteamsError {
pub fn from_response(res: BufferedHttpResponse) -> ListWorkteamsError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ValidationException" => {
return ListWorkteamsError::Validation(error_message.to_string());
}
_ => {}
}
}
return ListWorkteamsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListWorkteamsError {
fn from(err: serde_json::error::Error) -> ListWorkteamsError {
ListWorkteamsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListWorkteamsError {
fn from(err: CredentialsError) -> ListWorkteamsError {
ListWorkteamsError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListWorkteamsError {
fn from(err: HttpDispatchError) -> ListWorkteamsError {
ListWorkteamsError::HttpDispatch(err)
}
}
impl From<io::Error> for ListWorkteamsError {
fn from(err: io::Error) -> ListWorkteamsError {
ListWorkteamsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListWorkteamsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListWorkteamsError {
fn description(&self) -> &str {
match *self {
ListWorkteamsError::Validation(ref cause) => cause,
ListWorkteamsError::Credentials(ref err) => err.description(),
ListWorkteamsError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
ListWorkteamsError::ParseError(ref cause) => cause,
ListWorkteamsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum RenderUiTemplateError {
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl RenderUiTemplateError {
pub fn from_response(res: BufferedHttpResponse) -> RenderUiTemplateError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ValidationException" => {
return RenderUiTemplateError::Validation(error_message.to_string());
}
_ => {}
}
}
return RenderUiTemplateError::Unknown(res);
}
}
impl From<serde_json::error::Error> for RenderUiTemplateError {
fn from(err: serde_json::error::Error) -> RenderUiTemplateError {
RenderUiTemplateError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for RenderUiTemplateError {
fn from(err: CredentialsError) -> RenderUiTemplateError {
RenderUiTemplateError::Credentials(err)
}
}
impl From<HttpDispatchError> for RenderUiTemplateError {
fn from(err: HttpDispatchError) -> RenderUiTemplateError {
RenderUiTemplateError::HttpDispatch(err)
}
}
impl From<io::Error> for RenderUiTemplateError {
fn from(err: io::Error) -> RenderUiTemplateError {
RenderUiTemplateError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for RenderUiTemplateError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for RenderUiTemplateError {
fn description(&self) -> &str {
match *self {
RenderUiTemplateError::Validation(ref cause) => cause,
RenderUiTemplateError::Credentials(ref err) => err.description(),
RenderUiTemplateError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
RenderUiTemplateError::ParseError(ref cause) => cause,
RenderUiTemplateError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum SearchError {
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl SearchError {
pub fn from_response(res: BufferedHttpResponse) -> SearchError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ValidationException" => return SearchError::Validation(error_message.to_string()),
_ => {}
}
}
return SearchError::Unknown(res);
}
}
impl From<serde_json::error::Error> for SearchError {
fn from(err: serde_json::error::Error) -> SearchError {
SearchError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for SearchError {
fn from(err: CredentialsError) -> SearchError {
SearchError::Credentials(err)
}
}
impl From<HttpDispatchError> for SearchError {
fn from(err: HttpDispatchError) -> SearchError {
SearchError::HttpDispatch(err)
}
}
impl From<io::Error> for SearchError {
fn from(err: io::Error) -> SearchError {
SearchError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for SearchError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for SearchError {
fn description(&self) -> &str {
match *self {
SearchError::Validation(ref cause) => cause,
SearchError::Credentials(ref err) => err.description(),
SearchError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
SearchError::ParseError(ref cause) => cause,
SearchError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum StartNotebookInstanceError {
ResourceLimitExceeded(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl StartNotebookInstanceError {
pub fn from_response(res: BufferedHttpResponse) -> StartNotebookInstanceError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ResourceLimitExceeded" => {
return StartNotebookInstanceError::ResourceLimitExceeded(String::from(
error_message,
));
}
"ValidationException" => {
return StartNotebookInstanceError::Validation(error_message.to_string());
}
_ => {}
}
}
return StartNotebookInstanceError::Unknown(res);
}
}
impl From<serde_json::error::Error> for StartNotebookInstanceError {
fn from(err: serde_json::error::Error) -> StartNotebookInstanceError {
StartNotebookInstanceError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for StartNotebookInstanceError {
fn from(err: CredentialsError) -> StartNotebookInstanceError {
StartNotebookInstanceError::Credentials(err)
}
}
impl From<HttpDispatchError> for StartNotebookInstanceError {
fn from(err: HttpDispatchError) -> StartNotebookInstanceError {
StartNotebookInstanceError::HttpDispatch(err)
}
}
impl From<io::Error> for StartNotebookInstanceError {
fn from(err: io::Error) -> StartNotebookInstanceError {
StartNotebookInstanceError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for StartNotebookInstanceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for StartNotebookInstanceError {
fn description(&self) -> &str {
match *self {
StartNotebookInstanceError::ResourceLimitExceeded(ref cause) => cause,
StartNotebookInstanceError::Validation(ref cause) => cause,
StartNotebookInstanceError::Credentials(ref err) => err.description(),
StartNotebookInstanceError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
StartNotebookInstanceError::ParseError(ref cause) => cause,
StartNotebookInstanceError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum StopCompilationJobError {
ResourceNotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl StopCompilationJobError {
pub fn from_response(res: BufferedHttpResponse) -> StopCompilationJobError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ResourceNotFound" => {
return StopCompilationJobError::ResourceNotFound(String::from(error_message));
}
"ValidationException" => {
return StopCompilationJobError::Validation(error_message.to_string());
}
_ => {}
}
}
return StopCompilationJobError::Unknown(res);
}
}
impl From<serde_json::error::Error> for StopCompilationJobError {
fn from(err: serde_json::error::Error) -> StopCompilationJobError {
StopCompilationJobError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for StopCompilationJobError {
fn from(err: CredentialsError) -> StopCompilationJobError {
StopCompilationJobError::Credentials(err)
}
}
impl From<HttpDispatchError> for StopCompilationJobError {
fn from(err: HttpDispatchError) -> StopCompilationJobError {
StopCompilationJobError::HttpDispatch(err)
}
}
impl From<io::Error> for StopCompilationJobError {
fn from(err: io::Error) -> StopCompilationJobError {
StopCompilationJobError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for StopCompilationJobError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for StopCompilationJobError {
fn description(&self) -> &str {
match *self {
StopCompilationJobError::ResourceNotFound(ref cause) => cause,
StopCompilationJobError::Validation(ref cause) => cause,
StopCompilationJobError::Credentials(ref err) => err.description(),
StopCompilationJobError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
StopCompilationJobError::ParseError(ref cause) => cause,
StopCompilationJobError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum StopHyperParameterTuningJobError {
ResourceNotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl StopHyperParameterTuningJobError {
pub fn from_response(res: BufferedHttpResponse) -> StopHyperParameterTuningJobError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ResourceNotFound" => {
return StopHyperParameterTuningJobError::ResourceNotFound(String::from(
error_message,
));
}
"ValidationException" => {
return StopHyperParameterTuningJobError::Validation(error_message.to_string());
}
_ => {}
}
}
return StopHyperParameterTuningJobError::Unknown(res);
}
}
impl From<serde_json::error::Error> for StopHyperParameterTuningJobError {
fn from(err: serde_json::error::Error) -> StopHyperParameterTuningJobError {
StopHyperParameterTuningJobError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for StopHyperParameterTuningJobError {
fn from(err: CredentialsError) -> StopHyperParameterTuningJobError {
StopHyperParameterTuningJobError::Credentials(err)
}
}
impl From<HttpDispatchError> for StopHyperParameterTuningJobError {
fn from(err: HttpDispatchError) -> StopHyperParameterTuningJobError {
StopHyperParameterTuningJobError::HttpDispatch(err)
}
}
impl From<io::Error> for StopHyperParameterTuningJobError {
fn from(err: io::Error) -> StopHyperParameterTuningJobError {
StopHyperParameterTuningJobError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for StopHyperParameterTuningJobError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for StopHyperParameterTuningJobError {
fn description(&self) -> &str {
match *self {
StopHyperParameterTuningJobError::ResourceNotFound(ref cause) => cause,
StopHyperParameterTuningJobError::Validation(ref cause) => cause,
StopHyperParameterTuningJobError::Credentials(ref err) => err.description(),
StopHyperParameterTuningJobError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
StopHyperParameterTuningJobError::ParseError(ref cause) => cause,
StopHyperParameterTuningJobError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum StopLabelingJobError {
ResourceNotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl StopLabelingJobError {
pub fn from_response(res: BufferedHttpResponse) -> StopLabelingJobError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ResourceNotFound" => {
return StopLabelingJobError::ResourceNotFound(String::from(error_message));
}
"ValidationException" => {
return StopLabelingJobError::Validation(error_message.to_string());
}
_ => {}
}
}
return StopLabelingJobError::Unknown(res);
}
}
impl From<serde_json::error::Error> for StopLabelingJobError {
fn from(err: serde_json::error::Error) -> StopLabelingJobError {
StopLabelingJobError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for StopLabelingJobError {
fn from(err: CredentialsError) -> StopLabelingJobError {
StopLabelingJobError::Credentials(err)
}
}
impl From<HttpDispatchError> for StopLabelingJobError {
fn from(err: HttpDispatchError) -> StopLabelingJobError {
StopLabelingJobError::HttpDispatch(err)
}
}
impl From<io::Error> for StopLabelingJobError {
fn from(err: io::Error) -> StopLabelingJobError {
StopLabelingJobError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for StopLabelingJobError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for StopLabelingJobError {
fn description(&self) -> &str {
match *self {
StopLabelingJobError::ResourceNotFound(ref cause) => cause,
StopLabelingJobError::Validation(ref cause) => cause,
StopLabelingJobError::Credentials(ref err) => err.description(),
StopLabelingJobError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
StopLabelingJobError::ParseError(ref cause) => cause,
StopLabelingJobError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum StopNotebookInstanceError {
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl StopNotebookInstanceError {
pub fn from_response(res: BufferedHttpResponse) -> StopNotebookInstanceError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ValidationException" => {
return StopNotebookInstanceError::Validation(error_message.to_string());
}
_ => {}
}
}
return StopNotebookInstanceError::Unknown(res);
}
}
impl From<serde_json::error::Error> for StopNotebookInstanceError {
fn from(err: serde_json::error::Error) -> StopNotebookInstanceError {
StopNotebookInstanceError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for StopNotebookInstanceError {
fn from(err: CredentialsError) -> StopNotebookInstanceError {
StopNotebookInstanceError::Credentials(err)
}
}
impl From<HttpDispatchError> for StopNotebookInstanceError {
fn from(err: HttpDispatchError) -> StopNotebookInstanceError {
StopNotebookInstanceError::HttpDispatch(err)
}
}
impl From<io::Error> for StopNotebookInstanceError {
fn from(err: io::Error) -> StopNotebookInstanceError {
StopNotebookInstanceError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for StopNotebookInstanceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for StopNotebookInstanceError {
fn description(&self) -> &str {
match *self {
StopNotebookInstanceError::Validation(ref cause) => cause,
StopNotebookInstanceError::Credentials(ref err) => err.description(),
StopNotebookInstanceError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
StopNotebookInstanceError::ParseError(ref cause) => cause,
StopNotebookInstanceError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum StopTrainingJobError {
ResourceNotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl StopTrainingJobError {
pub fn from_response(res: BufferedHttpResponse) -> StopTrainingJobError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ResourceNotFound" => {
return StopTrainingJobError::ResourceNotFound(String::from(error_message));
}
"ValidationException" => {
return StopTrainingJobError::Validation(error_message.to_string());
}
_ => {}
}
}
return StopTrainingJobError::Unknown(res);
}
}
impl From<serde_json::error::Error> for StopTrainingJobError {
fn from(err: serde_json::error::Error) -> StopTrainingJobError {
StopTrainingJobError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for StopTrainingJobError {
fn from(err: CredentialsError) -> StopTrainingJobError {
StopTrainingJobError::Credentials(err)
}
}
impl From<HttpDispatchError> for StopTrainingJobError {
fn from(err: HttpDispatchError) -> StopTrainingJobError {
StopTrainingJobError::HttpDispatch(err)
}
}
impl From<io::Error> for StopTrainingJobError {
fn from(err: io::Error) -> StopTrainingJobError {
StopTrainingJobError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for StopTrainingJobError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for StopTrainingJobError {
fn description(&self) -> &str {
match *self {
StopTrainingJobError::ResourceNotFound(ref cause) => cause,
StopTrainingJobError::Validation(ref cause) => cause,
StopTrainingJobError::Credentials(ref err) => err.description(),
StopTrainingJobError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
StopTrainingJobError::ParseError(ref cause) => cause,
StopTrainingJobError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum StopTransformJobError {
ResourceNotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl StopTransformJobError {
pub fn from_response(res: BufferedHttpResponse) -> StopTransformJobError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ResourceNotFound" => {
return StopTransformJobError::ResourceNotFound(String::from(error_message));
}
"ValidationException" => {
return StopTransformJobError::Validation(error_message.to_string());
}
_ => {}
}
}
return StopTransformJobError::Unknown(res);
}
}
impl From<serde_json::error::Error> for StopTransformJobError {
fn from(err: serde_json::error::Error) -> StopTransformJobError {
StopTransformJobError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for StopTransformJobError {
fn from(err: CredentialsError) -> StopTransformJobError {
StopTransformJobError::Credentials(err)
}
}
impl From<HttpDispatchError> for StopTransformJobError {
fn from(err: HttpDispatchError) -> StopTransformJobError {
StopTransformJobError::HttpDispatch(err)
}
}
impl From<io::Error> for StopTransformJobError {
fn from(err: io::Error) -> StopTransformJobError {
StopTransformJobError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for StopTransformJobError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for StopTransformJobError {
fn description(&self) -> &str {
match *self {
StopTransformJobError::ResourceNotFound(ref cause) => cause,
StopTransformJobError::Validation(ref cause) => cause,
StopTransformJobError::Credentials(ref err) => err.description(),
StopTransformJobError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
StopTransformJobError::ParseError(ref cause) => cause,
StopTransformJobError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateCodeRepositoryError {
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl UpdateCodeRepositoryError {
pub fn from_response(res: BufferedHttpResponse) -> UpdateCodeRepositoryError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ValidationException" => {
return UpdateCodeRepositoryError::Validation(error_message.to_string());
}
_ => {}
}
}
return UpdateCodeRepositoryError::Unknown(res);
}
}
impl From<serde_json::error::Error> for UpdateCodeRepositoryError {
fn from(err: serde_json::error::Error) -> UpdateCodeRepositoryError {
UpdateCodeRepositoryError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for UpdateCodeRepositoryError {
fn from(err: CredentialsError) -> UpdateCodeRepositoryError {
UpdateCodeRepositoryError::Credentials(err)
}
}
impl From<HttpDispatchError> for UpdateCodeRepositoryError {
fn from(err: HttpDispatchError) -> UpdateCodeRepositoryError {
UpdateCodeRepositoryError::HttpDispatch(err)
}
}
impl From<io::Error> for UpdateCodeRepositoryError {
fn from(err: io::Error) -> UpdateCodeRepositoryError {
UpdateCodeRepositoryError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for UpdateCodeRepositoryError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateCodeRepositoryError {
fn description(&self) -> &str {
match *self {
UpdateCodeRepositoryError::Validation(ref cause) => cause,
UpdateCodeRepositoryError::Credentials(ref err) => err.description(),
UpdateCodeRepositoryError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
UpdateCodeRepositoryError::ParseError(ref cause) => cause,
UpdateCodeRepositoryError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateEndpointError {
ResourceLimitExceeded(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl UpdateEndpointError {
pub fn from_response(res: BufferedHttpResponse) -> UpdateEndpointError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ResourceLimitExceeded" => {
return UpdateEndpointError::ResourceLimitExceeded(String::from(error_message));
}
"ValidationException" => {
return UpdateEndpointError::Validation(error_message.to_string());
}
_ => {}
}
}
return UpdateEndpointError::Unknown(res);
}
}
impl From<serde_json::error::Error> for UpdateEndpointError {
fn from(err: serde_json::error::Error) -> UpdateEndpointError {
UpdateEndpointError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for UpdateEndpointError {
fn from(err: CredentialsError) -> UpdateEndpointError {
UpdateEndpointError::Credentials(err)
}
}
impl From<HttpDispatchError> for UpdateEndpointError {
fn from(err: HttpDispatchError) -> UpdateEndpointError {
UpdateEndpointError::HttpDispatch(err)
}
}
impl From<io::Error> for UpdateEndpointError {
fn from(err: io::Error) -> UpdateEndpointError {
UpdateEndpointError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for UpdateEndpointError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateEndpointError {
fn description(&self) -> &str {
match *self {
UpdateEndpointError::ResourceLimitExceeded(ref cause) => cause,
UpdateEndpointError::Validation(ref cause) => cause,
UpdateEndpointError::Credentials(ref err) => err.description(),
UpdateEndpointError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
UpdateEndpointError::ParseError(ref cause) => cause,
UpdateEndpointError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateEndpointWeightsAndCapacitiesError {
ResourceLimitExceeded(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl UpdateEndpointWeightsAndCapacitiesError {
pub fn from_response(res: BufferedHttpResponse) -> UpdateEndpointWeightsAndCapacitiesError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ResourceLimitExceeded" => {
return UpdateEndpointWeightsAndCapacitiesError::ResourceLimitExceeded(
String::from(error_message),
);
}
"ValidationException" => {
return UpdateEndpointWeightsAndCapacitiesError::Validation(
error_message.to_string(),
);
}
_ => {}
}
}
return UpdateEndpointWeightsAndCapacitiesError::Unknown(res);
}
}
impl From<serde_json::error::Error> for UpdateEndpointWeightsAndCapacitiesError {
fn from(err: serde_json::error::Error) -> UpdateEndpointWeightsAndCapacitiesError {
UpdateEndpointWeightsAndCapacitiesError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for UpdateEndpointWeightsAndCapacitiesError {
fn from(err: CredentialsError) -> UpdateEndpointWeightsAndCapacitiesError {
UpdateEndpointWeightsAndCapacitiesError::Credentials(err)
}
}
impl From<HttpDispatchError> for UpdateEndpointWeightsAndCapacitiesError {
fn from(err: HttpDispatchError) -> UpdateEndpointWeightsAndCapacitiesError {
UpdateEndpointWeightsAndCapacitiesError::HttpDispatch(err)
}
}
impl From<io::Error> for UpdateEndpointWeightsAndCapacitiesError {
fn from(err: io::Error) -> UpdateEndpointWeightsAndCapacitiesError {
UpdateEndpointWeightsAndCapacitiesError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for UpdateEndpointWeightsAndCapacitiesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateEndpointWeightsAndCapacitiesError {
fn description(&self) -> &str {
match *self {
UpdateEndpointWeightsAndCapacitiesError::ResourceLimitExceeded(ref cause) => cause,
UpdateEndpointWeightsAndCapacitiesError::Validation(ref cause) => cause,
UpdateEndpointWeightsAndCapacitiesError::Credentials(ref err) => err.description(),
UpdateEndpointWeightsAndCapacitiesError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
UpdateEndpointWeightsAndCapacitiesError::ParseError(ref cause) => cause,
UpdateEndpointWeightsAndCapacitiesError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateNotebookInstanceError {
ResourceLimitExceeded(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl UpdateNotebookInstanceError {
pub fn from_response(res: BufferedHttpResponse) -> UpdateNotebookInstanceError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ResourceLimitExceeded" => {
return UpdateNotebookInstanceError::ResourceLimitExceeded(String::from(
error_message,
));
}
"ValidationException" => {
return UpdateNotebookInstanceError::Validation(error_message.to_string());
}
_ => {}
}
}
return UpdateNotebookInstanceError::Unknown(res);
}
}
impl From<serde_json::error::Error> for UpdateNotebookInstanceError {
fn from(err: serde_json::error::Error) -> UpdateNotebookInstanceError {
UpdateNotebookInstanceError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for UpdateNotebookInstanceError {
fn from(err: CredentialsError) -> UpdateNotebookInstanceError {
UpdateNotebookInstanceError::Credentials(err)
}
}
impl From<HttpDispatchError> for UpdateNotebookInstanceError {
fn from(err: HttpDispatchError) -> UpdateNotebookInstanceError {
UpdateNotebookInstanceError::HttpDispatch(err)
}
}
impl From<io::Error> for UpdateNotebookInstanceError {
fn from(err: io::Error) -> UpdateNotebookInstanceError {
UpdateNotebookInstanceError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for UpdateNotebookInstanceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateNotebookInstanceError {
fn description(&self) -> &str {
match *self {
UpdateNotebookInstanceError::ResourceLimitExceeded(ref cause) => cause,
UpdateNotebookInstanceError::Validation(ref cause) => cause,
UpdateNotebookInstanceError::Credentials(ref err) => err.description(),
UpdateNotebookInstanceError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
UpdateNotebookInstanceError::ParseError(ref cause) => cause,
UpdateNotebookInstanceError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateNotebookInstanceLifecycleConfigError {
ResourceLimitExceeded(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl UpdateNotebookInstanceLifecycleConfigError {
pub fn from_response(res: BufferedHttpResponse) -> UpdateNotebookInstanceLifecycleConfigError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ResourceLimitExceeded" => {
return UpdateNotebookInstanceLifecycleConfigError::ResourceLimitExceeded(
String::from(error_message),
);
}
"ValidationException" => {
return UpdateNotebookInstanceLifecycleConfigError::Validation(
error_message.to_string(),
);
}
_ => {}
}
}
return UpdateNotebookInstanceLifecycleConfigError::Unknown(res);
}
}
impl From<serde_json::error::Error> for UpdateNotebookInstanceLifecycleConfigError {
fn from(err: serde_json::error::Error) -> UpdateNotebookInstanceLifecycleConfigError {
UpdateNotebookInstanceLifecycleConfigError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for UpdateNotebookInstanceLifecycleConfigError {
fn from(err: CredentialsError) -> UpdateNotebookInstanceLifecycleConfigError {
UpdateNotebookInstanceLifecycleConfigError::Credentials(err)
}
}
impl From<HttpDispatchError> for UpdateNotebookInstanceLifecycleConfigError {
fn from(err: HttpDispatchError) -> UpdateNotebookInstanceLifecycleConfigError {
UpdateNotebookInstanceLifecycleConfigError::HttpDispatch(err)
}
}
impl From<io::Error> for UpdateNotebookInstanceLifecycleConfigError {
fn from(err: io::Error) -> UpdateNotebookInstanceLifecycleConfigError {
UpdateNotebookInstanceLifecycleConfigError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for UpdateNotebookInstanceLifecycleConfigError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateNotebookInstanceLifecycleConfigError {
fn description(&self) -> &str {
match *self {
UpdateNotebookInstanceLifecycleConfigError::ResourceLimitExceeded(ref cause) => cause,
UpdateNotebookInstanceLifecycleConfigError::Validation(ref cause) => cause,
UpdateNotebookInstanceLifecycleConfigError::Credentials(ref err) => err.description(),
UpdateNotebookInstanceLifecycleConfigError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
UpdateNotebookInstanceLifecycleConfigError::ParseError(ref cause) => cause,
UpdateNotebookInstanceLifecycleConfigError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateWorkteamError {
ResourceLimitExceeded(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl UpdateWorkteamError {
pub fn from_response(res: BufferedHttpResponse) -> UpdateWorkteamError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ResourceLimitExceeded" => {
return UpdateWorkteamError::ResourceLimitExceeded(String::from(error_message));
}
"ValidationException" => {
return UpdateWorkteamError::Validation(error_message.to_string());
}
_ => {}
}
}
return UpdateWorkteamError::Unknown(res);
}
}
impl From<serde_json::error::Error> for UpdateWorkteamError {
fn from(err: serde_json::error::Error) -> UpdateWorkteamError {
UpdateWorkteamError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for UpdateWorkteamError {
fn from(err: CredentialsError) -> UpdateWorkteamError {
UpdateWorkteamError::Credentials(err)
}
}
impl From<HttpDispatchError> for UpdateWorkteamError {
fn from(err: HttpDispatchError) -> UpdateWorkteamError {
UpdateWorkteamError::HttpDispatch(err)
}
}
impl From<io::Error> for UpdateWorkteamError {
fn from(err: io::Error) -> UpdateWorkteamError {
UpdateWorkteamError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for UpdateWorkteamError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateWorkteamError {
fn description(&self) -> &str {
match *self {
UpdateWorkteamError::ResourceLimitExceeded(ref cause) => cause,
UpdateWorkteamError::Validation(ref cause) => cause,
UpdateWorkteamError::Credentials(ref err) => err.description(),
UpdateWorkteamError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
UpdateWorkteamError::ParseError(ref cause) => cause,
UpdateWorkteamError::Unknown(_) => "unknown error",
}
}
}
pub trait SageMaker {
fn add_tags(&self, input: AddTagsInput) -> RusotoFuture<AddTagsOutput, AddTagsError>;
fn create_algorithm(
&self,
input: CreateAlgorithmInput,
) -> RusotoFuture<CreateAlgorithmOutput, CreateAlgorithmError>;
fn create_code_repository(
&self,
input: CreateCodeRepositoryInput,
) -> RusotoFuture<CreateCodeRepositoryOutput, CreateCodeRepositoryError>;
fn create_compilation_job(
&self,
input: CreateCompilationJobRequest,
) -> RusotoFuture<CreateCompilationJobResponse, CreateCompilationJobError>;
fn create_endpoint(
&self,
input: CreateEndpointInput,
) -> RusotoFuture<CreateEndpointOutput, CreateEndpointError>;
fn create_endpoint_config(
&self,
input: CreateEndpointConfigInput,
) -> RusotoFuture<CreateEndpointConfigOutput, CreateEndpointConfigError>;
fn create_hyper_parameter_tuning_job(
&self,
input: CreateHyperParameterTuningJobRequest,
) -> RusotoFuture<CreateHyperParameterTuningJobResponse, CreateHyperParameterTuningJobError>;
fn create_labeling_job(
&self,
input: CreateLabelingJobRequest,
) -> RusotoFuture<CreateLabelingJobResponse, CreateLabelingJobError>;
fn create_model(
&self,
input: CreateModelInput,
) -> RusotoFuture<CreateModelOutput, CreateModelError>;
fn create_model_package(
&self,
input: CreateModelPackageInput,
) -> RusotoFuture<CreateModelPackageOutput, CreateModelPackageError>;
fn create_notebook_instance(
&self,
input: CreateNotebookInstanceInput,
) -> RusotoFuture<CreateNotebookInstanceOutput, CreateNotebookInstanceError>;
fn create_notebook_instance_lifecycle_config(
&self,
input: CreateNotebookInstanceLifecycleConfigInput,
) -> RusotoFuture<
CreateNotebookInstanceLifecycleConfigOutput,
CreateNotebookInstanceLifecycleConfigError,
>;
fn create_presigned_notebook_instance_url(
&self,
input: CreatePresignedNotebookInstanceUrlInput,
) -> RusotoFuture<
CreatePresignedNotebookInstanceUrlOutput,
CreatePresignedNotebookInstanceUrlError,
>;
fn create_training_job(
&self,
input: CreateTrainingJobRequest,
) -> RusotoFuture<CreateTrainingJobResponse, CreateTrainingJobError>;
fn create_transform_job(
&self,
input: CreateTransformJobRequest,
) -> RusotoFuture<CreateTransformJobResponse, CreateTransformJobError>;
fn create_workteam(
&self,
input: CreateWorkteamRequest,
) -> RusotoFuture<CreateWorkteamResponse, CreateWorkteamError>;
fn delete_algorithm(
&self,
input: DeleteAlgorithmInput,
) -> RusotoFuture<(), DeleteAlgorithmError>;
fn delete_code_repository(
&self,
input: DeleteCodeRepositoryInput,
) -> RusotoFuture<(), DeleteCodeRepositoryError>;
fn delete_endpoint(&self, input: DeleteEndpointInput) -> RusotoFuture<(), DeleteEndpointError>;
fn delete_endpoint_config(
&self,
input: DeleteEndpointConfigInput,
) -> RusotoFuture<(), DeleteEndpointConfigError>;
fn delete_model(&self, input: DeleteModelInput) -> RusotoFuture<(), DeleteModelError>;
fn delete_model_package(
&self,
input: DeleteModelPackageInput,
) -> RusotoFuture<(), DeleteModelPackageError>;
fn delete_notebook_instance(
&self,
input: DeleteNotebookInstanceInput,
) -> RusotoFuture<(), DeleteNotebookInstanceError>;
fn delete_notebook_instance_lifecycle_config(
&self,
input: DeleteNotebookInstanceLifecycleConfigInput,
) -> RusotoFuture<(), DeleteNotebookInstanceLifecycleConfigError>;
fn delete_tags(
&self,
input: DeleteTagsInput,
) -> RusotoFuture<DeleteTagsOutput, DeleteTagsError>;
fn delete_workteam(
&self,
input: DeleteWorkteamRequest,
) -> RusotoFuture<DeleteWorkteamResponse, DeleteWorkteamError>;
fn describe_algorithm(
&self,
input: DescribeAlgorithmInput,
) -> RusotoFuture<DescribeAlgorithmOutput, DescribeAlgorithmError>;
fn describe_code_repository(
&self,
input: DescribeCodeRepositoryInput,
) -> RusotoFuture<DescribeCodeRepositoryOutput, DescribeCodeRepositoryError>;
fn describe_compilation_job(
&self,
input: DescribeCompilationJobRequest,
) -> RusotoFuture<DescribeCompilationJobResponse, DescribeCompilationJobError>;
fn describe_endpoint(
&self,
input: DescribeEndpointInput,
) -> RusotoFuture<DescribeEndpointOutput, DescribeEndpointError>;
fn describe_endpoint_config(
&self,
input: DescribeEndpointConfigInput,
) -> RusotoFuture<DescribeEndpointConfigOutput, DescribeEndpointConfigError>;
fn describe_hyper_parameter_tuning_job(
&self,
input: DescribeHyperParameterTuningJobRequest,
) -> RusotoFuture<DescribeHyperParameterTuningJobResponse, DescribeHyperParameterTuningJobError>;
fn describe_labeling_job(
&self,
input: DescribeLabelingJobRequest,
) -> RusotoFuture<DescribeLabelingJobResponse, DescribeLabelingJobError>;
fn describe_model(
&self,
input: DescribeModelInput,
) -> RusotoFuture<DescribeModelOutput, DescribeModelError>;
fn describe_model_package(
&self,
input: DescribeModelPackageInput,
) -> RusotoFuture<DescribeModelPackageOutput, DescribeModelPackageError>;
fn describe_notebook_instance(
&self,
input: DescribeNotebookInstanceInput,
) -> RusotoFuture<DescribeNotebookInstanceOutput, DescribeNotebookInstanceError>;
fn describe_notebook_instance_lifecycle_config(
&self,
input: DescribeNotebookInstanceLifecycleConfigInput,
) -> RusotoFuture<
DescribeNotebookInstanceLifecycleConfigOutput,
DescribeNotebookInstanceLifecycleConfigError,
>;
fn describe_subscribed_workteam(
&self,
input: DescribeSubscribedWorkteamRequest,
) -> RusotoFuture<DescribeSubscribedWorkteamResponse, DescribeSubscribedWorkteamError>;
fn describe_training_job(
&self,
input: DescribeTrainingJobRequest,
) -> RusotoFuture<DescribeTrainingJobResponse, DescribeTrainingJobError>;
fn describe_transform_job(
&self,
input: DescribeTransformJobRequest,
) -> RusotoFuture<DescribeTransformJobResponse, DescribeTransformJobError>;
fn describe_workteam(
&self,
input: DescribeWorkteamRequest,
) -> RusotoFuture<DescribeWorkteamResponse, DescribeWorkteamError>;
fn get_search_suggestions(
&self,
input: GetSearchSuggestionsRequest,
) -> RusotoFuture<GetSearchSuggestionsResponse, GetSearchSuggestionsError>;
fn list_algorithms(
&self,
input: ListAlgorithmsInput,
) -> RusotoFuture<ListAlgorithmsOutput, ListAlgorithmsError>;
fn list_code_repositories(
&self,
input: ListCodeRepositoriesInput,
) -> RusotoFuture<ListCodeRepositoriesOutput, ListCodeRepositoriesError>;
fn list_compilation_jobs(
&self,
input: ListCompilationJobsRequest,
) -> RusotoFuture<ListCompilationJobsResponse, ListCompilationJobsError>;
fn list_endpoint_configs(
&self,
input: ListEndpointConfigsInput,
) -> RusotoFuture<ListEndpointConfigsOutput, ListEndpointConfigsError>;
fn list_endpoints(
&self,
input: ListEndpointsInput,
) -> RusotoFuture<ListEndpointsOutput, ListEndpointsError>;
fn list_hyper_parameter_tuning_jobs(
&self,
input: ListHyperParameterTuningJobsRequest,
) -> RusotoFuture<ListHyperParameterTuningJobsResponse, ListHyperParameterTuningJobsError>;
fn list_labeling_jobs(
&self,
input: ListLabelingJobsRequest,
) -> RusotoFuture<ListLabelingJobsResponse, ListLabelingJobsError>;
fn list_labeling_jobs_for_workteam(
&self,
input: ListLabelingJobsForWorkteamRequest,
) -> RusotoFuture<ListLabelingJobsForWorkteamResponse, ListLabelingJobsForWorkteamError>;
fn list_model_packages(
&self,
input: ListModelPackagesInput,
) -> RusotoFuture<ListModelPackagesOutput, ListModelPackagesError>;
fn list_models(
&self,
input: ListModelsInput,
) -> RusotoFuture<ListModelsOutput, ListModelsError>;
fn list_notebook_instance_lifecycle_configs(
&self,
input: ListNotebookInstanceLifecycleConfigsInput,
) -> RusotoFuture<
ListNotebookInstanceLifecycleConfigsOutput,
ListNotebookInstanceLifecycleConfigsError,
>;
fn list_notebook_instances(
&self,
input: ListNotebookInstancesInput,
) -> RusotoFuture<ListNotebookInstancesOutput, ListNotebookInstancesError>;
fn list_subscribed_workteams(
&self,
input: ListSubscribedWorkteamsRequest,
) -> RusotoFuture<ListSubscribedWorkteamsResponse, ListSubscribedWorkteamsError>;
fn list_tags(&self, input: ListTagsInput) -> RusotoFuture<ListTagsOutput, ListTagsError>;
fn list_training_jobs(
&self,
input: ListTrainingJobsRequest,
) -> RusotoFuture<ListTrainingJobsResponse, ListTrainingJobsError>;
fn list_training_jobs_for_hyper_parameter_tuning_job(
&self,
input: ListTrainingJobsForHyperParameterTuningJobRequest,
) -> RusotoFuture<
ListTrainingJobsForHyperParameterTuningJobResponse,
ListTrainingJobsForHyperParameterTuningJobError,
>;
fn list_transform_jobs(
&self,
input: ListTransformJobsRequest,
) -> RusotoFuture<ListTransformJobsResponse, ListTransformJobsError>;
fn list_workteams(
&self,
input: ListWorkteamsRequest,
) -> RusotoFuture<ListWorkteamsResponse, ListWorkteamsError>;
fn render_ui_template(
&self,
input: RenderUiTemplateRequest,
) -> RusotoFuture<RenderUiTemplateResponse, RenderUiTemplateError>;
fn search(&self, input: SearchRequest) -> RusotoFuture<SearchResponse, SearchError>;
fn start_notebook_instance(
&self,
input: StartNotebookInstanceInput,
) -> RusotoFuture<(), StartNotebookInstanceError>;
fn stop_compilation_job(
&self,
input: StopCompilationJobRequest,
) -> RusotoFuture<(), StopCompilationJobError>;
fn stop_hyper_parameter_tuning_job(
&self,
input: StopHyperParameterTuningJobRequest,
) -> RusotoFuture<(), StopHyperParameterTuningJobError>;
fn stop_labeling_job(
&self,
input: StopLabelingJobRequest,
) -> RusotoFuture<(), StopLabelingJobError>;
fn stop_notebook_instance(
&self,
input: StopNotebookInstanceInput,
) -> RusotoFuture<(), StopNotebookInstanceError>;
fn stop_training_job(
&self,
input: StopTrainingJobRequest,
) -> RusotoFuture<(), StopTrainingJobError>;
fn stop_transform_job(
&self,
input: StopTransformJobRequest,
) -> RusotoFuture<(), StopTransformJobError>;
fn update_code_repository(
&self,
input: UpdateCodeRepositoryInput,
) -> RusotoFuture<UpdateCodeRepositoryOutput, UpdateCodeRepositoryError>;
fn update_endpoint(
&self,
input: UpdateEndpointInput,
) -> RusotoFuture<UpdateEndpointOutput, UpdateEndpointError>;
fn update_endpoint_weights_and_capacities(
&self,
input: UpdateEndpointWeightsAndCapacitiesInput,
) -> RusotoFuture<
UpdateEndpointWeightsAndCapacitiesOutput,
UpdateEndpointWeightsAndCapacitiesError,
>;
fn update_notebook_instance(
&self,
input: UpdateNotebookInstanceInput,
) -> RusotoFuture<UpdateNotebookInstanceOutput, UpdateNotebookInstanceError>;
fn update_notebook_instance_lifecycle_config(
&self,
input: UpdateNotebookInstanceLifecycleConfigInput,
) -> RusotoFuture<
UpdateNotebookInstanceLifecycleConfigOutput,
UpdateNotebookInstanceLifecycleConfigError,
>;
fn update_workteam(
&self,
input: UpdateWorkteamRequest,
) -> RusotoFuture<UpdateWorkteamResponse, UpdateWorkteamError>;
}
#[derive(Clone)]
pub struct SageMakerClient {
client: Client,
region: region::Region,
}
impl SageMakerClient {
pub fn new(region: region::Region) -> SageMakerClient {
SageMakerClient {
client: Client::shared(),
region: region,
}
}
pub fn new_with<P, D>(
request_dispatcher: D,
credentials_provider: P,
region: region::Region,
) -> SageMakerClient
where
P: ProvideAwsCredentials + Send + Sync + 'static,
P::Future: Send,
D: DispatchSignedRequest + Send + Sync + 'static,
D::Future: Send,
{
SageMakerClient {
client: Client::new_with(credentials_provider, request_dispatcher),
region: region,
}
}
}
impl SageMaker for SageMakerClient {
fn add_tags(&self, input: AddTagsInput) -> RusotoFuture<AddTagsOutput, AddTagsError> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.AddTags");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<AddTagsOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(AddTagsError::from_response(response))),
)
}
})
}
fn create_algorithm(
&self,
input: CreateAlgorithmInput,
) -> RusotoFuture<CreateAlgorithmOutput, CreateAlgorithmError> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.CreateAlgorithm");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<CreateAlgorithmOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateAlgorithmError::from_response(response))),
)
}
})
}
fn create_code_repository(
&self,
input: CreateCodeRepositoryInput,
) -> RusotoFuture<CreateCodeRepositoryOutput, CreateCodeRepositoryError> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.CreateCodeRepository");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<CreateCodeRepositoryOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(CreateCodeRepositoryError::from_response(response))
}),
)
}
})
}
fn create_compilation_job(
&self,
input: CreateCompilationJobRequest,
) -> RusotoFuture<CreateCompilationJobResponse, CreateCompilationJobError> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.CreateCompilationJob");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<CreateCompilationJobResponse>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(CreateCompilationJobError::from_response(response))
}),
)
}
})
}
fn create_endpoint(
&self,
input: CreateEndpointInput,
) -> RusotoFuture<CreateEndpointOutput, CreateEndpointError> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.CreateEndpoint");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<CreateEndpointOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateEndpointError::from_response(response))),
)
}
})
}
fn create_endpoint_config(
&self,
input: CreateEndpointConfigInput,
) -> RusotoFuture<CreateEndpointConfigOutput, CreateEndpointConfigError> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.CreateEndpointConfig");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<CreateEndpointConfigOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(CreateEndpointConfigError::from_response(response))
}),
)
}
})
}
fn create_hyper_parameter_tuning_job(
&self,
input: CreateHyperParameterTuningJobRequest,
) -> RusotoFuture<CreateHyperParameterTuningJobResponse, CreateHyperParameterTuningJobError>
{
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.CreateHyperParameterTuningJob");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<CreateHyperParameterTuningJobResponse>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(CreateHyperParameterTuningJobError::from_response(response))
}))
}
})
}
fn create_labeling_job(
&self,
input: CreateLabelingJobRequest,
) -> RusotoFuture<CreateLabelingJobResponse, CreateLabelingJobError> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.CreateLabelingJob");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<CreateLabelingJobResponse>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateLabelingJobError::from_response(response))),
)
}
})
}
fn create_model(
&self,
input: CreateModelInput,
) -> RusotoFuture<CreateModelOutput, CreateModelError> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.CreateModel");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<CreateModelOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateModelError::from_response(response))),
)
}
})
}
fn create_model_package(
&self,
input: CreateModelPackageInput,
) -> RusotoFuture<CreateModelPackageOutput, CreateModelPackageError> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.CreateModelPackage");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<CreateModelPackageOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateModelPackageError::from_response(response))),
)
}
})
}
fn create_notebook_instance(
&self,
input: CreateNotebookInstanceInput,
) -> RusotoFuture<CreateNotebookInstanceOutput, CreateNotebookInstanceError> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.CreateNotebookInstance");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<CreateNotebookInstanceOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(CreateNotebookInstanceError::from_response(response))
}),
)
}
})
}
fn create_notebook_instance_lifecycle_config(
&self,
input: CreateNotebookInstanceLifecycleConfigInput,
) -> RusotoFuture<
CreateNotebookInstanceLifecycleConfigOutput,
CreateNotebookInstanceLifecycleConfigError,
> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"SageMaker.CreateNotebookInstanceLifecycleConfig",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<CreateNotebookInstanceLifecycleConfigOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(CreateNotebookInstanceLifecycleConfigError::from_response(
response,
))
}))
}
})
}
fn create_presigned_notebook_instance_url(
&self,
input: CreatePresignedNotebookInstanceUrlInput,
) -> RusotoFuture<
CreatePresignedNotebookInstanceUrlOutput,
CreatePresignedNotebookInstanceUrlError,
> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"SageMaker.CreatePresignedNotebookInstanceUrl",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<CreatePresignedNotebookInstanceUrlOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(CreatePresignedNotebookInstanceUrlError::from_response(
response,
))
}))
}
})
}
fn create_training_job(
&self,
input: CreateTrainingJobRequest,
) -> RusotoFuture<CreateTrainingJobResponse, CreateTrainingJobError> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.CreateTrainingJob");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<CreateTrainingJobResponse>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateTrainingJobError::from_response(response))),
)
}
})
}
fn create_transform_job(
&self,
input: CreateTransformJobRequest,
) -> RusotoFuture<CreateTransformJobResponse, CreateTransformJobError> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.CreateTransformJob");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<CreateTransformJobResponse>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateTransformJobError::from_response(response))),
)
}
})
}
fn create_workteam(
&self,
input: CreateWorkteamRequest,
) -> RusotoFuture<CreateWorkteamResponse, CreateWorkteamError> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.CreateWorkteam");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<CreateWorkteamResponse>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateWorkteamError::from_response(response))),
)
}
})
}
fn delete_algorithm(
&self,
input: DeleteAlgorithmInput,
) -> RusotoFuture<(), DeleteAlgorithmError> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.DeleteAlgorithm");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(future::ok(::std::mem::drop(response)))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteAlgorithmError::from_response(response))),
)
}
})
}
fn delete_code_repository(
&self,
input: DeleteCodeRepositoryInput,
) -> RusotoFuture<(), DeleteCodeRepositoryError> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.DeleteCodeRepository");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(future::ok(::std::mem::drop(response)))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(DeleteCodeRepositoryError::from_response(response))
}),
)
}
})
}
fn delete_endpoint(&self, input: DeleteEndpointInput) -> RusotoFuture<(), DeleteEndpointError> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.DeleteEndpoint");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(future::ok(::std::mem::drop(response)))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteEndpointError::from_response(response))),
)
}
})
}
fn delete_endpoint_config(
&self,
input: DeleteEndpointConfigInput,
) -> RusotoFuture<(), DeleteEndpointConfigError> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.DeleteEndpointConfig");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(future::ok(::std::mem::drop(response)))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(DeleteEndpointConfigError::from_response(response))
}),
)
}
})
}
fn delete_model(&self, input: DeleteModelInput) -> RusotoFuture<(), DeleteModelError> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.DeleteModel");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(future::ok(::std::mem::drop(response)))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteModelError::from_response(response))),
)
}
})
}
fn delete_model_package(
&self,
input: DeleteModelPackageInput,
) -> RusotoFuture<(), DeleteModelPackageError> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.DeleteModelPackage");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(future::ok(::std::mem::drop(response)))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteModelPackageError::from_response(response))),
)
}
})
}
fn delete_notebook_instance(
&self,
input: DeleteNotebookInstanceInput,
) -> RusotoFuture<(), DeleteNotebookInstanceError> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.DeleteNotebookInstance");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(future::ok(::std::mem::drop(response)))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(DeleteNotebookInstanceError::from_response(response))
}),
)
}
})
}
fn delete_notebook_instance_lifecycle_config(
&self,
input: DeleteNotebookInstanceLifecycleConfigInput,
) -> RusotoFuture<(), DeleteNotebookInstanceLifecycleConfigError> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"SageMaker.DeleteNotebookInstanceLifecycleConfig",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(future::ok(::std::mem::drop(response)))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DeleteNotebookInstanceLifecycleConfigError::from_response(
response,
))
}))
}
})
}
fn delete_tags(
&self,
input: DeleteTagsInput,
) -> RusotoFuture<DeleteTagsOutput, DeleteTagsError> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.DeleteTags");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<DeleteTagsOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteTagsError::from_response(response))),
)
}
})
}
fn delete_workteam(
&self,
input: DeleteWorkteamRequest,
) -> RusotoFuture<DeleteWorkteamResponse, DeleteWorkteamError> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.DeleteWorkteam");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<DeleteWorkteamResponse>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteWorkteamError::from_response(response))),
)
}
})
}
fn describe_algorithm(
&self,
input: DescribeAlgorithmInput,
) -> RusotoFuture<DescribeAlgorithmOutput, DescribeAlgorithmError> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.DescribeAlgorithm");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<DescribeAlgorithmOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DescribeAlgorithmError::from_response(response))),
)
}
})
}
fn describe_code_repository(
&self,
input: DescribeCodeRepositoryInput,
) -> RusotoFuture<DescribeCodeRepositoryOutput, DescribeCodeRepositoryError> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.DescribeCodeRepository");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<DescribeCodeRepositoryOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(DescribeCodeRepositoryError::from_response(response))
}),
)
}
})
}
fn describe_compilation_job(
&self,
input: DescribeCompilationJobRequest,
) -> RusotoFuture<DescribeCompilationJobResponse, DescribeCompilationJobError> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.DescribeCompilationJob");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<DescribeCompilationJobResponse>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(DescribeCompilationJobError::from_response(response))
}),
)
}
})
}
fn describe_endpoint(
&self,
input: DescribeEndpointInput,
) -> RusotoFuture<DescribeEndpointOutput, DescribeEndpointError> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.DescribeEndpoint");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<DescribeEndpointOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DescribeEndpointError::from_response(response))),
)
}
})
}
fn describe_endpoint_config(
&self,
input: DescribeEndpointConfigInput,
) -> RusotoFuture<DescribeEndpointConfigOutput, DescribeEndpointConfigError> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.DescribeEndpointConfig");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<DescribeEndpointConfigOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(DescribeEndpointConfigError::from_response(response))
}),
)
}
})
}
fn describe_hyper_parameter_tuning_job(
&self,
input: DescribeHyperParameterTuningJobRequest,
) -> RusotoFuture<DescribeHyperParameterTuningJobResponse, DescribeHyperParameterTuningJobError>
{
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.DescribeHyperParameterTuningJob");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<DescribeHyperParameterTuningJobResponse>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeHyperParameterTuningJobError::from_response(
response,
))
}))
}
})
}
fn describe_labeling_job(
&self,
input: DescribeLabelingJobRequest,
) -> RusotoFuture<DescribeLabelingJobResponse, DescribeLabelingJobError> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.DescribeLabelingJob");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<DescribeLabelingJobResponse>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(DescribeLabelingJobError::from_response(response))
}),
)
}
})
}
fn describe_model(
&self,
input: DescribeModelInput,
) -> RusotoFuture<DescribeModelOutput, DescribeModelError> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.DescribeModel");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<DescribeModelOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DescribeModelError::from_response(response))),
)
}
})
}
fn describe_model_package(
&self,
input: DescribeModelPackageInput,
) -> RusotoFuture<DescribeModelPackageOutput, DescribeModelPackageError> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.DescribeModelPackage");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<DescribeModelPackageOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(DescribeModelPackageError::from_response(response))
}),
)
}
})
}
fn describe_notebook_instance(
&self,
input: DescribeNotebookInstanceInput,
) -> RusotoFuture<DescribeNotebookInstanceOutput, DescribeNotebookInstanceError> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.DescribeNotebookInstance");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<DescribeNotebookInstanceOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeNotebookInstanceError::from_response(response))
}))
}
})
}
fn describe_notebook_instance_lifecycle_config(
&self,
input: DescribeNotebookInstanceLifecycleConfigInput,
) -> RusotoFuture<
DescribeNotebookInstanceLifecycleConfigOutput,
DescribeNotebookInstanceLifecycleConfigError,
> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"SageMaker.DescribeNotebookInstanceLifecycleConfig",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<DescribeNotebookInstanceLifecycleConfigOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeNotebookInstanceLifecycleConfigError::from_response(
response,
))
}))
}
})
}
fn describe_subscribed_workteam(
&self,
input: DescribeSubscribedWorkteamRequest,
) -> RusotoFuture<DescribeSubscribedWorkteamResponse, DescribeSubscribedWorkteamError> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.DescribeSubscribedWorkteam");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<DescribeSubscribedWorkteamResponse>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeSubscribedWorkteamError::from_response(response))
}))
}
})
}
fn describe_training_job(
&self,
input: DescribeTrainingJobRequest,
) -> RusotoFuture<DescribeTrainingJobResponse, DescribeTrainingJobError> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.DescribeTrainingJob");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<DescribeTrainingJobResponse>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(DescribeTrainingJobError::from_response(response))
}),
)
}
})
}
fn describe_transform_job(
&self,
input: DescribeTransformJobRequest,
) -> RusotoFuture<DescribeTransformJobResponse, DescribeTransformJobError> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.DescribeTransformJob");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<DescribeTransformJobResponse>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(DescribeTransformJobError::from_response(response))
}),
)
}
})
}
fn describe_workteam(
&self,
input: DescribeWorkteamRequest,
) -> RusotoFuture<DescribeWorkteamResponse, DescribeWorkteamError> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.DescribeWorkteam");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<DescribeWorkteamResponse>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DescribeWorkteamError::from_response(response))),
)
}
})
}
fn get_search_suggestions(
&self,
input: GetSearchSuggestionsRequest,
) -> RusotoFuture<GetSearchSuggestionsResponse, GetSearchSuggestionsError> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.GetSearchSuggestions");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<GetSearchSuggestionsResponse>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(GetSearchSuggestionsError::from_response(response))
}),
)
}
})
}
fn list_algorithms(
&self,
input: ListAlgorithmsInput,
) -> RusotoFuture<ListAlgorithmsOutput, ListAlgorithmsError> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.ListAlgorithms");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<ListAlgorithmsOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListAlgorithmsError::from_response(response))),
)
}
})
}
fn list_code_repositories(
&self,
input: ListCodeRepositoriesInput,
) -> RusotoFuture<ListCodeRepositoriesOutput, ListCodeRepositoriesError> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.ListCodeRepositories");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<ListCodeRepositoriesOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(ListCodeRepositoriesError::from_response(response))
}),
)
}
})
}
fn list_compilation_jobs(
&self,
input: ListCompilationJobsRequest,
) -> RusotoFuture<ListCompilationJobsResponse, ListCompilationJobsError> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.ListCompilationJobs");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<ListCompilationJobsResponse>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(ListCompilationJobsError::from_response(response))
}),
)
}
})
}
fn list_endpoint_configs(
&self,
input: ListEndpointConfigsInput,
) -> RusotoFuture<ListEndpointConfigsOutput, ListEndpointConfigsError> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.ListEndpointConfigs");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<ListEndpointConfigsOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(ListEndpointConfigsError::from_response(response))
}),
)
}
})
}
fn list_endpoints(
&self,
input: ListEndpointsInput,
) -> RusotoFuture<ListEndpointsOutput, ListEndpointsError> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.ListEndpoints");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<ListEndpointsOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListEndpointsError::from_response(response))),
)
}
})
}
fn list_hyper_parameter_tuning_jobs(
&self,
input: ListHyperParameterTuningJobsRequest,
) -> RusotoFuture<ListHyperParameterTuningJobsResponse, ListHyperParameterTuningJobsError> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.ListHyperParameterTuningJobs");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<ListHyperParameterTuningJobsResponse>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(ListHyperParameterTuningJobsError::from_response(response))
}))
}
})
}
fn list_labeling_jobs(
&self,
input: ListLabelingJobsRequest,
) -> RusotoFuture<ListLabelingJobsResponse, ListLabelingJobsError> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.ListLabelingJobs");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<ListLabelingJobsResponse>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListLabelingJobsError::from_response(response))),
)
}
})
}
fn list_labeling_jobs_for_workteam(
&self,
input: ListLabelingJobsForWorkteamRequest,
) -> RusotoFuture<ListLabelingJobsForWorkteamResponse, ListLabelingJobsForWorkteamError> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.ListLabelingJobsForWorkteam");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<ListLabelingJobsForWorkteamResponse>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(ListLabelingJobsForWorkteamError::from_response(response))
}))
}
})
}
fn list_model_packages(
&self,
input: ListModelPackagesInput,
) -> RusotoFuture<ListModelPackagesOutput, ListModelPackagesError> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.ListModelPackages");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<ListModelPackagesOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListModelPackagesError::from_response(response))),
)
}
})
}
fn list_models(
&self,
input: ListModelsInput,
) -> RusotoFuture<ListModelsOutput, ListModelsError> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.ListModels");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<ListModelsOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListModelsError::from_response(response))),
)
}
})
}
fn list_notebook_instance_lifecycle_configs(
&self,
input: ListNotebookInstanceLifecycleConfigsInput,
) -> RusotoFuture<
ListNotebookInstanceLifecycleConfigsOutput,
ListNotebookInstanceLifecycleConfigsError,
> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"SageMaker.ListNotebookInstanceLifecycleConfigs",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<ListNotebookInstanceLifecycleConfigsOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(ListNotebookInstanceLifecycleConfigsError::from_response(
response,
))
}))
}
})
}
fn list_notebook_instances(
&self,
input: ListNotebookInstancesInput,
) -> RusotoFuture<ListNotebookInstancesOutput, ListNotebookInstancesError> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.ListNotebookInstances");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<ListNotebookInstancesOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(ListNotebookInstancesError::from_response(response))
}),
)
}
})
}
fn list_subscribed_workteams(
&self,
input: ListSubscribedWorkteamsRequest,
) -> RusotoFuture<ListSubscribedWorkteamsResponse, ListSubscribedWorkteamsError> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.ListSubscribedWorkteams");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<ListSubscribedWorkteamsResponse>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(ListSubscribedWorkteamsError::from_response(response))
}))
}
})
}
fn list_tags(&self, input: ListTagsInput) -> RusotoFuture<ListTagsOutput, ListTagsError> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.ListTags");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<ListTagsOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListTagsError::from_response(response))),
)
}
})
}
fn list_training_jobs(
&self,
input: ListTrainingJobsRequest,
) -> RusotoFuture<ListTrainingJobsResponse, ListTrainingJobsError> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.ListTrainingJobs");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<ListTrainingJobsResponse>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListTrainingJobsError::from_response(response))),
)
}
})
}
fn list_training_jobs_for_hyper_parameter_tuning_job(
&self,
input: ListTrainingJobsForHyperParameterTuningJobRequest,
) -> RusotoFuture<
ListTrainingJobsForHyperParameterTuningJobResponse,
ListTrainingJobsForHyperParameterTuningJobError,
> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"SageMaker.ListTrainingJobsForHyperParameterTuningJob",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<ListTrainingJobsForHyperParameterTuningJobResponse>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(ListTrainingJobsForHyperParameterTuningJobError::from_response(response))
}))
}
})
}
fn list_transform_jobs(
&self,
input: ListTransformJobsRequest,
) -> RusotoFuture<ListTransformJobsResponse, ListTransformJobsError> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.ListTransformJobs");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<ListTransformJobsResponse>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListTransformJobsError::from_response(response))),
)
}
})
}
fn list_workteams(
&self,
input: ListWorkteamsRequest,
) -> RusotoFuture<ListWorkteamsResponse, ListWorkteamsError> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.ListWorkteams");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<ListWorkteamsResponse>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListWorkteamsError::from_response(response))),
)
}
})
}
fn render_ui_template(
&self,
input: RenderUiTemplateRequest,
) -> RusotoFuture<RenderUiTemplateResponse, RenderUiTemplateError> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.RenderUiTemplate");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<RenderUiTemplateResponse>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(RenderUiTemplateError::from_response(response))),
)
}
})
}
fn search(&self, input: SearchRequest) -> RusotoFuture<SearchResponse, SearchError> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.Search");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<SearchResponse>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(SearchError::from_response(response))),
)
}
})
}
fn start_notebook_instance(
&self,
input: StartNotebookInstanceInput,
) -> RusotoFuture<(), StartNotebookInstanceError> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.StartNotebookInstance");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(future::ok(::std::mem::drop(response)))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(StartNotebookInstanceError::from_response(response))
}),
)
}
})
}
fn stop_compilation_job(
&self,
input: StopCompilationJobRequest,
) -> RusotoFuture<(), StopCompilationJobError> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.StopCompilationJob");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(future::ok(::std::mem::drop(response)))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(StopCompilationJobError::from_response(response))),
)
}
})
}
fn stop_hyper_parameter_tuning_job(
&self,
input: StopHyperParameterTuningJobRequest,
) -> RusotoFuture<(), StopHyperParameterTuningJobError> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.StopHyperParameterTuningJob");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(future::ok(::std::mem::drop(response)))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(StopHyperParameterTuningJobError::from_response(response))
}))
}
})
}
fn stop_labeling_job(
&self,
input: StopLabelingJobRequest,
) -> RusotoFuture<(), StopLabelingJobError> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.StopLabelingJob");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(future::ok(::std::mem::drop(response)))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(StopLabelingJobError::from_response(response))),
)
}
})
}
fn stop_notebook_instance(
&self,
input: StopNotebookInstanceInput,
) -> RusotoFuture<(), StopNotebookInstanceError> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.StopNotebookInstance");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(future::ok(::std::mem::drop(response)))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(StopNotebookInstanceError::from_response(response))
}),
)
}
})
}
fn stop_training_job(
&self,
input: StopTrainingJobRequest,
) -> RusotoFuture<(), StopTrainingJobError> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.StopTrainingJob");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(future::ok(::std::mem::drop(response)))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(StopTrainingJobError::from_response(response))),
)
}
})
}
fn stop_transform_job(
&self,
input: StopTransformJobRequest,
) -> RusotoFuture<(), StopTransformJobError> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.StopTransformJob");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(future::ok(::std::mem::drop(response)))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(StopTransformJobError::from_response(response))),
)
}
})
}
fn update_code_repository(
&self,
input: UpdateCodeRepositoryInput,
) -> RusotoFuture<UpdateCodeRepositoryOutput, UpdateCodeRepositoryError> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.UpdateCodeRepository");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<UpdateCodeRepositoryOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(UpdateCodeRepositoryError::from_response(response))
}),
)
}
})
}
fn update_endpoint(
&self,
input: UpdateEndpointInput,
) -> RusotoFuture<UpdateEndpointOutput, UpdateEndpointError> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.UpdateEndpoint");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<UpdateEndpointOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(UpdateEndpointError::from_response(response))),
)
}
})
}
fn update_endpoint_weights_and_capacities(
&self,
input: UpdateEndpointWeightsAndCapacitiesInput,
) -> RusotoFuture<
UpdateEndpointWeightsAndCapacitiesOutput,
UpdateEndpointWeightsAndCapacitiesError,
> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"SageMaker.UpdateEndpointWeightsAndCapacities",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<UpdateEndpointWeightsAndCapacitiesOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(UpdateEndpointWeightsAndCapacitiesError::from_response(
response,
))
}))
}
})
}
fn update_notebook_instance(
&self,
input: UpdateNotebookInstanceInput,
) -> RusotoFuture<UpdateNotebookInstanceOutput, UpdateNotebookInstanceError> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.UpdateNotebookInstance");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<UpdateNotebookInstanceOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(UpdateNotebookInstanceError::from_response(response))
}),
)
}
})
}
fn update_notebook_instance_lifecycle_config(
&self,
input: UpdateNotebookInstanceLifecycleConfigInput,
) -> RusotoFuture<
UpdateNotebookInstanceLifecycleConfigOutput,
UpdateNotebookInstanceLifecycleConfigError,
> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"SageMaker.UpdateNotebookInstanceLifecycleConfig",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<UpdateNotebookInstanceLifecycleConfigOutput>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(UpdateNotebookInstanceLifecycleConfigError::from_response(
response,
))
}))
}
})
}
fn update_workteam(
&self,
input: UpdateWorkteamRequest,
) -> RusotoFuture<UpdateWorkteamResponse, UpdateWorkteamError> {
let mut request = SignedRequest::new("POST", "sagemaker", &self.region, "/");
request.set_endpoint_prefix("api.sagemaker".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "SageMaker.UpdateWorkteam");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<UpdateWorkteamResponse>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(UpdateWorkteamError::from_response(response))),
)
}
})
}
}
#[cfg(test)]
mod protocol_tests {}