cortexa-aws-appstream 0.1.0

AWS APPSTREAM service client and resource abstractions for cortexa-rust-aws.
Documentation
//! Typed AWS APPSTREAM service client.

use cortexa_aws_core::client::{AwsClient, AwsServiceClient};
use cortexa_aws_core::transport::{DefaultRuntime, Runtime};

/// Service client for AWS APPSTREAM.
#[derive(Debug)]
#[repr(transparent)]
pub struct AppstreamClient<R: Runtime = DefaultRuntime> {
    client: AwsClient<R>,
}

impl<R: Runtime> Clone for AppstreamClient<R> {
    fn clone(&self) -> Self {
        Self {
            client: self.client.clone(),
        }
    }
}

impl<R: Runtime> AppstreamClient<R> {
    /// Creates a new `AppstreamClient` wrapping `client`.
    #[must_use]
    pub const fn new(client: AwsClient<R>) -> Self {
        Self { client }
    }

    /// Returns the underlying [`AwsClient`].
    #[must_use]
    pub const fn client(&self) -> &AwsClient<R> {
        &self.client
    }

    /// Returns the auto-generated typed operations client covering all Smithy 2.0 operations.
    #[must_use]
    pub fn ops(&self) -> crate::generated::GeneratedClient<R> {
        crate::generated::GeneratedClient::new(self.client.clone())
    }
}

impl<R: Runtime> AwsServiceClient<R> for AppstreamClient<R> {
    const SERVICE_NAME: &'static str = "appstream";

    fn from_client(client: AwsClient<R>) -> Self {
        Self::new(client)
    }

    fn client(&self) -> &AwsClient<R> {
        &self.client
    }
}