square_api_client/models/
list_subscription_events_parameters.rs1#[derive(Clone, Debug, Default)]
5pub struct ListSubscriptionEventsParameters {
6 pub cursor: Option<String>,
13 pub limit: Option<i32>,
15}
16
17impl ListSubscriptionEventsParameters {
18 pub fn to_query_string(&self) -> String {
19 self.to_string()
20 }
21}
22
23impl From<ListSubscriptionEventsParameters> for String {
24 fn from(list_subscription_events_parameters: ListSubscriptionEventsParameters) -> Self {
25 list_subscription_events_parameters.to_string()
26 }
27}
28
29impl ToString for ListSubscriptionEventsParameters {
30 fn to_string(&self) -> String {
31 let mut params = Vec::new();
32
33 if let Some(cursor) = &self.cursor {
34 params.push(format!("cursor={}", cursor));
35 }
36
37 if let Some(limit) = &self.limit {
38 params.push(format!("limit={}", limit));
39 }
40
41 if params.is_empty() {
42 String::new()
43 } else {
44 format!("?{}", params.join("&"))
45 }
46 }
47}