use std::error::Error;
use std::fmt;
use async_trait::async_trait;
use rusoto_core::credential::ProvideAwsCredentials;
use rusoto_core::region;
use rusoto_core::request::{BufferedHttpResponse, DispatchSignedRequest};
use rusoto_core::{Client, RusotoError};
use rusoto_core::param::{Params, ServiceParams};
use rusoto_core::proto;
use rusoto_core::signature::SignedRequest;
#[allow(unused_imports)]
use serde::{Deserialize, Serialize};
use serde_json;
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Authorization {
#[serde(rename = "CdnIdentifierSecret")]
pub cdn_identifier_secret: String,
#[serde(rename = "SecretsRoleArn")]
pub secrets_role_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct Channel {
#[serde(rename = "Arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "HlsIngest")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hls_ingest: Option<HlsIngest>,
#[serde(rename = "Id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<::std::collections::HashMap<String, String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct CmafEncryption {
#[serde(rename = "KeyRotationIntervalSeconds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub key_rotation_interval_seconds: Option<i64>,
#[serde(rename = "SpekeKeyProvider")]
pub speke_key_provider: SpekeKeyProvider,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct CmafPackage {
#[serde(rename = "Encryption")]
#[serde(skip_serializing_if = "Option::is_none")]
pub encryption: Option<CmafEncryption>,
#[serde(rename = "HlsManifests")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hls_manifests: Option<Vec<HlsManifest>>,
#[serde(rename = "SegmentDurationSeconds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub segment_duration_seconds: Option<i64>,
#[serde(rename = "SegmentPrefix")]
#[serde(skip_serializing_if = "Option::is_none")]
pub segment_prefix: Option<String>,
#[serde(rename = "StreamSelection")]
#[serde(skip_serializing_if = "Option::is_none")]
pub stream_selection: Option<StreamSelection>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct CmafPackageCreateOrUpdateParameters {
#[serde(rename = "Encryption")]
#[serde(skip_serializing_if = "Option::is_none")]
pub encryption: Option<CmafEncryption>,
#[serde(rename = "HlsManifests")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hls_manifests: Option<Vec<HlsManifestCreateOrUpdateParameters>>,
#[serde(rename = "SegmentDurationSeconds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub segment_duration_seconds: Option<i64>,
#[serde(rename = "SegmentPrefix")]
#[serde(skip_serializing_if = "Option::is_none")]
pub segment_prefix: Option<String>,
#[serde(rename = "StreamSelection")]
#[serde(skip_serializing_if = "Option::is_none")]
pub stream_selection: Option<StreamSelection>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct CreateChannelRequest {
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "Id")]
pub id: String,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<::std::collections::HashMap<String, String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct CreateChannelResponse {
#[serde(rename = "Arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "HlsIngest")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hls_ingest: Option<HlsIngest>,
#[serde(rename = "Id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<::std::collections::HashMap<String, String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct CreateHarvestJobRequest {
#[serde(rename = "EndTime")]
pub end_time: String,
#[serde(rename = "Id")]
pub id: String,
#[serde(rename = "OriginEndpointId")]
pub origin_endpoint_id: String,
#[serde(rename = "S3Destination")]
pub s3_destination: S3Destination,
#[serde(rename = "StartTime")]
pub start_time: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct CreateHarvestJobResponse {
#[serde(rename = "Arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "ChannelId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub channel_id: Option<String>,
#[serde(rename = "CreatedAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_at: Option<String>,
#[serde(rename = "EndTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub end_time: Option<String>,
#[serde(rename = "Id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "OriginEndpointId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub origin_endpoint_id: Option<String>,
#[serde(rename = "S3Destination")]
#[serde(skip_serializing_if = "Option::is_none")]
pub s3_destination: Option<S3Destination>,
#[serde(rename = "StartTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub start_time: Option<String>,
#[serde(rename = "Status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct CreateOriginEndpointRequest {
#[serde(rename = "Authorization")]
#[serde(skip_serializing_if = "Option::is_none")]
pub authorization: Option<Authorization>,
#[serde(rename = "ChannelId")]
pub channel_id: String,
#[serde(rename = "CmafPackage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cmaf_package: Option<CmafPackageCreateOrUpdateParameters>,
#[serde(rename = "DashPackage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub dash_package: Option<DashPackage>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "HlsPackage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hls_package: Option<HlsPackage>,
#[serde(rename = "Id")]
pub id: String,
#[serde(rename = "ManifestName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub manifest_name: Option<String>,
#[serde(rename = "MssPackage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub mss_package: Option<MssPackage>,
#[serde(rename = "Origination")]
#[serde(skip_serializing_if = "Option::is_none")]
pub origination: Option<String>,
#[serde(rename = "StartoverWindowSeconds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub startover_window_seconds: Option<i64>,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<::std::collections::HashMap<String, String>>,
#[serde(rename = "TimeDelaySeconds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub time_delay_seconds: Option<i64>,
#[serde(rename = "Whitelist")]
#[serde(skip_serializing_if = "Option::is_none")]
pub whitelist: Option<Vec<String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct CreateOriginEndpointResponse {
#[serde(rename = "Arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "Authorization")]
#[serde(skip_serializing_if = "Option::is_none")]
pub authorization: Option<Authorization>,
#[serde(rename = "ChannelId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub channel_id: Option<String>,
#[serde(rename = "CmafPackage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cmaf_package: Option<CmafPackage>,
#[serde(rename = "DashPackage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub dash_package: Option<DashPackage>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "HlsPackage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hls_package: Option<HlsPackage>,
#[serde(rename = "Id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "ManifestName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub manifest_name: Option<String>,
#[serde(rename = "MssPackage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub mss_package: Option<MssPackage>,
#[serde(rename = "Origination")]
#[serde(skip_serializing_if = "Option::is_none")]
pub origination: Option<String>,
#[serde(rename = "StartoverWindowSeconds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub startover_window_seconds: Option<i64>,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<::std::collections::HashMap<String, String>>,
#[serde(rename = "TimeDelaySeconds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub time_delay_seconds: Option<i64>,
#[serde(rename = "Url")]
#[serde(skip_serializing_if = "Option::is_none")]
pub url: Option<String>,
#[serde(rename = "Whitelist")]
#[serde(skip_serializing_if = "Option::is_none")]
pub whitelist: Option<Vec<String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct DashEncryption {
#[serde(rename = "KeyRotationIntervalSeconds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub key_rotation_interval_seconds: Option<i64>,
#[serde(rename = "SpekeKeyProvider")]
pub speke_key_provider: SpekeKeyProvider,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct DashPackage {
#[serde(rename = "AdTriggers")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ad_triggers: Option<Vec<String>>,
#[serde(rename = "AdsOnDeliveryRestrictions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ads_on_delivery_restrictions: Option<String>,
#[serde(rename = "Encryption")]
#[serde(skip_serializing_if = "Option::is_none")]
pub encryption: Option<DashEncryption>,
#[serde(rename = "ManifestLayout")]
#[serde(skip_serializing_if = "Option::is_none")]
pub manifest_layout: Option<String>,
#[serde(rename = "ManifestWindowSeconds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub manifest_window_seconds: Option<i64>,
#[serde(rename = "MinBufferTimeSeconds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub min_buffer_time_seconds: Option<i64>,
#[serde(rename = "MinUpdatePeriodSeconds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub min_update_period_seconds: Option<i64>,
#[serde(rename = "PeriodTriggers")]
#[serde(skip_serializing_if = "Option::is_none")]
pub period_triggers: Option<Vec<String>>,
#[serde(rename = "Profile")]
#[serde(skip_serializing_if = "Option::is_none")]
pub profile: Option<String>,
#[serde(rename = "SegmentDurationSeconds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub segment_duration_seconds: Option<i64>,
#[serde(rename = "SegmentTemplateFormat")]
#[serde(skip_serializing_if = "Option::is_none")]
pub segment_template_format: Option<String>,
#[serde(rename = "StreamSelection")]
#[serde(skip_serializing_if = "Option::is_none")]
pub stream_selection: Option<StreamSelection>,
#[serde(rename = "SuggestedPresentationDelaySeconds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub suggested_presentation_delay_seconds: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DeleteChannelRequest {
#[serde(rename = "Id")]
pub id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DeleteChannelResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DeleteOriginEndpointRequest {
#[serde(rename = "Id")]
pub id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DeleteOriginEndpointResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DescribeChannelRequest {
#[serde(rename = "Id")]
pub id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DescribeChannelResponse {
#[serde(rename = "Arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "HlsIngest")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hls_ingest: Option<HlsIngest>,
#[serde(rename = "Id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<::std::collections::HashMap<String, String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DescribeHarvestJobRequest {
#[serde(rename = "Id")]
pub id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DescribeHarvestJobResponse {
#[serde(rename = "Arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "ChannelId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub channel_id: Option<String>,
#[serde(rename = "CreatedAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_at: Option<String>,
#[serde(rename = "EndTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub end_time: Option<String>,
#[serde(rename = "Id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "OriginEndpointId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub origin_endpoint_id: Option<String>,
#[serde(rename = "S3Destination")]
#[serde(skip_serializing_if = "Option::is_none")]
pub s3_destination: Option<S3Destination>,
#[serde(rename = "StartTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub start_time: Option<String>,
#[serde(rename = "Status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DescribeOriginEndpointRequest {
#[serde(rename = "Id")]
pub id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DescribeOriginEndpointResponse {
#[serde(rename = "Arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "Authorization")]
#[serde(skip_serializing_if = "Option::is_none")]
pub authorization: Option<Authorization>,
#[serde(rename = "ChannelId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub channel_id: Option<String>,
#[serde(rename = "CmafPackage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cmaf_package: Option<CmafPackage>,
#[serde(rename = "DashPackage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub dash_package: Option<DashPackage>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "HlsPackage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hls_package: Option<HlsPackage>,
#[serde(rename = "Id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "ManifestName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub manifest_name: Option<String>,
#[serde(rename = "MssPackage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub mss_package: Option<MssPackage>,
#[serde(rename = "Origination")]
#[serde(skip_serializing_if = "Option::is_none")]
pub origination: Option<String>,
#[serde(rename = "StartoverWindowSeconds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub startover_window_seconds: Option<i64>,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<::std::collections::HashMap<String, String>>,
#[serde(rename = "TimeDelaySeconds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub time_delay_seconds: Option<i64>,
#[serde(rename = "Url")]
#[serde(skip_serializing_if = "Option::is_none")]
pub url: Option<String>,
#[serde(rename = "Whitelist")]
#[serde(skip_serializing_if = "Option::is_none")]
pub whitelist: Option<Vec<String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct HarvestJob {
#[serde(rename = "Arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "ChannelId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub channel_id: Option<String>,
#[serde(rename = "CreatedAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_at: Option<String>,
#[serde(rename = "EndTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub end_time: Option<String>,
#[serde(rename = "Id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "OriginEndpointId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub origin_endpoint_id: Option<String>,
#[serde(rename = "S3Destination")]
#[serde(skip_serializing_if = "Option::is_none")]
pub s3_destination: Option<S3Destination>,
#[serde(rename = "StartTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub start_time: 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 HlsEncryption {
#[serde(rename = "ConstantInitializationVector")]
#[serde(skip_serializing_if = "Option::is_none")]
pub constant_initialization_vector: Option<String>,
#[serde(rename = "EncryptionMethod")]
#[serde(skip_serializing_if = "Option::is_none")]
pub encryption_method: Option<String>,
#[serde(rename = "KeyRotationIntervalSeconds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub key_rotation_interval_seconds: Option<i64>,
#[serde(rename = "RepeatExtXKey")]
#[serde(skip_serializing_if = "Option::is_none")]
pub repeat_ext_x_key: Option<bool>,
#[serde(rename = "SpekeKeyProvider")]
pub speke_key_provider: SpekeKeyProvider,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct HlsIngest {
#[serde(rename = "IngestEndpoints")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ingest_endpoints: Option<Vec<IngestEndpoint>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct HlsManifest {
#[serde(rename = "AdMarkers")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ad_markers: Option<String>,
#[serde(rename = "Id")]
pub id: String,
#[serde(rename = "IncludeIframeOnlyStream")]
#[serde(skip_serializing_if = "Option::is_none")]
pub include_iframe_only_stream: Option<bool>,
#[serde(rename = "ManifestName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub manifest_name: Option<String>,
#[serde(rename = "PlaylistType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub playlist_type: Option<String>,
#[serde(rename = "PlaylistWindowSeconds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub playlist_window_seconds: Option<i64>,
#[serde(rename = "ProgramDateTimeIntervalSeconds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub program_date_time_interval_seconds: Option<i64>,
#[serde(rename = "Url")]
#[serde(skip_serializing_if = "Option::is_none")]
pub url: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct HlsManifestCreateOrUpdateParameters {
#[serde(rename = "AdMarkers")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ad_markers: Option<String>,
#[serde(rename = "AdTriggers")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ad_triggers: Option<Vec<String>>,
#[serde(rename = "AdsOnDeliveryRestrictions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ads_on_delivery_restrictions: Option<String>,
#[serde(rename = "Id")]
pub id: String,
#[serde(rename = "IncludeIframeOnlyStream")]
#[serde(skip_serializing_if = "Option::is_none")]
pub include_iframe_only_stream: Option<bool>,
#[serde(rename = "ManifestName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub manifest_name: Option<String>,
#[serde(rename = "PlaylistType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub playlist_type: Option<String>,
#[serde(rename = "PlaylistWindowSeconds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub playlist_window_seconds: Option<i64>,
#[serde(rename = "ProgramDateTimeIntervalSeconds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub program_date_time_interval_seconds: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct HlsPackage {
#[serde(rename = "AdMarkers")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ad_markers: Option<String>,
#[serde(rename = "AdTriggers")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ad_triggers: Option<Vec<String>>,
#[serde(rename = "AdsOnDeliveryRestrictions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ads_on_delivery_restrictions: Option<String>,
#[serde(rename = "Encryption")]
#[serde(skip_serializing_if = "Option::is_none")]
pub encryption: Option<HlsEncryption>,
#[serde(rename = "IncludeIframeOnlyStream")]
#[serde(skip_serializing_if = "Option::is_none")]
pub include_iframe_only_stream: Option<bool>,
#[serde(rename = "PlaylistType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub playlist_type: Option<String>,
#[serde(rename = "PlaylistWindowSeconds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub playlist_window_seconds: Option<i64>,
#[serde(rename = "ProgramDateTimeIntervalSeconds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub program_date_time_interval_seconds: Option<i64>,
#[serde(rename = "SegmentDurationSeconds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub segment_duration_seconds: Option<i64>,
#[serde(rename = "StreamSelection")]
#[serde(skip_serializing_if = "Option::is_none")]
pub stream_selection: Option<StreamSelection>,
#[serde(rename = "UseAudioRenditionGroup")]
#[serde(skip_serializing_if = "Option::is_none")]
pub use_audio_rendition_group: Option<bool>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct IngestEndpoint {
#[serde(rename = "Id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "Password")]
#[serde(skip_serializing_if = "Option::is_none")]
pub password: Option<String>,
#[serde(rename = "Url")]
#[serde(skip_serializing_if = "Option::is_none")]
pub url: Option<String>,
#[serde(rename = "Username")]
#[serde(skip_serializing_if = "Option::is_none")]
pub username: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct ListChannelsRequest {
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ListChannelsResponse {
#[serde(rename = "Channels")]
#[serde(skip_serializing_if = "Option::is_none")]
pub channels: Option<Vec<Channel>>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct ListHarvestJobsRequest {
#[serde(rename = "IncludeChannelId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub include_channel_id: Option<String>,
#[serde(rename = "IncludeStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub include_status: Option<String>,
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ListHarvestJobsResponse {
#[serde(rename = "HarvestJobs")]
#[serde(skip_serializing_if = "Option::is_none")]
pub harvest_jobs: Option<Vec<HarvestJob>>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct ListOriginEndpointsRequest {
#[serde(rename = "ChannelId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub channel_id: Option<String>,
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ListOriginEndpointsResponse {
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "OriginEndpoints")]
#[serde(skip_serializing_if = "Option::is_none")]
pub origin_endpoints: Option<Vec<OriginEndpoint>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct ListTagsForResourceRequest {
#[serde(rename = "ResourceArn")]
pub resource_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ListTagsForResourceResponse {
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<::std::collections::HashMap<String, String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct MssEncryption {
#[serde(rename = "SpekeKeyProvider")]
pub speke_key_provider: SpekeKeyProvider,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct MssPackage {
#[serde(rename = "Encryption")]
#[serde(skip_serializing_if = "Option::is_none")]
pub encryption: Option<MssEncryption>,
#[serde(rename = "ManifestWindowSeconds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub manifest_window_seconds: Option<i64>,
#[serde(rename = "SegmentDurationSeconds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub segment_duration_seconds: Option<i64>,
#[serde(rename = "StreamSelection")]
#[serde(skip_serializing_if = "Option::is_none")]
pub stream_selection: Option<StreamSelection>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct OriginEndpoint {
#[serde(rename = "Arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "Authorization")]
#[serde(skip_serializing_if = "Option::is_none")]
pub authorization: Option<Authorization>,
#[serde(rename = "ChannelId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub channel_id: Option<String>,
#[serde(rename = "CmafPackage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cmaf_package: Option<CmafPackage>,
#[serde(rename = "DashPackage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub dash_package: Option<DashPackage>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "HlsPackage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hls_package: Option<HlsPackage>,
#[serde(rename = "Id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "ManifestName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub manifest_name: Option<String>,
#[serde(rename = "MssPackage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub mss_package: Option<MssPackage>,
#[serde(rename = "Origination")]
#[serde(skip_serializing_if = "Option::is_none")]
pub origination: Option<String>,
#[serde(rename = "StartoverWindowSeconds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub startover_window_seconds: Option<i64>,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<::std::collections::HashMap<String, String>>,
#[serde(rename = "TimeDelaySeconds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub time_delay_seconds: Option<i64>,
#[serde(rename = "Url")]
#[serde(skip_serializing_if = "Option::is_none")]
pub url: Option<String>,
#[serde(rename = "Whitelist")]
#[serde(skip_serializing_if = "Option::is_none")]
pub whitelist: Option<Vec<String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct RotateChannelCredentialsRequest {
#[serde(rename = "Id")]
pub id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct RotateChannelCredentialsResponse {
#[serde(rename = "Arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "HlsIngest")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hls_ingest: Option<HlsIngest>,
#[serde(rename = "Id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<::std::collections::HashMap<String, String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct RotateIngestEndpointCredentialsRequest {
#[serde(rename = "Id")]
pub id: String,
#[serde(rename = "IngestEndpointId")]
pub ingest_endpoint_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct RotateIngestEndpointCredentialsResponse {
#[serde(rename = "Arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "HlsIngest")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hls_ingest: Option<HlsIngest>,
#[serde(rename = "Id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<::std::collections::HashMap<String, String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct S3Destination {
#[serde(rename = "BucketName")]
pub bucket_name: String,
#[serde(rename = "ManifestKey")]
pub manifest_key: String,
#[serde(rename = "RoleArn")]
pub role_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SpekeKeyProvider {
#[serde(rename = "CertificateArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub certificate_arn: Option<String>,
#[serde(rename = "ResourceId")]
pub resource_id: String,
#[serde(rename = "RoleArn")]
pub role_arn: String,
#[serde(rename = "SystemIds")]
pub system_ids: Vec<String>,
#[serde(rename = "Url")]
pub url: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct StreamSelection {
#[serde(rename = "MaxVideoBitsPerSecond")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_video_bits_per_second: Option<i64>,
#[serde(rename = "MinVideoBitsPerSecond")]
#[serde(skip_serializing_if = "Option::is_none")]
pub min_video_bits_per_second: Option<i64>,
#[serde(rename = "StreamOrder")]
#[serde(skip_serializing_if = "Option::is_none")]
pub stream_order: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct TagResourceRequest {
#[serde(rename = "ResourceArn")]
pub resource_arn: String,
#[serde(rename = "Tags")]
pub tags: ::std::collections::HashMap<String, String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct UntagResourceRequest {
#[serde(rename = "ResourceArn")]
pub resource_arn: String,
#[serde(rename = "TagKeys")]
pub tag_keys: Vec<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct UpdateChannelRequest {
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "Id")]
pub id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct UpdateChannelResponse {
#[serde(rename = "Arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "HlsIngest")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hls_ingest: Option<HlsIngest>,
#[serde(rename = "Id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<::std::collections::HashMap<String, String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct UpdateOriginEndpointRequest {
#[serde(rename = "Authorization")]
#[serde(skip_serializing_if = "Option::is_none")]
pub authorization: Option<Authorization>,
#[serde(rename = "CmafPackage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cmaf_package: Option<CmafPackageCreateOrUpdateParameters>,
#[serde(rename = "DashPackage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub dash_package: Option<DashPackage>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "HlsPackage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hls_package: Option<HlsPackage>,
#[serde(rename = "Id")]
pub id: String,
#[serde(rename = "ManifestName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub manifest_name: Option<String>,
#[serde(rename = "MssPackage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub mss_package: Option<MssPackage>,
#[serde(rename = "Origination")]
#[serde(skip_serializing_if = "Option::is_none")]
pub origination: Option<String>,
#[serde(rename = "StartoverWindowSeconds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub startover_window_seconds: Option<i64>,
#[serde(rename = "TimeDelaySeconds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub time_delay_seconds: Option<i64>,
#[serde(rename = "Whitelist")]
#[serde(skip_serializing_if = "Option::is_none")]
pub whitelist: Option<Vec<String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct UpdateOriginEndpointResponse {
#[serde(rename = "Arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "Authorization")]
#[serde(skip_serializing_if = "Option::is_none")]
pub authorization: Option<Authorization>,
#[serde(rename = "ChannelId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub channel_id: Option<String>,
#[serde(rename = "CmafPackage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cmaf_package: Option<CmafPackage>,
#[serde(rename = "DashPackage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub dash_package: Option<DashPackage>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "HlsPackage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hls_package: Option<HlsPackage>,
#[serde(rename = "Id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "ManifestName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub manifest_name: Option<String>,
#[serde(rename = "MssPackage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub mss_package: Option<MssPackage>,
#[serde(rename = "Origination")]
#[serde(skip_serializing_if = "Option::is_none")]
pub origination: Option<String>,
#[serde(rename = "StartoverWindowSeconds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub startover_window_seconds: Option<i64>,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<::std::collections::HashMap<String, String>>,
#[serde(rename = "TimeDelaySeconds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub time_delay_seconds: Option<i64>,
#[serde(rename = "Url")]
#[serde(skip_serializing_if = "Option::is_none")]
pub url: Option<String>,
#[serde(rename = "Whitelist")]
#[serde(skip_serializing_if = "Option::is_none")]
pub whitelist: Option<Vec<String>>,
}
#[derive(Debug, PartialEq)]
pub enum CreateChannelError {
Forbidden(String),
InternalServerError(String),
NotFound(String),
ServiceUnavailable(String),
TooManyRequests(String),
UnprocessableEntity(String),
}
impl CreateChannelError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateChannelError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"ForbiddenException" => {
return RusotoError::Service(CreateChannelError::Forbidden(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(CreateChannelError::InternalServerError(err.msg))
}
"NotFoundException" => {
return RusotoError::Service(CreateChannelError::NotFound(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(CreateChannelError::ServiceUnavailable(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(CreateChannelError::TooManyRequests(err.msg))
}
"UnprocessableEntityException" => {
return RusotoError::Service(CreateChannelError::UnprocessableEntity(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for CreateChannelError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
CreateChannelError::Forbidden(ref cause) => write!(f, "{}", cause),
CreateChannelError::InternalServerError(ref cause) => write!(f, "{}", cause),
CreateChannelError::NotFound(ref cause) => write!(f, "{}", cause),
CreateChannelError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
CreateChannelError::TooManyRequests(ref cause) => write!(f, "{}", cause),
CreateChannelError::UnprocessableEntity(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for CreateChannelError {}
#[derive(Debug, PartialEq)]
pub enum CreateHarvestJobError {
Forbidden(String),
InternalServerError(String),
NotFound(String),
ServiceUnavailable(String),
TooManyRequests(String),
UnprocessableEntity(String),
}
impl CreateHarvestJobError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateHarvestJobError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"ForbiddenException" => {
return RusotoError::Service(CreateHarvestJobError::Forbidden(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(CreateHarvestJobError::InternalServerError(
err.msg,
))
}
"NotFoundException" => {
return RusotoError::Service(CreateHarvestJobError::NotFound(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(CreateHarvestJobError::ServiceUnavailable(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(CreateHarvestJobError::TooManyRequests(err.msg))
}
"UnprocessableEntityException" => {
return RusotoError::Service(CreateHarvestJobError::UnprocessableEntity(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for CreateHarvestJobError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
CreateHarvestJobError::Forbidden(ref cause) => write!(f, "{}", cause),
CreateHarvestJobError::InternalServerError(ref cause) => write!(f, "{}", cause),
CreateHarvestJobError::NotFound(ref cause) => write!(f, "{}", cause),
CreateHarvestJobError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
CreateHarvestJobError::TooManyRequests(ref cause) => write!(f, "{}", cause),
CreateHarvestJobError::UnprocessableEntity(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for CreateHarvestJobError {}
#[derive(Debug, PartialEq)]
pub enum CreateOriginEndpointError {
Forbidden(String),
InternalServerError(String),
NotFound(String),
ServiceUnavailable(String),
TooManyRequests(String),
UnprocessableEntity(String),
}
impl CreateOriginEndpointError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateOriginEndpointError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"ForbiddenException" => {
return RusotoError::Service(CreateOriginEndpointError::Forbidden(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(CreateOriginEndpointError::InternalServerError(
err.msg,
))
}
"NotFoundException" => {
return RusotoError::Service(CreateOriginEndpointError::NotFound(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(CreateOriginEndpointError::ServiceUnavailable(
err.msg,
))
}
"TooManyRequestsException" => {
return RusotoError::Service(CreateOriginEndpointError::TooManyRequests(
err.msg,
))
}
"UnprocessableEntityException" => {
return RusotoError::Service(CreateOriginEndpointError::UnprocessableEntity(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for CreateOriginEndpointError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
CreateOriginEndpointError::Forbidden(ref cause) => write!(f, "{}", cause),
CreateOriginEndpointError::InternalServerError(ref cause) => write!(f, "{}", cause),
CreateOriginEndpointError::NotFound(ref cause) => write!(f, "{}", cause),
CreateOriginEndpointError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
CreateOriginEndpointError::TooManyRequests(ref cause) => write!(f, "{}", cause),
CreateOriginEndpointError::UnprocessableEntity(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for CreateOriginEndpointError {}
#[derive(Debug, PartialEq)]
pub enum DeleteChannelError {
Forbidden(String),
InternalServerError(String),
NotFound(String),
ServiceUnavailable(String),
TooManyRequests(String),
UnprocessableEntity(String),
}
impl DeleteChannelError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteChannelError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"ForbiddenException" => {
return RusotoError::Service(DeleteChannelError::Forbidden(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(DeleteChannelError::InternalServerError(err.msg))
}
"NotFoundException" => {
return RusotoError::Service(DeleteChannelError::NotFound(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(DeleteChannelError::ServiceUnavailable(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(DeleteChannelError::TooManyRequests(err.msg))
}
"UnprocessableEntityException" => {
return RusotoError::Service(DeleteChannelError::UnprocessableEntity(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DeleteChannelError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DeleteChannelError::Forbidden(ref cause) => write!(f, "{}", cause),
DeleteChannelError::InternalServerError(ref cause) => write!(f, "{}", cause),
DeleteChannelError::NotFound(ref cause) => write!(f, "{}", cause),
DeleteChannelError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
DeleteChannelError::TooManyRequests(ref cause) => write!(f, "{}", cause),
DeleteChannelError::UnprocessableEntity(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for DeleteChannelError {}
#[derive(Debug, PartialEq)]
pub enum DeleteOriginEndpointError {
Forbidden(String),
InternalServerError(String),
NotFound(String),
ServiceUnavailable(String),
TooManyRequests(String),
UnprocessableEntity(String),
}
impl DeleteOriginEndpointError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteOriginEndpointError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"ForbiddenException" => {
return RusotoError::Service(DeleteOriginEndpointError::Forbidden(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(DeleteOriginEndpointError::InternalServerError(
err.msg,
))
}
"NotFoundException" => {
return RusotoError::Service(DeleteOriginEndpointError::NotFound(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(DeleteOriginEndpointError::ServiceUnavailable(
err.msg,
))
}
"TooManyRequestsException" => {
return RusotoError::Service(DeleteOriginEndpointError::TooManyRequests(
err.msg,
))
}
"UnprocessableEntityException" => {
return RusotoError::Service(DeleteOriginEndpointError::UnprocessableEntity(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DeleteOriginEndpointError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DeleteOriginEndpointError::Forbidden(ref cause) => write!(f, "{}", cause),
DeleteOriginEndpointError::InternalServerError(ref cause) => write!(f, "{}", cause),
DeleteOriginEndpointError::NotFound(ref cause) => write!(f, "{}", cause),
DeleteOriginEndpointError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
DeleteOriginEndpointError::TooManyRequests(ref cause) => write!(f, "{}", cause),
DeleteOriginEndpointError::UnprocessableEntity(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for DeleteOriginEndpointError {}
#[derive(Debug, PartialEq)]
pub enum DescribeChannelError {
Forbidden(String),
InternalServerError(String),
NotFound(String),
ServiceUnavailable(String),
TooManyRequests(String),
UnprocessableEntity(String),
}
impl DescribeChannelError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeChannelError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"ForbiddenException" => {
return RusotoError::Service(DescribeChannelError::Forbidden(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(DescribeChannelError::InternalServerError(err.msg))
}
"NotFoundException" => {
return RusotoError::Service(DescribeChannelError::NotFound(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(DescribeChannelError::ServiceUnavailable(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(DescribeChannelError::TooManyRequests(err.msg))
}
"UnprocessableEntityException" => {
return RusotoError::Service(DescribeChannelError::UnprocessableEntity(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DescribeChannelError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DescribeChannelError::Forbidden(ref cause) => write!(f, "{}", cause),
DescribeChannelError::InternalServerError(ref cause) => write!(f, "{}", cause),
DescribeChannelError::NotFound(ref cause) => write!(f, "{}", cause),
DescribeChannelError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
DescribeChannelError::TooManyRequests(ref cause) => write!(f, "{}", cause),
DescribeChannelError::UnprocessableEntity(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for DescribeChannelError {}
#[derive(Debug, PartialEq)]
pub enum DescribeHarvestJobError {
Forbidden(String),
InternalServerError(String),
NotFound(String),
ServiceUnavailable(String),
TooManyRequests(String),
UnprocessableEntity(String),
}
impl DescribeHarvestJobError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeHarvestJobError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"ForbiddenException" => {
return RusotoError::Service(DescribeHarvestJobError::Forbidden(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(DescribeHarvestJobError::InternalServerError(
err.msg,
))
}
"NotFoundException" => {
return RusotoError::Service(DescribeHarvestJobError::NotFound(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(DescribeHarvestJobError::ServiceUnavailable(
err.msg,
))
}
"TooManyRequestsException" => {
return RusotoError::Service(DescribeHarvestJobError::TooManyRequests(err.msg))
}
"UnprocessableEntityException" => {
return RusotoError::Service(DescribeHarvestJobError::UnprocessableEntity(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DescribeHarvestJobError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DescribeHarvestJobError::Forbidden(ref cause) => write!(f, "{}", cause),
DescribeHarvestJobError::InternalServerError(ref cause) => write!(f, "{}", cause),
DescribeHarvestJobError::NotFound(ref cause) => write!(f, "{}", cause),
DescribeHarvestJobError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
DescribeHarvestJobError::TooManyRequests(ref cause) => write!(f, "{}", cause),
DescribeHarvestJobError::UnprocessableEntity(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for DescribeHarvestJobError {}
#[derive(Debug, PartialEq)]
pub enum DescribeOriginEndpointError {
Forbidden(String),
InternalServerError(String),
NotFound(String),
ServiceUnavailable(String),
TooManyRequests(String),
UnprocessableEntity(String),
}
impl DescribeOriginEndpointError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeOriginEndpointError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"ForbiddenException" => {
return RusotoError::Service(DescribeOriginEndpointError::Forbidden(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(DescribeOriginEndpointError::InternalServerError(
err.msg,
))
}
"NotFoundException" => {
return RusotoError::Service(DescribeOriginEndpointError::NotFound(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(DescribeOriginEndpointError::ServiceUnavailable(
err.msg,
))
}
"TooManyRequestsException" => {
return RusotoError::Service(DescribeOriginEndpointError::TooManyRequests(
err.msg,
))
}
"UnprocessableEntityException" => {
return RusotoError::Service(DescribeOriginEndpointError::UnprocessableEntity(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DescribeOriginEndpointError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DescribeOriginEndpointError::Forbidden(ref cause) => write!(f, "{}", cause),
DescribeOriginEndpointError::InternalServerError(ref cause) => write!(f, "{}", cause),
DescribeOriginEndpointError::NotFound(ref cause) => write!(f, "{}", cause),
DescribeOriginEndpointError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
DescribeOriginEndpointError::TooManyRequests(ref cause) => write!(f, "{}", cause),
DescribeOriginEndpointError::UnprocessableEntity(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for DescribeOriginEndpointError {}
#[derive(Debug, PartialEq)]
pub enum ListChannelsError {
Forbidden(String),
InternalServerError(String),
NotFound(String),
ServiceUnavailable(String),
TooManyRequests(String),
UnprocessableEntity(String),
}
impl ListChannelsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListChannelsError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"ForbiddenException" => {
return RusotoError::Service(ListChannelsError::Forbidden(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(ListChannelsError::InternalServerError(err.msg))
}
"NotFoundException" => {
return RusotoError::Service(ListChannelsError::NotFound(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(ListChannelsError::ServiceUnavailable(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(ListChannelsError::TooManyRequests(err.msg))
}
"UnprocessableEntityException" => {
return RusotoError::Service(ListChannelsError::UnprocessableEntity(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for ListChannelsError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
ListChannelsError::Forbidden(ref cause) => write!(f, "{}", cause),
ListChannelsError::InternalServerError(ref cause) => write!(f, "{}", cause),
ListChannelsError::NotFound(ref cause) => write!(f, "{}", cause),
ListChannelsError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
ListChannelsError::TooManyRequests(ref cause) => write!(f, "{}", cause),
ListChannelsError::UnprocessableEntity(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for ListChannelsError {}
#[derive(Debug, PartialEq)]
pub enum ListHarvestJobsError {
Forbidden(String),
InternalServerError(String),
NotFound(String),
ServiceUnavailable(String),
TooManyRequests(String),
UnprocessableEntity(String),
}
impl ListHarvestJobsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListHarvestJobsError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"ForbiddenException" => {
return RusotoError::Service(ListHarvestJobsError::Forbidden(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(ListHarvestJobsError::InternalServerError(err.msg))
}
"NotFoundException" => {
return RusotoError::Service(ListHarvestJobsError::NotFound(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(ListHarvestJobsError::ServiceUnavailable(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(ListHarvestJobsError::TooManyRequests(err.msg))
}
"UnprocessableEntityException" => {
return RusotoError::Service(ListHarvestJobsError::UnprocessableEntity(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for ListHarvestJobsError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
ListHarvestJobsError::Forbidden(ref cause) => write!(f, "{}", cause),
ListHarvestJobsError::InternalServerError(ref cause) => write!(f, "{}", cause),
ListHarvestJobsError::NotFound(ref cause) => write!(f, "{}", cause),
ListHarvestJobsError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
ListHarvestJobsError::TooManyRequests(ref cause) => write!(f, "{}", cause),
ListHarvestJobsError::UnprocessableEntity(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for ListHarvestJobsError {}
#[derive(Debug, PartialEq)]
pub enum ListOriginEndpointsError {
Forbidden(String),
InternalServerError(String),
NotFound(String),
ServiceUnavailable(String),
TooManyRequests(String),
UnprocessableEntity(String),
}
impl ListOriginEndpointsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListOriginEndpointsError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"ForbiddenException" => {
return RusotoError::Service(ListOriginEndpointsError::Forbidden(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(ListOriginEndpointsError::InternalServerError(
err.msg,
))
}
"NotFoundException" => {
return RusotoError::Service(ListOriginEndpointsError::NotFound(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(ListOriginEndpointsError::ServiceUnavailable(
err.msg,
))
}
"TooManyRequestsException" => {
return RusotoError::Service(ListOriginEndpointsError::TooManyRequests(err.msg))
}
"UnprocessableEntityException" => {
return RusotoError::Service(ListOriginEndpointsError::UnprocessableEntity(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for ListOriginEndpointsError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
ListOriginEndpointsError::Forbidden(ref cause) => write!(f, "{}", cause),
ListOriginEndpointsError::InternalServerError(ref cause) => write!(f, "{}", cause),
ListOriginEndpointsError::NotFound(ref cause) => write!(f, "{}", cause),
ListOriginEndpointsError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
ListOriginEndpointsError::TooManyRequests(ref cause) => write!(f, "{}", cause),
ListOriginEndpointsError::UnprocessableEntity(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for ListOriginEndpointsError {}
#[derive(Debug, PartialEq)]
pub enum ListTagsForResourceError {}
impl ListTagsForResourceError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListTagsForResourceError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for ListTagsForResourceError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {}
}
}
impl Error for ListTagsForResourceError {}
#[derive(Debug, PartialEq)]
pub enum RotateChannelCredentialsError {
Forbidden(String),
InternalServerError(String),
NotFound(String),
ServiceUnavailable(String),
TooManyRequests(String),
UnprocessableEntity(String),
}
impl RotateChannelCredentialsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<RotateChannelCredentialsError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"ForbiddenException" => {
return RusotoError::Service(RotateChannelCredentialsError::Forbidden(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(
RotateChannelCredentialsError::InternalServerError(err.msg),
)
}
"NotFoundException" => {
return RusotoError::Service(RotateChannelCredentialsError::NotFound(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(RotateChannelCredentialsError::ServiceUnavailable(
err.msg,
))
}
"TooManyRequestsException" => {
return RusotoError::Service(RotateChannelCredentialsError::TooManyRequests(
err.msg,
))
}
"UnprocessableEntityException" => {
return RusotoError::Service(
RotateChannelCredentialsError::UnprocessableEntity(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for RotateChannelCredentialsError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
RotateChannelCredentialsError::Forbidden(ref cause) => write!(f, "{}", cause),
RotateChannelCredentialsError::InternalServerError(ref cause) => write!(f, "{}", cause),
RotateChannelCredentialsError::NotFound(ref cause) => write!(f, "{}", cause),
RotateChannelCredentialsError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
RotateChannelCredentialsError::TooManyRequests(ref cause) => write!(f, "{}", cause),
RotateChannelCredentialsError::UnprocessableEntity(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for RotateChannelCredentialsError {}
#[derive(Debug, PartialEq)]
pub enum RotateIngestEndpointCredentialsError {
Forbidden(String),
InternalServerError(String),
NotFound(String),
ServiceUnavailable(String),
TooManyRequests(String),
UnprocessableEntity(String),
}
impl RotateIngestEndpointCredentialsError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<RotateIngestEndpointCredentialsError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"ForbiddenException" => {
return RusotoError::Service(RotateIngestEndpointCredentialsError::Forbidden(
err.msg,
))
}
"InternalServerErrorException" => {
return RusotoError::Service(
RotateIngestEndpointCredentialsError::InternalServerError(err.msg),
)
}
"NotFoundException" => {
return RusotoError::Service(RotateIngestEndpointCredentialsError::NotFound(
err.msg,
))
}
"ServiceUnavailableException" => {
return RusotoError::Service(
RotateIngestEndpointCredentialsError::ServiceUnavailable(err.msg),
)
}
"TooManyRequestsException" => {
return RusotoError::Service(
RotateIngestEndpointCredentialsError::TooManyRequests(err.msg),
)
}
"UnprocessableEntityException" => {
return RusotoError::Service(
RotateIngestEndpointCredentialsError::UnprocessableEntity(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for RotateIngestEndpointCredentialsError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
RotateIngestEndpointCredentialsError::Forbidden(ref cause) => write!(f, "{}", cause),
RotateIngestEndpointCredentialsError::InternalServerError(ref cause) => {
write!(f, "{}", cause)
}
RotateIngestEndpointCredentialsError::NotFound(ref cause) => write!(f, "{}", cause),
RotateIngestEndpointCredentialsError::ServiceUnavailable(ref cause) => {
write!(f, "{}", cause)
}
RotateIngestEndpointCredentialsError::TooManyRequests(ref cause) => {
write!(f, "{}", cause)
}
RotateIngestEndpointCredentialsError::UnprocessableEntity(ref cause) => {
write!(f, "{}", cause)
}
}
}
}
impl Error for RotateIngestEndpointCredentialsError {}
#[derive(Debug, PartialEq)]
pub enum TagResourceError {}
impl TagResourceError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<TagResourceError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for TagResourceError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {}
}
}
impl Error for TagResourceError {}
#[derive(Debug, PartialEq)]
pub enum UntagResourceError {}
impl UntagResourceError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UntagResourceError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for UntagResourceError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {}
}
}
impl Error for UntagResourceError {}
#[derive(Debug, PartialEq)]
pub enum UpdateChannelError {
Forbidden(String),
InternalServerError(String),
NotFound(String),
ServiceUnavailable(String),
TooManyRequests(String),
UnprocessableEntity(String),
}
impl UpdateChannelError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateChannelError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"ForbiddenException" => {
return RusotoError::Service(UpdateChannelError::Forbidden(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(UpdateChannelError::InternalServerError(err.msg))
}
"NotFoundException" => {
return RusotoError::Service(UpdateChannelError::NotFound(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(UpdateChannelError::ServiceUnavailable(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(UpdateChannelError::TooManyRequests(err.msg))
}
"UnprocessableEntityException" => {
return RusotoError::Service(UpdateChannelError::UnprocessableEntity(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for UpdateChannelError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
UpdateChannelError::Forbidden(ref cause) => write!(f, "{}", cause),
UpdateChannelError::InternalServerError(ref cause) => write!(f, "{}", cause),
UpdateChannelError::NotFound(ref cause) => write!(f, "{}", cause),
UpdateChannelError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
UpdateChannelError::TooManyRequests(ref cause) => write!(f, "{}", cause),
UpdateChannelError::UnprocessableEntity(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for UpdateChannelError {}
#[derive(Debug, PartialEq)]
pub enum UpdateOriginEndpointError {
Forbidden(String),
InternalServerError(String),
NotFound(String),
ServiceUnavailable(String),
TooManyRequests(String),
UnprocessableEntity(String),
}
impl UpdateOriginEndpointError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateOriginEndpointError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"ForbiddenException" => {
return RusotoError::Service(UpdateOriginEndpointError::Forbidden(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(UpdateOriginEndpointError::InternalServerError(
err.msg,
))
}
"NotFoundException" => {
return RusotoError::Service(UpdateOriginEndpointError::NotFound(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(UpdateOriginEndpointError::ServiceUnavailable(
err.msg,
))
}
"TooManyRequestsException" => {
return RusotoError::Service(UpdateOriginEndpointError::TooManyRequests(
err.msg,
))
}
"UnprocessableEntityException" => {
return RusotoError::Service(UpdateOriginEndpointError::UnprocessableEntity(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for UpdateOriginEndpointError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
UpdateOriginEndpointError::Forbidden(ref cause) => write!(f, "{}", cause),
UpdateOriginEndpointError::InternalServerError(ref cause) => write!(f, "{}", cause),
UpdateOriginEndpointError::NotFound(ref cause) => write!(f, "{}", cause),
UpdateOriginEndpointError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
UpdateOriginEndpointError::TooManyRequests(ref cause) => write!(f, "{}", cause),
UpdateOriginEndpointError::UnprocessableEntity(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for UpdateOriginEndpointError {}
#[async_trait]
pub trait MediaPackage {
async fn create_channel(
&self,
input: CreateChannelRequest,
) -> Result<CreateChannelResponse, RusotoError<CreateChannelError>>;
async fn create_harvest_job(
&self,
input: CreateHarvestJobRequest,
) -> Result<CreateHarvestJobResponse, RusotoError<CreateHarvestJobError>>;
async fn create_origin_endpoint(
&self,
input: CreateOriginEndpointRequest,
) -> Result<CreateOriginEndpointResponse, RusotoError<CreateOriginEndpointError>>;
async fn delete_channel(
&self,
input: DeleteChannelRequest,
) -> Result<DeleteChannelResponse, RusotoError<DeleteChannelError>>;
async fn delete_origin_endpoint(
&self,
input: DeleteOriginEndpointRequest,
) -> Result<DeleteOriginEndpointResponse, RusotoError<DeleteOriginEndpointError>>;
async fn describe_channel(
&self,
input: DescribeChannelRequest,
) -> Result<DescribeChannelResponse, RusotoError<DescribeChannelError>>;
async fn describe_harvest_job(
&self,
input: DescribeHarvestJobRequest,
) -> Result<DescribeHarvestJobResponse, RusotoError<DescribeHarvestJobError>>;
async fn describe_origin_endpoint(
&self,
input: DescribeOriginEndpointRequest,
) -> Result<DescribeOriginEndpointResponse, RusotoError<DescribeOriginEndpointError>>;
async fn list_channels(
&self,
input: ListChannelsRequest,
) -> Result<ListChannelsResponse, RusotoError<ListChannelsError>>;
async fn list_harvest_jobs(
&self,
input: ListHarvestJobsRequest,
) -> Result<ListHarvestJobsResponse, RusotoError<ListHarvestJobsError>>;
async fn list_origin_endpoints(
&self,
input: ListOriginEndpointsRequest,
) -> Result<ListOriginEndpointsResponse, RusotoError<ListOriginEndpointsError>>;
async fn list_tags_for_resource(
&self,
input: ListTagsForResourceRequest,
) -> Result<ListTagsForResourceResponse, RusotoError<ListTagsForResourceError>>;
async fn rotate_channel_credentials(
&self,
input: RotateChannelCredentialsRequest,
) -> Result<RotateChannelCredentialsResponse, RusotoError<RotateChannelCredentialsError>>;
async fn rotate_ingest_endpoint_credentials(
&self,
input: RotateIngestEndpointCredentialsRequest,
) -> Result<
RotateIngestEndpointCredentialsResponse,
RusotoError<RotateIngestEndpointCredentialsError>,
>;
async fn tag_resource(
&self,
input: TagResourceRequest,
) -> Result<(), RusotoError<TagResourceError>>;
async fn untag_resource(
&self,
input: UntagResourceRequest,
) -> Result<(), RusotoError<UntagResourceError>>;
async fn update_channel(
&self,
input: UpdateChannelRequest,
) -> Result<UpdateChannelResponse, RusotoError<UpdateChannelError>>;
async fn update_origin_endpoint(
&self,
input: UpdateOriginEndpointRequest,
) -> Result<UpdateOriginEndpointResponse, RusotoError<UpdateOriginEndpointError>>;
}
#[derive(Clone)]
pub struct MediaPackageClient {
client: Client,
region: region::Region,
}
impl MediaPackageClient {
pub fn new(region: region::Region) -> MediaPackageClient {
MediaPackageClient {
client: Client::shared(),
region,
}
}
pub fn new_with<P, D>(
request_dispatcher: D,
credentials_provider: P,
region: region::Region,
) -> MediaPackageClient
where
P: ProvideAwsCredentials + Send + Sync + 'static,
D: DispatchSignedRequest + Send + Sync + 'static,
{
MediaPackageClient {
client: Client::new_with(credentials_provider, request_dispatcher),
region,
}
}
pub fn new_with_client(client: Client, region: region::Region) -> MediaPackageClient {
MediaPackageClient { client, region }
}
}
#[async_trait]
impl MediaPackage for MediaPackageClient {
async fn create_channel(
&self,
input: CreateChannelRequest,
) -> Result<CreateChannelResponse, RusotoError<CreateChannelError>> {
let request_uri = "/channels";
let mut request = SignedRequest::new("POST", "mediapackage", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
let mut response = self
.client
.sign_and_dispatch(request)
.await
.map_err(RusotoError::from)?;
if response.status.as_u16() == 200 {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<CreateChannelResponse, _>()?;
Ok(result)
} else {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
Err(CreateChannelError::from_response(response))
}
}
async fn create_harvest_job(
&self,
input: CreateHarvestJobRequest,
) -> Result<CreateHarvestJobResponse, RusotoError<CreateHarvestJobError>> {
let request_uri = "/harvest_jobs";
let mut request = SignedRequest::new("POST", "mediapackage", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
let mut response = self
.client
.sign_and_dispatch(request)
.await
.map_err(RusotoError::from)?;
if response.status.as_u16() == 200 {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<CreateHarvestJobResponse, _>()?;
Ok(result)
} else {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
Err(CreateHarvestJobError::from_response(response))
}
}
async fn create_origin_endpoint(
&self,
input: CreateOriginEndpointRequest,
) -> Result<CreateOriginEndpointResponse, RusotoError<CreateOriginEndpointError>> {
let request_uri = "/origin_endpoints";
let mut request = SignedRequest::new("POST", "mediapackage", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
let mut response = self
.client
.sign_and_dispatch(request)
.await
.map_err(RusotoError::from)?;
if response.status.as_u16() == 200 {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<CreateOriginEndpointResponse, _>()?;
Ok(result)
} else {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
Err(CreateOriginEndpointError::from_response(response))
}
}
async fn delete_channel(
&self,
input: DeleteChannelRequest,
) -> Result<DeleteChannelResponse, RusotoError<DeleteChannelError>> {
let request_uri = format!("/channels/{id}", id = input.id);
let mut request = SignedRequest::new("DELETE", "mediapackage", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let mut response = self
.client
.sign_and_dispatch(request)
.await
.map_err(RusotoError::from)?;
if response.status.as_u16() == 202 {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<DeleteChannelResponse, _>()?;
Ok(result)
} else {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
Err(DeleteChannelError::from_response(response))
}
}
async fn delete_origin_endpoint(
&self,
input: DeleteOriginEndpointRequest,
) -> Result<DeleteOriginEndpointResponse, RusotoError<DeleteOriginEndpointError>> {
let request_uri = format!("/origin_endpoints/{id}", id = input.id);
let mut request = SignedRequest::new("DELETE", "mediapackage", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let mut response = self
.client
.sign_and_dispatch(request)
.await
.map_err(RusotoError::from)?;
if response.status.as_u16() == 202 {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<DeleteOriginEndpointResponse, _>()?;
Ok(result)
} else {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
Err(DeleteOriginEndpointError::from_response(response))
}
}
async fn describe_channel(
&self,
input: DescribeChannelRequest,
) -> Result<DescribeChannelResponse, RusotoError<DescribeChannelError>> {
let request_uri = format!("/channels/{id}", id = input.id);
let mut request = SignedRequest::new("GET", "mediapackage", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let mut response = self
.client
.sign_and_dispatch(request)
.await
.map_err(RusotoError::from)?;
if response.status.as_u16() == 200 {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeChannelResponse, _>()?;
Ok(result)
} else {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
Err(DescribeChannelError::from_response(response))
}
}
async fn describe_harvest_job(
&self,
input: DescribeHarvestJobRequest,
) -> Result<DescribeHarvestJobResponse, RusotoError<DescribeHarvestJobError>> {
let request_uri = format!("/harvest_jobs/{id}", id = input.id);
let mut request = SignedRequest::new("GET", "mediapackage", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let mut response = self
.client
.sign_and_dispatch(request)
.await
.map_err(RusotoError::from)?;
if response.status.as_u16() == 200 {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeHarvestJobResponse, _>()?;
Ok(result)
} else {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
Err(DescribeHarvestJobError::from_response(response))
}
}
async fn describe_origin_endpoint(
&self,
input: DescribeOriginEndpointRequest,
) -> Result<DescribeOriginEndpointResponse, RusotoError<DescribeOriginEndpointError>> {
let request_uri = format!("/origin_endpoints/{id}", id = input.id);
let mut request = SignedRequest::new("GET", "mediapackage", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let mut response = self
.client
.sign_and_dispatch(request)
.await
.map_err(RusotoError::from)?;
if response.status.as_u16() == 200 {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeOriginEndpointResponse, _>()?;
Ok(result)
} else {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
Err(DescribeOriginEndpointError::from_response(response))
}
}
async fn list_channels(
&self,
input: ListChannelsRequest,
) -> Result<ListChannelsResponse, RusotoError<ListChannelsError>> {
let request_uri = "/channels";
let mut request = SignedRequest::new("GET", "mediapackage", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let mut params = Params::new();
if let Some(ref x) = input.max_results {
params.put("maxResults", x);
}
if let Some(ref x) = input.next_token {
params.put("nextToken", x);
}
request.set_params(params);
let mut response = self
.client
.sign_and_dispatch(request)
.await
.map_err(RusotoError::from)?;
if response.status.as_u16() == 200 {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<ListChannelsResponse, _>()?;
Ok(result)
} else {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
Err(ListChannelsError::from_response(response))
}
}
async fn list_harvest_jobs(
&self,
input: ListHarvestJobsRequest,
) -> Result<ListHarvestJobsResponse, RusotoError<ListHarvestJobsError>> {
let request_uri = "/harvest_jobs";
let mut request = SignedRequest::new("GET", "mediapackage", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let mut params = Params::new();
if let Some(ref x) = input.include_channel_id {
params.put("includeChannelId", x);
}
if let Some(ref x) = input.include_status {
params.put("includeStatus", x);
}
if let Some(ref x) = input.max_results {
params.put("maxResults", x);
}
if let Some(ref x) = input.next_token {
params.put("nextToken", x);
}
request.set_params(params);
let mut response = self
.client
.sign_and_dispatch(request)
.await
.map_err(RusotoError::from)?;
if response.status.as_u16() == 200 {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<ListHarvestJobsResponse, _>()?;
Ok(result)
} else {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
Err(ListHarvestJobsError::from_response(response))
}
}
async fn list_origin_endpoints(
&self,
input: ListOriginEndpointsRequest,
) -> Result<ListOriginEndpointsResponse, RusotoError<ListOriginEndpointsError>> {
let request_uri = "/origin_endpoints";
let mut request = SignedRequest::new("GET", "mediapackage", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let mut params = Params::new();
if let Some(ref x) = input.channel_id {
params.put("channelId", x);
}
if let Some(ref x) = input.max_results {
params.put("maxResults", x);
}
if let Some(ref x) = input.next_token {
params.put("nextToken", x);
}
request.set_params(params);
let mut response = self
.client
.sign_and_dispatch(request)
.await
.map_err(RusotoError::from)?;
if response.status.as_u16() == 200 {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<ListOriginEndpointsResponse, _>()?;
Ok(result)
} else {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
Err(ListOriginEndpointsError::from_response(response))
}
}
async fn list_tags_for_resource(
&self,
input: ListTagsForResourceRequest,
) -> Result<ListTagsForResourceResponse, RusotoError<ListTagsForResourceError>> {
let request_uri = format!("/tags/{resource_arn}", resource_arn = input.resource_arn);
let mut request = SignedRequest::new("GET", "mediapackage", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let mut response = self
.client
.sign_and_dispatch(request)
.await
.map_err(RusotoError::from)?;
if response.status.as_u16() == 200 {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<ListTagsForResourceResponse, _>()?;
Ok(result)
} else {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
Err(ListTagsForResourceError::from_response(response))
}
}
async fn rotate_channel_credentials(
&self,
input: RotateChannelCredentialsRequest,
) -> Result<RotateChannelCredentialsResponse, RusotoError<RotateChannelCredentialsError>> {
let request_uri = format!("/channels/{id}/credentials", id = input.id);
let mut request = SignedRequest::new("PUT", "mediapackage", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let mut response = self
.client
.sign_and_dispatch(request)
.await
.map_err(RusotoError::from)?;
if response.status.as_u16() == 200 {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<RotateChannelCredentialsResponse, _>()?;
Ok(result)
} else {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
Err(RotateChannelCredentialsError::from_response(response))
}
}
async fn rotate_ingest_endpoint_credentials(
&self,
input: RotateIngestEndpointCredentialsRequest,
) -> Result<
RotateIngestEndpointCredentialsResponse,
RusotoError<RotateIngestEndpointCredentialsError>,
> {
let request_uri = format!(
"/channels/{id}/ingest_endpoints/{ingest_endpoint_id}/credentials",
id = input.id,
ingest_endpoint_id = input.ingest_endpoint_id
);
let mut request = SignedRequest::new("PUT", "mediapackage", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let mut response = self
.client
.sign_and_dispatch(request)
.await
.map_err(RusotoError::from)?;
if response.status.as_u16() == 200 {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<RotateIngestEndpointCredentialsResponse, _>()?;
Ok(result)
} else {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
Err(RotateIngestEndpointCredentialsError::from_response(
response,
))
}
}
async fn tag_resource(
&self,
input: TagResourceRequest,
) -> Result<(), RusotoError<TagResourceError>> {
let request_uri = format!("/tags/{resource_arn}", resource_arn = input.resource_arn);
let mut request = SignedRequest::new("POST", "mediapackage", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
let mut response = self
.client
.sign_and_dispatch(request)
.await
.map_err(RusotoError::from)?;
if response.status.as_u16() == 204 {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
let result = ::std::mem::drop(response);
Ok(result)
} else {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
Err(TagResourceError::from_response(response))
}
}
async fn untag_resource(
&self,
input: UntagResourceRequest,
) -> Result<(), RusotoError<UntagResourceError>> {
let request_uri = format!("/tags/{resource_arn}", resource_arn = input.resource_arn);
let mut request = SignedRequest::new("DELETE", "mediapackage", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let mut params = Params::new();
for item in input.tag_keys.iter() {
params.put("tagKeys", item);
}
request.set_params(params);
let mut response = self
.client
.sign_and_dispatch(request)
.await
.map_err(RusotoError::from)?;
if response.status.as_u16() == 204 {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
let result = ::std::mem::drop(response);
Ok(result)
} else {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
Err(UntagResourceError::from_response(response))
}
}
async fn update_channel(
&self,
input: UpdateChannelRequest,
) -> Result<UpdateChannelResponse, RusotoError<UpdateChannelError>> {
let request_uri = format!("/channels/{id}", id = input.id);
let mut request = SignedRequest::new("PUT", "mediapackage", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
let mut response = self
.client
.sign_and_dispatch(request)
.await
.map_err(RusotoError::from)?;
if response.status.as_u16() == 200 {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<UpdateChannelResponse, _>()?;
Ok(result)
} else {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
Err(UpdateChannelError::from_response(response))
}
}
async fn update_origin_endpoint(
&self,
input: UpdateOriginEndpointRequest,
) -> Result<UpdateOriginEndpointResponse, RusotoError<UpdateOriginEndpointError>> {
let request_uri = format!("/origin_endpoints/{id}", id = input.id);
let mut request = SignedRequest::new("PUT", "mediapackage", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
let mut response = self
.client
.sign_and_dispatch(request)
.await
.map_err(RusotoError::from)?;
if response.status.as_u16() == 200 {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<UpdateOriginEndpointResponse, _>()?;
Ok(result)
} else {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
Err(UpdateOriginEndpointError::from_response(response))
}
}
}