use std::error::Error;
use std::fmt;
#[allow(warnings)]
use futures::future;
use futures::Future;
use rusoto_core::credential::ProvideAwsCredentials;
use rusoto_core::region;
use rusoto_core::request::{BufferedHttpResponse, DispatchSignedRequest};
use rusoto_core::{Client, RusotoError, RusotoFuture};
use rusoto_core::proto;
use rusoto_core::signature::SignedRequest;
use serde_json;
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct AuthorizationData {
#[serde(rename = "authorizationToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub authorization_token: Option<String>,
#[serde(rename = "expiresAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub expires_at: Option<f64>,
#[serde(rename = "proxyEndpoint")]
#[serde(skip_serializing_if = "Option::is_none")]
pub proxy_endpoint: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct BatchCheckLayerAvailabilityRequest {
#[serde(rename = "layerDigests")]
pub layer_digests: Vec<String>,
#[serde(rename = "registryId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub registry_id: Option<String>,
#[serde(rename = "repositoryName")]
pub repository_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct BatchCheckLayerAvailabilityResponse {
#[serde(rename = "failures")]
#[serde(skip_serializing_if = "Option::is_none")]
pub failures: Option<Vec<LayerFailure>>,
#[serde(rename = "layers")]
#[serde(skip_serializing_if = "Option::is_none")]
pub layers: Option<Vec<Layer>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct BatchDeleteImageRequest {
#[serde(rename = "imageIds")]
pub image_ids: Vec<ImageIdentifier>,
#[serde(rename = "registryId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub registry_id: Option<String>,
#[serde(rename = "repositoryName")]
pub repository_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct BatchDeleteImageResponse {
#[serde(rename = "failures")]
#[serde(skip_serializing_if = "Option::is_none")]
pub failures: Option<Vec<ImageFailure>>,
#[serde(rename = "imageIds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub image_ids: Option<Vec<ImageIdentifier>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct BatchGetImageRequest {
#[serde(rename = "acceptedMediaTypes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accepted_media_types: Option<Vec<String>>,
#[serde(rename = "imageIds")]
pub image_ids: Vec<ImageIdentifier>,
#[serde(rename = "registryId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub registry_id: Option<String>,
#[serde(rename = "repositoryName")]
pub repository_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct BatchGetImageResponse {
#[serde(rename = "failures")]
#[serde(skip_serializing_if = "Option::is_none")]
pub failures: Option<Vec<ImageFailure>>,
#[serde(rename = "images")]
#[serde(skip_serializing_if = "Option::is_none")]
pub images: Option<Vec<Image>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CompleteLayerUploadRequest {
#[serde(rename = "layerDigests")]
pub layer_digests: Vec<String>,
#[serde(rename = "registryId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub registry_id: Option<String>,
#[serde(rename = "repositoryName")]
pub repository_name: String,
#[serde(rename = "uploadId")]
pub upload_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CompleteLayerUploadResponse {
#[serde(rename = "layerDigest")]
#[serde(skip_serializing_if = "Option::is_none")]
pub layer_digest: Option<String>,
#[serde(rename = "registryId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub registry_id: Option<String>,
#[serde(rename = "repositoryName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub repository_name: Option<String>,
#[serde(rename = "uploadId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub upload_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateRepositoryRequest {
#[serde(rename = "repositoryName")]
pub repository_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 CreateRepositoryResponse {
#[serde(rename = "repository")]
#[serde(skip_serializing_if = "Option::is_none")]
pub repository: Option<Repository>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteLifecyclePolicyRequest {
#[serde(rename = "registryId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub registry_id: Option<String>,
#[serde(rename = "repositoryName")]
pub repository_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteLifecyclePolicyResponse {
#[serde(rename = "lastEvaluatedAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_evaluated_at: Option<f64>,
#[serde(rename = "lifecyclePolicyText")]
#[serde(skip_serializing_if = "Option::is_none")]
pub lifecycle_policy_text: Option<String>,
#[serde(rename = "registryId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub registry_id: Option<String>,
#[serde(rename = "repositoryName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub repository_name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteRepositoryPolicyRequest {
#[serde(rename = "registryId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub registry_id: Option<String>,
#[serde(rename = "repositoryName")]
pub repository_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteRepositoryPolicyResponse {
#[serde(rename = "policyText")]
#[serde(skip_serializing_if = "Option::is_none")]
pub policy_text: Option<String>,
#[serde(rename = "registryId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub registry_id: Option<String>,
#[serde(rename = "repositoryName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub repository_name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteRepositoryRequest {
#[serde(rename = "force")]
#[serde(skip_serializing_if = "Option::is_none")]
pub force: Option<bool>,
#[serde(rename = "registryId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub registry_id: Option<String>,
#[serde(rename = "repositoryName")]
pub repository_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteRepositoryResponse {
#[serde(rename = "repository")]
#[serde(skip_serializing_if = "Option::is_none")]
pub repository: Option<Repository>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeImagesFilter {
#[serde(rename = "tagStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tag_status: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeImagesRequest {
#[serde(rename = "filter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub filter: Option<DescribeImagesFilter>,
#[serde(rename = "imageIds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub image_ids: Option<Vec<ImageIdentifier>>,
#[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 = "registryId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub registry_id: Option<String>,
#[serde(rename = "repositoryName")]
pub repository_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeImagesResponse {
#[serde(rename = "imageDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub image_details: Option<Vec<ImageDetail>>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeRepositoriesRequest {
#[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 = "registryId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub registry_id: Option<String>,
#[serde(rename = "repositoryNames")]
#[serde(skip_serializing_if = "Option::is_none")]
pub repository_names: Option<Vec<String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeRepositoriesResponse {
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "repositories")]
#[serde(skip_serializing_if = "Option::is_none")]
pub repositories: Option<Vec<Repository>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetAuthorizationTokenRequest {
#[serde(rename = "registryIds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub registry_ids: Option<Vec<String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetAuthorizationTokenResponse {
#[serde(rename = "authorizationData")]
#[serde(skip_serializing_if = "Option::is_none")]
pub authorization_data: Option<Vec<AuthorizationData>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetDownloadUrlForLayerRequest {
#[serde(rename = "layerDigest")]
pub layer_digest: String,
#[serde(rename = "registryId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub registry_id: Option<String>,
#[serde(rename = "repositoryName")]
pub repository_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetDownloadUrlForLayerResponse {
#[serde(rename = "downloadUrl")]
#[serde(skip_serializing_if = "Option::is_none")]
pub download_url: Option<String>,
#[serde(rename = "layerDigest")]
#[serde(skip_serializing_if = "Option::is_none")]
pub layer_digest: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetLifecyclePolicyPreviewRequest {
#[serde(rename = "filter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub filter: Option<LifecyclePolicyPreviewFilter>,
#[serde(rename = "imageIds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub image_ids: Option<Vec<ImageIdentifier>>,
#[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 = "registryId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub registry_id: Option<String>,
#[serde(rename = "repositoryName")]
pub repository_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetLifecyclePolicyPreviewResponse {
#[serde(rename = "lifecyclePolicyText")]
#[serde(skip_serializing_if = "Option::is_none")]
pub lifecycle_policy_text: Option<String>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "previewResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub preview_results: Option<Vec<LifecyclePolicyPreviewResult>>,
#[serde(rename = "registryId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub registry_id: Option<String>,
#[serde(rename = "repositoryName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub repository_name: Option<String>,
#[serde(rename = "status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
#[serde(rename = "summary")]
#[serde(skip_serializing_if = "Option::is_none")]
pub summary: Option<LifecyclePolicyPreviewSummary>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetLifecyclePolicyRequest {
#[serde(rename = "registryId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub registry_id: Option<String>,
#[serde(rename = "repositoryName")]
pub repository_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetLifecyclePolicyResponse {
#[serde(rename = "lastEvaluatedAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_evaluated_at: Option<f64>,
#[serde(rename = "lifecyclePolicyText")]
#[serde(skip_serializing_if = "Option::is_none")]
pub lifecycle_policy_text: Option<String>,
#[serde(rename = "registryId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub registry_id: Option<String>,
#[serde(rename = "repositoryName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub repository_name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetRepositoryPolicyRequest {
#[serde(rename = "registryId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub registry_id: Option<String>,
#[serde(rename = "repositoryName")]
pub repository_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetRepositoryPolicyResponse {
#[serde(rename = "policyText")]
#[serde(skip_serializing_if = "Option::is_none")]
pub policy_text: Option<String>,
#[serde(rename = "registryId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub registry_id: Option<String>,
#[serde(rename = "repositoryName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub repository_name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Image {
#[serde(rename = "imageId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub image_id: Option<ImageIdentifier>,
#[serde(rename = "imageManifest")]
#[serde(skip_serializing_if = "Option::is_none")]
pub image_manifest: Option<String>,
#[serde(rename = "registryId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub registry_id: Option<String>,
#[serde(rename = "repositoryName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub repository_name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ImageDetail {
#[serde(rename = "imageDigest")]
#[serde(skip_serializing_if = "Option::is_none")]
pub image_digest: Option<String>,
#[serde(rename = "imagePushedAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub image_pushed_at: Option<f64>,
#[serde(rename = "imageSizeInBytes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub image_size_in_bytes: Option<i64>,
#[serde(rename = "imageTags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub image_tags: Option<Vec<String>>,
#[serde(rename = "registryId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub registry_id: Option<String>,
#[serde(rename = "repositoryName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub repository_name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ImageFailure {
#[serde(rename = "failureCode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub failure_code: Option<String>,
#[serde(rename = "failureReason")]
#[serde(skip_serializing_if = "Option::is_none")]
pub failure_reason: Option<String>,
#[serde(rename = "imageId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub image_id: Option<ImageIdentifier>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ImageIdentifier {
#[serde(rename = "imageDigest")]
#[serde(skip_serializing_if = "Option::is_none")]
pub image_digest: Option<String>,
#[serde(rename = "imageTag")]
#[serde(skip_serializing_if = "Option::is_none")]
pub image_tag: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct InitiateLayerUploadRequest {
#[serde(rename = "registryId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub registry_id: Option<String>,
#[serde(rename = "repositoryName")]
pub repository_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct InitiateLayerUploadResponse {
#[serde(rename = "partSize")]
#[serde(skip_serializing_if = "Option::is_none")]
pub part_size: Option<i64>,
#[serde(rename = "uploadId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub upload_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Layer {
#[serde(rename = "layerAvailability")]
#[serde(skip_serializing_if = "Option::is_none")]
pub layer_availability: Option<String>,
#[serde(rename = "layerDigest")]
#[serde(skip_serializing_if = "Option::is_none")]
pub layer_digest: Option<String>,
#[serde(rename = "layerSize")]
#[serde(skip_serializing_if = "Option::is_none")]
pub layer_size: Option<i64>,
#[serde(rename = "mediaType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub media_type: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct LayerFailure {
#[serde(rename = "failureCode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub failure_code: Option<String>,
#[serde(rename = "failureReason")]
#[serde(skip_serializing_if = "Option::is_none")]
pub failure_reason: Option<String>,
#[serde(rename = "layerDigest")]
#[serde(skip_serializing_if = "Option::is_none")]
pub layer_digest: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct LifecyclePolicyPreviewFilter {
#[serde(rename = "tagStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tag_status: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct LifecyclePolicyPreviewResult {
#[serde(rename = "action")]
#[serde(skip_serializing_if = "Option::is_none")]
pub action: Option<LifecyclePolicyRuleAction>,
#[serde(rename = "appliedRulePriority")]
#[serde(skip_serializing_if = "Option::is_none")]
pub applied_rule_priority: Option<i64>,
#[serde(rename = "imageDigest")]
#[serde(skip_serializing_if = "Option::is_none")]
pub image_digest: Option<String>,
#[serde(rename = "imagePushedAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub image_pushed_at: Option<f64>,
#[serde(rename = "imageTags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub image_tags: Option<Vec<String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct LifecyclePolicyPreviewSummary {
#[serde(rename = "expiringImageTotalCount")]
#[serde(skip_serializing_if = "Option::is_none")]
pub expiring_image_total_count: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct LifecyclePolicyRuleAction {
#[serde(rename = "type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub type_: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListImagesFilter {
#[serde(rename = "tagStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tag_status: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListImagesRequest {
#[serde(rename = "filter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub filter: Option<ListImagesFilter>,
#[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 = "registryId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub registry_id: Option<String>,
#[serde(rename = "repositoryName")]
pub repository_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListImagesResponse {
#[serde(rename = "imageIds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub image_ids: Option<Vec<ImageIdentifier>>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListTagsForResourceRequest {
#[serde(rename = "resourceArn")]
pub resource_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListTagsForResourceResponse {
#[serde(rename = "tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct PutImageRequest {
#[serde(rename = "imageManifest")]
pub image_manifest: String,
#[serde(rename = "imageTag")]
#[serde(skip_serializing_if = "Option::is_none")]
pub image_tag: Option<String>,
#[serde(rename = "registryId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub registry_id: Option<String>,
#[serde(rename = "repositoryName")]
pub repository_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct PutImageResponse {
#[serde(rename = "image")]
#[serde(skip_serializing_if = "Option::is_none")]
pub image: Option<Image>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct PutLifecyclePolicyRequest {
#[serde(rename = "lifecyclePolicyText")]
pub lifecycle_policy_text: String,
#[serde(rename = "registryId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub registry_id: Option<String>,
#[serde(rename = "repositoryName")]
pub repository_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct PutLifecyclePolicyResponse {
#[serde(rename = "lifecyclePolicyText")]
#[serde(skip_serializing_if = "Option::is_none")]
pub lifecycle_policy_text: Option<String>,
#[serde(rename = "registryId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub registry_id: Option<String>,
#[serde(rename = "repositoryName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub repository_name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Repository {
#[serde(rename = "createdAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_at: Option<f64>,
#[serde(rename = "registryId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub registry_id: Option<String>,
#[serde(rename = "repositoryArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub repository_arn: Option<String>,
#[serde(rename = "repositoryName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub repository_name: Option<String>,
#[serde(rename = "repositoryUri")]
#[serde(skip_serializing_if = "Option::is_none")]
pub repository_uri: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct SetRepositoryPolicyRequest {
#[serde(rename = "force")]
#[serde(skip_serializing_if = "Option::is_none")]
pub force: Option<bool>,
#[serde(rename = "policyText")]
pub policy_text: String,
#[serde(rename = "registryId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub registry_id: Option<String>,
#[serde(rename = "repositoryName")]
pub repository_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct SetRepositoryPolicyResponse {
#[serde(rename = "policyText")]
#[serde(skip_serializing_if = "Option::is_none")]
pub policy_text: Option<String>,
#[serde(rename = "registryId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub registry_id: Option<String>,
#[serde(rename = "repositoryName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub repository_name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct StartLifecyclePolicyPreviewRequest {
#[serde(rename = "lifecyclePolicyText")]
#[serde(skip_serializing_if = "Option::is_none")]
pub lifecycle_policy_text: Option<String>,
#[serde(rename = "registryId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub registry_id: Option<String>,
#[serde(rename = "repositoryName")]
pub repository_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct StartLifecyclePolicyPreviewResponse {
#[serde(rename = "lifecyclePolicyText")]
#[serde(skip_serializing_if = "Option::is_none")]
pub lifecycle_policy_text: Option<String>,
#[serde(rename = "registryId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub registry_id: Option<String>,
#[serde(rename = "repositoryName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub repository_name: Option<String>,
#[serde(rename = "status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Tag {
#[serde(rename = "Key")]
#[serde(skip_serializing_if = "Option::is_none")]
pub key: Option<String>,
#[serde(rename = "Value")]
#[serde(skip_serializing_if = "Option::is_none")]
pub value: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct TagResourceRequest {
#[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 TagResourceResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UntagResourceRequest {
#[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 UntagResourceResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UploadLayerPartRequest {
#[serde(rename = "layerPartBlob")]
#[serde(
deserialize_with = "::rusoto_core::serialization::SerdeBlob::deserialize_blob",
serialize_with = "::rusoto_core::serialization::SerdeBlob::serialize_blob",
default
)]
pub layer_part_blob: bytes::Bytes,
#[serde(rename = "partFirstByte")]
pub part_first_byte: i64,
#[serde(rename = "partLastByte")]
pub part_last_byte: i64,
#[serde(rename = "registryId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub registry_id: Option<String>,
#[serde(rename = "repositoryName")]
pub repository_name: String,
#[serde(rename = "uploadId")]
pub upload_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UploadLayerPartResponse {
#[serde(rename = "lastByteReceived")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_byte_received: Option<i64>,
#[serde(rename = "registryId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub registry_id: Option<String>,
#[serde(rename = "repositoryName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub repository_name: Option<String>,
#[serde(rename = "uploadId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub upload_id: Option<String>,
}
#[derive(Debug, PartialEq)]
pub enum BatchCheckLayerAvailabilityError {
InvalidParameter(String),
RepositoryNotFound(String),
Server(String),
}
impl BatchCheckLayerAvailabilityError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<BatchCheckLayerAvailabilityError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterException" => {
return RusotoError::Service(
BatchCheckLayerAvailabilityError::InvalidParameter(err.msg),
)
}
"RepositoryNotFoundException" => {
return RusotoError::Service(
BatchCheckLayerAvailabilityError::RepositoryNotFound(err.msg),
)
}
"ServerException" => {
return RusotoError::Service(BatchCheckLayerAvailabilityError::Server(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for BatchCheckLayerAvailabilityError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for BatchCheckLayerAvailabilityError {
fn description(&self) -> &str {
match *self {
BatchCheckLayerAvailabilityError::InvalidParameter(ref cause) => cause,
BatchCheckLayerAvailabilityError::RepositoryNotFound(ref cause) => cause,
BatchCheckLayerAvailabilityError::Server(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum BatchDeleteImageError {
InvalidParameter(String),
RepositoryNotFound(String),
Server(String),
}
impl BatchDeleteImageError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<BatchDeleteImageError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterException" => {
return RusotoError::Service(BatchDeleteImageError::InvalidParameter(err.msg))
}
"RepositoryNotFoundException" => {
return RusotoError::Service(BatchDeleteImageError::RepositoryNotFound(err.msg))
}
"ServerException" => {
return RusotoError::Service(BatchDeleteImageError::Server(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for BatchDeleteImageError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for BatchDeleteImageError {
fn description(&self) -> &str {
match *self {
BatchDeleteImageError::InvalidParameter(ref cause) => cause,
BatchDeleteImageError::RepositoryNotFound(ref cause) => cause,
BatchDeleteImageError::Server(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum BatchGetImageError {
InvalidParameter(String),
RepositoryNotFound(String),
Server(String),
}
impl BatchGetImageError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<BatchGetImageError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterException" => {
return RusotoError::Service(BatchGetImageError::InvalidParameter(err.msg))
}
"RepositoryNotFoundException" => {
return RusotoError::Service(BatchGetImageError::RepositoryNotFound(err.msg))
}
"ServerException" => {
return RusotoError::Service(BatchGetImageError::Server(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for BatchGetImageError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for BatchGetImageError {
fn description(&self) -> &str {
match *self {
BatchGetImageError::InvalidParameter(ref cause) => cause,
BatchGetImageError::RepositoryNotFound(ref cause) => cause,
BatchGetImageError::Server(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CompleteLayerUploadError {
EmptyUpload(String),
InvalidLayer(String),
InvalidParameter(String),
LayerAlreadyExists(String),
LayerPartTooSmall(String),
RepositoryNotFound(String),
Server(String),
UploadNotFound(String),
}
impl CompleteLayerUploadError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CompleteLayerUploadError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"EmptyUploadException" => {
return RusotoError::Service(CompleteLayerUploadError::EmptyUpload(err.msg))
}
"InvalidLayerException" => {
return RusotoError::Service(CompleteLayerUploadError::InvalidLayer(err.msg))
}
"InvalidParameterException" => {
return RusotoError::Service(CompleteLayerUploadError::InvalidParameter(
err.msg,
))
}
"LayerAlreadyExistsException" => {
return RusotoError::Service(CompleteLayerUploadError::LayerAlreadyExists(
err.msg,
))
}
"LayerPartTooSmallException" => {
return RusotoError::Service(CompleteLayerUploadError::LayerPartTooSmall(
err.msg,
))
}
"RepositoryNotFoundException" => {
return RusotoError::Service(CompleteLayerUploadError::RepositoryNotFound(
err.msg,
))
}
"ServerException" => {
return RusotoError::Service(CompleteLayerUploadError::Server(err.msg))
}
"UploadNotFoundException" => {
return RusotoError::Service(CompleteLayerUploadError::UploadNotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CompleteLayerUploadError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CompleteLayerUploadError {
fn description(&self) -> &str {
match *self {
CompleteLayerUploadError::EmptyUpload(ref cause) => cause,
CompleteLayerUploadError::InvalidLayer(ref cause) => cause,
CompleteLayerUploadError::InvalidParameter(ref cause) => cause,
CompleteLayerUploadError::LayerAlreadyExists(ref cause) => cause,
CompleteLayerUploadError::LayerPartTooSmall(ref cause) => cause,
CompleteLayerUploadError::RepositoryNotFound(ref cause) => cause,
CompleteLayerUploadError::Server(ref cause) => cause,
CompleteLayerUploadError::UploadNotFound(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateRepositoryError {
InvalidParameter(String),
InvalidTagParameter(String),
LimitExceeded(String),
RepositoryAlreadyExists(String),
Server(String),
TooManyTags(String),
}
impl CreateRepositoryError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateRepositoryError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterException" => {
return RusotoError::Service(CreateRepositoryError::InvalidParameter(err.msg))
}
"InvalidTagParameterException" => {
return RusotoError::Service(CreateRepositoryError::InvalidTagParameter(
err.msg,
))
}
"LimitExceededException" => {
return RusotoError::Service(CreateRepositoryError::LimitExceeded(err.msg))
}
"RepositoryAlreadyExistsException" => {
return RusotoError::Service(CreateRepositoryError::RepositoryAlreadyExists(
err.msg,
))
}
"ServerException" => {
return RusotoError::Service(CreateRepositoryError::Server(err.msg))
}
"TooManyTagsException" => {
return RusotoError::Service(CreateRepositoryError::TooManyTags(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CreateRepositoryError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateRepositoryError {
fn description(&self) -> &str {
match *self {
CreateRepositoryError::InvalidParameter(ref cause) => cause,
CreateRepositoryError::InvalidTagParameter(ref cause) => cause,
CreateRepositoryError::LimitExceeded(ref cause) => cause,
CreateRepositoryError::RepositoryAlreadyExists(ref cause) => cause,
CreateRepositoryError::Server(ref cause) => cause,
CreateRepositoryError::TooManyTags(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteLifecyclePolicyError {
InvalidParameter(String),
LifecyclePolicyNotFound(String),
RepositoryNotFound(String),
Server(String),
}
impl DeleteLifecyclePolicyError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteLifecyclePolicyError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterException" => {
return RusotoError::Service(DeleteLifecyclePolicyError::InvalidParameter(
err.msg,
))
}
"LifecyclePolicyNotFoundException" => {
return RusotoError::Service(
DeleteLifecyclePolicyError::LifecyclePolicyNotFound(err.msg),
)
}
"RepositoryNotFoundException" => {
return RusotoError::Service(DeleteLifecyclePolicyError::RepositoryNotFound(
err.msg,
))
}
"ServerException" => {
return RusotoError::Service(DeleteLifecyclePolicyError::Server(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteLifecyclePolicyError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteLifecyclePolicyError {
fn description(&self) -> &str {
match *self {
DeleteLifecyclePolicyError::InvalidParameter(ref cause) => cause,
DeleteLifecyclePolicyError::LifecyclePolicyNotFound(ref cause) => cause,
DeleteLifecyclePolicyError::RepositoryNotFound(ref cause) => cause,
DeleteLifecyclePolicyError::Server(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteRepositoryError {
InvalidParameter(String),
RepositoryNotEmpty(String),
RepositoryNotFound(String),
Server(String),
}
impl DeleteRepositoryError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteRepositoryError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterException" => {
return RusotoError::Service(DeleteRepositoryError::InvalidParameter(err.msg))
}
"RepositoryNotEmptyException" => {
return RusotoError::Service(DeleteRepositoryError::RepositoryNotEmpty(err.msg))
}
"RepositoryNotFoundException" => {
return RusotoError::Service(DeleteRepositoryError::RepositoryNotFound(err.msg))
}
"ServerException" => {
return RusotoError::Service(DeleteRepositoryError::Server(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteRepositoryError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteRepositoryError {
fn description(&self) -> &str {
match *self {
DeleteRepositoryError::InvalidParameter(ref cause) => cause,
DeleteRepositoryError::RepositoryNotEmpty(ref cause) => cause,
DeleteRepositoryError::RepositoryNotFound(ref cause) => cause,
DeleteRepositoryError::Server(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteRepositoryPolicyError {
InvalidParameter(String),
RepositoryNotFound(String),
RepositoryPolicyNotFound(String),
Server(String),
}
impl DeleteRepositoryPolicyError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteRepositoryPolicyError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterException" => {
return RusotoError::Service(DeleteRepositoryPolicyError::InvalidParameter(
err.msg,
))
}
"RepositoryNotFoundException" => {
return RusotoError::Service(DeleteRepositoryPolicyError::RepositoryNotFound(
err.msg,
))
}
"RepositoryPolicyNotFoundException" => {
return RusotoError::Service(
DeleteRepositoryPolicyError::RepositoryPolicyNotFound(err.msg),
)
}
"ServerException" => {
return RusotoError::Service(DeleteRepositoryPolicyError::Server(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteRepositoryPolicyError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteRepositoryPolicyError {
fn description(&self) -> &str {
match *self {
DeleteRepositoryPolicyError::InvalidParameter(ref cause) => cause,
DeleteRepositoryPolicyError::RepositoryNotFound(ref cause) => cause,
DeleteRepositoryPolicyError::RepositoryPolicyNotFound(ref cause) => cause,
DeleteRepositoryPolicyError::Server(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeImagesError {
ImageNotFound(String),
InvalidParameter(String),
RepositoryNotFound(String),
Server(String),
}
impl DescribeImagesError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeImagesError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"ImageNotFoundException" => {
return RusotoError::Service(DescribeImagesError::ImageNotFound(err.msg))
}
"InvalidParameterException" => {
return RusotoError::Service(DescribeImagesError::InvalidParameter(err.msg))
}
"RepositoryNotFoundException" => {
return RusotoError::Service(DescribeImagesError::RepositoryNotFound(err.msg))
}
"ServerException" => {
return RusotoError::Service(DescribeImagesError::Server(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeImagesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeImagesError {
fn description(&self) -> &str {
match *self {
DescribeImagesError::ImageNotFound(ref cause) => cause,
DescribeImagesError::InvalidParameter(ref cause) => cause,
DescribeImagesError::RepositoryNotFound(ref cause) => cause,
DescribeImagesError::Server(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeRepositoriesError {
InvalidParameter(String),
RepositoryNotFound(String),
Server(String),
}
impl DescribeRepositoriesError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeRepositoriesError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterException" => {
return RusotoError::Service(DescribeRepositoriesError::InvalidParameter(
err.msg,
))
}
"RepositoryNotFoundException" => {
return RusotoError::Service(DescribeRepositoriesError::RepositoryNotFound(
err.msg,
))
}
"ServerException" => {
return RusotoError::Service(DescribeRepositoriesError::Server(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeRepositoriesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeRepositoriesError {
fn description(&self) -> &str {
match *self {
DescribeRepositoriesError::InvalidParameter(ref cause) => cause,
DescribeRepositoriesError::RepositoryNotFound(ref cause) => cause,
DescribeRepositoriesError::Server(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetAuthorizationTokenError {
InvalidParameter(String),
Server(String),
}
impl GetAuthorizationTokenError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetAuthorizationTokenError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterException" => {
return RusotoError::Service(GetAuthorizationTokenError::InvalidParameter(
err.msg,
))
}
"ServerException" => {
return RusotoError::Service(GetAuthorizationTokenError::Server(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetAuthorizationTokenError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetAuthorizationTokenError {
fn description(&self) -> &str {
match *self {
GetAuthorizationTokenError::InvalidParameter(ref cause) => cause,
GetAuthorizationTokenError::Server(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetDownloadUrlForLayerError {
InvalidParameter(String),
LayerInaccessible(String),
LayersNotFound(String),
RepositoryNotFound(String),
Server(String),
}
impl GetDownloadUrlForLayerError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetDownloadUrlForLayerError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterException" => {
return RusotoError::Service(GetDownloadUrlForLayerError::InvalidParameter(
err.msg,
))
}
"LayerInaccessibleException" => {
return RusotoError::Service(GetDownloadUrlForLayerError::LayerInaccessible(
err.msg,
))
}
"LayersNotFoundException" => {
return RusotoError::Service(GetDownloadUrlForLayerError::LayersNotFound(
err.msg,
))
}
"RepositoryNotFoundException" => {
return RusotoError::Service(GetDownloadUrlForLayerError::RepositoryNotFound(
err.msg,
))
}
"ServerException" => {
return RusotoError::Service(GetDownloadUrlForLayerError::Server(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetDownloadUrlForLayerError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetDownloadUrlForLayerError {
fn description(&self) -> &str {
match *self {
GetDownloadUrlForLayerError::InvalidParameter(ref cause) => cause,
GetDownloadUrlForLayerError::LayerInaccessible(ref cause) => cause,
GetDownloadUrlForLayerError::LayersNotFound(ref cause) => cause,
GetDownloadUrlForLayerError::RepositoryNotFound(ref cause) => cause,
GetDownloadUrlForLayerError::Server(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetLifecyclePolicyError {
InvalidParameter(String),
LifecyclePolicyNotFound(String),
RepositoryNotFound(String),
Server(String),
}
impl GetLifecyclePolicyError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetLifecyclePolicyError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterException" => {
return RusotoError::Service(GetLifecyclePolicyError::InvalidParameter(err.msg))
}
"LifecyclePolicyNotFoundException" => {
return RusotoError::Service(GetLifecyclePolicyError::LifecyclePolicyNotFound(
err.msg,
))
}
"RepositoryNotFoundException" => {
return RusotoError::Service(GetLifecyclePolicyError::RepositoryNotFound(
err.msg,
))
}
"ServerException" => {
return RusotoError::Service(GetLifecyclePolicyError::Server(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetLifecyclePolicyError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetLifecyclePolicyError {
fn description(&self) -> &str {
match *self {
GetLifecyclePolicyError::InvalidParameter(ref cause) => cause,
GetLifecyclePolicyError::LifecyclePolicyNotFound(ref cause) => cause,
GetLifecyclePolicyError::RepositoryNotFound(ref cause) => cause,
GetLifecyclePolicyError::Server(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetLifecyclePolicyPreviewError {
InvalidParameter(String),
LifecyclePolicyPreviewNotFound(String),
RepositoryNotFound(String),
Server(String),
}
impl GetLifecyclePolicyPreviewError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetLifecyclePolicyPreviewError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterException" => {
return RusotoError::Service(GetLifecyclePolicyPreviewError::InvalidParameter(
err.msg,
))
}
"LifecyclePolicyPreviewNotFoundException" => {
return RusotoError::Service(
GetLifecyclePolicyPreviewError::LifecyclePolicyPreviewNotFound(err.msg),
)
}
"RepositoryNotFoundException" => {
return RusotoError::Service(
GetLifecyclePolicyPreviewError::RepositoryNotFound(err.msg),
)
}
"ServerException" => {
return RusotoError::Service(GetLifecyclePolicyPreviewError::Server(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetLifecyclePolicyPreviewError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetLifecyclePolicyPreviewError {
fn description(&self) -> &str {
match *self {
GetLifecyclePolicyPreviewError::InvalidParameter(ref cause) => cause,
GetLifecyclePolicyPreviewError::LifecyclePolicyPreviewNotFound(ref cause) => cause,
GetLifecyclePolicyPreviewError::RepositoryNotFound(ref cause) => cause,
GetLifecyclePolicyPreviewError::Server(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetRepositoryPolicyError {
InvalidParameter(String),
RepositoryNotFound(String),
RepositoryPolicyNotFound(String),
Server(String),
}
impl GetRepositoryPolicyError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetRepositoryPolicyError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterException" => {
return RusotoError::Service(GetRepositoryPolicyError::InvalidParameter(
err.msg,
))
}
"RepositoryNotFoundException" => {
return RusotoError::Service(GetRepositoryPolicyError::RepositoryNotFound(
err.msg,
))
}
"RepositoryPolicyNotFoundException" => {
return RusotoError::Service(
GetRepositoryPolicyError::RepositoryPolicyNotFound(err.msg),
)
}
"ServerException" => {
return RusotoError::Service(GetRepositoryPolicyError::Server(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetRepositoryPolicyError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetRepositoryPolicyError {
fn description(&self) -> &str {
match *self {
GetRepositoryPolicyError::InvalidParameter(ref cause) => cause,
GetRepositoryPolicyError::RepositoryNotFound(ref cause) => cause,
GetRepositoryPolicyError::RepositoryPolicyNotFound(ref cause) => cause,
GetRepositoryPolicyError::Server(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum InitiateLayerUploadError {
InvalidParameter(String),
RepositoryNotFound(String),
Server(String),
}
impl InitiateLayerUploadError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<InitiateLayerUploadError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterException" => {
return RusotoError::Service(InitiateLayerUploadError::InvalidParameter(
err.msg,
))
}
"RepositoryNotFoundException" => {
return RusotoError::Service(InitiateLayerUploadError::RepositoryNotFound(
err.msg,
))
}
"ServerException" => {
return RusotoError::Service(InitiateLayerUploadError::Server(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for InitiateLayerUploadError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for InitiateLayerUploadError {
fn description(&self) -> &str {
match *self {
InitiateLayerUploadError::InvalidParameter(ref cause) => cause,
InitiateLayerUploadError::RepositoryNotFound(ref cause) => cause,
InitiateLayerUploadError::Server(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListImagesError {
InvalidParameter(String),
RepositoryNotFound(String),
Server(String),
}
impl ListImagesError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListImagesError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterException" => {
return RusotoError::Service(ListImagesError::InvalidParameter(err.msg))
}
"RepositoryNotFoundException" => {
return RusotoError::Service(ListImagesError::RepositoryNotFound(err.msg))
}
"ServerException" => return RusotoError::Service(ListImagesError::Server(err.msg)),
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListImagesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListImagesError {
fn description(&self) -> &str {
match *self {
ListImagesError::InvalidParameter(ref cause) => cause,
ListImagesError::RepositoryNotFound(ref cause) => cause,
ListImagesError::Server(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListTagsForResourceError {
InvalidParameter(String),
RepositoryNotFound(String),
Server(String),
}
impl ListTagsForResourceError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListTagsForResourceError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterException" => {
return RusotoError::Service(ListTagsForResourceError::InvalidParameter(
err.msg,
))
}
"RepositoryNotFoundException" => {
return RusotoError::Service(ListTagsForResourceError::RepositoryNotFound(
err.msg,
))
}
"ServerException" => {
return RusotoError::Service(ListTagsForResourceError::Server(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListTagsForResourceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListTagsForResourceError {
fn description(&self) -> &str {
match *self {
ListTagsForResourceError::InvalidParameter(ref cause) => cause,
ListTagsForResourceError::RepositoryNotFound(ref cause) => cause,
ListTagsForResourceError::Server(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum PutImageError {
ImageAlreadyExists(String),
InvalidParameter(String),
LayersNotFound(String),
LimitExceeded(String),
RepositoryNotFound(String),
Server(String),
}
impl PutImageError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<PutImageError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"ImageAlreadyExistsException" => {
return RusotoError::Service(PutImageError::ImageAlreadyExists(err.msg))
}
"InvalidParameterException" => {
return RusotoError::Service(PutImageError::InvalidParameter(err.msg))
}
"LayersNotFoundException" => {
return RusotoError::Service(PutImageError::LayersNotFound(err.msg))
}
"LimitExceededException" => {
return RusotoError::Service(PutImageError::LimitExceeded(err.msg))
}
"RepositoryNotFoundException" => {
return RusotoError::Service(PutImageError::RepositoryNotFound(err.msg))
}
"ServerException" => return RusotoError::Service(PutImageError::Server(err.msg)),
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for PutImageError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for PutImageError {
fn description(&self) -> &str {
match *self {
PutImageError::ImageAlreadyExists(ref cause) => cause,
PutImageError::InvalidParameter(ref cause) => cause,
PutImageError::LayersNotFound(ref cause) => cause,
PutImageError::LimitExceeded(ref cause) => cause,
PutImageError::RepositoryNotFound(ref cause) => cause,
PutImageError::Server(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum PutLifecyclePolicyError {
InvalidParameter(String),
RepositoryNotFound(String),
Server(String),
}
impl PutLifecyclePolicyError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<PutLifecyclePolicyError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterException" => {
return RusotoError::Service(PutLifecyclePolicyError::InvalidParameter(err.msg))
}
"RepositoryNotFoundException" => {
return RusotoError::Service(PutLifecyclePolicyError::RepositoryNotFound(
err.msg,
))
}
"ServerException" => {
return RusotoError::Service(PutLifecyclePolicyError::Server(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for PutLifecyclePolicyError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for PutLifecyclePolicyError {
fn description(&self) -> &str {
match *self {
PutLifecyclePolicyError::InvalidParameter(ref cause) => cause,
PutLifecyclePolicyError::RepositoryNotFound(ref cause) => cause,
PutLifecyclePolicyError::Server(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum SetRepositoryPolicyError {
InvalidParameter(String),
RepositoryNotFound(String),
Server(String),
}
impl SetRepositoryPolicyError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<SetRepositoryPolicyError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterException" => {
return RusotoError::Service(SetRepositoryPolicyError::InvalidParameter(
err.msg,
))
}
"RepositoryNotFoundException" => {
return RusotoError::Service(SetRepositoryPolicyError::RepositoryNotFound(
err.msg,
))
}
"ServerException" => {
return RusotoError::Service(SetRepositoryPolicyError::Server(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for SetRepositoryPolicyError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for SetRepositoryPolicyError {
fn description(&self) -> &str {
match *self {
SetRepositoryPolicyError::InvalidParameter(ref cause) => cause,
SetRepositoryPolicyError::RepositoryNotFound(ref cause) => cause,
SetRepositoryPolicyError::Server(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum StartLifecyclePolicyPreviewError {
InvalidParameter(String),
LifecyclePolicyNotFound(String),
LifecyclePolicyPreviewInProgress(String),
RepositoryNotFound(String),
Server(String),
}
impl StartLifecyclePolicyPreviewError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<StartLifecyclePolicyPreviewError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterException" => {
return RusotoError::Service(
StartLifecyclePolicyPreviewError::InvalidParameter(err.msg),
)
}
"LifecyclePolicyNotFoundException" => {
return RusotoError::Service(
StartLifecyclePolicyPreviewError::LifecyclePolicyNotFound(err.msg),
)
}
"LifecyclePolicyPreviewInProgressException" => {
return RusotoError::Service(
StartLifecyclePolicyPreviewError::LifecyclePolicyPreviewInProgress(err.msg),
)
}
"RepositoryNotFoundException" => {
return RusotoError::Service(
StartLifecyclePolicyPreviewError::RepositoryNotFound(err.msg),
)
}
"ServerException" => {
return RusotoError::Service(StartLifecyclePolicyPreviewError::Server(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for StartLifecyclePolicyPreviewError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for StartLifecyclePolicyPreviewError {
fn description(&self) -> &str {
match *self {
StartLifecyclePolicyPreviewError::InvalidParameter(ref cause) => cause,
StartLifecyclePolicyPreviewError::LifecyclePolicyNotFound(ref cause) => cause,
StartLifecyclePolicyPreviewError::LifecyclePolicyPreviewInProgress(ref cause) => cause,
StartLifecyclePolicyPreviewError::RepositoryNotFound(ref cause) => cause,
StartLifecyclePolicyPreviewError::Server(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum TagResourceError {
InvalidParameter(String),
InvalidTagParameter(String),
RepositoryNotFound(String),
Server(String),
TooManyTags(String),
}
impl TagResourceError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<TagResourceError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterException" => {
return RusotoError::Service(TagResourceError::InvalidParameter(err.msg))
}
"InvalidTagParameterException" => {
return RusotoError::Service(TagResourceError::InvalidTagParameter(err.msg))
}
"RepositoryNotFoundException" => {
return RusotoError::Service(TagResourceError::RepositoryNotFound(err.msg))
}
"ServerException" => {
return RusotoError::Service(TagResourceError::Server(err.msg))
}
"TooManyTagsException" => {
return RusotoError::Service(TagResourceError::TooManyTags(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for TagResourceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for TagResourceError {
fn description(&self) -> &str {
match *self {
TagResourceError::InvalidParameter(ref cause) => cause,
TagResourceError::InvalidTagParameter(ref cause) => cause,
TagResourceError::RepositoryNotFound(ref cause) => cause,
TagResourceError::Server(ref cause) => cause,
TagResourceError::TooManyTags(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UntagResourceError {
InvalidParameter(String),
InvalidTagParameter(String),
RepositoryNotFound(String),
Server(String),
TooManyTags(String),
}
impl UntagResourceError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UntagResourceError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterException" => {
return RusotoError::Service(UntagResourceError::InvalidParameter(err.msg))
}
"InvalidTagParameterException" => {
return RusotoError::Service(UntagResourceError::InvalidTagParameter(err.msg))
}
"RepositoryNotFoundException" => {
return RusotoError::Service(UntagResourceError::RepositoryNotFound(err.msg))
}
"ServerException" => {
return RusotoError::Service(UntagResourceError::Server(err.msg))
}
"TooManyTagsException" => {
return RusotoError::Service(UntagResourceError::TooManyTags(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UntagResourceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UntagResourceError {
fn description(&self) -> &str {
match *self {
UntagResourceError::InvalidParameter(ref cause) => cause,
UntagResourceError::InvalidTagParameter(ref cause) => cause,
UntagResourceError::RepositoryNotFound(ref cause) => cause,
UntagResourceError::Server(ref cause) => cause,
UntagResourceError::TooManyTags(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UploadLayerPartError {
InvalidLayerPart(String),
InvalidParameter(String),
LimitExceeded(String),
RepositoryNotFound(String),
Server(String),
UploadNotFound(String),
}
impl UploadLayerPartError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UploadLayerPartError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidLayerPartException" => {
return RusotoError::Service(UploadLayerPartError::InvalidLayerPart(err.msg))
}
"InvalidParameterException" => {
return RusotoError::Service(UploadLayerPartError::InvalidParameter(err.msg))
}
"LimitExceededException" => {
return RusotoError::Service(UploadLayerPartError::LimitExceeded(err.msg))
}
"RepositoryNotFoundException" => {
return RusotoError::Service(UploadLayerPartError::RepositoryNotFound(err.msg))
}
"ServerException" => {
return RusotoError::Service(UploadLayerPartError::Server(err.msg))
}
"UploadNotFoundException" => {
return RusotoError::Service(UploadLayerPartError::UploadNotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UploadLayerPartError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UploadLayerPartError {
fn description(&self) -> &str {
match *self {
UploadLayerPartError::InvalidLayerPart(ref cause) => cause,
UploadLayerPartError::InvalidParameter(ref cause) => cause,
UploadLayerPartError::LimitExceeded(ref cause) => cause,
UploadLayerPartError::RepositoryNotFound(ref cause) => cause,
UploadLayerPartError::Server(ref cause) => cause,
UploadLayerPartError::UploadNotFound(ref cause) => cause,
}
}
}
pub trait Ecr {
fn batch_check_layer_availability(
&self,
input: BatchCheckLayerAvailabilityRequest,
) -> RusotoFuture<BatchCheckLayerAvailabilityResponse, BatchCheckLayerAvailabilityError>;
fn batch_delete_image(
&self,
input: BatchDeleteImageRequest,
) -> RusotoFuture<BatchDeleteImageResponse, BatchDeleteImageError>;
fn batch_get_image(
&self,
input: BatchGetImageRequest,
) -> RusotoFuture<BatchGetImageResponse, BatchGetImageError>;
fn complete_layer_upload(
&self,
input: CompleteLayerUploadRequest,
) -> RusotoFuture<CompleteLayerUploadResponse, CompleteLayerUploadError>;
fn create_repository(
&self,
input: CreateRepositoryRequest,
) -> RusotoFuture<CreateRepositoryResponse, CreateRepositoryError>;
fn delete_lifecycle_policy(
&self,
input: DeleteLifecyclePolicyRequest,
) -> RusotoFuture<DeleteLifecyclePolicyResponse, DeleteLifecyclePolicyError>;
fn delete_repository(
&self,
input: DeleteRepositoryRequest,
) -> RusotoFuture<DeleteRepositoryResponse, DeleteRepositoryError>;
fn delete_repository_policy(
&self,
input: DeleteRepositoryPolicyRequest,
) -> RusotoFuture<DeleteRepositoryPolicyResponse, DeleteRepositoryPolicyError>;
fn describe_images(
&self,
input: DescribeImagesRequest,
) -> RusotoFuture<DescribeImagesResponse, DescribeImagesError>;
fn describe_repositories(
&self,
input: DescribeRepositoriesRequest,
) -> RusotoFuture<DescribeRepositoriesResponse, DescribeRepositoriesError>;
fn get_authorization_token(
&self,
input: GetAuthorizationTokenRequest,
) -> RusotoFuture<GetAuthorizationTokenResponse, GetAuthorizationTokenError>;
fn get_download_url_for_layer(
&self,
input: GetDownloadUrlForLayerRequest,
) -> RusotoFuture<GetDownloadUrlForLayerResponse, GetDownloadUrlForLayerError>;
fn get_lifecycle_policy(
&self,
input: GetLifecyclePolicyRequest,
) -> RusotoFuture<GetLifecyclePolicyResponse, GetLifecyclePolicyError>;
fn get_lifecycle_policy_preview(
&self,
input: GetLifecyclePolicyPreviewRequest,
) -> RusotoFuture<GetLifecyclePolicyPreviewResponse, GetLifecyclePolicyPreviewError>;
fn get_repository_policy(
&self,
input: GetRepositoryPolicyRequest,
) -> RusotoFuture<GetRepositoryPolicyResponse, GetRepositoryPolicyError>;
fn initiate_layer_upload(
&self,
input: InitiateLayerUploadRequest,
) -> RusotoFuture<InitiateLayerUploadResponse, InitiateLayerUploadError>;
fn list_images(
&self,
input: ListImagesRequest,
) -> RusotoFuture<ListImagesResponse, ListImagesError>;
fn list_tags_for_resource(
&self,
input: ListTagsForResourceRequest,
) -> RusotoFuture<ListTagsForResourceResponse, ListTagsForResourceError>;
fn put_image(&self, input: PutImageRequest) -> RusotoFuture<PutImageResponse, PutImageError>;
fn put_lifecycle_policy(
&self,
input: PutLifecyclePolicyRequest,
) -> RusotoFuture<PutLifecyclePolicyResponse, PutLifecyclePolicyError>;
fn set_repository_policy(
&self,
input: SetRepositoryPolicyRequest,
) -> RusotoFuture<SetRepositoryPolicyResponse, SetRepositoryPolicyError>;
fn start_lifecycle_policy_preview(
&self,
input: StartLifecyclePolicyPreviewRequest,
) -> RusotoFuture<StartLifecyclePolicyPreviewResponse, StartLifecyclePolicyPreviewError>;
fn tag_resource(
&self,
input: TagResourceRequest,
) -> RusotoFuture<TagResourceResponse, TagResourceError>;
fn untag_resource(
&self,
input: UntagResourceRequest,
) -> RusotoFuture<UntagResourceResponse, UntagResourceError>;
fn upload_layer_part(
&self,
input: UploadLayerPartRequest,
) -> RusotoFuture<UploadLayerPartResponse, UploadLayerPartError>;
}
#[derive(Clone)]
pub struct EcrClient {
client: Client,
region: region::Region,
}
impl EcrClient {
pub fn new(region: region::Region) -> EcrClient {
EcrClient {
client: Client::shared(),
region,
}
}
pub fn new_with<P, D>(
request_dispatcher: D,
credentials_provider: P,
region: region::Region,
) -> EcrClient
where
P: ProvideAwsCredentials + Send + Sync + 'static,
P::Future: Send,
D: DispatchSignedRequest + Send + Sync + 'static,
D::Future: Send,
{
EcrClient {
client: Client::new_with(credentials_provider, request_dispatcher),
region,
}
}
}
impl Ecr for EcrClient {
fn batch_check_layer_availability(
&self,
input: BatchCheckLayerAvailabilityRequest,
) -> RusotoFuture<BatchCheckLayerAvailabilityResponse, BatchCheckLayerAvailabilityError> {
let mut request = SignedRequest::new("POST", "ecr", &self.region, "/");
request.set_endpoint_prefix("api.ecr".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AmazonEC2ContainerRegistry_V20150921.BatchCheckLayerAvailability",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<BatchCheckLayerAvailabilityResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(BatchCheckLayerAvailabilityError::from_response(response))
}))
}
})
}
fn batch_delete_image(
&self,
input: BatchDeleteImageRequest,
) -> RusotoFuture<BatchDeleteImageResponse, BatchDeleteImageError> {
let mut request = SignedRequest::new("POST", "ecr", &self.region, "/");
request.set_endpoint_prefix("api.ecr".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AmazonEC2ContainerRegistry_V20150921.BatchDeleteImage",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<BatchDeleteImageResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(BatchDeleteImageError::from_response(response))),
)
}
})
}
fn batch_get_image(
&self,
input: BatchGetImageRequest,
) -> RusotoFuture<BatchGetImageResponse, BatchGetImageError> {
let mut request = SignedRequest::new("POST", "ecr", &self.region, "/");
request.set_endpoint_prefix("api.ecr".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AmazonEC2ContainerRegistry_V20150921.BatchGetImage",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<BatchGetImageResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(BatchGetImageError::from_response(response))),
)
}
})
}
fn complete_layer_upload(
&self,
input: CompleteLayerUploadRequest,
) -> RusotoFuture<CompleteLayerUploadResponse, CompleteLayerUploadError> {
let mut request = SignedRequest::new("POST", "ecr", &self.region, "/");
request.set_endpoint_prefix("api.ecr".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AmazonEC2ContainerRegistry_V20150921.CompleteLayerUpload",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<CompleteLayerUploadResponse, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(CompleteLayerUploadError::from_response(response))
}),
)
}
})
}
fn create_repository(
&self,
input: CreateRepositoryRequest,
) -> RusotoFuture<CreateRepositoryResponse, CreateRepositoryError> {
let mut request = SignedRequest::new("POST", "ecr", &self.region, "/");
request.set_endpoint_prefix("api.ecr".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AmazonEC2ContainerRegistry_V20150921.CreateRepository",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<CreateRepositoryResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateRepositoryError::from_response(response))),
)
}
})
}
fn delete_lifecycle_policy(
&self,
input: DeleteLifecyclePolicyRequest,
) -> RusotoFuture<DeleteLifecyclePolicyResponse, DeleteLifecyclePolicyError> {
let mut request = SignedRequest::new("POST", "ecr", &self.region, "/");
request.set_endpoint_prefix("api.ecr".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AmazonEC2ContainerRegistry_V20150921.DeleteLifecyclePolicy",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DeleteLifecyclePolicyResponse, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(DeleteLifecyclePolicyError::from_response(response))
}),
)
}
})
}
fn delete_repository(
&self,
input: DeleteRepositoryRequest,
) -> RusotoFuture<DeleteRepositoryResponse, DeleteRepositoryError> {
let mut request = SignedRequest::new("POST", "ecr", &self.region, "/");
request.set_endpoint_prefix("api.ecr".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AmazonEC2ContainerRegistry_V20150921.DeleteRepository",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DeleteRepositoryResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteRepositoryError::from_response(response))),
)
}
})
}
fn delete_repository_policy(
&self,
input: DeleteRepositoryPolicyRequest,
) -> RusotoFuture<DeleteRepositoryPolicyResponse, DeleteRepositoryPolicyError> {
let mut request = SignedRequest::new("POST", "ecr", &self.region, "/");
request.set_endpoint_prefix("api.ecr".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AmazonEC2ContainerRegistry_V20150921.DeleteRepositoryPolicy",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DeleteRepositoryPolicyResponse, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(DeleteRepositoryPolicyError::from_response(response))
}),
)
}
})
}
fn describe_images(
&self,
input: DescribeImagesRequest,
) -> RusotoFuture<DescribeImagesResponse, DescribeImagesError> {
let mut request = SignedRequest::new("POST", "ecr", &self.region, "/");
request.set_endpoint_prefix("api.ecr".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AmazonEC2ContainerRegistry_V20150921.DescribeImages",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeImagesResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DescribeImagesError::from_response(response))),
)
}
})
}
fn describe_repositories(
&self,
input: DescribeRepositoriesRequest,
) -> RusotoFuture<DescribeRepositoriesResponse, DescribeRepositoriesError> {
let mut request = SignedRequest::new("POST", "ecr", &self.region, "/");
request.set_endpoint_prefix("api.ecr".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AmazonEC2ContainerRegistry_V20150921.DescribeRepositories",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeRepositoriesResponse, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(DescribeRepositoriesError::from_response(response))
}),
)
}
})
}
fn get_authorization_token(
&self,
input: GetAuthorizationTokenRequest,
) -> RusotoFuture<GetAuthorizationTokenResponse, GetAuthorizationTokenError> {
let mut request = SignedRequest::new("POST", "ecr", &self.region, "/");
request.set_endpoint_prefix("api.ecr".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AmazonEC2ContainerRegistry_V20150921.GetAuthorizationToken",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<GetAuthorizationTokenResponse, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(GetAuthorizationTokenError::from_response(response))
}),
)
}
})
}
fn get_download_url_for_layer(
&self,
input: GetDownloadUrlForLayerRequest,
) -> RusotoFuture<GetDownloadUrlForLayerResponse, GetDownloadUrlForLayerError> {
let mut request = SignedRequest::new("POST", "ecr", &self.region, "/");
request.set_endpoint_prefix("api.ecr".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AmazonEC2ContainerRegistry_V20150921.GetDownloadUrlForLayer",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<GetDownloadUrlForLayerResponse, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(GetDownloadUrlForLayerError::from_response(response))
}),
)
}
})
}
fn get_lifecycle_policy(
&self,
input: GetLifecyclePolicyRequest,
) -> RusotoFuture<GetLifecyclePolicyResponse, GetLifecyclePolicyError> {
let mut request = SignedRequest::new("POST", "ecr", &self.region, "/");
request.set_endpoint_prefix("api.ecr".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AmazonEC2ContainerRegistry_V20150921.GetLifecyclePolicy",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<GetLifecyclePolicyResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetLifecyclePolicyError::from_response(response))),
)
}
})
}
fn get_lifecycle_policy_preview(
&self,
input: GetLifecyclePolicyPreviewRequest,
) -> RusotoFuture<GetLifecyclePolicyPreviewResponse, GetLifecyclePolicyPreviewError> {
let mut request = SignedRequest::new("POST", "ecr", &self.region, "/");
request.set_endpoint_prefix("api.ecr".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AmazonEC2ContainerRegistry_V20150921.GetLifecyclePolicyPreview",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<GetLifecyclePolicyPreviewResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(GetLifecyclePolicyPreviewError::from_response(response))
}))
}
})
}
fn get_repository_policy(
&self,
input: GetRepositoryPolicyRequest,
) -> RusotoFuture<GetRepositoryPolicyResponse, GetRepositoryPolicyError> {
let mut request = SignedRequest::new("POST", "ecr", &self.region, "/");
request.set_endpoint_prefix("api.ecr".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AmazonEC2ContainerRegistry_V20150921.GetRepositoryPolicy",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<GetRepositoryPolicyResponse, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(GetRepositoryPolicyError::from_response(response))
}),
)
}
})
}
fn initiate_layer_upload(
&self,
input: InitiateLayerUploadRequest,
) -> RusotoFuture<InitiateLayerUploadResponse, InitiateLayerUploadError> {
let mut request = SignedRequest::new("POST", "ecr", &self.region, "/");
request.set_endpoint_prefix("api.ecr".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AmazonEC2ContainerRegistry_V20150921.InitiateLayerUpload",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<InitiateLayerUploadResponse, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(InitiateLayerUploadError::from_response(response))
}),
)
}
})
}
fn list_images(
&self,
input: ListImagesRequest,
) -> RusotoFuture<ListImagesResponse, ListImagesError> {
let mut request = SignedRequest::new("POST", "ecr", &self.region, "/");
request.set_endpoint_prefix("api.ecr".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AmazonEC2ContainerRegistry_V20150921.ListImages",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<ListImagesResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListImagesError::from_response(response))),
)
}
})
}
fn list_tags_for_resource(
&self,
input: ListTagsForResourceRequest,
) -> RusotoFuture<ListTagsForResourceResponse, ListTagsForResourceError> {
let mut request = SignedRequest::new("POST", "ecr", &self.region, "/");
request.set_endpoint_prefix("api.ecr".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AmazonEC2ContainerRegistry_V20150921.ListTagsForResource",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<ListTagsForResourceResponse, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(ListTagsForResourceError::from_response(response))
}),
)
}
})
}
fn put_image(&self, input: PutImageRequest) -> RusotoFuture<PutImageResponse, PutImageError> {
let mut request = SignedRequest::new("POST", "ecr", &self.region, "/");
request.set_endpoint_prefix("api.ecr".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AmazonEC2ContainerRegistry_V20150921.PutImage",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<PutImageResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(PutImageError::from_response(response))),
)
}
})
}
fn put_lifecycle_policy(
&self,
input: PutLifecyclePolicyRequest,
) -> RusotoFuture<PutLifecyclePolicyResponse, PutLifecyclePolicyError> {
let mut request = SignedRequest::new("POST", "ecr", &self.region, "/");
request.set_endpoint_prefix("api.ecr".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AmazonEC2ContainerRegistry_V20150921.PutLifecyclePolicy",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<PutLifecyclePolicyResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(PutLifecyclePolicyError::from_response(response))),
)
}
})
}
fn set_repository_policy(
&self,
input: SetRepositoryPolicyRequest,
) -> RusotoFuture<SetRepositoryPolicyResponse, SetRepositoryPolicyError> {
let mut request = SignedRequest::new("POST", "ecr", &self.region, "/");
request.set_endpoint_prefix("api.ecr".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AmazonEC2ContainerRegistry_V20150921.SetRepositoryPolicy",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<SetRepositoryPolicyResponse, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(SetRepositoryPolicyError::from_response(response))
}),
)
}
})
}
fn start_lifecycle_policy_preview(
&self,
input: StartLifecyclePolicyPreviewRequest,
) -> RusotoFuture<StartLifecyclePolicyPreviewResponse, StartLifecyclePolicyPreviewError> {
let mut request = SignedRequest::new("POST", "ecr", &self.region, "/");
request.set_endpoint_prefix("api.ecr".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AmazonEC2ContainerRegistry_V20150921.StartLifecyclePolicyPreview",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<StartLifecyclePolicyPreviewResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(StartLifecyclePolicyPreviewError::from_response(response))
}))
}
})
}
fn tag_resource(
&self,
input: TagResourceRequest,
) -> RusotoFuture<TagResourceResponse, TagResourceError> {
let mut request = SignedRequest::new("POST", "ecr", &self.region, "/");
request.set_endpoint_prefix("api.ecr".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AmazonEC2ContainerRegistry_V20150921.TagResource",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<TagResourceResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(TagResourceError::from_response(response))),
)
}
})
}
fn untag_resource(
&self,
input: UntagResourceRequest,
) -> RusotoFuture<UntagResourceResponse, UntagResourceError> {
let mut request = SignedRequest::new("POST", "ecr", &self.region, "/");
request.set_endpoint_prefix("api.ecr".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AmazonEC2ContainerRegistry_V20150921.UntagResource",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<UntagResourceResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(UntagResourceError::from_response(response))),
)
}
})
}
fn upload_layer_part(
&self,
input: UploadLayerPartRequest,
) -> RusotoFuture<UploadLayerPartResponse, UploadLayerPartError> {
let mut request = SignedRequest::new("POST", "ecr", &self.region, "/");
request.set_endpoint_prefix("api.ecr".to_string());
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AmazonEC2ContainerRegistry_V20150921.UploadLayerPart",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<UploadLayerPartResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(UploadLayerPartError::from_response(response))),
)
}
})
}
}