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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
use serde_json::json;
use crate::model::*;
use crate::FluentRequest;
use serde::{Serialize, Deserialize};
use httpclient::InMemoryResponseExt;
use crate::StripeClient;
/**Create this with the associated client method.

That method takes required values as arguments. Set optional values using builder methods on this struct.*/
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GetSubscriptionsRequest {
    pub automatic_tax: Option<AutomaticTaxFilterParams>,
    pub collection_method: Option<String>,
    pub created: Option<serde_json::Value>,
    pub current_period_end: Option<serde_json::Value>,
    pub current_period_start: Option<serde_json::Value>,
    pub customer: Option<String>,
    pub ending_before: Option<String>,
    pub expand: Option<Vec<String>>,
    pub limit: Option<i64>,
    pub price: Option<String>,
    pub starting_after: Option<String>,
    pub status: Option<String>,
    pub test_clock: Option<String>,
}
impl GetSubscriptionsRequest {}
impl FluentRequest<'_, GetSubscriptionsRequest> {
    pub fn automatic_tax(mut self, automatic_tax: AutomaticTaxFilterParams) -> Self {
        self.params.automatic_tax = Some(automatic_tax);
        self
    }
    pub fn collection_method(mut self, collection_method: &str) -> Self {
        self.params.collection_method = Some(collection_method.to_owned());
        self
    }
    pub fn created(mut self, created: serde_json::Value) -> Self {
        self.params.created = Some(created);
        self
    }
    pub fn current_period_end(mut self, current_period_end: serde_json::Value) -> Self {
        self.params.current_period_end = Some(current_period_end);
        self
    }
    pub fn current_period_start(
        mut self,
        current_period_start: serde_json::Value,
    ) -> Self {
        self.params.current_period_start = Some(current_period_start);
        self
    }
    pub fn customer(mut self, customer: &str) -> Self {
        self.params.customer = Some(customer.to_owned());
        self
    }
    pub fn ending_before(mut self, ending_before: &str) -> Self {
        self.params.ending_before = Some(ending_before.to_owned());
        self
    }
    pub fn expand(mut self, expand: impl IntoIterator<Item = impl AsRef<str>>) -> Self {
        self
            .params
            .expand = Some(expand.into_iter().map(|s| s.as_ref().to_owned()).collect());
        self
    }
    pub fn limit(mut self, limit: i64) -> Self {
        self.params.limit = Some(limit);
        self
    }
    pub fn price(mut self, price: &str) -> Self {
        self.params.price = Some(price.to_owned());
        self
    }
    pub fn starting_after(mut self, starting_after: &str) -> Self {
        self.params.starting_after = Some(starting_after.to_owned());
        self
    }
    pub fn status(mut self, status: &str) -> Self {
        self.params.status = Some(status.to_owned());
        self
    }
    pub fn test_clock(mut self, test_clock: &str) -> Self {
        self.params.test_clock = Some(test_clock.to_owned());
        self
    }
}
impl<'a> ::std::future::IntoFuture for FluentRequest<'a, GetSubscriptionsRequest> {
    type Output = httpclient::InMemoryResult<SubscriptionsSubscriptionList>;
    type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>;
    fn into_future(self) -> Self::IntoFuture {
        Box::pin(async {
            let url = "/v1/subscriptions";
            let mut r = self.client.client.get(url);
            r = r.set_query(self.params);
            r = self.client.authenticate(r);
            let res = r.await?;
            res.json().map_err(Into::into)
        })
    }
}