Skip to main content

cortexa_aws_appstream/
client.rs

1//! Typed AWS APPSTREAM service client.
2
3use cortexa_aws_core::client::{AwsClient, AwsServiceClient};
4use cortexa_aws_core::transport::{DefaultRuntime, Runtime};
5
6/// Service client for AWS APPSTREAM.
7#[derive(Debug)]
8#[repr(transparent)]
9pub struct AppstreamClient<R: Runtime = DefaultRuntime> {
10    client: AwsClient<R>,
11}
12
13impl<R: Runtime> Clone for AppstreamClient<R> {
14    fn clone(&self) -> Self {
15        Self {
16            client: self.client.clone(),
17        }
18    }
19}
20
21impl<R: Runtime> AppstreamClient<R> {
22    /// Creates a new `AppstreamClient` wrapping `client`.
23    #[must_use]
24    pub const fn new(client: AwsClient<R>) -> Self {
25        Self { client }
26    }
27
28    /// Returns the underlying [`AwsClient`].
29    #[must_use]
30    pub const fn client(&self) -> &AwsClient<R> {
31        &self.client
32    }
33
34    /// Returns the auto-generated typed operations client covering all Smithy 2.0 operations.
35    #[must_use]
36    pub fn ops(&self) -> crate::generated::GeneratedClient<R> {
37        crate::generated::GeneratedClient::new(self.client.clone())
38    }
39}
40
41impl<R: Runtime> AwsServiceClient<R> for AppstreamClient<R> {
42    const SERVICE_NAME: &'static str = "appstream";
43
44    fn from_client(client: AwsClient<R>) -> Self {
45        Self::new(client)
46    }
47
48    fn client(&self) -> &AwsClient<R> {
49        &self.client
50    }
51}