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::param::{Params, ServiceParams};
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 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(test, 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)]
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)]
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(test, 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)]
pub struct CreateOriginEndpointRequest {
#[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 = "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(test, derive(Serialize))]
pub struct CreateOriginEndpointResponse {
#[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 = "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 = "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 = "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)]
pub struct DeleteChannelRequest {
#[serde(rename = "Id")]
pub id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteChannelResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteOriginEndpointRequest {
#[serde(rename = "Id")]
pub id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteOriginEndpointResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeChannelRequest {
#[serde(rename = "Id")]
pub id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, 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)]
pub struct DescribeOriginEndpointRequest {
#[serde(rename = "Id")]
pub id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeOriginEndpointResponse {
#[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 = "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 = "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 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(test, 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(test, 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)]
pub struct HlsManifestCreateOrUpdateParameters {
#[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>,
}
#[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 = "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(test, 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)]
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(test, 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)]
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(test, 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)]
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<::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(test, derive(Serialize))]
pub struct OriginEndpoint {
#[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 = "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 = "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)]
pub struct RotateChannelCredentialsRequest {
#[serde(rename = "Id")]
pub id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, 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)]
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(test, 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 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)]
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)]
pub struct UntagResourceRequest {
#[serde(rename = "ResourceArn")]
pub resource_arn: String,
#[serde(rename = "TagKeys")]
pub tag_keys: Vec<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
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(test, 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)]
pub struct UpdateOriginEndpointRequest {
#[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 = "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(test, derive(Serialize))]
pub struct UpdateOriginEndpointResponse {
#[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 = "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 = "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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CreateChannelError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateChannelError {
fn description(&self) -> &str {
match *self {
CreateChannelError::Forbidden(ref cause) => cause,
CreateChannelError::InternalServerError(ref cause) => cause,
CreateChannelError::NotFound(ref cause) => cause,
CreateChannelError::ServiceUnavailable(ref cause) => cause,
CreateChannelError::TooManyRequests(ref cause) => cause,
CreateChannelError::UnprocessableEntity(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CreateOriginEndpointError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateOriginEndpointError {
fn description(&self) -> &str {
match *self {
CreateOriginEndpointError::Forbidden(ref cause) => cause,
CreateOriginEndpointError::InternalServerError(ref cause) => cause,
CreateOriginEndpointError::NotFound(ref cause) => cause,
CreateOriginEndpointError::ServiceUnavailable(ref cause) => cause,
CreateOriginEndpointError::TooManyRequests(ref cause) => cause,
CreateOriginEndpointError::UnprocessableEntity(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteChannelError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteChannelError {
fn description(&self) -> &str {
match *self {
DeleteChannelError::Forbidden(ref cause) => cause,
DeleteChannelError::InternalServerError(ref cause) => cause,
DeleteChannelError::NotFound(ref cause) => cause,
DeleteChannelError::ServiceUnavailable(ref cause) => cause,
DeleteChannelError::TooManyRequests(ref cause) => cause,
DeleteChannelError::UnprocessableEntity(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteOriginEndpointError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteOriginEndpointError {
fn description(&self) -> &str {
match *self {
DeleteOriginEndpointError::Forbidden(ref cause) => cause,
DeleteOriginEndpointError::InternalServerError(ref cause) => cause,
DeleteOriginEndpointError::NotFound(ref cause) => cause,
DeleteOriginEndpointError::ServiceUnavailable(ref cause) => cause,
DeleteOriginEndpointError::TooManyRequests(ref cause) => cause,
DeleteOriginEndpointError::UnprocessableEntity(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeChannelError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeChannelError {
fn description(&self) -> &str {
match *self {
DescribeChannelError::Forbidden(ref cause) => cause,
DescribeChannelError::InternalServerError(ref cause) => cause,
DescribeChannelError::NotFound(ref cause) => cause,
DescribeChannelError::ServiceUnavailable(ref cause) => cause,
DescribeChannelError::TooManyRequests(ref cause) => cause,
DescribeChannelError::UnprocessableEntity(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeOriginEndpointError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeOriginEndpointError {
fn description(&self) -> &str {
match *self {
DescribeOriginEndpointError::Forbidden(ref cause) => cause,
DescribeOriginEndpointError::InternalServerError(ref cause) => cause,
DescribeOriginEndpointError::NotFound(ref cause) => cause,
DescribeOriginEndpointError::ServiceUnavailable(ref cause) => cause,
DescribeOriginEndpointError::TooManyRequests(ref cause) => cause,
DescribeOriginEndpointError::UnprocessableEntity(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListChannelsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListChannelsError {
fn description(&self) -> &str {
match *self {
ListChannelsError::Forbidden(ref cause) => cause,
ListChannelsError::InternalServerError(ref cause) => cause,
ListChannelsError::NotFound(ref cause) => cause,
ListChannelsError::ServiceUnavailable(ref cause) => cause,
ListChannelsError::TooManyRequests(ref cause) => cause,
ListChannelsError::UnprocessableEntity(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListOriginEndpointsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListOriginEndpointsError {
fn description(&self) -> &str {
match *self {
ListOriginEndpointsError::Forbidden(ref cause) => cause,
ListOriginEndpointsError::InternalServerError(ref cause) => cause,
ListOriginEndpointsError::NotFound(ref cause) => cause,
ListOriginEndpointsError::ServiceUnavailable(ref cause) => cause,
ListOriginEndpointsError::TooManyRequests(ref cause) => cause,
ListOriginEndpointsError::UnprocessableEntity(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
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 {}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for RotateChannelCredentialsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for RotateChannelCredentialsError {
fn description(&self) -> &str {
match *self {
RotateChannelCredentialsError::Forbidden(ref cause) => cause,
RotateChannelCredentialsError::InternalServerError(ref cause) => cause,
RotateChannelCredentialsError::NotFound(ref cause) => cause,
RotateChannelCredentialsError::ServiceUnavailable(ref cause) => cause,
RotateChannelCredentialsError::TooManyRequests(ref cause) => cause,
RotateChannelCredentialsError::UnprocessableEntity(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for RotateIngestEndpointCredentialsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for RotateIngestEndpointCredentialsError {
fn description(&self) -> &str {
match *self {
RotateIngestEndpointCredentialsError::Forbidden(ref cause) => cause,
RotateIngestEndpointCredentialsError::InternalServerError(ref cause) => cause,
RotateIngestEndpointCredentialsError::NotFound(ref cause) => cause,
RotateIngestEndpointCredentialsError::ServiceUnavailable(ref cause) => cause,
RotateIngestEndpointCredentialsError::TooManyRequests(ref cause) => cause,
RotateIngestEndpointCredentialsError::UnprocessableEntity(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
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 {}
}
}
#[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),
_ => {}
}
}
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 {}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UpdateChannelError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateChannelError {
fn description(&self) -> &str {
match *self {
UpdateChannelError::Forbidden(ref cause) => cause,
UpdateChannelError::InternalServerError(ref cause) => cause,
UpdateChannelError::NotFound(ref cause) => cause,
UpdateChannelError::ServiceUnavailable(ref cause) => cause,
UpdateChannelError::TooManyRequests(ref cause) => cause,
UpdateChannelError::UnprocessableEntity(ref cause) => cause,
}
}
}
#[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),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UpdateOriginEndpointError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateOriginEndpointError {
fn description(&self) -> &str {
match *self {
UpdateOriginEndpointError::Forbidden(ref cause) => cause,
UpdateOriginEndpointError::InternalServerError(ref cause) => cause,
UpdateOriginEndpointError::NotFound(ref cause) => cause,
UpdateOriginEndpointError::ServiceUnavailable(ref cause) => cause,
UpdateOriginEndpointError::TooManyRequests(ref cause) => cause,
UpdateOriginEndpointError::UnprocessableEntity(ref cause) => cause,
}
}
}
pub trait MediaPackage {
fn create_channel(
&self,
input: CreateChannelRequest,
) -> RusotoFuture<CreateChannelResponse, CreateChannelError>;
fn create_origin_endpoint(
&self,
input: CreateOriginEndpointRequest,
) -> RusotoFuture<CreateOriginEndpointResponse, CreateOriginEndpointError>;
fn delete_channel(
&self,
input: DeleteChannelRequest,
) -> RusotoFuture<DeleteChannelResponse, DeleteChannelError>;
fn delete_origin_endpoint(
&self,
input: DeleteOriginEndpointRequest,
) -> RusotoFuture<DeleteOriginEndpointResponse, DeleteOriginEndpointError>;
fn describe_channel(
&self,
input: DescribeChannelRequest,
) -> RusotoFuture<DescribeChannelResponse, DescribeChannelError>;
fn describe_origin_endpoint(
&self,
input: DescribeOriginEndpointRequest,
) -> RusotoFuture<DescribeOriginEndpointResponse, DescribeOriginEndpointError>;
fn list_channels(
&self,
input: ListChannelsRequest,
) -> RusotoFuture<ListChannelsResponse, ListChannelsError>;
fn list_origin_endpoints(
&self,
input: ListOriginEndpointsRequest,
) -> RusotoFuture<ListOriginEndpointsResponse, ListOriginEndpointsError>;
fn list_tags_for_resource(
&self,
input: ListTagsForResourceRequest,
) -> RusotoFuture<ListTagsForResourceResponse, ListTagsForResourceError>;
fn rotate_channel_credentials(
&self,
input: RotateChannelCredentialsRequest,
) -> RusotoFuture<RotateChannelCredentialsResponse, RotateChannelCredentialsError>;
fn rotate_ingest_endpoint_credentials(
&self,
input: RotateIngestEndpointCredentialsRequest,
) -> RusotoFuture<RotateIngestEndpointCredentialsResponse, RotateIngestEndpointCredentialsError>;
fn tag_resource(&self, input: TagResourceRequest) -> RusotoFuture<(), TagResourceError>;
fn untag_resource(&self, input: UntagResourceRequest) -> RusotoFuture<(), UntagResourceError>;
fn update_channel(
&self,
input: UpdateChannelRequest,
) -> RusotoFuture<UpdateChannelResponse, UpdateChannelError>;
fn update_origin_endpoint(
&self,
input: UpdateOriginEndpointRequest,
) -> RusotoFuture<UpdateOriginEndpointResponse, 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,
P::Future: Send,
D: DispatchSignedRequest + Send + Sync + 'static,
D::Future: Send,
{
MediaPackageClient {
client: Client::new_with(credentials_provider, request_dispatcher),
region,
}
}
}
impl MediaPackage for MediaPackageClient {
fn create_channel(
&self,
input: CreateChannelRequest,
) -> RusotoFuture<CreateChannelResponse, 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);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<CreateChannelResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateChannelError::from_response(response))),
)
}
})
}
fn create_origin_endpoint(
&self,
input: CreateOriginEndpointRequest,
) -> RusotoFuture<CreateOriginEndpointResponse, 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);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<CreateOriginEndpointResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(CreateOriginEndpointError::from_response(response))
}),
)
}
})
}
fn delete_channel(
&self,
input: DeleteChannelRequest,
) -> RusotoFuture<DeleteChannelResponse, 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());
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 202 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<DeleteChannelResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteChannelError::from_response(response))),
)
}
})
}
fn delete_origin_endpoint(
&self,
input: DeleteOriginEndpointRequest,
) -> RusotoFuture<DeleteOriginEndpointResponse, 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());
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 202 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<DeleteOriginEndpointResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(DeleteOriginEndpointError::from_response(response))
}),
)
}
})
}
fn describe_channel(
&self,
input: DescribeChannelRequest,
) -> RusotoFuture<DescribeChannelResponse, 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());
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeChannelResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DescribeChannelError::from_response(response))),
)
}
})
}
fn describe_origin_endpoint(
&self,
input: DescribeOriginEndpointRequest,
) -> RusotoFuture<DescribeOriginEndpointResponse, 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());
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeOriginEndpointResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(DescribeOriginEndpointError::from_response(response))
}),
)
}
})
}
fn list_channels(
&self,
input: ListChannelsRequest,
) -> RusotoFuture<ListChannelsResponse, 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);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<ListChannelsResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListChannelsError::from_response(response))),
)
}
})
}
fn list_origin_endpoints(
&self,
input: ListOriginEndpointsRequest,
) -> RusotoFuture<ListOriginEndpointsResponse, 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);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<ListOriginEndpointsResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(ListOriginEndpointsError::from_response(response))
}),
)
}
})
}
fn list_tags_for_resource(
&self,
input: ListTagsForResourceRequest,
) -> RusotoFuture<ListTagsForResourceResponse, 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());
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<ListTagsForResourceResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(ListTagsForResourceError::from_response(response))
}),
)
}
})
}
fn rotate_channel_credentials(
&self,
input: RotateChannelCredentialsRequest,
) -> RusotoFuture<RotateChannelCredentialsResponse, 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());
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<RotateChannelCredentialsResponse, _>()?;
Ok(result)
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(RotateChannelCredentialsError::from_response(response))
}))
}
})
}
fn rotate_ingest_endpoint_credentials(
&self,
input: RotateIngestEndpointCredentialsRequest,
) -> RusotoFuture<RotateIngestEndpointCredentialsResponse, 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());
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<RotateIngestEndpointCredentialsResponse, _>()?;
Ok(result)
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(RotateIngestEndpointCredentialsError::from_response(
response,
))
}))
}
})
}
fn tag_resource(&self, input: TagResourceRequest) -> RusotoFuture<(), 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);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 204 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = ::std::mem::drop(response);
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(TagResourceError::from_response(response))),
)
}
})
}
fn untag_resource(&self, input: UntagResourceRequest) -> RusotoFuture<(), 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);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 204 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = ::std::mem::drop(response);
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(UntagResourceError::from_response(response))),
)
}
})
}
fn update_channel(
&self,
input: UpdateChannelRequest,
) -> RusotoFuture<UpdateChannelResponse, 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);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<UpdateChannelResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(UpdateChannelError::from_response(response))),
)
}
})
}
fn update_origin_endpoint(
&self,
input: UpdateOriginEndpointRequest,
) -> RusotoFuture<UpdateOriginEndpointResponse, 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);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<UpdateOriginEndpointResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(UpdateOriginEndpointError::from_response(response))
}),
)
}
})
}
}