#[derive(Debug)]
pub(crate) struct Handle<C, M, R = aws_smithy_client::retry::Standard> {
pub(crate) client: aws_smithy_client::Client<C, M, R>,
pub(crate) conf: crate::Config,
}
#[derive(std::fmt::Debug)]
pub struct Client<C, M, R = aws_smithy_client::retry::Standard> {
handle: std::sync::Arc<Handle<C, M, R>>,
}
impl<C, M, R> std::clone::Clone for Client<C, M, R> {
fn clone(&self) -> Self {
Self {
handle: self.handle.clone(),
}
}
}
#[doc(inline)]
pub use aws_smithy_client::Builder;
impl<C, M, R> From<aws_smithy_client::Client<C, M, R>> for Client<C, M, R> {
fn from(client: aws_smithy_client::Client<C, M, R>) -> Self {
Self::with_config(client, crate::Config::builder().build())
}
}
impl<C, M, R> Client<C, M, R> {
pub fn with_config(client: aws_smithy_client::Client<C, M, R>, conf: crate::Config) -> Self {
Self {
handle: std::sync::Arc::new(Handle { client, conf }),
}
}
pub fn conf(&self) -> &crate::Config {
&self.handle.conf
}
}
impl<C, M, R> Client<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
pub fn get_direct_thread(&self) -> fluent_builders::GetDirectThread<C, M, R> {
fluent_builders::GetDirectThread::new(self.handle.clone())
}
pub fn get_thread_history(&self) -> fluent_builders::GetThreadHistory<C, M, R> {
fluent_builders::GetThreadHistory::new(self.handle.clone())
}
pub fn get_thread_topic(&self) -> fluent_builders::GetThreadTopic<C, M, R> {
fluent_builders::GetThreadTopic::new(self.handle.clone())
}
pub fn send_chat_message(&self) -> fluent_builders::SendChatMessage<C, M, R> {
fluent_builders::SendChatMessage::new(self.handle.clone())
}
pub fn set_thread_read(&self) -> fluent_builders::SetThreadRead<C, M, R> {
fluent_builders::SetThreadRead::new(self.handle.clone())
}
pub fn set_typing_status(&self) -> fluent_builders::SetTypingStatus<C, M, R> {
fluent_builders::SetTypingStatus::new(self.handle.clone())
}
pub fn watch_thread(&self) -> fluent_builders::WatchThread<C, M, R> {
fluent_builders::WatchThread::new(self.handle.clone())
}
}
pub mod fluent_builders {
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct GetDirectThread<C, M, R = aws_smithy_client::retry::Standard> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::get_direct_thread_input::Builder,
}
impl<C, M, R> GetDirectThread<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
pub async fn send(
self,
) -> std::result::Result<
crate::output::GetDirectThreadOutput,
aws_smithy_http::result::SdkError<crate::error::GetDirectThreadError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::GetDirectThreadInputOperationOutputAlias,
crate::output::GetDirectThreadOutput,
crate::error::GetDirectThreadError,
crate::input::GetDirectThreadInputOperationRetryAlias,
>,
{
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
pub fn identity_id(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.identity_id(input.into());
self
}
pub fn set_identity_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_identity_id(input);
self
}
}
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct GetThreadHistory<C, M, R = aws_smithy_client::retry::Standard> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::get_thread_history_input::Builder,
}
impl<C, M, R> GetThreadHistory<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
pub async fn send(
self,
) -> std::result::Result<
crate::output::GetThreadHistoryOutput,
aws_smithy_http::result::SdkError<crate::error::GetThreadHistoryError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::GetThreadHistoryInputOperationOutputAlias,
crate::output::GetThreadHistoryOutput,
crate::error::GetThreadHistoryError,
crate::input::GetThreadHistoryInputOperationRetryAlias,
>,
{
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
pub fn thread_id(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.thread_id(input.into());
self
}
pub fn set_thread_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_thread_id(input);
self
}
pub fn ts(mut self, input: aws_smithy_types::DateTime) -> Self {
self.inner = self.inner.ts(input);
self
}
pub fn set_ts(mut self, input: std::option::Option<aws_smithy_types::DateTime>) -> Self {
self.inner = self.inner.set_ts(input);
self
}
pub fn count(mut self, input: i32) -> Self {
self.inner = self.inner.count(input);
self
}
pub fn set_count(mut self, input: std::option::Option<i32>) -> Self {
self.inner = self.inner.set_count(input);
self
}
pub fn query_direction(mut self, input: crate::model::QueryDirection) -> Self {
self.inner = self.inner.query_direction(input);
self
}
pub fn set_query_direction(
mut self,
input: std::option::Option<crate::model::QueryDirection>,
) -> Self {
self.inner = self.inner.set_query_direction(input);
self
}
}
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct GetThreadTopic<C, M, R = aws_smithy_client::retry::Standard> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::get_thread_topic_input::Builder,
}
impl<C, M, R> GetThreadTopic<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
pub async fn send(
self,
) -> std::result::Result<
crate::output::GetThreadTopicOutput,
aws_smithy_http::result::SdkError<crate::error::GetThreadTopicError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::GetThreadTopicInputOperationOutputAlias,
crate::output::GetThreadTopicOutput,
crate::error::GetThreadTopicError,
crate::input::GetThreadTopicInputOperationRetryAlias,
>,
{
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
pub fn thread_id(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.thread_id(input.into());
self
}
pub fn set_thread_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_thread_id(input);
self
}
}
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct SendChatMessage<C, M, R = aws_smithy_client::retry::Standard> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::send_chat_message_input::Builder,
}
impl<C, M, R> SendChatMessage<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
pub async fn send(
self,
) -> std::result::Result<
crate::output::SendChatMessageOutput,
aws_smithy_http::result::SdkError<crate::error::SendChatMessageError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::SendChatMessageInputOperationOutputAlias,
crate::output::SendChatMessageOutput,
crate::error::SendChatMessageError,
crate::input::SendChatMessageInputOperationRetryAlias,
>,
{
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
pub fn topic(mut self, input: crate::model::SendChatTopic) -> Self {
self.inner = self.inner.topic(input);
self
}
pub fn set_topic(
mut self,
input: std::option::Option<crate::model::SendChatTopic>,
) -> Self {
self.inner = self.inner.set_topic(input);
self
}
pub fn message_body(mut self, input: crate::model::SendMessageBody) -> Self {
self.inner = self.inner.message_body(input);
self
}
pub fn set_message_body(
mut self,
input: std::option::Option<crate::model::SendMessageBody>,
) -> Self {
self.inner = self.inner.set_message_body(input);
self
}
}
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct SetThreadRead<C, M, R = aws_smithy_client::retry::Standard> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::set_thread_read_input::Builder,
}
impl<C, M, R> SetThreadRead<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
pub async fn send(
self,
) -> std::result::Result<
crate::output::SetThreadReadOutput,
aws_smithy_http::result::SdkError<crate::error::SetThreadReadError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::SetThreadReadInputOperationOutputAlias,
crate::output::SetThreadReadOutput,
crate::error::SetThreadReadError,
crate::input::SetThreadReadInputOperationRetryAlias,
>,
{
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
pub fn thread_id(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.thread_id(input.into());
self
}
pub fn set_thread_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_thread_id(input);
self
}
pub fn last_read_ts(mut self, input: aws_smithy_types::DateTime) -> Self {
self.inner = self.inner.last_read_ts(input);
self
}
pub fn set_last_read_ts(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.inner = self.inner.set_last_read_ts(input);
self
}
}
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct SetTypingStatus<C, M, R = aws_smithy_client::retry::Standard> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::set_typing_status_input::Builder,
}
impl<C, M, R> SetTypingStatus<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
pub async fn send(
self,
) -> std::result::Result<
crate::output::SetTypingStatusOutput,
aws_smithy_http::result::SdkError<crate::error::SetTypingStatusError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::SetTypingStatusInputOperationOutputAlias,
crate::output::SetTypingStatusOutput,
crate::error::SetTypingStatusError,
crate::input::SetTypingStatusInputOperationRetryAlias,
>,
{
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
pub fn thread_id(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.thread_id(input.into());
self
}
pub fn set_thread_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_thread_id(input);
self
}
pub fn status(mut self, input: crate::model::ChatTypingStatus) -> Self {
self.inner = self.inner.status(input);
self
}
pub fn set_status(
mut self,
input: std::option::Option<crate::model::ChatTypingStatus>,
) -> Self {
self.inner = self.inner.set_status(input);
self
}
}
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct WatchThread<C, M, R = aws_smithy_client::retry::Standard> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::watch_thread_input::Builder,
}
impl<C, M, R> WatchThread<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
pub async fn send(
self,
) -> std::result::Result<
crate::output::WatchThreadOutput,
aws_smithy_http::result::SdkError<crate::error::WatchThreadError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::WatchThreadInputOperationOutputAlias,
crate::output::WatchThreadOutput,
crate::error::WatchThreadError,
crate::input::WatchThreadInputOperationRetryAlias,
>,
{
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
pub fn thread_id(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.thread_id(input.into());
self
}
pub fn set_thread_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_thread_id(input);
self
}
pub fn watch_index(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.watch_index(input.into());
self
}
pub fn set_watch_index(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_watch_index(input);
self
}
}
}
pub struct ClientWrapper {
pub(crate) client: Client<aws_smithy_client::erase::DynConnector, tower::layer::util::Identity>,
}
impl std::ops::Deref for ClientWrapper {
type Target = Client<aws_smithy_client::erase::DynConnector, tower::layer::util::Identity>;
fn deref(&self) -> &Self::Target {
&self.client
}
}