redis_cloud/handlers/
fixed.rs1use crate::{Result, client::CloudClient};
4use serde_json::Value;
5
6pub struct CloudFixedHandler {
8 client: CloudClient,
9}
10
11impl CloudFixedHandler {
12 pub fn new(client: CloudClient) -> Self {
13 CloudFixedHandler { client }
14 }
15
16 pub async fn list(&self) -> Result<Value> {
18 self.client.get("/fixed/subscriptions").await
19 }
20
21 pub async fn get(&self, subscription_id: u32) -> Result<Value> {
23 self.client
24 .get(&format!("/fixed/subscriptions/{}", subscription_id))
25 .await
26 }
27
28 pub async fn databases(&self, subscription_id: u32) -> Result<Value> {
30 self.client
31 .get(&format!(
32 "/fixed/subscriptions/{}/databases",
33 subscription_id
34 ))
35 .await
36 }
37
38 pub async fn database(&self, subscription_id: u32, database_id: u32) -> Result<Value> {
40 self.client
41 .get(&format!(
42 "/fixed/subscriptions/{}/databases/{}",
43 subscription_id, database_id
44 ))
45 .await
46 }
47
48 pub async fn plans(&self) -> Result<Value> {
50 self.client.get("/fixed/plans").await
51 }
52
53 pub async fn plan(&self, plan_id: u32) -> Result<Value> {
55 self.client.get(&format!("/fixed/plans/{}", plan_id)).await
56 }
57}