Skip to main content

aws_lite_rs/api/
redshift.rs

1//! Amazon Redshift API client.
2//!
3//! Thin wrapper over generated ops. All URL construction and HTTP methods
4//! are in `ops::redshift::RedshiftOps`. This layer adds:
5//! - Ergonomic method signatures
6
7use crate::{
8    AwsHttpClient, Result,
9    ops::redshift::RedshiftOps,
10    types::redshift::{
11        DeleteClusterRequest, DeleteClusterResponse, DescribeClustersRequest,
12        DescribeClustersResponse, PauseClusterRequest, PauseClusterResponse, ResizeClusterRequest,
13        ResizeClusterResponse, ResumeClusterRequest, ResumeClusterResponse,
14    },
15};
16
17/// Client for the Amazon Redshift API
18pub struct RedshiftClient<'a> {
19    ops: RedshiftOps<'a>,
20}
21
22impl<'a> RedshiftClient<'a> {
23    /// Create a new Amazon Redshift API client
24    pub(crate) fn new(client: &'a AwsHttpClient) -> Self {
25        Self {
26            ops: RedshiftOps::new(client),
27        }
28    }
29
30    /// Returns properties of provisioned clusters including general cluster properties, cluster database properties, maintenanc
31    pub async fn describe_clusters(
32        &self,
33        body: &DescribeClustersRequest,
34    ) -> Result<DescribeClustersResponse> {
35        self.ops.describe_clusters(body).await
36    }
37
38    /// Pauses a cluster.
39    pub async fn pause_cluster(&self, body: &PauseClusterRequest) -> Result<PauseClusterResponse> {
40        self.ops.pause_cluster(body).await
41    }
42
43    /// Resumes a paused cluster.
44    pub async fn resume_cluster(
45        &self,
46        body: &ResumeClusterRequest,
47    ) -> Result<ResumeClusterResponse> {
48        self.ops.resume_cluster(body).await
49    }
50
51    /// Changes the size of the cluster. You can change the cluster's type, or change the number or type of nodes. The default b
52    pub async fn resize_cluster(
53        &self,
54        body: &ResizeClusterRequest,
55    ) -> Result<ResizeClusterResponse> {
56        self.ops.resize_cluster(body).await
57    }
58
59    /// Deletes a previously provisioned cluster without its final snapshot being created. A successful response from the web se
60    pub async fn delete_cluster(
61        &self,
62        body: &DeleteClusterRequest,
63    ) -> Result<DeleteClusterResponse> {
64        self.ops.delete_cluster(body).await
65    }
66}