use std::fmt::Write;
pub mod get_ice_server_config_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) channel_arn: std::option::Option<std::string::String>,
pub(crate) client_id: std::option::Option<std::string::String>,
pub(crate) service: std::option::Option<crate::model::Service>,
pub(crate) username: std::option::Option<std::string::String>,
}
impl Builder {
pub fn channel_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.channel_arn = Some(input.into());
self
}
pub fn set_channel_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.channel_arn = input;
self
}
pub fn client_id(mut self, input: impl Into<std::string::String>) -> Self {
self.client_id = Some(input.into());
self
}
pub fn set_client_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.client_id = input;
self
}
pub fn service(mut self, input: crate::model::Service) -> Self {
self.service = Some(input);
self
}
pub fn set_service(mut self, input: std::option::Option<crate::model::Service>) -> Self {
self.service = input;
self
}
pub fn username(mut self, input: impl Into<std::string::String>) -> Self {
self.username = Some(input.into());
self
}
pub fn set_username(mut self, input: std::option::Option<std::string::String>) -> Self {
self.username = input;
self
}
pub fn build(
self,
) -> std::result::Result<
crate::input::GetIceServerConfigInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::GetIceServerConfigInput {
channel_arn: self.channel_arn,
client_id: self.client_id,
service: self.service,
username: self.username,
})
}
}
}
#[doc(hidden)]
pub type GetIceServerConfigInputOperationOutputAlias = crate::operation::GetIceServerConfig;
#[doc(hidden)]
pub type GetIceServerConfigInputOperationRetryAlias = aws_http::retry::AwsErrorRetryPolicy;
impl GetIceServerConfigInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::GetIceServerConfig,
aws_http::retry::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
let mut request = {
fn uri_base(
_input: &crate::input::GetIceServerConfigInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
write!(output, "/v1/get-ice-server-config").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetIceServerConfigInput,
builder: http::request::Builder,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_get_ice_server_config(&self)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
aws_endpoint::set_endpoint_resolver(
&mut request.properties_mut(),
_config.endpoint_resolver.clone(),
);
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_provider(
&mut request.properties_mut(),
_config.credentials_provider.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::GetIceServerConfig::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetIceServerConfig",
"kinesisvideosignaling",
));
let op = op.with_retry_policy(aws_http::retry::AwsErrorRetryPolicy::new());
Ok(op)
}
pub fn builder() -> crate::input::get_ice_server_config_input::Builder {
crate::input::get_ice_server_config_input::Builder::default()
}
}
pub mod send_alexa_offer_to_master_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) channel_arn: std::option::Option<std::string::String>,
pub(crate) sender_client_id: std::option::Option<std::string::String>,
pub(crate) message_payload: std::option::Option<std::string::String>,
}
impl Builder {
pub fn channel_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.channel_arn = Some(input.into());
self
}
pub fn set_channel_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.channel_arn = input;
self
}
pub fn sender_client_id(mut self, input: impl Into<std::string::String>) -> Self {
self.sender_client_id = Some(input.into());
self
}
pub fn set_sender_client_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.sender_client_id = input;
self
}
pub fn message_payload(mut self, input: impl Into<std::string::String>) -> Self {
self.message_payload = Some(input.into());
self
}
pub fn set_message_payload(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.message_payload = input;
self
}
pub fn build(
self,
) -> std::result::Result<
crate::input::SendAlexaOfferToMasterInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::SendAlexaOfferToMasterInput {
channel_arn: self.channel_arn,
sender_client_id: self.sender_client_id,
message_payload: self.message_payload,
})
}
}
}
#[doc(hidden)]
pub type SendAlexaOfferToMasterInputOperationOutputAlias = crate::operation::SendAlexaOfferToMaster;
#[doc(hidden)]
pub type SendAlexaOfferToMasterInputOperationRetryAlias = aws_http::retry::AwsErrorRetryPolicy;
impl SendAlexaOfferToMasterInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::SendAlexaOfferToMaster,
aws_http::retry::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
let mut request = {
fn uri_base(
_input: &crate::input::SendAlexaOfferToMasterInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
write!(output, "/v1/send-alexa-offer-to-master")
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::SendAlexaOfferToMasterInput,
builder: http::request::Builder,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_send_alexa_offer_to_master(
&self,
)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
aws_endpoint::set_endpoint_resolver(
&mut request.properties_mut(),
_config.endpoint_resolver.clone(),
);
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_provider(
&mut request.properties_mut(),
_config.credentials_provider.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::SendAlexaOfferToMaster::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"SendAlexaOfferToMaster",
"kinesisvideosignaling",
));
let op = op.with_retry_policy(aws_http::retry::AwsErrorRetryPolicy::new());
Ok(op)
}
pub fn builder() -> crate::input::send_alexa_offer_to_master_input::Builder {
crate::input::send_alexa_offer_to_master_input::Builder::default()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct SendAlexaOfferToMasterInput {
pub channel_arn: std::option::Option<std::string::String>,
pub sender_client_id: std::option::Option<std::string::String>,
pub message_payload: std::option::Option<std::string::String>,
}
impl SendAlexaOfferToMasterInput {
pub fn channel_arn(&self) -> std::option::Option<&str> {
self.channel_arn.as_deref()
}
pub fn sender_client_id(&self) -> std::option::Option<&str> {
self.sender_client_id.as_deref()
}
pub fn message_payload(&self) -> std::option::Option<&str> {
self.message_payload.as_deref()
}
}
impl std::fmt::Debug for SendAlexaOfferToMasterInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("SendAlexaOfferToMasterInput");
formatter.field("channel_arn", &self.channel_arn);
formatter.field("sender_client_id", &self.sender_client_id);
formatter.field("message_payload", &self.message_payload);
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct GetIceServerConfigInput {
pub channel_arn: std::option::Option<std::string::String>,
pub client_id: std::option::Option<std::string::String>,
pub service: std::option::Option<crate::model::Service>,
pub username: std::option::Option<std::string::String>,
}
impl GetIceServerConfigInput {
pub fn channel_arn(&self) -> std::option::Option<&str> {
self.channel_arn.as_deref()
}
pub fn client_id(&self) -> std::option::Option<&str> {
self.client_id.as_deref()
}
pub fn service(&self) -> std::option::Option<&crate::model::Service> {
self.service.as_ref()
}
pub fn username(&self) -> std::option::Option<&str> {
self.username.as_deref()
}
}
impl std::fmt::Debug for GetIceServerConfigInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("GetIceServerConfigInput");
formatter.field("channel_arn", &self.channel_arn);
formatter.field("client_id", &self.client_id);
formatter.field("service", &self.service);
formatter.field("username", &self.username);
formatter.finish()
}
}