1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// GENERATED by scripts/generate-sdk-resources.mjs from sdks/manifest.json.
// Do not edit by hand — change the route, run `pnpm sdk:sync`, and regenerate.
use crate::error::MisarDevError;
use crate::transport::Transport;
use crate::transport::body_or_empty;
use reqwest::Method;
use serde_json::Value;
/// The `billing` resource — 5 operation(s).
///
/// Plans, plan comparison, subscription, checkout, plan switch.
///
/// Reached through [`crate::MisarDev::billing`].
#[derive(Debug, Clone, Copy)]
pub struct BillingResource<'a> {
pub(crate) t: &'a Transport,
}
impl BillingResource<'_> {
/// `POST /billing/checkout`
///
/// misardev:method billing.checkout
pub async fn checkout(self, body: Option<Value>) -> Result<Value, MisarDevError> {
self.t.request(Method::POST, "/billing/checkout", "", Some(body_or_empty(body))).await
}
/// `GET /billing/comparison`
///
/// Public — works without a key, but the client still sends it.
///
/// misardev:method billing.comparison
pub async fn comparison(self) -> Result<Value, MisarDevError> {
self.t.request(Method::GET, "/billing/comparison", "", None).await
}
/// `GET /billing/plans`
///
/// Public — works without a key, but the client still sends it.
///
/// misardev:method billing.plans
pub async fn plans(self) -> Result<Value, MisarDevError> {
self.t.request(Method::GET, "/billing/plans", "", None).await
}
/// `GET /billing/subscription`
///
/// misardev:method billing.subscription
pub async fn subscription(self) -> Result<Value, MisarDevError> {
self.t.request(Method::GET, "/billing/subscription", "", None).await
}
/// `POST /billing/switch-plan`
///
/// misardev:method billing.switchPlan
pub async fn switch_plan(self, body: Option<Value>) -> Result<Value, MisarDevError> {
self.t.request(Method::POST, "/billing/switch-plan", "", Some(body_or_empty(body))).await
}
}