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::proto;
use rusoto_core::signature::SignedRequest;
#[allow(unused_imports)]
use serde::{Deserialize, Serialize};
use serde_json;
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ChannelInfo {
#[serde(rename = "ChannelARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub channel_arn: Option<String>,
#[serde(rename = "ChannelName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub channel_name: Option<String>,
#[serde(rename = "ChannelStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub channel_status: Option<String>,
#[serde(rename = "ChannelType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub channel_type: Option<String>,
#[serde(rename = "CreationTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_time: Option<f64>,
#[serde(rename = "SingleMasterConfiguration")]
#[serde(skip_serializing_if = "Option::is_none")]
pub single_master_configuration: Option<SingleMasterConfiguration>,
#[serde(rename = "Version")]
#[serde(skip_serializing_if = "Option::is_none")]
pub version: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct ChannelNameCondition {
#[serde(rename = "ComparisonOperator")]
#[serde(skip_serializing_if = "Option::is_none")]
pub comparison_operator: Option<String>,
#[serde(rename = "ComparisonValue")]
#[serde(skip_serializing_if = "Option::is_none")]
pub comparison_value: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct CreateSignalingChannelInput {
#[serde(rename = "ChannelName")]
pub channel_name: String,
#[serde(rename = "ChannelType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub channel_type: Option<String>,
#[serde(rename = "SingleMasterConfiguration")]
#[serde(skip_serializing_if = "Option::is_none")]
pub single_master_configuration: Option<SingleMasterConfiguration>,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct CreateSignalingChannelOutput {
#[serde(rename = "ChannelARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub channel_arn: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct CreateStreamInput {
#[serde(rename = "DataRetentionInHours")]
#[serde(skip_serializing_if = "Option::is_none")]
pub data_retention_in_hours: Option<i64>,
#[serde(rename = "DeviceName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub device_name: Option<String>,
#[serde(rename = "KmsKeyId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub kms_key_id: Option<String>,
#[serde(rename = "MediaType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub media_type: Option<String>,
#[serde(rename = "StreamName")]
pub stream_name: String,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<::std::collections::HashMap<String, String>>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct CreateStreamOutput {
#[serde(rename = "StreamARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub stream_arn: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DeleteSignalingChannelInput {
#[serde(rename = "ChannelARN")]
pub channel_arn: String,
#[serde(rename = "CurrentVersion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub current_version: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DeleteSignalingChannelOutput {}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DeleteStreamInput {
#[serde(rename = "CurrentVersion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub current_version: Option<String>,
#[serde(rename = "StreamARN")]
pub stream_arn: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DeleteStreamOutput {}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DescribeSignalingChannelInput {
#[serde(rename = "ChannelARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub channel_arn: Option<String>,
#[serde(rename = "ChannelName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub channel_name: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DescribeSignalingChannelOutput {
#[serde(rename = "ChannelInfo")]
#[serde(skip_serializing_if = "Option::is_none")]
pub channel_info: Option<ChannelInfo>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DescribeStreamInput {
#[serde(rename = "StreamARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub stream_arn: Option<String>,
#[serde(rename = "StreamName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub stream_name: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DescribeStreamOutput {
#[serde(rename = "StreamInfo")]
#[serde(skip_serializing_if = "Option::is_none")]
pub stream_info: Option<StreamInfo>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct GetDataEndpointInput {
#[serde(rename = "APIName")]
pub api_name: String,
#[serde(rename = "StreamARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub stream_arn: Option<String>,
#[serde(rename = "StreamName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub stream_name: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct GetDataEndpointOutput {
#[serde(rename = "DataEndpoint")]
#[serde(skip_serializing_if = "Option::is_none")]
pub data_endpoint: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct GetSignalingChannelEndpointInput {
#[serde(rename = "ChannelARN")]
pub channel_arn: String,
#[serde(rename = "SingleMasterChannelEndpointConfiguration")]
#[serde(skip_serializing_if = "Option::is_none")]
pub single_master_channel_endpoint_configuration:
Option<SingleMasterChannelEndpointConfiguration>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct GetSignalingChannelEndpointOutput {
#[serde(rename = "ResourceEndpointList")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_endpoint_list: Option<Vec<ResourceEndpointListItem>>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct ListSignalingChannelsInput {
#[serde(rename = "ChannelNameCondition")]
#[serde(skip_serializing_if = "Option::is_none")]
pub channel_name_condition: Option<ChannelNameCondition>,
#[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(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ListSignalingChannelsOutput {
#[serde(rename = "ChannelInfoList")]
#[serde(skip_serializing_if = "Option::is_none")]
pub channel_info_list: Option<Vec<ChannelInfo>>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct ListStreamsInput {
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "StreamNameCondition")]
#[serde(skip_serializing_if = "Option::is_none")]
pub stream_name_condition: Option<StreamNameCondition>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ListStreamsOutput {
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "StreamInfoList")]
#[serde(skip_serializing_if = "Option::is_none")]
pub stream_info_list: Option<Vec<StreamInfo>>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct ListTagsForResourceInput {
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "ResourceARN")]
pub resource_arn: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ListTagsForResourceOutput {
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<::std::collections::HashMap<String, String>>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct ListTagsForStreamInput {
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "StreamARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub stream_arn: Option<String>,
#[serde(rename = "StreamName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub stream_name: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ListTagsForStreamOutput {
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<::std::collections::HashMap<String, String>>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ResourceEndpointListItem {
#[serde(rename = "Protocol")]
#[serde(skip_serializing_if = "Option::is_none")]
pub protocol: Option<String>,
#[serde(rename = "ResourceEndpoint")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_endpoint: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct SingleMasterChannelEndpointConfiguration {
#[serde(rename = "Protocols")]
#[serde(skip_serializing_if = "Option::is_none")]
pub protocols: Option<Vec<String>>,
#[serde(rename = "Role")]
#[serde(skip_serializing_if = "Option::is_none")]
pub role: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct SingleMasterConfiguration {
#[serde(rename = "MessageTtlSeconds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub message_ttl_seconds: Option<i64>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct StreamInfo {
#[serde(rename = "CreationTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_time: Option<f64>,
#[serde(rename = "DataRetentionInHours")]
#[serde(skip_serializing_if = "Option::is_none")]
pub data_retention_in_hours: Option<i64>,
#[serde(rename = "DeviceName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub device_name: Option<String>,
#[serde(rename = "KmsKeyId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub kms_key_id: Option<String>,
#[serde(rename = "MediaType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub media_type: Option<String>,
#[serde(rename = "Status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
#[serde(rename = "StreamARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub stream_arn: Option<String>,
#[serde(rename = "StreamName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub stream_name: Option<String>,
#[serde(rename = "Version")]
#[serde(skip_serializing_if = "Option::is_none")]
pub version: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct StreamNameCondition {
#[serde(rename = "ComparisonOperator")]
#[serde(skip_serializing_if = "Option::is_none")]
pub comparison_operator: Option<String>,
#[serde(rename = "ComparisonValue")]
#[serde(skip_serializing_if = "Option::is_none")]
pub comparison_value: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct Tag {
#[serde(rename = "Key")]
pub key: String,
#[serde(rename = "Value")]
pub value: String,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct TagResourceInput {
#[serde(rename = "ResourceARN")]
pub resource_arn: String,
#[serde(rename = "Tags")]
pub tags: Vec<Tag>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct TagResourceOutput {}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct TagStreamInput {
#[serde(rename = "StreamARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub stream_arn: Option<String>,
#[serde(rename = "StreamName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub stream_name: Option<String>,
#[serde(rename = "Tags")]
pub tags: ::std::collections::HashMap<String, String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct TagStreamOutput {}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct UntagResourceInput {
#[serde(rename = "ResourceARN")]
pub resource_arn: String,
#[serde(rename = "TagKeyList")]
pub tag_key_list: Vec<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct UntagResourceOutput {}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct UntagStreamInput {
#[serde(rename = "StreamARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub stream_arn: Option<String>,
#[serde(rename = "StreamName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub stream_name: Option<String>,
#[serde(rename = "TagKeyList")]
pub tag_key_list: Vec<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct UntagStreamOutput {}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct UpdateDataRetentionInput {
#[serde(rename = "CurrentVersion")]
pub current_version: String,
#[serde(rename = "DataRetentionChangeInHours")]
pub data_retention_change_in_hours: i64,
#[serde(rename = "Operation")]
pub operation: String,
#[serde(rename = "StreamARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub stream_arn: Option<String>,
#[serde(rename = "StreamName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub stream_name: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct UpdateDataRetentionOutput {}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct UpdateSignalingChannelInput {
#[serde(rename = "ChannelARN")]
pub channel_arn: String,
#[serde(rename = "CurrentVersion")]
pub current_version: String,
#[serde(rename = "SingleMasterConfiguration")]
#[serde(skip_serializing_if = "Option::is_none")]
pub single_master_configuration: Option<SingleMasterConfiguration>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct UpdateSignalingChannelOutput {}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct UpdateStreamInput {
#[serde(rename = "CurrentVersion")]
pub current_version: String,
#[serde(rename = "DeviceName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub device_name: Option<String>,
#[serde(rename = "MediaType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub media_type: Option<String>,
#[serde(rename = "StreamARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub stream_arn: Option<String>,
#[serde(rename = "StreamName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub stream_name: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct UpdateStreamOutput {}
#[derive(Debug, PartialEq)]
pub enum CreateSignalingChannelError {
AccessDenied(String),
AccountChannelLimitExceeded(String),
ClientLimitExceeded(String),
InvalidArgument(String),
ResourceInUse(String),
TagsPerResourceExceededLimit(String),
}
impl CreateSignalingChannelError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateSignalingChannelError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(CreateSignalingChannelError::AccessDenied(err.msg))
}
"AccountChannelLimitExceededException" => {
return RusotoError::Service(
CreateSignalingChannelError::AccountChannelLimitExceeded(err.msg),
)
}
"ClientLimitExceededException" => {
return RusotoError::Service(CreateSignalingChannelError::ClientLimitExceeded(
err.msg,
))
}
"InvalidArgumentException" => {
return RusotoError::Service(CreateSignalingChannelError::InvalidArgument(
err.msg,
))
}
"ResourceInUseException" => {
return RusotoError::Service(CreateSignalingChannelError::ResourceInUse(
err.msg,
))
}
"TagsPerResourceExceededLimitException" => {
return RusotoError::Service(
CreateSignalingChannelError::TagsPerResourceExceededLimit(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for CreateSignalingChannelError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
CreateSignalingChannelError::AccessDenied(ref cause) => write!(f, "{}", cause),
CreateSignalingChannelError::AccountChannelLimitExceeded(ref cause) => {
write!(f, "{}", cause)
}
CreateSignalingChannelError::ClientLimitExceeded(ref cause) => write!(f, "{}", cause),
CreateSignalingChannelError::InvalidArgument(ref cause) => write!(f, "{}", cause),
CreateSignalingChannelError::ResourceInUse(ref cause) => write!(f, "{}", cause),
CreateSignalingChannelError::TagsPerResourceExceededLimit(ref cause) => {
write!(f, "{}", cause)
}
}
}
}
impl Error for CreateSignalingChannelError {}
#[derive(Debug, PartialEq)]
pub enum CreateStreamError {
AccountStreamLimitExceeded(String),
ClientLimitExceeded(String),
DeviceStreamLimitExceeded(String),
InvalidArgument(String),
InvalidDevice(String),
ResourceInUse(String),
TagsPerResourceExceededLimit(String),
}
impl CreateStreamError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateStreamError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"AccountStreamLimitExceededException" => {
return RusotoError::Service(CreateStreamError::AccountStreamLimitExceeded(
err.msg,
))
}
"ClientLimitExceededException" => {
return RusotoError::Service(CreateStreamError::ClientLimitExceeded(err.msg))
}
"DeviceStreamLimitExceededException" => {
return RusotoError::Service(CreateStreamError::DeviceStreamLimitExceeded(
err.msg,
))
}
"InvalidArgumentException" => {
return RusotoError::Service(CreateStreamError::InvalidArgument(err.msg))
}
"InvalidDeviceException" => {
return RusotoError::Service(CreateStreamError::InvalidDevice(err.msg))
}
"ResourceInUseException" => {
return RusotoError::Service(CreateStreamError::ResourceInUse(err.msg))
}
"TagsPerResourceExceededLimitException" => {
return RusotoError::Service(CreateStreamError::TagsPerResourceExceededLimit(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for CreateStreamError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
CreateStreamError::AccountStreamLimitExceeded(ref cause) => write!(f, "{}", cause),
CreateStreamError::ClientLimitExceeded(ref cause) => write!(f, "{}", cause),
CreateStreamError::DeviceStreamLimitExceeded(ref cause) => write!(f, "{}", cause),
CreateStreamError::InvalidArgument(ref cause) => write!(f, "{}", cause),
CreateStreamError::InvalidDevice(ref cause) => write!(f, "{}", cause),
CreateStreamError::ResourceInUse(ref cause) => write!(f, "{}", cause),
CreateStreamError::TagsPerResourceExceededLimit(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for CreateStreamError {}
#[derive(Debug, PartialEq)]
pub enum DeleteSignalingChannelError {
AccessDenied(String),
ClientLimitExceeded(String),
InvalidArgument(String),
ResourceInUse(String),
ResourceNotFound(String),
VersionMismatch(String),
}
impl DeleteSignalingChannelError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteSignalingChannelError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(DeleteSignalingChannelError::AccessDenied(err.msg))
}
"ClientLimitExceededException" => {
return RusotoError::Service(DeleteSignalingChannelError::ClientLimitExceeded(
err.msg,
))
}
"InvalidArgumentException" => {
return RusotoError::Service(DeleteSignalingChannelError::InvalidArgument(
err.msg,
))
}
"ResourceInUseException" => {
return RusotoError::Service(DeleteSignalingChannelError::ResourceInUse(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(DeleteSignalingChannelError::ResourceNotFound(
err.msg,
))
}
"VersionMismatchException" => {
return RusotoError::Service(DeleteSignalingChannelError::VersionMismatch(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DeleteSignalingChannelError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DeleteSignalingChannelError::AccessDenied(ref cause) => write!(f, "{}", cause),
DeleteSignalingChannelError::ClientLimitExceeded(ref cause) => write!(f, "{}", cause),
DeleteSignalingChannelError::InvalidArgument(ref cause) => write!(f, "{}", cause),
DeleteSignalingChannelError::ResourceInUse(ref cause) => write!(f, "{}", cause),
DeleteSignalingChannelError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
DeleteSignalingChannelError::VersionMismatch(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for DeleteSignalingChannelError {}
#[derive(Debug, PartialEq)]
pub enum DeleteStreamError {
ClientLimitExceeded(String),
InvalidArgument(String),
NotAuthorized(String),
ResourceInUse(String),
ResourceNotFound(String),
VersionMismatch(String),
}
impl DeleteStreamError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteStreamError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"ClientLimitExceededException" => {
return RusotoError::Service(DeleteStreamError::ClientLimitExceeded(err.msg))
}
"InvalidArgumentException" => {
return RusotoError::Service(DeleteStreamError::InvalidArgument(err.msg))
}
"NotAuthorizedException" => {
return RusotoError::Service(DeleteStreamError::NotAuthorized(err.msg))
}
"ResourceInUseException" => {
return RusotoError::Service(DeleteStreamError::ResourceInUse(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(DeleteStreamError::ResourceNotFound(err.msg))
}
"VersionMismatchException" => {
return RusotoError::Service(DeleteStreamError::VersionMismatch(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DeleteStreamError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DeleteStreamError::ClientLimitExceeded(ref cause) => write!(f, "{}", cause),
DeleteStreamError::InvalidArgument(ref cause) => write!(f, "{}", cause),
DeleteStreamError::NotAuthorized(ref cause) => write!(f, "{}", cause),
DeleteStreamError::ResourceInUse(ref cause) => write!(f, "{}", cause),
DeleteStreamError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
DeleteStreamError::VersionMismatch(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for DeleteStreamError {}
#[derive(Debug, PartialEq)]
pub enum DescribeSignalingChannelError {
AccessDenied(String),
ClientLimitExceeded(String),
InvalidArgument(String),
ResourceNotFound(String),
}
impl DescribeSignalingChannelError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeSignalingChannelError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(DescribeSignalingChannelError::AccessDenied(
err.msg,
))
}
"ClientLimitExceededException" => {
return RusotoError::Service(
DescribeSignalingChannelError::ClientLimitExceeded(err.msg),
)
}
"InvalidArgumentException" => {
return RusotoError::Service(DescribeSignalingChannelError::InvalidArgument(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(DescribeSignalingChannelError::ResourceNotFound(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DescribeSignalingChannelError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DescribeSignalingChannelError::AccessDenied(ref cause) => write!(f, "{}", cause),
DescribeSignalingChannelError::ClientLimitExceeded(ref cause) => write!(f, "{}", cause),
DescribeSignalingChannelError::InvalidArgument(ref cause) => write!(f, "{}", cause),
DescribeSignalingChannelError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for DescribeSignalingChannelError {}
#[derive(Debug, PartialEq)]
pub enum DescribeStreamError {
ClientLimitExceeded(String),
InvalidArgument(String),
NotAuthorized(String),
ResourceNotFound(String),
}
impl DescribeStreamError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeStreamError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"ClientLimitExceededException" => {
return RusotoError::Service(DescribeStreamError::ClientLimitExceeded(err.msg))
}
"InvalidArgumentException" => {
return RusotoError::Service(DescribeStreamError::InvalidArgument(err.msg))
}
"NotAuthorizedException" => {
return RusotoError::Service(DescribeStreamError::NotAuthorized(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(DescribeStreamError::ResourceNotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DescribeStreamError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DescribeStreamError::ClientLimitExceeded(ref cause) => write!(f, "{}", cause),
DescribeStreamError::InvalidArgument(ref cause) => write!(f, "{}", cause),
DescribeStreamError::NotAuthorized(ref cause) => write!(f, "{}", cause),
DescribeStreamError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for DescribeStreamError {}
#[derive(Debug, PartialEq)]
pub enum GetDataEndpointError {
ClientLimitExceeded(String),
InvalidArgument(String),
NotAuthorized(String),
ResourceNotFound(String),
}
impl GetDataEndpointError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetDataEndpointError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"ClientLimitExceededException" => {
return RusotoError::Service(GetDataEndpointError::ClientLimitExceeded(err.msg))
}
"InvalidArgumentException" => {
return RusotoError::Service(GetDataEndpointError::InvalidArgument(err.msg))
}
"NotAuthorizedException" => {
return RusotoError::Service(GetDataEndpointError::NotAuthorized(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(GetDataEndpointError::ResourceNotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for GetDataEndpointError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
GetDataEndpointError::ClientLimitExceeded(ref cause) => write!(f, "{}", cause),
GetDataEndpointError::InvalidArgument(ref cause) => write!(f, "{}", cause),
GetDataEndpointError::NotAuthorized(ref cause) => write!(f, "{}", cause),
GetDataEndpointError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for GetDataEndpointError {}
#[derive(Debug, PartialEq)]
pub enum GetSignalingChannelEndpointError {
AccessDenied(String),
ClientLimitExceeded(String),
InvalidArgument(String),
ResourceInUse(String),
ResourceNotFound(String),
}
impl GetSignalingChannelEndpointError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<GetSignalingChannelEndpointError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(GetSignalingChannelEndpointError::AccessDenied(
err.msg,
))
}
"ClientLimitExceededException" => {
return RusotoError::Service(
GetSignalingChannelEndpointError::ClientLimitExceeded(err.msg),
)
}
"InvalidArgumentException" => {
return RusotoError::Service(GetSignalingChannelEndpointError::InvalidArgument(
err.msg,
))
}
"ResourceInUseException" => {
return RusotoError::Service(GetSignalingChannelEndpointError::ResourceInUse(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(
GetSignalingChannelEndpointError::ResourceNotFound(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for GetSignalingChannelEndpointError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
GetSignalingChannelEndpointError::AccessDenied(ref cause) => write!(f, "{}", cause),
GetSignalingChannelEndpointError::ClientLimitExceeded(ref cause) => {
write!(f, "{}", cause)
}
GetSignalingChannelEndpointError::InvalidArgument(ref cause) => write!(f, "{}", cause),
GetSignalingChannelEndpointError::ResourceInUse(ref cause) => write!(f, "{}", cause),
GetSignalingChannelEndpointError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for GetSignalingChannelEndpointError {}
#[derive(Debug, PartialEq)]
pub enum ListSignalingChannelsError {
AccessDenied(String),
ClientLimitExceeded(String),
InvalidArgument(String),
}
impl ListSignalingChannelsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListSignalingChannelsError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(ListSignalingChannelsError::AccessDenied(err.msg))
}
"ClientLimitExceededException" => {
return RusotoError::Service(ListSignalingChannelsError::ClientLimitExceeded(
err.msg,
))
}
"InvalidArgumentException" => {
return RusotoError::Service(ListSignalingChannelsError::InvalidArgument(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for ListSignalingChannelsError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
ListSignalingChannelsError::AccessDenied(ref cause) => write!(f, "{}", cause),
ListSignalingChannelsError::ClientLimitExceeded(ref cause) => write!(f, "{}", cause),
ListSignalingChannelsError::InvalidArgument(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for ListSignalingChannelsError {}
#[derive(Debug, PartialEq)]
pub enum ListStreamsError {
ClientLimitExceeded(String),
InvalidArgument(String),
}
impl ListStreamsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListStreamsError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"ClientLimitExceededException" => {
return RusotoError::Service(ListStreamsError::ClientLimitExceeded(err.msg))
}
"InvalidArgumentException" => {
return RusotoError::Service(ListStreamsError::InvalidArgument(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for ListStreamsError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
ListStreamsError::ClientLimitExceeded(ref cause) => write!(f, "{}", cause),
ListStreamsError::InvalidArgument(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for ListStreamsError {}
#[derive(Debug, PartialEq)]
pub enum ListTagsForResourceError {
AccessDenied(String),
ClientLimitExceeded(String),
InvalidArgument(String),
ResourceNotFound(String),
}
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() {
"AccessDeniedException" => {
return RusotoError::Service(ListTagsForResourceError::AccessDenied(err.msg))
}
"ClientLimitExceededException" => {
return RusotoError::Service(ListTagsForResourceError::ClientLimitExceeded(
err.msg,
))
}
"InvalidArgumentException" => {
return RusotoError::Service(ListTagsForResourceError::InvalidArgument(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(ListTagsForResourceError::ResourceNotFound(
err.msg,
))
}
"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 {
ListTagsForResourceError::AccessDenied(ref cause) => write!(f, "{}", cause),
ListTagsForResourceError::ClientLimitExceeded(ref cause) => write!(f, "{}", cause),
ListTagsForResourceError::InvalidArgument(ref cause) => write!(f, "{}", cause),
ListTagsForResourceError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for ListTagsForResourceError {}
#[derive(Debug, PartialEq)]
pub enum ListTagsForStreamError {
ClientLimitExceeded(String),
InvalidArgument(String),
InvalidResourceFormat(String),
NotAuthorized(String),
ResourceNotFound(String),
}
impl ListTagsForStreamError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListTagsForStreamError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"ClientLimitExceededException" => {
return RusotoError::Service(ListTagsForStreamError::ClientLimitExceeded(
err.msg,
))
}
"InvalidArgumentException" => {
return RusotoError::Service(ListTagsForStreamError::InvalidArgument(err.msg))
}
"InvalidResourceFormatException" => {
return RusotoError::Service(ListTagsForStreamError::InvalidResourceFormat(
err.msg,
))
}
"NotAuthorizedException" => {
return RusotoError::Service(ListTagsForStreamError::NotAuthorized(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(ListTagsForStreamError::ResourceNotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for ListTagsForStreamError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
ListTagsForStreamError::ClientLimitExceeded(ref cause) => write!(f, "{}", cause),
ListTagsForStreamError::InvalidArgument(ref cause) => write!(f, "{}", cause),
ListTagsForStreamError::InvalidResourceFormat(ref cause) => write!(f, "{}", cause),
ListTagsForStreamError::NotAuthorized(ref cause) => write!(f, "{}", cause),
ListTagsForStreamError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for ListTagsForStreamError {}
#[derive(Debug, PartialEq)]
pub enum TagResourceError {
AccessDenied(String),
ClientLimitExceeded(String),
InvalidArgument(String),
ResourceNotFound(String),
TagsPerResourceExceededLimit(String),
}
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() {
"AccessDeniedException" => {
return RusotoError::Service(TagResourceError::AccessDenied(err.msg))
}
"ClientLimitExceededException" => {
return RusotoError::Service(TagResourceError::ClientLimitExceeded(err.msg))
}
"InvalidArgumentException" => {
return RusotoError::Service(TagResourceError::InvalidArgument(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(TagResourceError::ResourceNotFound(err.msg))
}
"TagsPerResourceExceededLimitException" => {
return RusotoError::Service(TagResourceError::TagsPerResourceExceededLimit(
err.msg,
))
}
"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 {
TagResourceError::AccessDenied(ref cause) => write!(f, "{}", cause),
TagResourceError::ClientLimitExceeded(ref cause) => write!(f, "{}", cause),
TagResourceError::InvalidArgument(ref cause) => write!(f, "{}", cause),
TagResourceError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
TagResourceError::TagsPerResourceExceededLimit(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for TagResourceError {}
#[derive(Debug, PartialEq)]
pub enum TagStreamError {
ClientLimitExceeded(String),
InvalidArgument(String),
InvalidResourceFormat(String),
NotAuthorized(String),
ResourceNotFound(String),
TagsPerResourceExceededLimit(String),
}
impl TagStreamError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<TagStreamError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"ClientLimitExceededException" => {
return RusotoError::Service(TagStreamError::ClientLimitExceeded(err.msg))
}
"InvalidArgumentException" => {
return RusotoError::Service(TagStreamError::InvalidArgument(err.msg))
}
"InvalidResourceFormatException" => {
return RusotoError::Service(TagStreamError::InvalidResourceFormat(err.msg))
}
"NotAuthorizedException" => {
return RusotoError::Service(TagStreamError::NotAuthorized(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(TagStreamError::ResourceNotFound(err.msg))
}
"TagsPerResourceExceededLimitException" => {
return RusotoError::Service(TagStreamError::TagsPerResourceExceededLimit(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for TagStreamError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
TagStreamError::ClientLimitExceeded(ref cause) => write!(f, "{}", cause),
TagStreamError::InvalidArgument(ref cause) => write!(f, "{}", cause),
TagStreamError::InvalidResourceFormat(ref cause) => write!(f, "{}", cause),
TagStreamError::NotAuthorized(ref cause) => write!(f, "{}", cause),
TagStreamError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
TagStreamError::TagsPerResourceExceededLimit(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for TagStreamError {}
#[derive(Debug, PartialEq)]
pub enum UntagResourceError {
AccessDenied(String),
ClientLimitExceeded(String),
InvalidArgument(String),
ResourceNotFound(String),
}
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() {
"AccessDeniedException" => {
return RusotoError::Service(UntagResourceError::AccessDenied(err.msg))
}
"ClientLimitExceededException" => {
return RusotoError::Service(UntagResourceError::ClientLimitExceeded(err.msg))
}
"InvalidArgumentException" => {
return RusotoError::Service(UntagResourceError::InvalidArgument(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(UntagResourceError::ResourceNotFound(err.msg))
}
"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 {
UntagResourceError::AccessDenied(ref cause) => write!(f, "{}", cause),
UntagResourceError::ClientLimitExceeded(ref cause) => write!(f, "{}", cause),
UntagResourceError::InvalidArgument(ref cause) => write!(f, "{}", cause),
UntagResourceError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for UntagResourceError {}
#[derive(Debug, PartialEq)]
pub enum UntagStreamError {
ClientLimitExceeded(String),
InvalidArgument(String),
InvalidResourceFormat(String),
NotAuthorized(String),
ResourceNotFound(String),
}
impl UntagStreamError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UntagStreamError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"ClientLimitExceededException" => {
return RusotoError::Service(UntagStreamError::ClientLimitExceeded(err.msg))
}
"InvalidArgumentException" => {
return RusotoError::Service(UntagStreamError::InvalidArgument(err.msg))
}
"InvalidResourceFormatException" => {
return RusotoError::Service(UntagStreamError::InvalidResourceFormat(err.msg))
}
"NotAuthorizedException" => {
return RusotoError::Service(UntagStreamError::NotAuthorized(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(UntagStreamError::ResourceNotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for UntagStreamError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
UntagStreamError::ClientLimitExceeded(ref cause) => write!(f, "{}", cause),
UntagStreamError::InvalidArgument(ref cause) => write!(f, "{}", cause),
UntagStreamError::InvalidResourceFormat(ref cause) => write!(f, "{}", cause),
UntagStreamError::NotAuthorized(ref cause) => write!(f, "{}", cause),
UntagStreamError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for UntagStreamError {}
#[derive(Debug, PartialEq)]
pub enum UpdateDataRetentionError {
ClientLimitExceeded(String),
InvalidArgument(String),
NotAuthorized(String),
ResourceInUse(String),
ResourceNotFound(String),
VersionMismatch(String),
}
impl UpdateDataRetentionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateDataRetentionError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"ClientLimitExceededException" => {
return RusotoError::Service(UpdateDataRetentionError::ClientLimitExceeded(
err.msg,
))
}
"InvalidArgumentException" => {
return RusotoError::Service(UpdateDataRetentionError::InvalidArgument(err.msg))
}
"NotAuthorizedException" => {
return RusotoError::Service(UpdateDataRetentionError::NotAuthorized(err.msg))
}
"ResourceInUseException" => {
return RusotoError::Service(UpdateDataRetentionError::ResourceInUse(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(UpdateDataRetentionError::ResourceNotFound(
err.msg,
))
}
"VersionMismatchException" => {
return RusotoError::Service(UpdateDataRetentionError::VersionMismatch(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for UpdateDataRetentionError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
UpdateDataRetentionError::ClientLimitExceeded(ref cause) => write!(f, "{}", cause),
UpdateDataRetentionError::InvalidArgument(ref cause) => write!(f, "{}", cause),
UpdateDataRetentionError::NotAuthorized(ref cause) => write!(f, "{}", cause),
UpdateDataRetentionError::ResourceInUse(ref cause) => write!(f, "{}", cause),
UpdateDataRetentionError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
UpdateDataRetentionError::VersionMismatch(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for UpdateDataRetentionError {}
#[derive(Debug, PartialEq)]
pub enum UpdateSignalingChannelError {
AccessDenied(String),
ClientLimitExceeded(String),
InvalidArgument(String),
ResourceInUse(String),
ResourceNotFound(String),
VersionMismatch(String),
}
impl UpdateSignalingChannelError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateSignalingChannelError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(UpdateSignalingChannelError::AccessDenied(err.msg))
}
"ClientLimitExceededException" => {
return RusotoError::Service(UpdateSignalingChannelError::ClientLimitExceeded(
err.msg,
))
}
"InvalidArgumentException" => {
return RusotoError::Service(UpdateSignalingChannelError::InvalidArgument(
err.msg,
))
}
"ResourceInUseException" => {
return RusotoError::Service(UpdateSignalingChannelError::ResourceInUse(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(UpdateSignalingChannelError::ResourceNotFound(
err.msg,
))
}
"VersionMismatchException" => {
return RusotoError::Service(UpdateSignalingChannelError::VersionMismatch(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for UpdateSignalingChannelError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
UpdateSignalingChannelError::AccessDenied(ref cause) => write!(f, "{}", cause),
UpdateSignalingChannelError::ClientLimitExceeded(ref cause) => write!(f, "{}", cause),
UpdateSignalingChannelError::InvalidArgument(ref cause) => write!(f, "{}", cause),
UpdateSignalingChannelError::ResourceInUse(ref cause) => write!(f, "{}", cause),
UpdateSignalingChannelError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
UpdateSignalingChannelError::VersionMismatch(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for UpdateSignalingChannelError {}
#[derive(Debug, PartialEq)]
pub enum UpdateStreamError {
ClientLimitExceeded(String),
InvalidArgument(String),
NotAuthorized(String),
ResourceInUse(String),
ResourceNotFound(String),
VersionMismatch(String),
}
impl UpdateStreamError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateStreamError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"ClientLimitExceededException" => {
return RusotoError::Service(UpdateStreamError::ClientLimitExceeded(err.msg))
}
"InvalidArgumentException" => {
return RusotoError::Service(UpdateStreamError::InvalidArgument(err.msg))
}
"NotAuthorizedException" => {
return RusotoError::Service(UpdateStreamError::NotAuthorized(err.msg))
}
"ResourceInUseException" => {
return RusotoError::Service(UpdateStreamError::ResourceInUse(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(UpdateStreamError::ResourceNotFound(err.msg))
}
"VersionMismatchException" => {
return RusotoError::Service(UpdateStreamError::VersionMismatch(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for UpdateStreamError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
UpdateStreamError::ClientLimitExceeded(ref cause) => write!(f, "{}", cause),
UpdateStreamError::InvalidArgument(ref cause) => write!(f, "{}", cause),
UpdateStreamError::NotAuthorized(ref cause) => write!(f, "{}", cause),
UpdateStreamError::ResourceInUse(ref cause) => write!(f, "{}", cause),
UpdateStreamError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
UpdateStreamError::VersionMismatch(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for UpdateStreamError {}
#[async_trait]
pub trait KinesisVideo {
async fn create_signaling_channel(
&self,
input: CreateSignalingChannelInput,
) -> Result<CreateSignalingChannelOutput, RusotoError<CreateSignalingChannelError>>;
async fn create_stream(
&self,
input: CreateStreamInput,
) -> Result<CreateStreamOutput, RusotoError<CreateStreamError>>;
async fn delete_signaling_channel(
&self,
input: DeleteSignalingChannelInput,
) -> Result<DeleteSignalingChannelOutput, RusotoError<DeleteSignalingChannelError>>;
async fn delete_stream(
&self,
input: DeleteStreamInput,
) -> Result<DeleteStreamOutput, RusotoError<DeleteStreamError>>;
async fn describe_signaling_channel(
&self,
input: DescribeSignalingChannelInput,
) -> Result<DescribeSignalingChannelOutput, RusotoError<DescribeSignalingChannelError>>;
async fn describe_stream(
&self,
input: DescribeStreamInput,
) -> Result<DescribeStreamOutput, RusotoError<DescribeStreamError>>;
async fn get_data_endpoint(
&self,
input: GetDataEndpointInput,
) -> Result<GetDataEndpointOutput, RusotoError<GetDataEndpointError>>;
async fn get_signaling_channel_endpoint(
&self,
input: GetSignalingChannelEndpointInput,
) -> Result<GetSignalingChannelEndpointOutput, RusotoError<GetSignalingChannelEndpointError>>;
async fn list_signaling_channels(
&self,
input: ListSignalingChannelsInput,
) -> Result<ListSignalingChannelsOutput, RusotoError<ListSignalingChannelsError>>;
async fn list_streams(
&self,
input: ListStreamsInput,
) -> Result<ListStreamsOutput, RusotoError<ListStreamsError>>;
async fn list_tags_for_resource(
&self,
input: ListTagsForResourceInput,
) -> Result<ListTagsForResourceOutput, RusotoError<ListTagsForResourceError>>;
async fn list_tags_for_stream(
&self,
input: ListTagsForStreamInput,
) -> Result<ListTagsForStreamOutput, RusotoError<ListTagsForStreamError>>;
async fn tag_resource(
&self,
input: TagResourceInput,
) -> Result<TagResourceOutput, RusotoError<TagResourceError>>;
async fn tag_stream(
&self,
input: TagStreamInput,
) -> Result<TagStreamOutput, RusotoError<TagStreamError>>;
async fn untag_resource(
&self,
input: UntagResourceInput,
) -> Result<UntagResourceOutput, RusotoError<UntagResourceError>>;
async fn untag_stream(
&self,
input: UntagStreamInput,
) -> Result<UntagStreamOutput, RusotoError<UntagStreamError>>;
async fn update_data_retention(
&self,
input: UpdateDataRetentionInput,
) -> Result<UpdateDataRetentionOutput, RusotoError<UpdateDataRetentionError>>;
async fn update_signaling_channel(
&self,
input: UpdateSignalingChannelInput,
) -> Result<UpdateSignalingChannelOutput, RusotoError<UpdateSignalingChannelError>>;
async fn update_stream(
&self,
input: UpdateStreamInput,
) -> Result<UpdateStreamOutput, RusotoError<UpdateStreamError>>;
}
#[derive(Clone)]
pub struct KinesisVideoClient {
client: Client,
region: region::Region,
}
impl KinesisVideoClient {
pub fn new(region: region::Region) -> KinesisVideoClient {
KinesisVideoClient {
client: Client::shared(),
region,
}
}
pub fn new_with<P, D>(
request_dispatcher: D,
credentials_provider: P,
region: region::Region,
) -> KinesisVideoClient
where
P: ProvideAwsCredentials + Send + Sync + 'static,
D: DispatchSignedRequest + Send + Sync + 'static,
{
KinesisVideoClient {
client: Client::new_with(credentials_provider, request_dispatcher),
region,
}
}
pub fn new_with_client(client: Client, region: region::Region) -> KinesisVideoClient {
KinesisVideoClient { client, region }
}
}
#[async_trait]
impl KinesisVideo for KinesisVideoClient {
#[allow(unused_mut)]
async fn create_signaling_channel(
&self,
input: CreateSignalingChannelInput,
) -> Result<CreateSignalingChannelOutput, RusotoError<CreateSignalingChannelError>> {
let request_uri = "/createSignalingChannel";
let mut request = SignedRequest::new("POST", "kinesisvideo", &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.is_success() {
let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<CreateSignalingChannelOutput, _>()?;
Ok(result)
} else {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
Err(CreateSignalingChannelError::from_response(response))
}
}
#[allow(unused_mut)]
async fn create_stream(
&self,
input: CreateStreamInput,
) -> Result<CreateStreamOutput, RusotoError<CreateStreamError>> {
let request_uri = "/createStream";
let mut request = SignedRequest::new("POST", "kinesisvideo", &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.is_success() {
let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<CreateStreamOutput, _>()?;
Ok(result)
} else {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
Err(CreateStreamError::from_response(response))
}
}
#[allow(unused_mut)]
async fn delete_signaling_channel(
&self,
input: DeleteSignalingChannelInput,
) -> Result<DeleteSignalingChannelOutput, RusotoError<DeleteSignalingChannelError>> {
let request_uri = "/deleteSignalingChannel";
let mut request = SignedRequest::new("POST", "kinesisvideo", &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.is_success() {
let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<DeleteSignalingChannelOutput, _>()?;
Ok(result)
} else {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
Err(DeleteSignalingChannelError::from_response(response))
}
}
#[allow(unused_mut)]
async fn delete_stream(
&self,
input: DeleteStreamInput,
) -> Result<DeleteStreamOutput, RusotoError<DeleteStreamError>> {
let request_uri = "/deleteStream";
let mut request = SignedRequest::new("POST", "kinesisvideo", &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.is_success() {
let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<DeleteStreamOutput, _>()?;
Ok(result)
} else {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
Err(DeleteStreamError::from_response(response))
}
}
#[allow(unused_mut)]
async fn describe_signaling_channel(
&self,
input: DescribeSignalingChannelInput,
) -> Result<DescribeSignalingChannelOutput, RusotoError<DescribeSignalingChannelError>> {
let request_uri = "/describeSignalingChannel";
let mut request = SignedRequest::new("POST", "kinesisvideo", &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.is_success() {
let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeSignalingChannelOutput, _>()?;
Ok(result)
} else {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
Err(DescribeSignalingChannelError::from_response(response))
}
}
#[allow(unused_mut)]
async fn describe_stream(
&self,
input: DescribeStreamInput,
) -> Result<DescribeStreamOutput, RusotoError<DescribeStreamError>> {
let request_uri = "/describeStream";
let mut request = SignedRequest::new("POST", "kinesisvideo", &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.is_success() {
let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeStreamOutput, _>()?;
Ok(result)
} else {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
Err(DescribeStreamError::from_response(response))
}
}
#[allow(unused_mut)]
async fn get_data_endpoint(
&self,
input: GetDataEndpointInput,
) -> Result<GetDataEndpointOutput, RusotoError<GetDataEndpointError>> {
let request_uri = "/getDataEndpoint";
let mut request = SignedRequest::new("POST", "kinesisvideo", &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.is_success() {
let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<GetDataEndpointOutput, _>()?;
Ok(result)
} else {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
Err(GetDataEndpointError::from_response(response))
}
}
#[allow(unused_mut)]
async fn get_signaling_channel_endpoint(
&self,
input: GetSignalingChannelEndpointInput,
) -> Result<GetSignalingChannelEndpointOutput, RusotoError<GetSignalingChannelEndpointError>>
{
let request_uri = "/getSignalingChannelEndpoint";
let mut request = SignedRequest::new("POST", "kinesisvideo", &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.is_success() {
let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<GetSignalingChannelEndpointOutput, _>()?;
Ok(result)
} else {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
Err(GetSignalingChannelEndpointError::from_response(response))
}
}
#[allow(unused_mut)]
async fn list_signaling_channels(
&self,
input: ListSignalingChannelsInput,
) -> Result<ListSignalingChannelsOutput, RusotoError<ListSignalingChannelsError>> {
let request_uri = "/listSignalingChannels";
let mut request = SignedRequest::new("POST", "kinesisvideo", &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.is_success() {
let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<ListSignalingChannelsOutput, _>()?;
Ok(result)
} else {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
Err(ListSignalingChannelsError::from_response(response))
}
}
#[allow(unused_mut)]
async fn list_streams(
&self,
input: ListStreamsInput,
) -> Result<ListStreamsOutput, RusotoError<ListStreamsError>> {
let request_uri = "/listStreams";
let mut request = SignedRequest::new("POST", "kinesisvideo", &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.is_success() {
let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<ListStreamsOutput, _>()?;
Ok(result)
} else {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
Err(ListStreamsError::from_response(response))
}
}
#[allow(unused_mut)]
async fn list_tags_for_resource(
&self,
input: ListTagsForResourceInput,
) -> Result<ListTagsForResourceOutput, RusotoError<ListTagsForResourceError>> {
let request_uri = "/ListTagsForResource";
let mut request = SignedRequest::new("POST", "kinesisvideo", &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.is_success() {
let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<ListTagsForResourceOutput, _>()?;
Ok(result)
} else {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
Err(ListTagsForResourceError::from_response(response))
}
}
#[allow(unused_mut)]
async fn list_tags_for_stream(
&self,
input: ListTagsForStreamInput,
) -> Result<ListTagsForStreamOutput, RusotoError<ListTagsForStreamError>> {
let request_uri = "/listTagsForStream";
let mut request = SignedRequest::new("POST", "kinesisvideo", &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.is_success() {
let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<ListTagsForStreamOutput, _>()?;
Ok(result)
} else {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
Err(ListTagsForStreamError::from_response(response))
}
}
#[allow(unused_mut)]
async fn tag_resource(
&self,
input: TagResourceInput,
) -> Result<TagResourceOutput, RusotoError<TagResourceError>> {
let request_uri = "/TagResource";
let mut request = SignedRequest::new("POST", "kinesisvideo", &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.is_success() {
let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<TagResourceOutput, _>()?;
Ok(result)
} else {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
Err(TagResourceError::from_response(response))
}
}
#[allow(unused_mut)]
async fn tag_stream(
&self,
input: TagStreamInput,
) -> Result<TagStreamOutput, RusotoError<TagStreamError>> {
let request_uri = "/tagStream";
let mut request = SignedRequest::new("POST", "kinesisvideo", &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.is_success() {
let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
let result =
proto::json::ResponsePayload::new(&response).deserialize::<TagStreamOutput, _>()?;
Ok(result)
} else {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
Err(TagStreamError::from_response(response))
}
}
#[allow(unused_mut)]
async fn untag_resource(
&self,
input: UntagResourceInput,
) -> Result<UntagResourceOutput, RusotoError<UntagResourceError>> {
let request_uri = "/UntagResource";
let mut request = SignedRequest::new("POST", "kinesisvideo", &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.is_success() {
let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<UntagResourceOutput, _>()?;
Ok(result)
} else {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
Err(UntagResourceError::from_response(response))
}
}
#[allow(unused_mut)]
async fn untag_stream(
&self,
input: UntagStreamInput,
) -> Result<UntagStreamOutput, RusotoError<UntagStreamError>> {
let request_uri = "/untagStream";
let mut request = SignedRequest::new("POST", "kinesisvideo", &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.is_success() {
let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<UntagStreamOutput, _>()?;
Ok(result)
} else {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
Err(UntagStreamError::from_response(response))
}
}
#[allow(unused_mut)]
async fn update_data_retention(
&self,
input: UpdateDataRetentionInput,
) -> Result<UpdateDataRetentionOutput, RusotoError<UpdateDataRetentionError>> {
let request_uri = "/updateDataRetention";
let mut request = SignedRequest::new("POST", "kinesisvideo", &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.is_success() {
let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<UpdateDataRetentionOutput, _>()?;
Ok(result)
} else {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
Err(UpdateDataRetentionError::from_response(response))
}
}
#[allow(unused_mut)]
async fn update_signaling_channel(
&self,
input: UpdateSignalingChannelInput,
) -> Result<UpdateSignalingChannelOutput, RusotoError<UpdateSignalingChannelError>> {
let request_uri = "/updateSignalingChannel";
let mut request = SignedRequest::new("POST", "kinesisvideo", &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.is_success() {
let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<UpdateSignalingChannelOutput, _>()?;
Ok(result)
} else {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
Err(UpdateSignalingChannelError::from_response(response))
}
}
#[allow(unused_mut)]
async fn update_stream(
&self,
input: UpdateStreamInput,
) -> Result<UpdateStreamOutput, RusotoError<UpdateStreamError>> {
let request_uri = "/updateStream";
let mut request = SignedRequest::new("POST", "kinesisvideo", &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.is_success() {
let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<UpdateStreamOutput, _>()?;
Ok(result)
} else {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
Err(UpdateStreamError::from_response(response))
}
}
}