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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
// ======================================
// This file was automatically generated.
// ======================================
use crate::client::{Client, Response};
use crate::ids::{CountrySpecId};
use crate::params::{Expand, List, Object, Paginable};
use crate::resources::{Currency};
use serde::{Deserialize, Serialize};
/// The resource representing a Stripe "CountrySpec".
///
/// For more details see <https://stripe.com/docs/api/country_specs/object>
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct CountrySpec {
/// Unique identifier for the object.
///
/// Represented as the ISO country code for this country.
pub id: CountrySpecId,
/// The default currency for this country.
///
/// This applies to both payment methods and bank accounts.
pub default_currency: Currency,
/// Currencies that can be accepted in the specific country (for transfers).
pub supported_bank_account_currencies: Vec<String>,
/// Currencies that can be accepted in the specified country (for payments).
pub supported_payment_currencies: Vec<String>,
/// Payment methods available in the specified country.
///
/// You may need to enable some payment methods (e.g., [ACH](https://stripe.com/docs/ach)) on your account before they appear in this list.
/// The `stripe` payment method refers to [charging through your platform](https://stripe.com/docs/connect/destination-charges).
pub supported_payment_methods: Vec<String>,
/// Countries that can accept transfers from the specified country.
pub supported_transfer_countries: Vec<String>,
pub verification_fields: CountrySpecVerificationFields,
}
impl CountrySpec {
/// Lists all Country Spec objects available in the API.
pub fn list(client: &Client, params: &ListCountrySpecs<'_>) -> Response<List<CountrySpec>> {
client.get_query("/country_specs", params)
}
/// Returns a Country Spec for a given Country code.
pub fn retrieve(client: &Client, id: &CountrySpecId, expand: &[&str]) -> Response<CountrySpec> {
client.get_query(&format!("/country_specs/{}", id), Expand { expand })
}
}
impl Object for CountrySpec {
type Id = CountrySpecId;
fn id(&self) -> Self::Id {
self.id.clone()
}
fn object(&self) -> &'static str {
"country_spec"
}
}
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct CountrySpecVerificationFields {
pub company: CountrySpecVerificationFieldDetails,
pub individual: CountrySpecVerificationFieldDetails,
}
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct CountrySpecVerificationFieldDetails {
/// Additional fields which are only required for some users.
pub additional: Vec<String>,
/// Fields which every account must eventually provide.
pub minimum: Vec<String>,
}
/// The parameters for `CountrySpec::list`.
#[derive(Clone, Debug, Serialize, Default)]
pub struct ListCountrySpecs<'a> {
/// A cursor for use in pagination.
///
/// `ending_before` is an object ID that defines your place in the list.
/// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.
#[serde(skip_serializing_if = "Option::is_none")]
pub ending_before: Option<CountrySpecId>,
/// Specifies which fields in the response should be expanded.
#[serde(skip_serializing_if = "Expand::is_empty")]
pub expand: &'a [&'a str],
/// A limit on the number of objects to be returned.
///
/// Limit can range between 1 and 100, and the default is 10.
#[serde(skip_serializing_if = "Option::is_none")]
pub limit: Option<u64>,
/// A cursor for use in pagination.
///
/// `starting_after` is an object ID that defines your place in the list.
/// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.
#[serde(skip_serializing_if = "Option::is_none")]
pub starting_after: Option<CountrySpecId>,
}
impl<'a> ListCountrySpecs<'a> {
pub fn new() -> Self {
ListCountrySpecs {
ending_before: Default::default(),
expand: Default::default(),
limit: Default::default(),
starting_after: Default::default(),
}
}
}
impl Paginable for ListCountrySpecs<'_> {
type O = CountrySpec;
fn set_last(&mut self, item: Self::O) {
self.starting_after = Some(item.id());
}}