Skip to main content

stripe_issuing/issuing_authorization/
requests.rs

1use stripe_client_core::{
2    RequestBuilder, StripeBlockingClient, StripeClient, StripeMethod, StripeRequest,
3};
4
5#[derive(Clone, Eq, PartialEq)]
6#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
7#[derive(serde::Serialize)]
8struct ListIssuingAuthorizationBuilder {
9    #[serde(skip_serializing_if = "Option::is_none")]
10    card: Option<String>,
11    #[serde(skip_serializing_if = "Option::is_none")]
12    cardholder: Option<String>,
13    #[serde(skip_serializing_if = "Option::is_none")]
14    created: Option<stripe_types::RangeQueryTs>,
15    #[serde(skip_serializing_if = "Option::is_none")]
16    ending_before: Option<String>,
17    #[serde(skip_serializing_if = "Option::is_none")]
18    expand: Option<Vec<String>>,
19    #[serde(skip_serializing_if = "Option::is_none")]
20    limit: Option<i64>,
21    #[serde(skip_serializing_if = "Option::is_none")]
22    starting_after: Option<String>,
23    #[serde(skip_serializing_if = "Option::is_none")]
24    status: Option<stripe_shared::IssuingAuthorizationStatus>,
25}
26#[cfg(feature = "redact-generated-debug")]
27impl std::fmt::Debug for ListIssuingAuthorizationBuilder {
28    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29        f.debug_struct("ListIssuingAuthorizationBuilder").finish_non_exhaustive()
30    }
31}
32impl ListIssuingAuthorizationBuilder {
33    fn new() -> Self {
34        Self {
35            card: None,
36            cardholder: None,
37            created: None,
38            ending_before: None,
39            expand: None,
40            limit: None,
41            starting_after: None,
42            status: None,
43        }
44    }
45}
46/// Returns a list of Issuing `Authorization` objects.
47/// The objects are sorted in descending order by creation date, with the most recently created object appearing first.
48#[derive(Clone)]
49#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
50#[derive(serde::Serialize)]
51pub struct ListIssuingAuthorization {
52    inner: ListIssuingAuthorizationBuilder,
53}
54#[cfg(feature = "redact-generated-debug")]
55impl std::fmt::Debug for ListIssuingAuthorization {
56    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
57        f.debug_struct("ListIssuingAuthorization").finish_non_exhaustive()
58    }
59}
60impl ListIssuingAuthorization {
61    /// Construct a new `ListIssuingAuthorization`.
62    pub fn new() -> Self {
63        Self { inner: ListIssuingAuthorizationBuilder::new() }
64    }
65    /// Only return authorizations that belong to the given card.
66    pub fn card(mut self, card: impl Into<String>) -> Self {
67        self.inner.card = Some(card.into());
68        self
69    }
70    /// Only return authorizations that belong to the given cardholder.
71    pub fn cardholder(mut self, cardholder: impl Into<String>) -> Self {
72        self.inner.cardholder = Some(cardholder.into());
73        self
74    }
75    /// Only return authorizations that were created during the given date interval.
76    pub fn created(mut self, created: impl Into<stripe_types::RangeQueryTs>) -> Self {
77        self.inner.created = Some(created.into());
78        self
79    }
80    /// A cursor for use in pagination.
81    /// `ending_before` is an object ID that defines your place in the list.
82    /// 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.
83    pub fn ending_before(mut self, ending_before: impl Into<String>) -> Self {
84        self.inner.ending_before = Some(ending_before.into());
85        self
86    }
87    /// Specifies which fields in the response should be expanded.
88    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
89        self.inner.expand = Some(expand.into());
90        self
91    }
92    /// A limit on the number of objects to be returned.
93    /// Limit can range between 1 and 100, and the default is 10.
94    pub fn limit(mut self, limit: impl Into<i64>) -> Self {
95        self.inner.limit = Some(limit.into());
96        self
97    }
98    /// A cursor for use in pagination.
99    /// `starting_after` is an object ID that defines your place in the list.
100    /// 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.
101    pub fn starting_after(mut self, starting_after: impl Into<String>) -> Self {
102        self.inner.starting_after = Some(starting_after.into());
103        self
104    }
105    /// Only return authorizations with the given status. One of `pending`, `closed`, or `reversed`.
106    pub fn status(mut self, status: impl Into<stripe_shared::IssuingAuthorizationStatus>) -> Self {
107        self.inner.status = Some(status.into());
108        self
109    }
110}
111impl Default for ListIssuingAuthorization {
112    fn default() -> Self {
113        Self::new()
114    }
115}
116impl ListIssuingAuthorization {
117    /// Send the request and return the deserialized response.
118    pub async fn send<C: StripeClient>(
119        &self,
120        client: &C,
121    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
122        self.customize().send(client).await
123    }
124
125    /// Send the request and return the deserialized response, blocking until completion.
126    pub fn send_blocking<C: StripeBlockingClient>(
127        &self,
128        client: &C,
129    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
130        self.customize().send_blocking(client)
131    }
132
133    pub fn paginate(
134        &self,
135    ) -> stripe_client_core::ListPaginator<stripe_types::List<stripe_shared::IssuingAuthorization>>
136    {
137        stripe_client_core::ListPaginator::new_list("/issuing/authorizations", &self.inner)
138    }
139}
140
141impl StripeRequest for ListIssuingAuthorization {
142    type Output = stripe_types::List<stripe_shared::IssuingAuthorization>;
143
144    fn build(&self) -> RequestBuilder {
145        RequestBuilder::new(StripeMethod::Get, "/issuing/authorizations").query(&self.inner)
146    }
147}
148#[derive(Clone, Eq, PartialEq)]
149#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
150#[derive(serde::Serialize)]
151struct RetrieveIssuingAuthorizationBuilder {
152    #[serde(skip_serializing_if = "Option::is_none")]
153    expand: Option<Vec<String>>,
154}
155#[cfg(feature = "redact-generated-debug")]
156impl std::fmt::Debug for RetrieveIssuingAuthorizationBuilder {
157    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
158        f.debug_struct("RetrieveIssuingAuthorizationBuilder").finish_non_exhaustive()
159    }
160}
161impl RetrieveIssuingAuthorizationBuilder {
162    fn new() -> Self {
163        Self { expand: None }
164    }
165}
166/// Retrieves an Issuing `Authorization` object.
167#[derive(Clone)]
168#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
169#[derive(serde::Serialize)]
170pub struct RetrieveIssuingAuthorization {
171    inner: RetrieveIssuingAuthorizationBuilder,
172    authorization: stripe_shared::IssuingAuthorizationId,
173}
174#[cfg(feature = "redact-generated-debug")]
175impl std::fmt::Debug for RetrieveIssuingAuthorization {
176    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
177        f.debug_struct("RetrieveIssuingAuthorization").finish_non_exhaustive()
178    }
179}
180impl RetrieveIssuingAuthorization {
181    /// Construct a new `RetrieveIssuingAuthorization`.
182    pub fn new(authorization: impl Into<stripe_shared::IssuingAuthorizationId>) -> Self {
183        Self {
184            authorization: authorization.into(),
185            inner: RetrieveIssuingAuthorizationBuilder::new(),
186        }
187    }
188    /// Specifies which fields in the response should be expanded.
189    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
190        self.inner.expand = Some(expand.into());
191        self
192    }
193}
194impl RetrieveIssuingAuthorization {
195    /// Send the request and return the deserialized response.
196    pub async fn send<C: StripeClient>(
197        &self,
198        client: &C,
199    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
200        self.customize().send(client).await
201    }
202
203    /// Send the request and return the deserialized response, blocking until completion.
204    pub fn send_blocking<C: StripeBlockingClient>(
205        &self,
206        client: &C,
207    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
208        self.customize().send_blocking(client)
209    }
210}
211
212impl StripeRequest for RetrieveIssuingAuthorization {
213    type Output = stripe_shared::IssuingAuthorization;
214
215    fn build(&self) -> RequestBuilder {
216        let authorization = &self.authorization;
217        RequestBuilder::new(StripeMethod::Get, format!("/issuing/authorizations/{authorization}"))
218            .query(&self.inner)
219    }
220}
221#[derive(Clone)]
222#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
223#[derive(serde::Serialize)]
224struct UpdateIssuingAuthorizationBuilder {
225    #[serde(skip_serializing_if = "Option::is_none")]
226    expand: Option<Vec<String>>,
227    #[serde(skip_serializing_if = "Option::is_none")]
228    metadata: Option<std::collections::HashMap<String, String>>,
229}
230#[cfg(feature = "redact-generated-debug")]
231impl std::fmt::Debug for UpdateIssuingAuthorizationBuilder {
232    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
233        f.debug_struct("UpdateIssuingAuthorizationBuilder").finish_non_exhaustive()
234    }
235}
236impl UpdateIssuingAuthorizationBuilder {
237    fn new() -> Self {
238        Self { expand: None, metadata: None }
239    }
240}
241/// Updates the specified Issuing `Authorization` object by setting the values of the parameters passed.
242/// Any parameters not provided will be left unchanged.
243#[derive(Clone)]
244#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
245#[derive(serde::Serialize)]
246pub struct UpdateIssuingAuthorization {
247    inner: UpdateIssuingAuthorizationBuilder,
248    authorization: stripe_shared::IssuingAuthorizationId,
249}
250#[cfg(feature = "redact-generated-debug")]
251impl std::fmt::Debug for UpdateIssuingAuthorization {
252    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
253        f.debug_struct("UpdateIssuingAuthorization").finish_non_exhaustive()
254    }
255}
256impl UpdateIssuingAuthorization {
257    /// Construct a new `UpdateIssuingAuthorization`.
258    pub fn new(authorization: impl Into<stripe_shared::IssuingAuthorizationId>) -> Self {
259        Self {
260            authorization: authorization.into(),
261            inner: UpdateIssuingAuthorizationBuilder::new(),
262        }
263    }
264    /// Specifies which fields in the response should be expanded.
265    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
266        self.inner.expand = Some(expand.into());
267        self
268    }
269    /// Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object.
270    /// This can be useful for storing additional information about the object in a structured format.
271    /// Individual keys can be unset by posting an empty value to them.
272    /// All keys can be unset by posting an empty value to `metadata`.
273    pub fn metadata(
274        mut self,
275        metadata: impl Into<std::collections::HashMap<String, String>>,
276    ) -> Self {
277        self.inner.metadata = Some(metadata.into());
278        self
279    }
280}
281impl UpdateIssuingAuthorization {
282    /// Send the request and return the deserialized response.
283    pub async fn send<C: StripeClient>(
284        &self,
285        client: &C,
286    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
287        self.customize().send(client).await
288    }
289
290    /// Send the request and return the deserialized response, blocking until completion.
291    pub fn send_blocking<C: StripeBlockingClient>(
292        &self,
293        client: &C,
294    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
295        self.customize().send_blocking(client)
296    }
297}
298
299impl StripeRequest for UpdateIssuingAuthorization {
300    type Output = stripe_shared::IssuingAuthorization;
301
302    fn build(&self) -> RequestBuilder {
303        let authorization = &self.authorization;
304        RequestBuilder::new(StripeMethod::Post, format!("/issuing/authorizations/{authorization}"))
305            .form(&self.inner)
306    }
307}
308#[derive(Clone)]
309#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
310#[derive(serde::Serialize)]
311struct ApproveIssuingAuthorizationBuilder {
312    #[serde(skip_serializing_if = "Option::is_none")]
313    amount: Option<i64>,
314    #[serde(skip_serializing_if = "Option::is_none")]
315    expand: Option<Vec<String>>,
316    #[serde(skip_serializing_if = "Option::is_none")]
317    metadata: Option<std::collections::HashMap<String, String>>,
318}
319#[cfg(feature = "redact-generated-debug")]
320impl std::fmt::Debug for ApproveIssuingAuthorizationBuilder {
321    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
322        f.debug_struct("ApproveIssuingAuthorizationBuilder").finish_non_exhaustive()
323    }
324}
325impl ApproveIssuingAuthorizationBuilder {
326    fn new() -> Self {
327        Self { amount: None, expand: None, metadata: None }
328    }
329}
330/// \[Deprecated\] Approves a pending Issuing `Authorization` object.
331/// This request should be made within the timeout window of the [real-time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow.
332///
333/// This method is deprecated.
334/// Instead, [respond directly to the webhook request to approve an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling).
335#[derive(Clone)]
336#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
337#[derive(serde::Serialize)]
338pub struct ApproveIssuingAuthorization {
339    inner: ApproveIssuingAuthorizationBuilder,
340    authorization: stripe_shared::IssuingAuthorizationId,
341}
342#[cfg(feature = "redact-generated-debug")]
343impl std::fmt::Debug for ApproveIssuingAuthorization {
344    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
345        f.debug_struct("ApproveIssuingAuthorization").finish_non_exhaustive()
346    }
347}
348impl ApproveIssuingAuthorization {
349    /// Construct a new `ApproveIssuingAuthorization`.
350    pub fn new(authorization: impl Into<stripe_shared::IssuingAuthorizationId>) -> Self {
351        Self {
352            authorization: authorization.into(),
353            inner: ApproveIssuingAuthorizationBuilder::new(),
354        }
355    }
356    /// If the authorization's `pending_request.is_amount_controllable` property is `true`, you may provide this value to control how much to hold for the authorization.
357    /// Must be positive (use [`decline`](https://docs.stripe.com/api/issuing/authorizations/decline) to decline an authorization request).
358    pub fn amount(mut self, amount: impl Into<i64>) -> Self {
359        self.inner.amount = Some(amount.into());
360        self
361    }
362    /// Specifies which fields in the response should be expanded.
363    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
364        self.inner.expand = Some(expand.into());
365        self
366    }
367    /// Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object.
368    /// This can be useful for storing additional information about the object in a structured format.
369    /// Individual keys can be unset by posting an empty value to them.
370    /// All keys can be unset by posting an empty value to `metadata`.
371    pub fn metadata(
372        mut self,
373        metadata: impl Into<std::collections::HashMap<String, String>>,
374    ) -> Self {
375        self.inner.metadata = Some(metadata.into());
376        self
377    }
378}
379impl ApproveIssuingAuthorization {
380    /// Send the request and return the deserialized response.
381    pub async fn send<C: StripeClient>(
382        &self,
383        client: &C,
384    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
385        self.customize().send(client).await
386    }
387
388    /// Send the request and return the deserialized response, blocking until completion.
389    pub fn send_blocking<C: StripeBlockingClient>(
390        &self,
391        client: &C,
392    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
393        self.customize().send_blocking(client)
394    }
395}
396
397impl StripeRequest for ApproveIssuingAuthorization {
398    type Output = stripe_shared::IssuingAuthorization;
399
400    fn build(&self) -> RequestBuilder {
401        let authorization = &self.authorization;
402        RequestBuilder::new(
403            StripeMethod::Post,
404            format!("/issuing/authorizations/{authorization}/approve"),
405        )
406        .form(&self.inner)
407    }
408}
409#[derive(Clone)]
410#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
411#[derive(serde::Serialize)]
412struct DeclineIssuingAuthorizationBuilder {
413    #[serde(skip_serializing_if = "Option::is_none")]
414    expand: Option<Vec<String>>,
415    #[serde(skip_serializing_if = "Option::is_none")]
416    metadata: Option<std::collections::HashMap<String, String>>,
417}
418#[cfg(feature = "redact-generated-debug")]
419impl std::fmt::Debug for DeclineIssuingAuthorizationBuilder {
420    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
421        f.debug_struct("DeclineIssuingAuthorizationBuilder").finish_non_exhaustive()
422    }
423}
424impl DeclineIssuingAuthorizationBuilder {
425    fn new() -> Self {
426        Self { expand: None, metadata: None }
427    }
428}
429/// \[Deprecated\] Declines a pending Issuing `Authorization` object.
430/// This request should be made within the timeout window of the [real time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow.
431/// This method is deprecated.
432/// Instead, [respond directly to the webhook request to decline an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling).
433#[derive(Clone)]
434#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
435#[derive(serde::Serialize)]
436pub struct DeclineIssuingAuthorization {
437    inner: DeclineIssuingAuthorizationBuilder,
438    authorization: stripe_shared::IssuingAuthorizationId,
439}
440#[cfg(feature = "redact-generated-debug")]
441impl std::fmt::Debug for DeclineIssuingAuthorization {
442    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
443        f.debug_struct("DeclineIssuingAuthorization").finish_non_exhaustive()
444    }
445}
446impl DeclineIssuingAuthorization {
447    /// Construct a new `DeclineIssuingAuthorization`.
448    pub fn new(authorization: impl Into<stripe_shared::IssuingAuthorizationId>) -> Self {
449        Self {
450            authorization: authorization.into(),
451            inner: DeclineIssuingAuthorizationBuilder::new(),
452        }
453    }
454    /// Specifies which fields in the response should be expanded.
455    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
456        self.inner.expand = Some(expand.into());
457        self
458    }
459    /// Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object.
460    /// This can be useful for storing additional information about the object in a structured format.
461    /// Individual keys can be unset by posting an empty value to them.
462    /// All keys can be unset by posting an empty value to `metadata`.
463    pub fn metadata(
464        mut self,
465        metadata: impl Into<std::collections::HashMap<String, String>>,
466    ) -> Self {
467        self.inner.metadata = Some(metadata.into());
468        self
469    }
470}
471impl DeclineIssuingAuthorization {
472    /// Send the request and return the deserialized response.
473    pub async fn send<C: StripeClient>(
474        &self,
475        client: &C,
476    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
477        self.customize().send(client).await
478    }
479
480    /// Send the request and return the deserialized response, blocking until completion.
481    pub fn send_blocking<C: StripeBlockingClient>(
482        &self,
483        client: &C,
484    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
485        self.customize().send_blocking(client)
486    }
487}
488
489impl StripeRequest for DeclineIssuingAuthorization {
490    type Output = stripe_shared::IssuingAuthorization;
491
492    fn build(&self) -> RequestBuilder {
493        let authorization = &self.authorization;
494        RequestBuilder::new(
495            StripeMethod::Post,
496            format!("/issuing/authorizations/{authorization}/decline"),
497        )
498        .form(&self.inner)
499    }
500}
501#[derive(Clone)]
502#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
503#[derive(serde::Serialize)]
504struct CreateIssuingAuthorizationBuilder {
505    #[serde(skip_serializing_if = "Option::is_none")]
506    amount: Option<i64>,
507    #[serde(skip_serializing_if = "Option::is_none")]
508    amount_details: Option<CreateIssuingAuthorizationAmountDetails>,
509    #[serde(skip_serializing_if = "Option::is_none")]
510    authorization_method: Option<stripe_shared::IssuingAuthorizationAuthorizationMethod>,
511    card: String,
512    #[serde(skip_serializing_if = "Option::is_none")]
513    currency: Option<stripe_types::Currency>,
514    #[serde(skip_serializing_if = "Option::is_none")]
515    expand: Option<Vec<String>>,
516    #[serde(skip_serializing_if = "Option::is_none")]
517    fleet: Option<CreateIssuingAuthorizationFleet>,
518    #[serde(skip_serializing_if = "Option::is_none")]
519    fraud_disputability_likelihood: Option<CreateIssuingAuthorizationFraudDisputabilityLikelihood>,
520    #[serde(skip_serializing_if = "Option::is_none")]
521    fuel: Option<CreateIssuingAuthorizationFuel>,
522    #[serde(skip_serializing_if = "Option::is_none")]
523    is_amount_controllable: Option<bool>,
524    #[serde(skip_serializing_if = "Option::is_none")]
525    merchant_amount: Option<i64>,
526    #[serde(skip_serializing_if = "Option::is_none")]
527    merchant_currency: Option<stripe_types::Currency>,
528    #[serde(skip_serializing_if = "Option::is_none")]
529    merchant_data: Option<CreateIssuingAuthorizationMerchantData>,
530    #[serde(skip_serializing_if = "Option::is_none")]
531    network_data: Option<CreateIssuingAuthorizationNetworkData>,
532    #[serde(skip_serializing_if = "Option::is_none")]
533    risk_assessment: Option<CreateIssuingAuthorizationRiskAssessment>,
534    #[serde(skip_serializing_if = "Option::is_none")]
535    verification_data: Option<CreateIssuingAuthorizationVerificationData>,
536    #[serde(skip_serializing_if = "Option::is_none")]
537    wallet: Option<CreateIssuingAuthorizationWallet>,
538}
539#[cfg(feature = "redact-generated-debug")]
540impl std::fmt::Debug for CreateIssuingAuthorizationBuilder {
541    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
542        f.debug_struct("CreateIssuingAuthorizationBuilder").finish_non_exhaustive()
543    }
544}
545impl CreateIssuingAuthorizationBuilder {
546    fn new(card: impl Into<String>) -> Self {
547        Self {
548            amount: None,
549            amount_details: None,
550            authorization_method: None,
551            card: card.into(),
552            currency: None,
553            expand: None,
554            fleet: None,
555            fraud_disputability_likelihood: None,
556            fuel: None,
557            is_amount_controllable: None,
558            merchant_amount: None,
559            merchant_currency: None,
560            merchant_data: None,
561            network_data: None,
562            risk_assessment: None,
563            verification_data: None,
564            wallet: None,
565        }
566    }
567}
568/// Detailed breakdown of amount components.
569/// These amounts are denominated in `currency` and in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal).
570#[derive(Copy, Clone, Eq, PartialEq)]
571#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
572#[derive(serde::Serialize)]
573pub struct CreateIssuingAuthorizationAmountDetails {
574    /// The ATM withdrawal fee.
575    #[serde(skip_serializing_if = "Option::is_none")]
576    pub atm_fee: Option<i64>,
577    /// The amount of cash requested by the cardholder.
578    #[serde(skip_serializing_if = "Option::is_none")]
579    pub cashback_amount: Option<i64>,
580}
581#[cfg(feature = "redact-generated-debug")]
582impl std::fmt::Debug for CreateIssuingAuthorizationAmountDetails {
583    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
584        f.debug_struct("CreateIssuingAuthorizationAmountDetails").finish_non_exhaustive()
585    }
586}
587impl CreateIssuingAuthorizationAmountDetails {
588    pub fn new() -> Self {
589        Self { atm_fee: None, cashback_amount: None }
590    }
591}
592impl Default for CreateIssuingAuthorizationAmountDetails {
593    fn default() -> Self {
594        Self::new()
595    }
596}
597/// Fleet-specific information for authorizations using Fleet cards.
598#[derive(Clone, Eq, PartialEq)]
599#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
600#[derive(serde::Serialize)]
601pub struct CreateIssuingAuthorizationFleet {
602    /// Answers to prompts presented to the cardholder at the point of sale.
603    /// Prompted fields vary depending on the configuration of your physical fleet cards.
604    /// Typical points of sale support only numeric entry.
605    #[serde(skip_serializing_if = "Option::is_none")]
606    pub cardholder_prompt_data: Option<FleetCardholderPromptDataSpecs>,
607    /// The type of purchase. One of `fuel_purchase`, `non_fuel_purchase`, or `fuel_and_non_fuel_purchase`.
608    #[serde(skip_serializing_if = "Option::is_none")]
609    pub purchase_type: Option<CreateIssuingAuthorizationFleetPurchaseType>,
610    /// More information about the total amount.
611    /// This information is not guaranteed to be accurate as some merchants may provide unreliable data.
612    #[serde(skip_serializing_if = "Option::is_none")]
613    pub reported_breakdown: Option<FleetReportedBreakdownSpecs>,
614    /// The type of fuel service. One of `non_fuel_transaction`, `full_service`, or `self_service`.
615    #[serde(skip_serializing_if = "Option::is_none")]
616    pub service_type: Option<CreateIssuingAuthorizationFleetServiceType>,
617}
618#[cfg(feature = "redact-generated-debug")]
619impl std::fmt::Debug for CreateIssuingAuthorizationFleet {
620    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
621        f.debug_struct("CreateIssuingAuthorizationFleet").finish_non_exhaustive()
622    }
623}
624impl CreateIssuingAuthorizationFleet {
625    pub fn new() -> Self {
626        Self {
627            cardholder_prompt_data: None,
628            purchase_type: None,
629            reported_breakdown: None,
630            service_type: None,
631        }
632    }
633}
634impl Default for CreateIssuingAuthorizationFleet {
635    fn default() -> Self {
636        Self::new()
637    }
638}
639/// The type of purchase. One of `fuel_purchase`, `non_fuel_purchase`, or `fuel_and_non_fuel_purchase`.
640#[derive(Clone, Eq, PartialEq)]
641#[non_exhaustive]
642pub enum CreateIssuingAuthorizationFleetPurchaseType {
643    FuelAndNonFuelPurchase,
644    FuelPurchase,
645    NonFuelPurchase,
646    /// An unrecognized value from Stripe. Should not be used as a request parameter.
647    Unknown(String),
648}
649impl CreateIssuingAuthorizationFleetPurchaseType {
650    pub fn as_str(&self) -> &str {
651        use CreateIssuingAuthorizationFleetPurchaseType::*;
652        match self {
653            FuelAndNonFuelPurchase => "fuel_and_non_fuel_purchase",
654            FuelPurchase => "fuel_purchase",
655            NonFuelPurchase => "non_fuel_purchase",
656            Unknown(v) => v,
657        }
658    }
659}
660
661impl std::str::FromStr for CreateIssuingAuthorizationFleetPurchaseType {
662    type Err = std::convert::Infallible;
663    fn from_str(s: &str) -> Result<Self, Self::Err> {
664        use CreateIssuingAuthorizationFleetPurchaseType::*;
665        match s {
666            "fuel_and_non_fuel_purchase" => Ok(FuelAndNonFuelPurchase),
667            "fuel_purchase" => Ok(FuelPurchase),
668            "non_fuel_purchase" => Ok(NonFuelPurchase),
669            v => {
670                tracing::warn!(
671                    "Unknown value '{}' for enum '{}'",
672                    v,
673                    "CreateIssuingAuthorizationFleetPurchaseType"
674                );
675                Ok(Unknown(v.to_owned()))
676            }
677        }
678    }
679}
680impl std::fmt::Display for CreateIssuingAuthorizationFleetPurchaseType {
681    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
682        f.write_str(self.as_str())
683    }
684}
685
686#[cfg(not(feature = "redact-generated-debug"))]
687impl std::fmt::Debug for CreateIssuingAuthorizationFleetPurchaseType {
688    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
689        f.write_str(self.as_str())
690    }
691}
692#[cfg(feature = "redact-generated-debug")]
693impl std::fmt::Debug for CreateIssuingAuthorizationFleetPurchaseType {
694    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
695        f.debug_struct(stringify!(CreateIssuingAuthorizationFleetPurchaseType))
696            .finish_non_exhaustive()
697    }
698}
699impl serde::Serialize for CreateIssuingAuthorizationFleetPurchaseType {
700    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
701    where
702        S: serde::Serializer,
703    {
704        serializer.serialize_str(self.as_str())
705    }
706}
707#[cfg(feature = "deserialize")]
708impl<'de> serde::Deserialize<'de> for CreateIssuingAuthorizationFleetPurchaseType {
709    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
710        use std::str::FromStr;
711        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
712        Ok(Self::from_str(&s).expect("infallible"))
713    }
714}
715/// The type of fuel service. One of `non_fuel_transaction`, `full_service`, or `self_service`.
716#[derive(Clone, Eq, PartialEq)]
717#[non_exhaustive]
718pub enum CreateIssuingAuthorizationFleetServiceType {
719    FullService,
720    NonFuelTransaction,
721    SelfService,
722    /// An unrecognized value from Stripe. Should not be used as a request parameter.
723    Unknown(String),
724}
725impl CreateIssuingAuthorizationFleetServiceType {
726    pub fn as_str(&self) -> &str {
727        use CreateIssuingAuthorizationFleetServiceType::*;
728        match self {
729            FullService => "full_service",
730            NonFuelTransaction => "non_fuel_transaction",
731            SelfService => "self_service",
732            Unknown(v) => v,
733        }
734    }
735}
736
737impl std::str::FromStr for CreateIssuingAuthorizationFleetServiceType {
738    type Err = std::convert::Infallible;
739    fn from_str(s: &str) -> Result<Self, Self::Err> {
740        use CreateIssuingAuthorizationFleetServiceType::*;
741        match s {
742            "full_service" => Ok(FullService),
743            "non_fuel_transaction" => Ok(NonFuelTransaction),
744            "self_service" => Ok(SelfService),
745            v => {
746                tracing::warn!(
747                    "Unknown value '{}' for enum '{}'",
748                    v,
749                    "CreateIssuingAuthorizationFleetServiceType"
750                );
751                Ok(Unknown(v.to_owned()))
752            }
753        }
754    }
755}
756impl std::fmt::Display for CreateIssuingAuthorizationFleetServiceType {
757    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
758        f.write_str(self.as_str())
759    }
760}
761
762#[cfg(not(feature = "redact-generated-debug"))]
763impl std::fmt::Debug for CreateIssuingAuthorizationFleetServiceType {
764    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
765        f.write_str(self.as_str())
766    }
767}
768#[cfg(feature = "redact-generated-debug")]
769impl std::fmt::Debug for CreateIssuingAuthorizationFleetServiceType {
770    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
771        f.debug_struct(stringify!(CreateIssuingAuthorizationFleetServiceType))
772            .finish_non_exhaustive()
773    }
774}
775impl serde::Serialize for CreateIssuingAuthorizationFleetServiceType {
776    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
777    where
778        S: serde::Serializer,
779    {
780        serializer.serialize_str(self.as_str())
781    }
782}
783#[cfg(feature = "deserialize")]
784impl<'de> serde::Deserialize<'de> for CreateIssuingAuthorizationFleetServiceType {
785    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
786        use std::str::FromStr;
787        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
788        Ok(Self::from_str(&s).expect("infallible"))
789    }
790}
791/// Probability that this transaction can be disputed in the event of fraud.
792/// Assessed by comparing the characteristics of the authorization to card network rules.
793#[derive(Clone, Eq, PartialEq)]
794#[non_exhaustive]
795pub enum CreateIssuingAuthorizationFraudDisputabilityLikelihood {
796    Neutral,
797    Unknown,
798    VeryLikely,
799    VeryUnlikely,
800    /// An unrecognized value from Stripe. Should not be used as a request parameter.
801    /// This variant is prefixed with an underscore to avoid conflicts with Stripe's 'Unknown' variant.
802    _Unknown(String),
803}
804impl CreateIssuingAuthorizationFraudDisputabilityLikelihood {
805    pub fn as_str(&self) -> &str {
806        use CreateIssuingAuthorizationFraudDisputabilityLikelihood::*;
807        match self {
808            Neutral => "neutral",
809            Unknown => "unknown",
810            VeryLikely => "very_likely",
811            VeryUnlikely => "very_unlikely",
812            _Unknown(v) => v,
813        }
814    }
815}
816
817impl std::str::FromStr for CreateIssuingAuthorizationFraudDisputabilityLikelihood {
818    type Err = std::convert::Infallible;
819    fn from_str(s: &str) -> Result<Self, Self::Err> {
820        use CreateIssuingAuthorizationFraudDisputabilityLikelihood::*;
821        match s {
822            "neutral" => Ok(Neutral),
823            "unknown" => Ok(Unknown),
824            "very_likely" => Ok(VeryLikely),
825            "very_unlikely" => Ok(VeryUnlikely),
826            v => {
827                tracing::warn!(
828                    "Unknown value '{}' for enum '{}'",
829                    v,
830                    "CreateIssuingAuthorizationFraudDisputabilityLikelihood"
831                );
832                Ok(_Unknown(v.to_owned()))
833            }
834        }
835    }
836}
837impl std::fmt::Display for CreateIssuingAuthorizationFraudDisputabilityLikelihood {
838    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
839        f.write_str(self.as_str())
840    }
841}
842
843#[cfg(not(feature = "redact-generated-debug"))]
844impl std::fmt::Debug for CreateIssuingAuthorizationFraudDisputabilityLikelihood {
845    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
846        f.write_str(self.as_str())
847    }
848}
849#[cfg(feature = "redact-generated-debug")]
850impl std::fmt::Debug for CreateIssuingAuthorizationFraudDisputabilityLikelihood {
851    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
852        f.debug_struct(stringify!(CreateIssuingAuthorizationFraudDisputabilityLikelihood))
853            .finish_non_exhaustive()
854    }
855}
856impl serde::Serialize for CreateIssuingAuthorizationFraudDisputabilityLikelihood {
857    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
858    where
859        S: serde::Serializer,
860    {
861        serializer.serialize_str(self.as_str())
862    }
863}
864#[cfg(feature = "deserialize")]
865impl<'de> serde::Deserialize<'de> for CreateIssuingAuthorizationFraudDisputabilityLikelihood {
866    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
867        use std::str::FromStr;
868        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
869        Ok(Self::from_str(&s).expect("infallible"))
870    }
871}
872/// Information about fuel that was purchased with this transaction.
873#[derive(Clone, Eq, PartialEq)]
874#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
875#[derive(serde::Serialize)]
876pub struct CreateIssuingAuthorizationFuel {
877    /// [Conexxus Payment System Product Code](https://www.conexxus.org/conexxus-payment-system-product-codes) identifying the primary fuel product purchased.
878    #[serde(skip_serializing_if = "Option::is_none")]
879    pub industry_product_code: Option<String>,
880    /// The quantity of `unit`s of fuel that was dispensed, represented as a decimal string with at most 12 decimal places.
881    #[serde(skip_serializing_if = "Option::is_none")]
882    pub quantity_decimal: Option<String>,
883    /// The type of fuel that was purchased.
884    /// One of `diesel`, `unleaded_plus`, `unleaded_regular`, `unleaded_super`, or `other`.
885    #[serde(rename = "type")]
886    #[serde(skip_serializing_if = "Option::is_none")]
887    pub type_: Option<CreateIssuingAuthorizationFuelType>,
888    /// The units for `quantity_decimal`.
889    /// One of `charging_minute`, `imperial_gallon`, `kilogram`, `kilowatt_hour`, `liter`, `pound`, `us_gallon`, or `other`.
890    #[serde(skip_serializing_if = "Option::is_none")]
891    pub unit: Option<CreateIssuingAuthorizationFuelUnit>,
892    /// The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places.
893    #[serde(skip_serializing_if = "Option::is_none")]
894    pub unit_cost_decimal: Option<String>,
895}
896#[cfg(feature = "redact-generated-debug")]
897impl std::fmt::Debug for CreateIssuingAuthorizationFuel {
898    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
899        f.debug_struct("CreateIssuingAuthorizationFuel").finish_non_exhaustive()
900    }
901}
902impl CreateIssuingAuthorizationFuel {
903    pub fn new() -> Self {
904        Self {
905            industry_product_code: None,
906            quantity_decimal: None,
907            type_: None,
908            unit: None,
909            unit_cost_decimal: None,
910        }
911    }
912}
913impl Default for CreateIssuingAuthorizationFuel {
914    fn default() -> Self {
915        Self::new()
916    }
917}
918/// The type of fuel that was purchased.
919/// One of `diesel`, `unleaded_plus`, `unleaded_regular`, `unleaded_super`, or `other`.
920#[derive(Clone, Eq, PartialEq)]
921#[non_exhaustive]
922pub enum CreateIssuingAuthorizationFuelType {
923    Diesel,
924    Other,
925    UnleadedPlus,
926    UnleadedRegular,
927    UnleadedSuper,
928    /// An unrecognized value from Stripe. Should not be used as a request parameter.
929    Unknown(String),
930}
931impl CreateIssuingAuthorizationFuelType {
932    pub fn as_str(&self) -> &str {
933        use CreateIssuingAuthorizationFuelType::*;
934        match self {
935            Diesel => "diesel",
936            Other => "other",
937            UnleadedPlus => "unleaded_plus",
938            UnleadedRegular => "unleaded_regular",
939            UnleadedSuper => "unleaded_super",
940            Unknown(v) => v,
941        }
942    }
943}
944
945impl std::str::FromStr for CreateIssuingAuthorizationFuelType {
946    type Err = std::convert::Infallible;
947    fn from_str(s: &str) -> Result<Self, Self::Err> {
948        use CreateIssuingAuthorizationFuelType::*;
949        match s {
950            "diesel" => Ok(Diesel),
951            "other" => Ok(Other),
952            "unleaded_plus" => Ok(UnleadedPlus),
953            "unleaded_regular" => Ok(UnleadedRegular),
954            "unleaded_super" => Ok(UnleadedSuper),
955            v => {
956                tracing::warn!(
957                    "Unknown value '{}' for enum '{}'",
958                    v,
959                    "CreateIssuingAuthorizationFuelType"
960                );
961                Ok(Unknown(v.to_owned()))
962            }
963        }
964    }
965}
966impl std::fmt::Display for CreateIssuingAuthorizationFuelType {
967    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
968        f.write_str(self.as_str())
969    }
970}
971
972#[cfg(not(feature = "redact-generated-debug"))]
973impl std::fmt::Debug for CreateIssuingAuthorizationFuelType {
974    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
975        f.write_str(self.as_str())
976    }
977}
978#[cfg(feature = "redact-generated-debug")]
979impl std::fmt::Debug for CreateIssuingAuthorizationFuelType {
980    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
981        f.debug_struct(stringify!(CreateIssuingAuthorizationFuelType)).finish_non_exhaustive()
982    }
983}
984impl serde::Serialize for CreateIssuingAuthorizationFuelType {
985    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
986    where
987        S: serde::Serializer,
988    {
989        serializer.serialize_str(self.as_str())
990    }
991}
992#[cfg(feature = "deserialize")]
993impl<'de> serde::Deserialize<'de> for CreateIssuingAuthorizationFuelType {
994    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
995        use std::str::FromStr;
996        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
997        Ok(Self::from_str(&s).expect("infallible"))
998    }
999}
1000/// The units for `quantity_decimal`.
1001/// One of `charging_minute`, `imperial_gallon`, `kilogram`, `kilowatt_hour`, `liter`, `pound`, `us_gallon`, or `other`.
1002#[derive(Clone, Eq, PartialEq)]
1003#[non_exhaustive]
1004pub enum CreateIssuingAuthorizationFuelUnit {
1005    ChargingMinute,
1006    ImperialGallon,
1007    Kilogram,
1008    KilowattHour,
1009    Liter,
1010    Other,
1011    Pound,
1012    UsGallon,
1013    /// An unrecognized value from Stripe. Should not be used as a request parameter.
1014    Unknown(String),
1015}
1016impl CreateIssuingAuthorizationFuelUnit {
1017    pub fn as_str(&self) -> &str {
1018        use CreateIssuingAuthorizationFuelUnit::*;
1019        match self {
1020            ChargingMinute => "charging_minute",
1021            ImperialGallon => "imperial_gallon",
1022            Kilogram => "kilogram",
1023            KilowattHour => "kilowatt_hour",
1024            Liter => "liter",
1025            Other => "other",
1026            Pound => "pound",
1027            UsGallon => "us_gallon",
1028            Unknown(v) => v,
1029        }
1030    }
1031}
1032
1033impl std::str::FromStr for CreateIssuingAuthorizationFuelUnit {
1034    type Err = std::convert::Infallible;
1035    fn from_str(s: &str) -> Result<Self, Self::Err> {
1036        use CreateIssuingAuthorizationFuelUnit::*;
1037        match s {
1038            "charging_minute" => Ok(ChargingMinute),
1039            "imperial_gallon" => Ok(ImperialGallon),
1040            "kilogram" => Ok(Kilogram),
1041            "kilowatt_hour" => Ok(KilowattHour),
1042            "liter" => Ok(Liter),
1043            "other" => Ok(Other),
1044            "pound" => Ok(Pound),
1045            "us_gallon" => Ok(UsGallon),
1046            v => {
1047                tracing::warn!(
1048                    "Unknown value '{}' for enum '{}'",
1049                    v,
1050                    "CreateIssuingAuthorizationFuelUnit"
1051                );
1052                Ok(Unknown(v.to_owned()))
1053            }
1054        }
1055    }
1056}
1057impl std::fmt::Display for CreateIssuingAuthorizationFuelUnit {
1058    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1059        f.write_str(self.as_str())
1060    }
1061}
1062
1063#[cfg(not(feature = "redact-generated-debug"))]
1064impl std::fmt::Debug for CreateIssuingAuthorizationFuelUnit {
1065    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1066        f.write_str(self.as_str())
1067    }
1068}
1069#[cfg(feature = "redact-generated-debug")]
1070impl std::fmt::Debug for CreateIssuingAuthorizationFuelUnit {
1071    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1072        f.debug_struct(stringify!(CreateIssuingAuthorizationFuelUnit)).finish_non_exhaustive()
1073    }
1074}
1075impl serde::Serialize for CreateIssuingAuthorizationFuelUnit {
1076    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1077    where
1078        S: serde::Serializer,
1079    {
1080        serializer.serialize_str(self.as_str())
1081    }
1082}
1083#[cfg(feature = "deserialize")]
1084impl<'de> serde::Deserialize<'de> for CreateIssuingAuthorizationFuelUnit {
1085    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1086        use std::str::FromStr;
1087        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1088        Ok(Self::from_str(&s).expect("infallible"))
1089    }
1090}
1091/// Details about the seller (grocery store, e-commerce website, etc.) where the card authorization happened.
1092#[derive(Clone, Eq, PartialEq)]
1093#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
1094#[derive(serde::Serialize)]
1095pub struct CreateIssuingAuthorizationMerchantData {
1096    /// A categorization of the seller's type of business.
1097    /// See our [merchant categories guide](https://docs.stripe.com/issuing/merchant-categories) for a list of possible values.
1098    #[serde(skip_serializing_if = "Option::is_none")]
1099    pub category: Option<CreateIssuingAuthorizationMerchantDataCategory>,
1100    /// City where the seller is located
1101    #[serde(skip_serializing_if = "Option::is_none")]
1102    pub city: Option<String>,
1103    /// Country where the seller is located
1104    #[serde(skip_serializing_if = "Option::is_none")]
1105    pub country: Option<String>,
1106    /// Name of the seller
1107    #[serde(skip_serializing_if = "Option::is_none")]
1108    pub name: Option<String>,
1109    /// Identifier assigned to the seller by the card network.
1110    /// Different card networks may assign different network_id fields to the same merchant.
1111    #[serde(skip_serializing_if = "Option::is_none")]
1112    pub network_id: Option<String>,
1113    /// Postal code where the seller is located
1114    #[serde(skip_serializing_if = "Option::is_none")]
1115    pub postal_code: Option<String>,
1116    /// State where the seller is located
1117    #[serde(skip_serializing_if = "Option::is_none")]
1118    pub state: Option<String>,
1119    /// An ID assigned by the seller to the location of the sale.
1120    #[serde(skip_serializing_if = "Option::is_none")]
1121    pub terminal_id: Option<String>,
1122    /// URL provided by the merchant on a 3DS request
1123    #[serde(skip_serializing_if = "Option::is_none")]
1124    pub url: Option<String>,
1125}
1126#[cfg(feature = "redact-generated-debug")]
1127impl std::fmt::Debug for CreateIssuingAuthorizationMerchantData {
1128    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1129        f.debug_struct("CreateIssuingAuthorizationMerchantData").finish_non_exhaustive()
1130    }
1131}
1132impl CreateIssuingAuthorizationMerchantData {
1133    pub fn new() -> Self {
1134        Self {
1135            category: None,
1136            city: None,
1137            country: None,
1138            name: None,
1139            network_id: None,
1140            postal_code: None,
1141            state: None,
1142            terminal_id: None,
1143            url: None,
1144        }
1145    }
1146}
1147impl Default for CreateIssuingAuthorizationMerchantData {
1148    fn default() -> Self {
1149        Self::new()
1150    }
1151}
1152/// A categorization of the seller's type of business.
1153/// See our [merchant categories guide](https://docs.stripe.com/issuing/merchant-categories) for a list of possible values.
1154#[derive(Clone, Eq, PartialEq)]
1155#[non_exhaustive]
1156pub enum CreateIssuingAuthorizationMerchantDataCategory {
1157    AcRefrigerationRepair,
1158    AccountingBookkeepingServices,
1159    AdvertisingServices,
1160    AgriculturalCooperative,
1161    AirlinesAirCarriers,
1162    AirportsFlyingFields,
1163    AmbulanceServices,
1164    AmusementParksCarnivals,
1165    AntiqueReproductions,
1166    AntiqueShops,
1167    Aquariums,
1168    ArchitecturalSurveyingServices,
1169    ArtDealersAndGalleries,
1170    ArtistsSupplyAndCraftShops,
1171    AutoAndHomeSupplyStores,
1172    AutoBodyRepairShops,
1173    AutoPaintShops,
1174    AutoServiceShops,
1175    AutomatedCashDisburse,
1176    AutomatedFuelDispensers,
1177    AutomobileAssociations,
1178    AutomotivePartsAndAccessoriesStores,
1179    AutomotiveTireStores,
1180    BailAndBondPayments,
1181    Bakeries,
1182    BandsOrchestras,
1183    BarberAndBeautyShops,
1184    BettingCasinoGambling,
1185    BicycleShops,
1186    BilliardPoolEstablishments,
1187    BoatDealers,
1188    BoatRentalsAndLeases,
1189    BookStores,
1190    BooksPeriodicalsAndNewspapers,
1191    BowlingAlleys,
1192    BusLines,
1193    BusinessSecretarialSchools,
1194    BuyingShoppingServices,
1195    CableSatelliteAndOtherPayTelevisionAndRadio,
1196    CameraAndPhotographicSupplyStores,
1197    CandyNutAndConfectioneryStores,
1198    CarAndTruckDealersNewUsed,
1199    CarAndTruckDealersUsedOnly,
1200    CarRentalAgencies,
1201    CarWashes,
1202    CarpentryServices,
1203    CarpetUpholsteryCleaning,
1204    Caterers,
1205    CharitableAndSocialServiceOrganizationsFundraising,
1206    ChemicalsAndAlliedProducts,
1207    ChildCareServices,
1208    ChildrensAndInfantsWearStores,
1209    ChiropodistsPodiatrists,
1210    Chiropractors,
1211    CigarStoresAndStands,
1212    CivicSocialFraternalAssociations,
1213    CleaningAndMaintenance,
1214    ClothingRental,
1215    CollegesUniversities,
1216    CommercialEquipment,
1217    CommercialFootwear,
1218    CommercialPhotographyArtAndGraphics,
1219    CommuterTransportAndFerries,
1220    ComputerNetworkServices,
1221    ComputerProgramming,
1222    ComputerRepair,
1223    ComputerSoftwareStores,
1224    ComputersPeripheralsAndSoftware,
1225    ConcreteWorkServices,
1226    ConstructionMaterials,
1227    ConsultingPublicRelations,
1228    CorrespondenceSchools,
1229    CosmeticStores,
1230    CounselingServices,
1231    CountryClubs,
1232    CourierServices,
1233    CourtCosts,
1234    CreditReportingAgencies,
1235    CruiseLines,
1236    DairyProductsStores,
1237    DanceHallStudiosSchools,
1238    DatingEscortServices,
1239    DentistsOrthodontists,
1240    DepartmentStores,
1241    DetectiveAgencies,
1242    DigitalGoodsApplications,
1243    DigitalGoodsGames,
1244    DigitalGoodsLargeVolume,
1245    DigitalGoodsMedia,
1246    DirectMarketingCatalogMerchant,
1247    DirectMarketingCombinationCatalogAndRetailMerchant,
1248    DirectMarketingInboundTelemarketing,
1249    DirectMarketingInsuranceServices,
1250    DirectMarketingOther,
1251    DirectMarketingOutboundTelemarketing,
1252    DirectMarketingSubscription,
1253    DirectMarketingTravel,
1254    DiscountStores,
1255    Doctors,
1256    DoorToDoorSales,
1257    DraperyWindowCoveringAndUpholsteryStores,
1258    DrinkingPlaces,
1259    DrugStoresAndPharmacies,
1260    DrugsDrugProprietariesAndDruggistSundries,
1261    DryCleaners,
1262    DurableGoods,
1263    DutyFreeStores,
1264    EatingPlacesRestaurants,
1265    EducationalServices,
1266    ElectricRazorStores,
1267    ElectricVehicleCharging,
1268    ElectricalPartsAndEquipment,
1269    ElectricalServices,
1270    ElectronicsRepairShops,
1271    ElectronicsStores,
1272    ElementarySecondarySchools,
1273    EmergencyServicesGcasVisaUseOnly,
1274    EmploymentTempAgencies,
1275    EquipmentRental,
1276    ExterminatingServices,
1277    FamilyClothingStores,
1278    FastFoodRestaurants,
1279    FinancialInstitutions,
1280    FinesGovernmentAdministrativeEntities,
1281    FireplaceFireplaceScreensAndAccessoriesStores,
1282    FloorCoveringStores,
1283    Florists,
1284    FloristsSuppliesNurseryStockAndFlowers,
1285    FreezerAndLockerMeatProvisioners,
1286    FuelDealersNonAutomotive,
1287    FuneralServicesCrematories,
1288    FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances,
1289    FurnitureRepairRefinishing,
1290    FurriersAndFurShops,
1291    GeneralServices,
1292    GiftCardNoveltyAndSouvenirShops,
1293    GlassPaintAndWallpaperStores,
1294    GlasswareCrystalStores,
1295    GolfCoursesPublic,
1296    GovernmentLicensedHorseDogRacingUsRegionOnly,
1297    GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly,
1298    GovernmentOwnedLotteriesNonUsRegion,
1299    GovernmentOwnedLotteriesUsRegionOnly,
1300    GovernmentServices,
1301    GroceryStoresSupermarkets,
1302    HardwareEquipmentAndSupplies,
1303    HardwareStores,
1304    HealthAndBeautySpas,
1305    HearingAidsSalesAndSupplies,
1306    HeatingPlumbingAC,
1307    HobbyToyAndGameShops,
1308    HomeSupplyWarehouseStores,
1309    Hospitals,
1310    HotelsMotelsAndResorts,
1311    HouseholdApplianceStores,
1312    IndustrialSupplies,
1313    InformationRetrievalServices,
1314    InsuranceDefault,
1315    InsuranceUnderwritingPremiums,
1316    IntraCompanyPurchases,
1317    JewelryStoresWatchesClocksAndSilverwareStores,
1318    LandscapingServices,
1319    Laundries,
1320    LaundryCleaningServices,
1321    LegalServicesAttorneys,
1322    LuggageAndLeatherGoodsStores,
1323    LumberBuildingMaterialsStores,
1324    ManualCashDisburse,
1325    MarinasServiceAndSupplies,
1326    Marketplaces,
1327    MasonryStoneworkAndPlaster,
1328    MassageParlors,
1329    MedicalAndDentalLabs,
1330    MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies,
1331    MedicalServices,
1332    MembershipOrganizations,
1333    MensAndBoysClothingAndAccessoriesStores,
1334    MensWomensClothingStores,
1335    MetalServiceCenters,
1336    MiscellaneousApparelAndAccessoryShops,
1337    MiscellaneousAutoDealers,
1338    MiscellaneousBusinessServices,
1339    MiscellaneousFoodStores,
1340    MiscellaneousGeneralMerchandise,
1341    MiscellaneousGeneralServices,
1342    MiscellaneousHomeFurnishingSpecialtyStores,
1343    MiscellaneousPublishingAndPrinting,
1344    MiscellaneousRecreationServices,
1345    MiscellaneousRepairShops,
1346    MiscellaneousSpecialtyRetail,
1347    MobileHomeDealers,
1348    MotionPictureTheaters,
1349    MotorFreightCarriersAndTrucking,
1350    MotorHomesDealers,
1351    MotorVehicleSuppliesAndNewParts,
1352    MotorcycleShopsAndDealers,
1353    MotorcycleShopsDealers,
1354    MusicStoresMusicalInstrumentsPianosAndSheetMusic,
1355    NewsDealersAndNewsstands,
1356    NonFiMoneyOrders,
1357    NonFiStoredValueCardPurchaseLoad,
1358    NondurableGoods,
1359    NurseriesLawnAndGardenSupplyStores,
1360    NursingPersonalCare,
1361    OfficeAndCommercialFurniture,
1362    OpticiansEyeglasses,
1363    OptometristsOphthalmologist,
1364    OrthopedicGoodsProstheticDevices,
1365    Osteopaths,
1366    PackageStoresBeerWineAndLiquor,
1367    PaintsVarnishesAndSupplies,
1368    ParkingLotsGarages,
1369    PassengerRailways,
1370    PawnShops,
1371    PetShopsPetFoodAndSupplies,
1372    PetroleumAndPetroleumProducts,
1373    PhotoDeveloping,
1374    PhotographicPhotocopyMicrofilmEquipmentAndSupplies,
1375    PhotographicStudios,
1376    PictureVideoProduction,
1377    PieceGoodsNotionsAndOtherDryGoods,
1378    PlumbingHeatingEquipmentAndSupplies,
1379    PoliticalOrganizations,
1380    PostalServicesGovernmentOnly,
1381    PreciousStonesAndMetalsWatchesAndJewelry,
1382    ProfessionalServices,
1383    PublicWarehousingAndStorage,
1384    QuickCopyReproAndBlueprint,
1385    Railroads,
1386    RealEstateAgentsAndManagersRentals,
1387    RecordStores,
1388    RecreationalVehicleRentals,
1389    ReligiousGoodsStores,
1390    ReligiousOrganizations,
1391    RoofingSidingSheetMetal,
1392    SecretarialSupportServices,
1393    SecurityBrokersDealers,
1394    ServiceStations,
1395    SewingNeedleworkFabricAndPieceGoodsStores,
1396    ShoeRepairHatCleaning,
1397    ShoeStores,
1398    SmallApplianceRepair,
1399    SnowmobileDealers,
1400    SpecialTradeServices,
1401    SpecialtyCleaning,
1402    SportingGoodsStores,
1403    SportingRecreationCamps,
1404    SportsAndRidingApparelStores,
1405    SportsClubsFields,
1406    StampAndCoinStores,
1407    StationaryOfficeSuppliesPrintingAndWritingPaper,
1408    StationeryStoresOfficeAndSchoolSupplyStores,
1409    SwimmingPoolsSales,
1410    TUiTravelGermany,
1411    TailorsAlterations,
1412    TaxPaymentsGovernmentAgencies,
1413    TaxPreparationServices,
1414    TaxicabsLimousines,
1415    TelecommunicationEquipmentAndTelephoneSales,
1416    TelecommunicationServices,
1417    TelegraphServices,
1418    TentAndAwningShops,
1419    TestingLaboratories,
1420    TheatricalTicketAgencies,
1421    Timeshares,
1422    TireRetreadingAndRepair,
1423    TollsBridgeFees,
1424    TouristAttractionsAndExhibits,
1425    TowingServices,
1426    TrailerParksCampgrounds,
1427    TransportationServices,
1428    TravelAgenciesTourOperators,
1429    TruckStopIteration,
1430    TruckUtilityTrailerRentals,
1431    TypesettingPlateMakingAndRelatedServices,
1432    TypewriterStores,
1433    USFederalGovernmentAgenciesOrDepartments,
1434    UniformsCommercialClothing,
1435    UsedMerchandiseAndSecondhandStores,
1436    Utilities,
1437    VarietyStores,
1438    VeterinaryServices,
1439    VideoAmusementGameSupplies,
1440    VideoGameArcades,
1441    VideoTapeRentalStores,
1442    VocationalTradeSchools,
1443    WatchJewelryRepair,
1444    WeldingRepair,
1445    WholesaleClubs,
1446    WigAndToupeeStores,
1447    WiresMoneyOrders,
1448    WomensAccessoryAndSpecialtyShops,
1449    WomensReadyToWearStores,
1450    WreckingAndSalvageYards,
1451    /// An unrecognized value from Stripe. Should not be used as a request parameter.
1452    Unknown(String),
1453}
1454impl CreateIssuingAuthorizationMerchantDataCategory {
1455    pub fn as_str(&self) -> &str {
1456        use CreateIssuingAuthorizationMerchantDataCategory::*;
1457        match self {
1458            AcRefrigerationRepair => "ac_refrigeration_repair",
1459            AccountingBookkeepingServices => "accounting_bookkeeping_services",
1460            AdvertisingServices => "advertising_services",
1461            AgriculturalCooperative => "agricultural_cooperative",
1462            AirlinesAirCarriers => "airlines_air_carriers",
1463            AirportsFlyingFields => "airports_flying_fields",
1464            AmbulanceServices => "ambulance_services",
1465            AmusementParksCarnivals => "amusement_parks_carnivals",
1466            AntiqueReproductions => "antique_reproductions",
1467            AntiqueShops => "antique_shops",
1468            Aquariums => "aquariums",
1469            ArchitecturalSurveyingServices => "architectural_surveying_services",
1470            ArtDealersAndGalleries => "art_dealers_and_galleries",
1471            ArtistsSupplyAndCraftShops => "artists_supply_and_craft_shops",
1472            AutoAndHomeSupplyStores => "auto_and_home_supply_stores",
1473            AutoBodyRepairShops => "auto_body_repair_shops",
1474            AutoPaintShops => "auto_paint_shops",
1475            AutoServiceShops => "auto_service_shops",
1476            AutomatedCashDisburse => "automated_cash_disburse",
1477            AutomatedFuelDispensers => "automated_fuel_dispensers",
1478            AutomobileAssociations => "automobile_associations",
1479            AutomotivePartsAndAccessoriesStores => "automotive_parts_and_accessories_stores",
1480            AutomotiveTireStores => "automotive_tire_stores",
1481            BailAndBondPayments => "bail_and_bond_payments",
1482            Bakeries => "bakeries",
1483            BandsOrchestras => "bands_orchestras",
1484            BarberAndBeautyShops => "barber_and_beauty_shops",
1485            BettingCasinoGambling => "betting_casino_gambling",
1486            BicycleShops => "bicycle_shops",
1487            BilliardPoolEstablishments => "billiard_pool_establishments",
1488            BoatDealers => "boat_dealers",
1489            BoatRentalsAndLeases => "boat_rentals_and_leases",
1490            BookStores => "book_stores",
1491            BooksPeriodicalsAndNewspapers => "books_periodicals_and_newspapers",
1492            BowlingAlleys => "bowling_alleys",
1493            BusLines => "bus_lines",
1494            BusinessSecretarialSchools => "business_secretarial_schools",
1495            BuyingShoppingServices => "buying_shopping_services",
1496            CableSatelliteAndOtherPayTelevisionAndRadio => {
1497                "cable_satellite_and_other_pay_television_and_radio"
1498            }
1499            CameraAndPhotographicSupplyStores => "camera_and_photographic_supply_stores",
1500            CandyNutAndConfectioneryStores => "candy_nut_and_confectionery_stores",
1501            CarAndTruckDealersNewUsed => "car_and_truck_dealers_new_used",
1502            CarAndTruckDealersUsedOnly => "car_and_truck_dealers_used_only",
1503            CarRentalAgencies => "car_rental_agencies",
1504            CarWashes => "car_washes",
1505            CarpentryServices => "carpentry_services",
1506            CarpetUpholsteryCleaning => "carpet_upholstery_cleaning",
1507            Caterers => "caterers",
1508            CharitableAndSocialServiceOrganizationsFundraising => {
1509                "charitable_and_social_service_organizations_fundraising"
1510            }
1511            ChemicalsAndAlliedProducts => "chemicals_and_allied_products",
1512            ChildCareServices => "child_care_services",
1513            ChildrensAndInfantsWearStores => "childrens_and_infants_wear_stores",
1514            ChiropodistsPodiatrists => "chiropodists_podiatrists",
1515            Chiropractors => "chiropractors",
1516            CigarStoresAndStands => "cigar_stores_and_stands",
1517            CivicSocialFraternalAssociations => "civic_social_fraternal_associations",
1518            CleaningAndMaintenance => "cleaning_and_maintenance",
1519            ClothingRental => "clothing_rental",
1520            CollegesUniversities => "colleges_universities",
1521            CommercialEquipment => "commercial_equipment",
1522            CommercialFootwear => "commercial_footwear",
1523            CommercialPhotographyArtAndGraphics => "commercial_photography_art_and_graphics",
1524            CommuterTransportAndFerries => "commuter_transport_and_ferries",
1525            ComputerNetworkServices => "computer_network_services",
1526            ComputerProgramming => "computer_programming",
1527            ComputerRepair => "computer_repair",
1528            ComputerSoftwareStores => "computer_software_stores",
1529            ComputersPeripheralsAndSoftware => "computers_peripherals_and_software",
1530            ConcreteWorkServices => "concrete_work_services",
1531            ConstructionMaterials => "construction_materials",
1532            ConsultingPublicRelations => "consulting_public_relations",
1533            CorrespondenceSchools => "correspondence_schools",
1534            CosmeticStores => "cosmetic_stores",
1535            CounselingServices => "counseling_services",
1536            CountryClubs => "country_clubs",
1537            CourierServices => "courier_services",
1538            CourtCosts => "court_costs",
1539            CreditReportingAgencies => "credit_reporting_agencies",
1540            CruiseLines => "cruise_lines",
1541            DairyProductsStores => "dairy_products_stores",
1542            DanceHallStudiosSchools => "dance_hall_studios_schools",
1543            DatingEscortServices => "dating_escort_services",
1544            DentistsOrthodontists => "dentists_orthodontists",
1545            DepartmentStores => "department_stores",
1546            DetectiveAgencies => "detective_agencies",
1547            DigitalGoodsApplications => "digital_goods_applications",
1548            DigitalGoodsGames => "digital_goods_games",
1549            DigitalGoodsLargeVolume => "digital_goods_large_volume",
1550            DigitalGoodsMedia => "digital_goods_media",
1551            DirectMarketingCatalogMerchant => "direct_marketing_catalog_merchant",
1552            DirectMarketingCombinationCatalogAndRetailMerchant => {
1553                "direct_marketing_combination_catalog_and_retail_merchant"
1554            }
1555            DirectMarketingInboundTelemarketing => "direct_marketing_inbound_telemarketing",
1556            DirectMarketingInsuranceServices => "direct_marketing_insurance_services",
1557            DirectMarketingOther => "direct_marketing_other",
1558            DirectMarketingOutboundTelemarketing => "direct_marketing_outbound_telemarketing",
1559            DirectMarketingSubscription => "direct_marketing_subscription",
1560            DirectMarketingTravel => "direct_marketing_travel",
1561            DiscountStores => "discount_stores",
1562            Doctors => "doctors",
1563            DoorToDoorSales => "door_to_door_sales",
1564            DraperyWindowCoveringAndUpholsteryStores => {
1565                "drapery_window_covering_and_upholstery_stores"
1566            }
1567            DrinkingPlaces => "drinking_places",
1568            DrugStoresAndPharmacies => "drug_stores_and_pharmacies",
1569            DrugsDrugProprietariesAndDruggistSundries => {
1570                "drugs_drug_proprietaries_and_druggist_sundries"
1571            }
1572            DryCleaners => "dry_cleaners",
1573            DurableGoods => "durable_goods",
1574            DutyFreeStores => "duty_free_stores",
1575            EatingPlacesRestaurants => "eating_places_restaurants",
1576            EducationalServices => "educational_services",
1577            ElectricRazorStores => "electric_razor_stores",
1578            ElectricVehicleCharging => "electric_vehicle_charging",
1579            ElectricalPartsAndEquipment => "electrical_parts_and_equipment",
1580            ElectricalServices => "electrical_services",
1581            ElectronicsRepairShops => "electronics_repair_shops",
1582            ElectronicsStores => "electronics_stores",
1583            ElementarySecondarySchools => "elementary_secondary_schools",
1584            EmergencyServicesGcasVisaUseOnly => "emergency_services_gcas_visa_use_only",
1585            EmploymentTempAgencies => "employment_temp_agencies",
1586            EquipmentRental => "equipment_rental",
1587            ExterminatingServices => "exterminating_services",
1588            FamilyClothingStores => "family_clothing_stores",
1589            FastFoodRestaurants => "fast_food_restaurants",
1590            FinancialInstitutions => "financial_institutions",
1591            FinesGovernmentAdministrativeEntities => "fines_government_administrative_entities",
1592            FireplaceFireplaceScreensAndAccessoriesStores => {
1593                "fireplace_fireplace_screens_and_accessories_stores"
1594            }
1595            FloorCoveringStores => "floor_covering_stores",
1596            Florists => "florists",
1597            FloristsSuppliesNurseryStockAndFlowers => "florists_supplies_nursery_stock_and_flowers",
1598            FreezerAndLockerMeatProvisioners => "freezer_and_locker_meat_provisioners",
1599            FuelDealersNonAutomotive => "fuel_dealers_non_automotive",
1600            FuneralServicesCrematories => "funeral_services_crematories",
1601            FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances => {
1602                "furniture_home_furnishings_and_equipment_stores_except_appliances"
1603            }
1604            FurnitureRepairRefinishing => "furniture_repair_refinishing",
1605            FurriersAndFurShops => "furriers_and_fur_shops",
1606            GeneralServices => "general_services",
1607            GiftCardNoveltyAndSouvenirShops => "gift_card_novelty_and_souvenir_shops",
1608            GlassPaintAndWallpaperStores => "glass_paint_and_wallpaper_stores",
1609            GlasswareCrystalStores => "glassware_crystal_stores",
1610            GolfCoursesPublic => "golf_courses_public",
1611            GovernmentLicensedHorseDogRacingUsRegionOnly => {
1612                "government_licensed_horse_dog_racing_us_region_only"
1613            }
1614            GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly => {
1615                "government_licensed_online_casions_online_gambling_us_region_only"
1616            }
1617            GovernmentOwnedLotteriesNonUsRegion => "government_owned_lotteries_non_us_region",
1618            GovernmentOwnedLotteriesUsRegionOnly => "government_owned_lotteries_us_region_only",
1619            GovernmentServices => "government_services",
1620            GroceryStoresSupermarkets => "grocery_stores_supermarkets",
1621            HardwareEquipmentAndSupplies => "hardware_equipment_and_supplies",
1622            HardwareStores => "hardware_stores",
1623            HealthAndBeautySpas => "health_and_beauty_spas",
1624            HearingAidsSalesAndSupplies => "hearing_aids_sales_and_supplies",
1625            HeatingPlumbingAC => "heating_plumbing_a_c",
1626            HobbyToyAndGameShops => "hobby_toy_and_game_shops",
1627            HomeSupplyWarehouseStores => "home_supply_warehouse_stores",
1628            Hospitals => "hospitals",
1629            HotelsMotelsAndResorts => "hotels_motels_and_resorts",
1630            HouseholdApplianceStores => "household_appliance_stores",
1631            IndustrialSupplies => "industrial_supplies",
1632            InformationRetrievalServices => "information_retrieval_services",
1633            InsuranceDefault => "insurance_default",
1634            InsuranceUnderwritingPremiums => "insurance_underwriting_premiums",
1635            IntraCompanyPurchases => "intra_company_purchases",
1636            JewelryStoresWatchesClocksAndSilverwareStores => {
1637                "jewelry_stores_watches_clocks_and_silverware_stores"
1638            }
1639            LandscapingServices => "landscaping_services",
1640            Laundries => "laundries",
1641            LaundryCleaningServices => "laundry_cleaning_services",
1642            LegalServicesAttorneys => "legal_services_attorneys",
1643            LuggageAndLeatherGoodsStores => "luggage_and_leather_goods_stores",
1644            LumberBuildingMaterialsStores => "lumber_building_materials_stores",
1645            ManualCashDisburse => "manual_cash_disburse",
1646            MarinasServiceAndSupplies => "marinas_service_and_supplies",
1647            Marketplaces => "marketplaces",
1648            MasonryStoneworkAndPlaster => "masonry_stonework_and_plaster",
1649            MassageParlors => "massage_parlors",
1650            MedicalAndDentalLabs => "medical_and_dental_labs",
1651            MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies => {
1652                "medical_dental_ophthalmic_and_hospital_equipment_and_supplies"
1653            }
1654            MedicalServices => "medical_services",
1655            MembershipOrganizations => "membership_organizations",
1656            MensAndBoysClothingAndAccessoriesStores => {
1657                "mens_and_boys_clothing_and_accessories_stores"
1658            }
1659            MensWomensClothingStores => "mens_womens_clothing_stores",
1660            MetalServiceCenters => "metal_service_centers",
1661            MiscellaneousApparelAndAccessoryShops => "miscellaneous_apparel_and_accessory_shops",
1662            MiscellaneousAutoDealers => "miscellaneous_auto_dealers",
1663            MiscellaneousBusinessServices => "miscellaneous_business_services",
1664            MiscellaneousFoodStores => "miscellaneous_food_stores",
1665            MiscellaneousGeneralMerchandise => "miscellaneous_general_merchandise",
1666            MiscellaneousGeneralServices => "miscellaneous_general_services",
1667            MiscellaneousHomeFurnishingSpecialtyStores => {
1668                "miscellaneous_home_furnishing_specialty_stores"
1669            }
1670            MiscellaneousPublishingAndPrinting => "miscellaneous_publishing_and_printing",
1671            MiscellaneousRecreationServices => "miscellaneous_recreation_services",
1672            MiscellaneousRepairShops => "miscellaneous_repair_shops",
1673            MiscellaneousSpecialtyRetail => "miscellaneous_specialty_retail",
1674            MobileHomeDealers => "mobile_home_dealers",
1675            MotionPictureTheaters => "motion_picture_theaters",
1676            MotorFreightCarriersAndTrucking => "motor_freight_carriers_and_trucking",
1677            MotorHomesDealers => "motor_homes_dealers",
1678            MotorVehicleSuppliesAndNewParts => "motor_vehicle_supplies_and_new_parts",
1679            MotorcycleShopsAndDealers => "motorcycle_shops_and_dealers",
1680            MotorcycleShopsDealers => "motorcycle_shops_dealers",
1681            MusicStoresMusicalInstrumentsPianosAndSheetMusic => {
1682                "music_stores_musical_instruments_pianos_and_sheet_music"
1683            }
1684            NewsDealersAndNewsstands => "news_dealers_and_newsstands",
1685            NonFiMoneyOrders => "non_fi_money_orders",
1686            NonFiStoredValueCardPurchaseLoad => "non_fi_stored_value_card_purchase_load",
1687            NondurableGoods => "nondurable_goods",
1688            NurseriesLawnAndGardenSupplyStores => "nurseries_lawn_and_garden_supply_stores",
1689            NursingPersonalCare => "nursing_personal_care",
1690            OfficeAndCommercialFurniture => "office_and_commercial_furniture",
1691            OpticiansEyeglasses => "opticians_eyeglasses",
1692            OptometristsOphthalmologist => "optometrists_ophthalmologist",
1693            OrthopedicGoodsProstheticDevices => "orthopedic_goods_prosthetic_devices",
1694            Osteopaths => "osteopaths",
1695            PackageStoresBeerWineAndLiquor => "package_stores_beer_wine_and_liquor",
1696            PaintsVarnishesAndSupplies => "paints_varnishes_and_supplies",
1697            ParkingLotsGarages => "parking_lots_garages",
1698            PassengerRailways => "passenger_railways",
1699            PawnShops => "pawn_shops",
1700            PetShopsPetFoodAndSupplies => "pet_shops_pet_food_and_supplies",
1701            PetroleumAndPetroleumProducts => "petroleum_and_petroleum_products",
1702            PhotoDeveloping => "photo_developing",
1703            PhotographicPhotocopyMicrofilmEquipmentAndSupplies => {
1704                "photographic_photocopy_microfilm_equipment_and_supplies"
1705            }
1706            PhotographicStudios => "photographic_studios",
1707            PictureVideoProduction => "picture_video_production",
1708            PieceGoodsNotionsAndOtherDryGoods => "piece_goods_notions_and_other_dry_goods",
1709            PlumbingHeatingEquipmentAndSupplies => "plumbing_heating_equipment_and_supplies",
1710            PoliticalOrganizations => "political_organizations",
1711            PostalServicesGovernmentOnly => "postal_services_government_only",
1712            PreciousStonesAndMetalsWatchesAndJewelry => {
1713                "precious_stones_and_metals_watches_and_jewelry"
1714            }
1715            ProfessionalServices => "professional_services",
1716            PublicWarehousingAndStorage => "public_warehousing_and_storage",
1717            QuickCopyReproAndBlueprint => "quick_copy_repro_and_blueprint",
1718            Railroads => "railroads",
1719            RealEstateAgentsAndManagersRentals => "real_estate_agents_and_managers_rentals",
1720            RecordStores => "record_stores",
1721            RecreationalVehicleRentals => "recreational_vehicle_rentals",
1722            ReligiousGoodsStores => "religious_goods_stores",
1723            ReligiousOrganizations => "religious_organizations",
1724            RoofingSidingSheetMetal => "roofing_siding_sheet_metal",
1725            SecretarialSupportServices => "secretarial_support_services",
1726            SecurityBrokersDealers => "security_brokers_dealers",
1727            ServiceStations => "service_stations",
1728            SewingNeedleworkFabricAndPieceGoodsStores => {
1729                "sewing_needlework_fabric_and_piece_goods_stores"
1730            }
1731            ShoeRepairHatCleaning => "shoe_repair_hat_cleaning",
1732            ShoeStores => "shoe_stores",
1733            SmallApplianceRepair => "small_appliance_repair",
1734            SnowmobileDealers => "snowmobile_dealers",
1735            SpecialTradeServices => "special_trade_services",
1736            SpecialtyCleaning => "specialty_cleaning",
1737            SportingGoodsStores => "sporting_goods_stores",
1738            SportingRecreationCamps => "sporting_recreation_camps",
1739            SportsAndRidingApparelStores => "sports_and_riding_apparel_stores",
1740            SportsClubsFields => "sports_clubs_fields",
1741            StampAndCoinStores => "stamp_and_coin_stores",
1742            StationaryOfficeSuppliesPrintingAndWritingPaper => {
1743                "stationary_office_supplies_printing_and_writing_paper"
1744            }
1745            StationeryStoresOfficeAndSchoolSupplyStores => {
1746                "stationery_stores_office_and_school_supply_stores"
1747            }
1748            SwimmingPoolsSales => "swimming_pools_sales",
1749            TUiTravelGermany => "t_ui_travel_germany",
1750            TailorsAlterations => "tailors_alterations",
1751            TaxPaymentsGovernmentAgencies => "tax_payments_government_agencies",
1752            TaxPreparationServices => "tax_preparation_services",
1753            TaxicabsLimousines => "taxicabs_limousines",
1754            TelecommunicationEquipmentAndTelephoneSales => {
1755                "telecommunication_equipment_and_telephone_sales"
1756            }
1757            TelecommunicationServices => "telecommunication_services",
1758            TelegraphServices => "telegraph_services",
1759            TentAndAwningShops => "tent_and_awning_shops",
1760            TestingLaboratories => "testing_laboratories",
1761            TheatricalTicketAgencies => "theatrical_ticket_agencies",
1762            Timeshares => "timeshares",
1763            TireRetreadingAndRepair => "tire_retreading_and_repair",
1764            TollsBridgeFees => "tolls_bridge_fees",
1765            TouristAttractionsAndExhibits => "tourist_attractions_and_exhibits",
1766            TowingServices => "towing_services",
1767            TrailerParksCampgrounds => "trailer_parks_campgrounds",
1768            TransportationServices => "transportation_services",
1769            TravelAgenciesTourOperators => "travel_agencies_tour_operators",
1770            TruckStopIteration => "truck_stop_iteration",
1771            TruckUtilityTrailerRentals => "truck_utility_trailer_rentals",
1772            TypesettingPlateMakingAndRelatedServices => {
1773                "typesetting_plate_making_and_related_services"
1774            }
1775            TypewriterStores => "typewriter_stores",
1776            USFederalGovernmentAgenciesOrDepartments => {
1777                "u_s_federal_government_agencies_or_departments"
1778            }
1779            UniformsCommercialClothing => "uniforms_commercial_clothing",
1780            UsedMerchandiseAndSecondhandStores => "used_merchandise_and_secondhand_stores",
1781            Utilities => "utilities",
1782            VarietyStores => "variety_stores",
1783            VeterinaryServices => "veterinary_services",
1784            VideoAmusementGameSupplies => "video_amusement_game_supplies",
1785            VideoGameArcades => "video_game_arcades",
1786            VideoTapeRentalStores => "video_tape_rental_stores",
1787            VocationalTradeSchools => "vocational_trade_schools",
1788            WatchJewelryRepair => "watch_jewelry_repair",
1789            WeldingRepair => "welding_repair",
1790            WholesaleClubs => "wholesale_clubs",
1791            WigAndToupeeStores => "wig_and_toupee_stores",
1792            WiresMoneyOrders => "wires_money_orders",
1793            WomensAccessoryAndSpecialtyShops => "womens_accessory_and_specialty_shops",
1794            WomensReadyToWearStores => "womens_ready_to_wear_stores",
1795            WreckingAndSalvageYards => "wrecking_and_salvage_yards",
1796            Unknown(v) => v,
1797        }
1798    }
1799}
1800
1801impl std::str::FromStr for CreateIssuingAuthorizationMerchantDataCategory {
1802    type Err = std::convert::Infallible;
1803    fn from_str(s: &str) -> Result<Self, Self::Err> {
1804        use CreateIssuingAuthorizationMerchantDataCategory::*;
1805        match s {
1806            "ac_refrigeration_repair" => Ok(AcRefrigerationRepair),
1807            "accounting_bookkeeping_services" => Ok(AccountingBookkeepingServices),
1808            "advertising_services" => Ok(AdvertisingServices),
1809            "agricultural_cooperative" => Ok(AgriculturalCooperative),
1810            "airlines_air_carriers" => Ok(AirlinesAirCarriers),
1811            "airports_flying_fields" => Ok(AirportsFlyingFields),
1812            "ambulance_services" => Ok(AmbulanceServices),
1813            "amusement_parks_carnivals" => Ok(AmusementParksCarnivals),
1814            "antique_reproductions" => Ok(AntiqueReproductions),
1815            "antique_shops" => Ok(AntiqueShops),
1816            "aquariums" => Ok(Aquariums),
1817            "architectural_surveying_services" => Ok(ArchitecturalSurveyingServices),
1818            "art_dealers_and_galleries" => Ok(ArtDealersAndGalleries),
1819            "artists_supply_and_craft_shops" => Ok(ArtistsSupplyAndCraftShops),
1820            "auto_and_home_supply_stores" => Ok(AutoAndHomeSupplyStores),
1821            "auto_body_repair_shops" => Ok(AutoBodyRepairShops),
1822            "auto_paint_shops" => Ok(AutoPaintShops),
1823            "auto_service_shops" => Ok(AutoServiceShops),
1824            "automated_cash_disburse" => Ok(AutomatedCashDisburse),
1825            "automated_fuel_dispensers" => Ok(AutomatedFuelDispensers),
1826            "automobile_associations" => Ok(AutomobileAssociations),
1827            "automotive_parts_and_accessories_stores" => Ok(AutomotivePartsAndAccessoriesStores),
1828            "automotive_tire_stores" => Ok(AutomotiveTireStores),
1829            "bail_and_bond_payments" => Ok(BailAndBondPayments),
1830            "bakeries" => Ok(Bakeries),
1831            "bands_orchestras" => Ok(BandsOrchestras),
1832            "barber_and_beauty_shops" => Ok(BarberAndBeautyShops),
1833            "betting_casino_gambling" => Ok(BettingCasinoGambling),
1834            "bicycle_shops" => Ok(BicycleShops),
1835            "billiard_pool_establishments" => Ok(BilliardPoolEstablishments),
1836            "boat_dealers" => Ok(BoatDealers),
1837            "boat_rentals_and_leases" => Ok(BoatRentalsAndLeases),
1838            "book_stores" => Ok(BookStores),
1839            "books_periodicals_and_newspapers" => Ok(BooksPeriodicalsAndNewspapers),
1840            "bowling_alleys" => Ok(BowlingAlleys),
1841            "bus_lines" => Ok(BusLines),
1842            "business_secretarial_schools" => Ok(BusinessSecretarialSchools),
1843            "buying_shopping_services" => Ok(BuyingShoppingServices),
1844            "cable_satellite_and_other_pay_television_and_radio" => {
1845                Ok(CableSatelliteAndOtherPayTelevisionAndRadio)
1846            }
1847            "camera_and_photographic_supply_stores" => Ok(CameraAndPhotographicSupplyStores),
1848            "candy_nut_and_confectionery_stores" => Ok(CandyNutAndConfectioneryStores),
1849            "car_and_truck_dealers_new_used" => Ok(CarAndTruckDealersNewUsed),
1850            "car_and_truck_dealers_used_only" => Ok(CarAndTruckDealersUsedOnly),
1851            "car_rental_agencies" => Ok(CarRentalAgencies),
1852            "car_washes" => Ok(CarWashes),
1853            "carpentry_services" => Ok(CarpentryServices),
1854            "carpet_upholstery_cleaning" => Ok(CarpetUpholsteryCleaning),
1855            "caterers" => Ok(Caterers),
1856            "charitable_and_social_service_organizations_fundraising" => {
1857                Ok(CharitableAndSocialServiceOrganizationsFundraising)
1858            }
1859            "chemicals_and_allied_products" => Ok(ChemicalsAndAlliedProducts),
1860            "child_care_services" => Ok(ChildCareServices),
1861            "childrens_and_infants_wear_stores" => Ok(ChildrensAndInfantsWearStores),
1862            "chiropodists_podiatrists" => Ok(ChiropodistsPodiatrists),
1863            "chiropractors" => Ok(Chiropractors),
1864            "cigar_stores_and_stands" => Ok(CigarStoresAndStands),
1865            "civic_social_fraternal_associations" => Ok(CivicSocialFraternalAssociations),
1866            "cleaning_and_maintenance" => Ok(CleaningAndMaintenance),
1867            "clothing_rental" => Ok(ClothingRental),
1868            "colleges_universities" => Ok(CollegesUniversities),
1869            "commercial_equipment" => Ok(CommercialEquipment),
1870            "commercial_footwear" => Ok(CommercialFootwear),
1871            "commercial_photography_art_and_graphics" => Ok(CommercialPhotographyArtAndGraphics),
1872            "commuter_transport_and_ferries" => Ok(CommuterTransportAndFerries),
1873            "computer_network_services" => Ok(ComputerNetworkServices),
1874            "computer_programming" => Ok(ComputerProgramming),
1875            "computer_repair" => Ok(ComputerRepair),
1876            "computer_software_stores" => Ok(ComputerSoftwareStores),
1877            "computers_peripherals_and_software" => Ok(ComputersPeripheralsAndSoftware),
1878            "concrete_work_services" => Ok(ConcreteWorkServices),
1879            "construction_materials" => Ok(ConstructionMaterials),
1880            "consulting_public_relations" => Ok(ConsultingPublicRelations),
1881            "correspondence_schools" => Ok(CorrespondenceSchools),
1882            "cosmetic_stores" => Ok(CosmeticStores),
1883            "counseling_services" => Ok(CounselingServices),
1884            "country_clubs" => Ok(CountryClubs),
1885            "courier_services" => Ok(CourierServices),
1886            "court_costs" => Ok(CourtCosts),
1887            "credit_reporting_agencies" => Ok(CreditReportingAgencies),
1888            "cruise_lines" => Ok(CruiseLines),
1889            "dairy_products_stores" => Ok(DairyProductsStores),
1890            "dance_hall_studios_schools" => Ok(DanceHallStudiosSchools),
1891            "dating_escort_services" => Ok(DatingEscortServices),
1892            "dentists_orthodontists" => Ok(DentistsOrthodontists),
1893            "department_stores" => Ok(DepartmentStores),
1894            "detective_agencies" => Ok(DetectiveAgencies),
1895            "digital_goods_applications" => Ok(DigitalGoodsApplications),
1896            "digital_goods_games" => Ok(DigitalGoodsGames),
1897            "digital_goods_large_volume" => Ok(DigitalGoodsLargeVolume),
1898            "digital_goods_media" => Ok(DigitalGoodsMedia),
1899            "direct_marketing_catalog_merchant" => Ok(DirectMarketingCatalogMerchant),
1900            "direct_marketing_combination_catalog_and_retail_merchant" => {
1901                Ok(DirectMarketingCombinationCatalogAndRetailMerchant)
1902            }
1903            "direct_marketing_inbound_telemarketing" => Ok(DirectMarketingInboundTelemarketing),
1904            "direct_marketing_insurance_services" => Ok(DirectMarketingInsuranceServices),
1905            "direct_marketing_other" => Ok(DirectMarketingOther),
1906            "direct_marketing_outbound_telemarketing" => Ok(DirectMarketingOutboundTelemarketing),
1907            "direct_marketing_subscription" => Ok(DirectMarketingSubscription),
1908            "direct_marketing_travel" => Ok(DirectMarketingTravel),
1909            "discount_stores" => Ok(DiscountStores),
1910            "doctors" => Ok(Doctors),
1911            "door_to_door_sales" => Ok(DoorToDoorSales),
1912            "drapery_window_covering_and_upholstery_stores" => {
1913                Ok(DraperyWindowCoveringAndUpholsteryStores)
1914            }
1915            "drinking_places" => Ok(DrinkingPlaces),
1916            "drug_stores_and_pharmacies" => Ok(DrugStoresAndPharmacies),
1917            "drugs_drug_proprietaries_and_druggist_sundries" => {
1918                Ok(DrugsDrugProprietariesAndDruggistSundries)
1919            }
1920            "dry_cleaners" => Ok(DryCleaners),
1921            "durable_goods" => Ok(DurableGoods),
1922            "duty_free_stores" => Ok(DutyFreeStores),
1923            "eating_places_restaurants" => Ok(EatingPlacesRestaurants),
1924            "educational_services" => Ok(EducationalServices),
1925            "electric_razor_stores" => Ok(ElectricRazorStores),
1926            "electric_vehicle_charging" => Ok(ElectricVehicleCharging),
1927            "electrical_parts_and_equipment" => Ok(ElectricalPartsAndEquipment),
1928            "electrical_services" => Ok(ElectricalServices),
1929            "electronics_repair_shops" => Ok(ElectronicsRepairShops),
1930            "electronics_stores" => Ok(ElectronicsStores),
1931            "elementary_secondary_schools" => Ok(ElementarySecondarySchools),
1932            "emergency_services_gcas_visa_use_only" => Ok(EmergencyServicesGcasVisaUseOnly),
1933            "employment_temp_agencies" => Ok(EmploymentTempAgencies),
1934            "equipment_rental" => Ok(EquipmentRental),
1935            "exterminating_services" => Ok(ExterminatingServices),
1936            "family_clothing_stores" => Ok(FamilyClothingStores),
1937            "fast_food_restaurants" => Ok(FastFoodRestaurants),
1938            "financial_institutions" => Ok(FinancialInstitutions),
1939            "fines_government_administrative_entities" => Ok(FinesGovernmentAdministrativeEntities),
1940            "fireplace_fireplace_screens_and_accessories_stores" => {
1941                Ok(FireplaceFireplaceScreensAndAccessoriesStores)
1942            }
1943            "floor_covering_stores" => Ok(FloorCoveringStores),
1944            "florists" => Ok(Florists),
1945            "florists_supplies_nursery_stock_and_flowers" => {
1946                Ok(FloristsSuppliesNurseryStockAndFlowers)
1947            }
1948            "freezer_and_locker_meat_provisioners" => Ok(FreezerAndLockerMeatProvisioners),
1949            "fuel_dealers_non_automotive" => Ok(FuelDealersNonAutomotive),
1950            "funeral_services_crematories" => Ok(FuneralServicesCrematories),
1951            "furniture_home_furnishings_and_equipment_stores_except_appliances" => {
1952                Ok(FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances)
1953            }
1954            "furniture_repair_refinishing" => Ok(FurnitureRepairRefinishing),
1955            "furriers_and_fur_shops" => Ok(FurriersAndFurShops),
1956            "general_services" => Ok(GeneralServices),
1957            "gift_card_novelty_and_souvenir_shops" => Ok(GiftCardNoveltyAndSouvenirShops),
1958            "glass_paint_and_wallpaper_stores" => Ok(GlassPaintAndWallpaperStores),
1959            "glassware_crystal_stores" => Ok(GlasswareCrystalStores),
1960            "golf_courses_public" => Ok(GolfCoursesPublic),
1961            "government_licensed_horse_dog_racing_us_region_only" => {
1962                Ok(GovernmentLicensedHorseDogRacingUsRegionOnly)
1963            }
1964            "government_licensed_online_casions_online_gambling_us_region_only" => {
1965                Ok(GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly)
1966            }
1967            "government_owned_lotteries_non_us_region" => Ok(GovernmentOwnedLotteriesNonUsRegion),
1968            "government_owned_lotteries_us_region_only" => Ok(GovernmentOwnedLotteriesUsRegionOnly),
1969            "government_services" => Ok(GovernmentServices),
1970            "grocery_stores_supermarkets" => Ok(GroceryStoresSupermarkets),
1971            "hardware_equipment_and_supplies" => Ok(HardwareEquipmentAndSupplies),
1972            "hardware_stores" => Ok(HardwareStores),
1973            "health_and_beauty_spas" => Ok(HealthAndBeautySpas),
1974            "hearing_aids_sales_and_supplies" => Ok(HearingAidsSalesAndSupplies),
1975            "heating_plumbing_a_c" => Ok(HeatingPlumbingAC),
1976            "hobby_toy_and_game_shops" => Ok(HobbyToyAndGameShops),
1977            "home_supply_warehouse_stores" => Ok(HomeSupplyWarehouseStores),
1978            "hospitals" => Ok(Hospitals),
1979            "hotels_motels_and_resorts" => Ok(HotelsMotelsAndResorts),
1980            "household_appliance_stores" => Ok(HouseholdApplianceStores),
1981            "industrial_supplies" => Ok(IndustrialSupplies),
1982            "information_retrieval_services" => Ok(InformationRetrievalServices),
1983            "insurance_default" => Ok(InsuranceDefault),
1984            "insurance_underwriting_premiums" => Ok(InsuranceUnderwritingPremiums),
1985            "intra_company_purchases" => Ok(IntraCompanyPurchases),
1986            "jewelry_stores_watches_clocks_and_silverware_stores" => {
1987                Ok(JewelryStoresWatchesClocksAndSilverwareStores)
1988            }
1989            "landscaping_services" => Ok(LandscapingServices),
1990            "laundries" => Ok(Laundries),
1991            "laundry_cleaning_services" => Ok(LaundryCleaningServices),
1992            "legal_services_attorneys" => Ok(LegalServicesAttorneys),
1993            "luggage_and_leather_goods_stores" => Ok(LuggageAndLeatherGoodsStores),
1994            "lumber_building_materials_stores" => Ok(LumberBuildingMaterialsStores),
1995            "manual_cash_disburse" => Ok(ManualCashDisburse),
1996            "marinas_service_and_supplies" => Ok(MarinasServiceAndSupplies),
1997            "marketplaces" => Ok(Marketplaces),
1998            "masonry_stonework_and_plaster" => Ok(MasonryStoneworkAndPlaster),
1999            "massage_parlors" => Ok(MassageParlors),
2000            "medical_and_dental_labs" => Ok(MedicalAndDentalLabs),
2001            "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" => {
2002                Ok(MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies)
2003            }
2004            "medical_services" => Ok(MedicalServices),
2005            "membership_organizations" => Ok(MembershipOrganizations),
2006            "mens_and_boys_clothing_and_accessories_stores" => {
2007                Ok(MensAndBoysClothingAndAccessoriesStores)
2008            }
2009            "mens_womens_clothing_stores" => Ok(MensWomensClothingStores),
2010            "metal_service_centers" => Ok(MetalServiceCenters),
2011            "miscellaneous_apparel_and_accessory_shops" => {
2012                Ok(MiscellaneousApparelAndAccessoryShops)
2013            }
2014            "miscellaneous_auto_dealers" => Ok(MiscellaneousAutoDealers),
2015            "miscellaneous_business_services" => Ok(MiscellaneousBusinessServices),
2016            "miscellaneous_food_stores" => Ok(MiscellaneousFoodStores),
2017            "miscellaneous_general_merchandise" => Ok(MiscellaneousGeneralMerchandise),
2018            "miscellaneous_general_services" => Ok(MiscellaneousGeneralServices),
2019            "miscellaneous_home_furnishing_specialty_stores" => {
2020                Ok(MiscellaneousHomeFurnishingSpecialtyStores)
2021            }
2022            "miscellaneous_publishing_and_printing" => Ok(MiscellaneousPublishingAndPrinting),
2023            "miscellaneous_recreation_services" => Ok(MiscellaneousRecreationServices),
2024            "miscellaneous_repair_shops" => Ok(MiscellaneousRepairShops),
2025            "miscellaneous_specialty_retail" => Ok(MiscellaneousSpecialtyRetail),
2026            "mobile_home_dealers" => Ok(MobileHomeDealers),
2027            "motion_picture_theaters" => Ok(MotionPictureTheaters),
2028            "motor_freight_carriers_and_trucking" => Ok(MotorFreightCarriersAndTrucking),
2029            "motor_homes_dealers" => Ok(MotorHomesDealers),
2030            "motor_vehicle_supplies_and_new_parts" => Ok(MotorVehicleSuppliesAndNewParts),
2031            "motorcycle_shops_and_dealers" => Ok(MotorcycleShopsAndDealers),
2032            "motorcycle_shops_dealers" => Ok(MotorcycleShopsDealers),
2033            "music_stores_musical_instruments_pianos_and_sheet_music" => {
2034                Ok(MusicStoresMusicalInstrumentsPianosAndSheetMusic)
2035            }
2036            "news_dealers_and_newsstands" => Ok(NewsDealersAndNewsstands),
2037            "non_fi_money_orders" => Ok(NonFiMoneyOrders),
2038            "non_fi_stored_value_card_purchase_load" => Ok(NonFiStoredValueCardPurchaseLoad),
2039            "nondurable_goods" => Ok(NondurableGoods),
2040            "nurseries_lawn_and_garden_supply_stores" => Ok(NurseriesLawnAndGardenSupplyStores),
2041            "nursing_personal_care" => Ok(NursingPersonalCare),
2042            "office_and_commercial_furniture" => Ok(OfficeAndCommercialFurniture),
2043            "opticians_eyeglasses" => Ok(OpticiansEyeglasses),
2044            "optometrists_ophthalmologist" => Ok(OptometristsOphthalmologist),
2045            "orthopedic_goods_prosthetic_devices" => Ok(OrthopedicGoodsProstheticDevices),
2046            "osteopaths" => Ok(Osteopaths),
2047            "package_stores_beer_wine_and_liquor" => Ok(PackageStoresBeerWineAndLiquor),
2048            "paints_varnishes_and_supplies" => Ok(PaintsVarnishesAndSupplies),
2049            "parking_lots_garages" => Ok(ParkingLotsGarages),
2050            "passenger_railways" => Ok(PassengerRailways),
2051            "pawn_shops" => Ok(PawnShops),
2052            "pet_shops_pet_food_and_supplies" => Ok(PetShopsPetFoodAndSupplies),
2053            "petroleum_and_petroleum_products" => Ok(PetroleumAndPetroleumProducts),
2054            "photo_developing" => Ok(PhotoDeveloping),
2055            "photographic_photocopy_microfilm_equipment_and_supplies" => {
2056                Ok(PhotographicPhotocopyMicrofilmEquipmentAndSupplies)
2057            }
2058            "photographic_studios" => Ok(PhotographicStudios),
2059            "picture_video_production" => Ok(PictureVideoProduction),
2060            "piece_goods_notions_and_other_dry_goods" => Ok(PieceGoodsNotionsAndOtherDryGoods),
2061            "plumbing_heating_equipment_and_supplies" => Ok(PlumbingHeatingEquipmentAndSupplies),
2062            "political_organizations" => Ok(PoliticalOrganizations),
2063            "postal_services_government_only" => Ok(PostalServicesGovernmentOnly),
2064            "precious_stones_and_metals_watches_and_jewelry" => {
2065                Ok(PreciousStonesAndMetalsWatchesAndJewelry)
2066            }
2067            "professional_services" => Ok(ProfessionalServices),
2068            "public_warehousing_and_storage" => Ok(PublicWarehousingAndStorage),
2069            "quick_copy_repro_and_blueprint" => Ok(QuickCopyReproAndBlueprint),
2070            "railroads" => Ok(Railroads),
2071            "real_estate_agents_and_managers_rentals" => Ok(RealEstateAgentsAndManagersRentals),
2072            "record_stores" => Ok(RecordStores),
2073            "recreational_vehicle_rentals" => Ok(RecreationalVehicleRentals),
2074            "religious_goods_stores" => Ok(ReligiousGoodsStores),
2075            "religious_organizations" => Ok(ReligiousOrganizations),
2076            "roofing_siding_sheet_metal" => Ok(RoofingSidingSheetMetal),
2077            "secretarial_support_services" => Ok(SecretarialSupportServices),
2078            "security_brokers_dealers" => Ok(SecurityBrokersDealers),
2079            "service_stations" => Ok(ServiceStations),
2080            "sewing_needlework_fabric_and_piece_goods_stores" => {
2081                Ok(SewingNeedleworkFabricAndPieceGoodsStores)
2082            }
2083            "shoe_repair_hat_cleaning" => Ok(ShoeRepairHatCleaning),
2084            "shoe_stores" => Ok(ShoeStores),
2085            "small_appliance_repair" => Ok(SmallApplianceRepair),
2086            "snowmobile_dealers" => Ok(SnowmobileDealers),
2087            "special_trade_services" => Ok(SpecialTradeServices),
2088            "specialty_cleaning" => Ok(SpecialtyCleaning),
2089            "sporting_goods_stores" => Ok(SportingGoodsStores),
2090            "sporting_recreation_camps" => Ok(SportingRecreationCamps),
2091            "sports_and_riding_apparel_stores" => Ok(SportsAndRidingApparelStores),
2092            "sports_clubs_fields" => Ok(SportsClubsFields),
2093            "stamp_and_coin_stores" => Ok(StampAndCoinStores),
2094            "stationary_office_supplies_printing_and_writing_paper" => {
2095                Ok(StationaryOfficeSuppliesPrintingAndWritingPaper)
2096            }
2097            "stationery_stores_office_and_school_supply_stores" => {
2098                Ok(StationeryStoresOfficeAndSchoolSupplyStores)
2099            }
2100            "swimming_pools_sales" => Ok(SwimmingPoolsSales),
2101            "t_ui_travel_germany" => Ok(TUiTravelGermany),
2102            "tailors_alterations" => Ok(TailorsAlterations),
2103            "tax_payments_government_agencies" => Ok(TaxPaymentsGovernmentAgencies),
2104            "tax_preparation_services" => Ok(TaxPreparationServices),
2105            "taxicabs_limousines" => Ok(TaxicabsLimousines),
2106            "telecommunication_equipment_and_telephone_sales" => {
2107                Ok(TelecommunicationEquipmentAndTelephoneSales)
2108            }
2109            "telecommunication_services" => Ok(TelecommunicationServices),
2110            "telegraph_services" => Ok(TelegraphServices),
2111            "tent_and_awning_shops" => Ok(TentAndAwningShops),
2112            "testing_laboratories" => Ok(TestingLaboratories),
2113            "theatrical_ticket_agencies" => Ok(TheatricalTicketAgencies),
2114            "timeshares" => Ok(Timeshares),
2115            "tire_retreading_and_repair" => Ok(TireRetreadingAndRepair),
2116            "tolls_bridge_fees" => Ok(TollsBridgeFees),
2117            "tourist_attractions_and_exhibits" => Ok(TouristAttractionsAndExhibits),
2118            "towing_services" => Ok(TowingServices),
2119            "trailer_parks_campgrounds" => Ok(TrailerParksCampgrounds),
2120            "transportation_services" => Ok(TransportationServices),
2121            "travel_agencies_tour_operators" => Ok(TravelAgenciesTourOperators),
2122            "truck_stop_iteration" => Ok(TruckStopIteration),
2123            "truck_utility_trailer_rentals" => Ok(TruckUtilityTrailerRentals),
2124            "typesetting_plate_making_and_related_services" => {
2125                Ok(TypesettingPlateMakingAndRelatedServices)
2126            }
2127            "typewriter_stores" => Ok(TypewriterStores),
2128            "u_s_federal_government_agencies_or_departments" => {
2129                Ok(USFederalGovernmentAgenciesOrDepartments)
2130            }
2131            "uniforms_commercial_clothing" => Ok(UniformsCommercialClothing),
2132            "used_merchandise_and_secondhand_stores" => Ok(UsedMerchandiseAndSecondhandStores),
2133            "utilities" => Ok(Utilities),
2134            "variety_stores" => Ok(VarietyStores),
2135            "veterinary_services" => Ok(VeterinaryServices),
2136            "video_amusement_game_supplies" => Ok(VideoAmusementGameSupplies),
2137            "video_game_arcades" => Ok(VideoGameArcades),
2138            "video_tape_rental_stores" => Ok(VideoTapeRentalStores),
2139            "vocational_trade_schools" => Ok(VocationalTradeSchools),
2140            "watch_jewelry_repair" => Ok(WatchJewelryRepair),
2141            "welding_repair" => Ok(WeldingRepair),
2142            "wholesale_clubs" => Ok(WholesaleClubs),
2143            "wig_and_toupee_stores" => Ok(WigAndToupeeStores),
2144            "wires_money_orders" => Ok(WiresMoneyOrders),
2145            "womens_accessory_and_specialty_shops" => Ok(WomensAccessoryAndSpecialtyShops),
2146            "womens_ready_to_wear_stores" => Ok(WomensReadyToWearStores),
2147            "wrecking_and_salvage_yards" => Ok(WreckingAndSalvageYards),
2148            v => {
2149                tracing::warn!(
2150                    "Unknown value '{}' for enum '{}'",
2151                    v,
2152                    "CreateIssuingAuthorizationMerchantDataCategory"
2153                );
2154                Ok(Unknown(v.to_owned()))
2155            }
2156        }
2157    }
2158}
2159impl std::fmt::Display for CreateIssuingAuthorizationMerchantDataCategory {
2160    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2161        f.write_str(self.as_str())
2162    }
2163}
2164
2165#[cfg(not(feature = "redact-generated-debug"))]
2166impl std::fmt::Debug for CreateIssuingAuthorizationMerchantDataCategory {
2167    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2168        f.write_str(self.as_str())
2169    }
2170}
2171#[cfg(feature = "redact-generated-debug")]
2172impl std::fmt::Debug for CreateIssuingAuthorizationMerchantDataCategory {
2173    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2174        f.debug_struct(stringify!(CreateIssuingAuthorizationMerchantDataCategory))
2175            .finish_non_exhaustive()
2176    }
2177}
2178impl serde::Serialize for CreateIssuingAuthorizationMerchantDataCategory {
2179    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2180    where
2181        S: serde::Serializer,
2182    {
2183        serializer.serialize_str(self.as_str())
2184    }
2185}
2186#[cfg(feature = "deserialize")]
2187impl<'de> serde::Deserialize<'de> for CreateIssuingAuthorizationMerchantDataCategory {
2188    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2189        use std::str::FromStr;
2190        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2191        Ok(Self::from_str(&s).expect("infallible"))
2192    }
2193}
2194/// Details about the authorization, such as identifiers, set by the card network.
2195#[derive(Clone, Eq, PartialEq)]
2196#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
2197#[derive(serde::Serialize)]
2198pub struct CreateIssuingAuthorizationNetworkData {
2199    /// Identifier assigned to the acquirer by the card network.
2200    #[serde(skip_serializing_if = "Option::is_none")]
2201    pub acquiring_institution_id: Option<String>,
2202}
2203#[cfg(feature = "redact-generated-debug")]
2204impl std::fmt::Debug for CreateIssuingAuthorizationNetworkData {
2205    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2206        f.debug_struct("CreateIssuingAuthorizationNetworkData").finish_non_exhaustive()
2207    }
2208}
2209impl CreateIssuingAuthorizationNetworkData {
2210    pub fn new() -> Self {
2211        Self { acquiring_institution_id: None }
2212    }
2213}
2214impl Default for CreateIssuingAuthorizationNetworkData {
2215    fn default() -> Self {
2216        Self::new()
2217    }
2218}
2219/// Stripe’s assessment of the fraud risk for this authorization.
2220#[derive(Clone)]
2221#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
2222#[derive(serde::Serialize)]
2223pub struct CreateIssuingAuthorizationRiskAssessment {
2224    /// Stripe's assessment of this authorization's likelihood of being card testing activity.
2225    #[serde(skip_serializing_if = "Option::is_none")]
2226    pub card_testing_risk: Option<CreateIssuingAuthorizationRiskAssessmentCardTestingRisk>,
2227    /// Stripe’s assessment of this authorization’s likelihood to be fraudulent.
2228    #[serde(skip_serializing_if = "Option::is_none")]
2229    pub fraud_risk: Option<CreateIssuingAuthorizationRiskAssessmentFraudRisk>,
2230    /// The dispute risk of the merchant (the seller on a purchase) on an authorization based on all Stripe Issuing activity.
2231    #[serde(skip_serializing_if = "Option::is_none")]
2232    pub merchant_dispute_risk: Option<CreateIssuingAuthorizationRiskAssessmentMerchantDisputeRisk>,
2233}
2234#[cfg(feature = "redact-generated-debug")]
2235impl std::fmt::Debug for CreateIssuingAuthorizationRiskAssessment {
2236    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2237        f.debug_struct("CreateIssuingAuthorizationRiskAssessment").finish_non_exhaustive()
2238    }
2239}
2240impl CreateIssuingAuthorizationRiskAssessment {
2241    pub fn new() -> Self {
2242        Self { card_testing_risk: None, fraud_risk: None, merchant_dispute_risk: None }
2243    }
2244}
2245impl Default for CreateIssuingAuthorizationRiskAssessment {
2246    fn default() -> Self {
2247        Self::new()
2248    }
2249}
2250/// Stripe's assessment of this authorization's likelihood of being card testing activity.
2251#[derive(Clone, Eq, PartialEq)]
2252#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
2253#[derive(serde::Serialize)]
2254pub struct CreateIssuingAuthorizationRiskAssessmentCardTestingRisk {
2255    /// The % of declines due to a card number not existing in the past hour, taking place at the same merchant.
2256    /// Higher rates correspond to a greater probability of card testing activity, meaning bad actors may be attempting different card number combinations to guess a correct one.
2257    /// Takes on values between 0 and 100.
2258    #[serde(skip_serializing_if = "Option::is_none")]
2259    pub invalid_account_number_decline_rate_past_hour: Option<i64>,
2260    /// The % of declines due to incorrect verification data (like CVV or expiry) in the past hour, taking place at the same merchant.
2261    /// Higher rates correspond to a greater probability of bad actors attempting to utilize valid card credentials at merchants with verification requirements.
2262    /// Takes on values between 0 and 100.
2263    #[serde(skip_serializing_if = "Option::is_none")]
2264    pub invalid_credentials_decline_rate_past_hour: Option<i64>,
2265    /// The likelihood that this authorization is associated with card testing activity.
2266    /// This is assessed by evaluating decline activity over the last hour.
2267    pub level: CreateIssuingAuthorizationRiskAssessmentCardTestingRiskLevel,
2268}
2269#[cfg(feature = "redact-generated-debug")]
2270impl std::fmt::Debug for CreateIssuingAuthorizationRiskAssessmentCardTestingRisk {
2271    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2272        f.debug_struct("CreateIssuingAuthorizationRiskAssessmentCardTestingRisk")
2273            .finish_non_exhaustive()
2274    }
2275}
2276impl CreateIssuingAuthorizationRiskAssessmentCardTestingRisk {
2277    pub fn new(
2278        level: impl Into<CreateIssuingAuthorizationRiskAssessmentCardTestingRiskLevel>,
2279    ) -> Self {
2280        Self {
2281            invalid_account_number_decline_rate_past_hour: None,
2282            invalid_credentials_decline_rate_past_hour: None,
2283            level: level.into(),
2284        }
2285    }
2286}
2287/// The likelihood that this authorization is associated with card testing activity.
2288/// This is assessed by evaluating decline activity over the last hour.
2289#[derive(Clone, Eq, PartialEq)]
2290#[non_exhaustive]
2291pub enum CreateIssuingAuthorizationRiskAssessmentCardTestingRiskLevel {
2292    Elevated,
2293    Highest,
2294    Low,
2295    Normal,
2296    NotAssessed,
2297    Unknown,
2298    /// An unrecognized value from Stripe. Should not be used as a request parameter.
2299    /// This variant is prefixed with an underscore to avoid conflicts with Stripe's 'Unknown' variant.
2300    _Unknown(String),
2301}
2302impl CreateIssuingAuthorizationRiskAssessmentCardTestingRiskLevel {
2303    pub fn as_str(&self) -> &str {
2304        use CreateIssuingAuthorizationRiskAssessmentCardTestingRiskLevel::*;
2305        match self {
2306            Elevated => "elevated",
2307            Highest => "highest",
2308            Low => "low",
2309            Normal => "normal",
2310            NotAssessed => "not_assessed",
2311            Unknown => "unknown",
2312            _Unknown(v) => v,
2313        }
2314    }
2315}
2316
2317impl std::str::FromStr for CreateIssuingAuthorizationRiskAssessmentCardTestingRiskLevel {
2318    type Err = std::convert::Infallible;
2319    fn from_str(s: &str) -> Result<Self, Self::Err> {
2320        use CreateIssuingAuthorizationRiskAssessmentCardTestingRiskLevel::*;
2321        match s {
2322            "elevated" => Ok(Elevated),
2323            "highest" => Ok(Highest),
2324            "low" => Ok(Low),
2325            "normal" => Ok(Normal),
2326            "not_assessed" => Ok(NotAssessed),
2327            "unknown" => Ok(Unknown),
2328            v => {
2329                tracing::warn!(
2330                    "Unknown value '{}' for enum '{}'",
2331                    v,
2332                    "CreateIssuingAuthorizationRiskAssessmentCardTestingRiskLevel"
2333                );
2334                Ok(_Unknown(v.to_owned()))
2335            }
2336        }
2337    }
2338}
2339impl std::fmt::Display for CreateIssuingAuthorizationRiskAssessmentCardTestingRiskLevel {
2340    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2341        f.write_str(self.as_str())
2342    }
2343}
2344
2345#[cfg(not(feature = "redact-generated-debug"))]
2346impl std::fmt::Debug for CreateIssuingAuthorizationRiskAssessmentCardTestingRiskLevel {
2347    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2348        f.write_str(self.as_str())
2349    }
2350}
2351#[cfg(feature = "redact-generated-debug")]
2352impl std::fmt::Debug for CreateIssuingAuthorizationRiskAssessmentCardTestingRiskLevel {
2353    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2354        f.debug_struct(stringify!(CreateIssuingAuthorizationRiskAssessmentCardTestingRiskLevel))
2355            .finish_non_exhaustive()
2356    }
2357}
2358impl serde::Serialize for CreateIssuingAuthorizationRiskAssessmentCardTestingRiskLevel {
2359    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2360    where
2361        S: serde::Serializer,
2362    {
2363        serializer.serialize_str(self.as_str())
2364    }
2365}
2366#[cfg(feature = "deserialize")]
2367impl<'de> serde::Deserialize<'de> for CreateIssuingAuthorizationRiskAssessmentCardTestingRiskLevel {
2368    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2369        use std::str::FromStr;
2370        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2371        Ok(Self::from_str(&s).expect("infallible"))
2372    }
2373}
2374/// Stripe’s assessment of this authorization’s likelihood to be fraudulent.
2375#[derive(Clone)]
2376#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
2377#[derive(serde::Serialize)]
2378pub struct CreateIssuingAuthorizationRiskAssessmentFraudRisk {
2379    /// Stripe’s assessment of the likelihood of fraud on an authorization.
2380    pub level: CreateIssuingAuthorizationRiskAssessmentFraudRiskLevel,
2381    /// Stripe’s numerical model score assessing the likelihood of fraudulent activity.
2382    /// A higher score means a higher likelihood of fraudulent activity, and anything above 25 is considered high risk.
2383    #[serde(skip_serializing_if = "Option::is_none")]
2384    pub score: Option<f64>,
2385}
2386#[cfg(feature = "redact-generated-debug")]
2387impl std::fmt::Debug for CreateIssuingAuthorizationRiskAssessmentFraudRisk {
2388    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2389        f.debug_struct("CreateIssuingAuthorizationRiskAssessmentFraudRisk").finish_non_exhaustive()
2390    }
2391}
2392impl CreateIssuingAuthorizationRiskAssessmentFraudRisk {
2393    pub fn new(level: impl Into<CreateIssuingAuthorizationRiskAssessmentFraudRiskLevel>) -> Self {
2394        Self { level: level.into(), score: None }
2395    }
2396}
2397/// Stripe’s assessment of the likelihood of fraud on an authorization.
2398#[derive(Clone, Eq, PartialEq)]
2399#[non_exhaustive]
2400pub enum CreateIssuingAuthorizationRiskAssessmentFraudRiskLevel {
2401    Elevated,
2402    Highest,
2403    Low,
2404    Normal,
2405    NotAssessed,
2406    Unknown,
2407    /// An unrecognized value from Stripe. Should not be used as a request parameter.
2408    /// This variant is prefixed with an underscore to avoid conflicts with Stripe's 'Unknown' variant.
2409    _Unknown(String),
2410}
2411impl CreateIssuingAuthorizationRiskAssessmentFraudRiskLevel {
2412    pub fn as_str(&self) -> &str {
2413        use CreateIssuingAuthorizationRiskAssessmentFraudRiskLevel::*;
2414        match self {
2415            Elevated => "elevated",
2416            Highest => "highest",
2417            Low => "low",
2418            Normal => "normal",
2419            NotAssessed => "not_assessed",
2420            Unknown => "unknown",
2421            _Unknown(v) => v,
2422        }
2423    }
2424}
2425
2426impl std::str::FromStr for CreateIssuingAuthorizationRiskAssessmentFraudRiskLevel {
2427    type Err = std::convert::Infallible;
2428    fn from_str(s: &str) -> Result<Self, Self::Err> {
2429        use CreateIssuingAuthorizationRiskAssessmentFraudRiskLevel::*;
2430        match s {
2431            "elevated" => Ok(Elevated),
2432            "highest" => Ok(Highest),
2433            "low" => Ok(Low),
2434            "normal" => Ok(Normal),
2435            "not_assessed" => Ok(NotAssessed),
2436            "unknown" => Ok(Unknown),
2437            v => {
2438                tracing::warn!(
2439                    "Unknown value '{}' for enum '{}'",
2440                    v,
2441                    "CreateIssuingAuthorizationRiskAssessmentFraudRiskLevel"
2442                );
2443                Ok(_Unknown(v.to_owned()))
2444            }
2445        }
2446    }
2447}
2448impl std::fmt::Display for CreateIssuingAuthorizationRiskAssessmentFraudRiskLevel {
2449    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2450        f.write_str(self.as_str())
2451    }
2452}
2453
2454#[cfg(not(feature = "redact-generated-debug"))]
2455impl std::fmt::Debug for CreateIssuingAuthorizationRiskAssessmentFraudRiskLevel {
2456    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2457        f.write_str(self.as_str())
2458    }
2459}
2460#[cfg(feature = "redact-generated-debug")]
2461impl std::fmt::Debug for CreateIssuingAuthorizationRiskAssessmentFraudRiskLevel {
2462    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2463        f.debug_struct(stringify!(CreateIssuingAuthorizationRiskAssessmentFraudRiskLevel))
2464            .finish_non_exhaustive()
2465    }
2466}
2467impl serde::Serialize for CreateIssuingAuthorizationRiskAssessmentFraudRiskLevel {
2468    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2469    where
2470        S: serde::Serializer,
2471    {
2472        serializer.serialize_str(self.as_str())
2473    }
2474}
2475#[cfg(feature = "deserialize")]
2476impl<'de> serde::Deserialize<'de> for CreateIssuingAuthorizationRiskAssessmentFraudRiskLevel {
2477    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2478        use std::str::FromStr;
2479        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2480        Ok(Self::from_str(&s).expect("infallible"))
2481    }
2482}
2483/// The dispute risk of the merchant (the seller on a purchase) on an authorization based on all Stripe Issuing activity.
2484#[derive(Clone, Eq, PartialEq)]
2485#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
2486#[derive(serde::Serialize)]
2487pub struct CreateIssuingAuthorizationRiskAssessmentMerchantDisputeRisk {
2488    /// The dispute rate observed across all Stripe Issuing authorizations for this merchant.
2489    /// For example, a value of 50 means 50% of authorizations from this merchant on Stripe Issuing have resulted in a dispute.
2490    /// Higher values mean a higher likelihood the authorization is disputed.
2491    /// Takes on values between 0 and 100.
2492    #[serde(skip_serializing_if = "Option::is_none")]
2493    pub dispute_rate: Option<i64>,
2494    /// The likelihood that authorizations from this merchant will result in a dispute based on their history on Stripe Issuing.
2495    pub level: CreateIssuingAuthorizationRiskAssessmentMerchantDisputeRiskLevel,
2496}
2497#[cfg(feature = "redact-generated-debug")]
2498impl std::fmt::Debug for CreateIssuingAuthorizationRiskAssessmentMerchantDisputeRisk {
2499    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2500        f.debug_struct("CreateIssuingAuthorizationRiskAssessmentMerchantDisputeRisk")
2501            .finish_non_exhaustive()
2502    }
2503}
2504impl CreateIssuingAuthorizationRiskAssessmentMerchantDisputeRisk {
2505    pub fn new(
2506        level: impl Into<CreateIssuingAuthorizationRiskAssessmentMerchantDisputeRiskLevel>,
2507    ) -> Self {
2508        Self { dispute_rate: None, level: level.into() }
2509    }
2510}
2511/// The likelihood that authorizations from this merchant will result in a dispute based on their history on Stripe Issuing.
2512#[derive(Clone, Eq, PartialEq)]
2513#[non_exhaustive]
2514pub enum CreateIssuingAuthorizationRiskAssessmentMerchantDisputeRiskLevel {
2515    Elevated,
2516    Highest,
2517    Low,
2518    Normal,
2519    NotAssessed,
2520    Unknown,
2521    /// An unrecognized value from Stripe. Should not be used as a request parameter.
2522    /// This variant is prefixed with an underscore to avoid conflicts with Stripe's 'Unknown' variant.
2523    _Unknown(String),
2524}
2525impl CreateIssuingAuthorizationRiskAssessmentMerchantDisputeRiskLevel {
2526    pub fn as_str(&self) -> &str {
2527        use CreateIssuingAuthorizationRiskAssessmentMerchantDisputeRiskLevel::*;
2528        match self {
2529            Elevated => "elevated",
2530            Highest => "highest",
2531            Low => "low",
2532            Normal => "normal",
2533            NotAssessed => "not_assessed",
2534            Unknown => "unknown",
2535            _Unknown(v) => v,
2536        }
2537    }
2538}
2539
2540impl std::str::FromStr for CreateIssuingAuthorizationRiskAssessmentMerchantDisputeRiskLevel {
2541    type Err = std::convert::Infallible;
2542    fn from_str(s: &str) -> Result<Self, Self::Err> {
2543        use CreateIssuingAuthorizationRiskAssessmentMerchantDisputeRiskLevel::*;
2544        match s {
2545            "elevated" => Ok(Elevated),
2546            "highest" => Ok(Highest),
2547            "low" => Ok(Low),
2548            "normal" => Ok(Normal),
2549            "not_assessed" => Ok(NotAssessed),
2550            "unknown" => Ok(Unknown),
2551            v => {
2552                tracing::warn!(
2553                    "Unknown value '{}' for enum '{}'",
2554                    v,
2555                    "CreateIssuingAuthorizationRiskAssessmentMerchantDisputeRiskLevel"
2556                );
2557                Ok(_Unknown(v.to_owned()))
2558            }
2559        }
2560    }
2561}
2562impl std::fmt::Display for CreateIssuingAuthorizationRiskAssessmentMerchantDisputeRiskLevel {
2563    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2564        f.write_str(self.as_str())
2565    }
2566}
2567
2568#[cfg(not(feature = "redact-generated-debug"))]
2569impl std::fmt::Debug for CreateIssuingAuthorizationRiskAssessmentMerchantDisputeRiskLevel {
2570    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2571        f.write_str(self.as_str())
2572    }
2573}
2574#[cfg(feature = "redact-generated-debug")]
2575impl std::fmt::Debug for CreateIssuingAuthorizationRiskAssessmentMerchantDisputeRiskLevel {
2576    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2577        f.debug_struct(stringify!(CreateIssuingAuthorizationRiskAssessmentMerchantDisputeRiskLevel))
2578            .finish_non_exhaustive()
2579    }
2580}
2581impl serde::Serialize for CreateIssuingAuthorizationRiskAssessmentMerchantDisputeRiskLevel {
2582    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2583    where
2584        S: serde::Serializer,
2585    {
2586        serializer.serialize_str(self.as_str())
2587    }
2588}
2589#[cfg(feature = "deserialize")]
2590impl<'de> serde::Deserialize<'de>
2591    for CreateIssuingAuthorizationRiskAssessmentMerchantDisputeRiskLevel
2592{
2593    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2594        use std::str::FromStr;
2595        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2596        Ok(Self::from_str(&s).expect("infallible"))
2597    }
2598}
2599/// Verifications that Stripe performed on information that the cardholder provided to the merchant.
2600#[derive(Clone, Eq, PartialEq)]
2601#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
2602#[derive(serde::Serialize)]
2603pub struct CreateIssuingAuthorizationVerificationData {
2604    /// Whether the cardholder provided an address first line and if it matched the cardholder’s `billing.address.line1`.
2605    #[serde(skip_serializing_if = "Option::is_none")]
2606    pub address_line1_check: Option<CreateIssuingAuthorizationVerificationDataAddressLine1Check>,
2607    /// Whether the cardholder provided a postal code and if it matched the cardholder’s `billing.address.postal_code`.
2608    #[serde(skip_serializing_if = "Option::is_none")]
2609    pub address_postal_code_check:
2610        Option<CreateIssuingAuthorizationVerificationDataAddressPostalCodeCheck>,
2611    /// The exemption applied to this authorization.
2612    #[serde(skip_serializing_if = "Option::is_none")]
2613    pub authentication_exemption:
2614        Option<CreateIssuingAuthorizationVerificationDataAuthenticationExemption>,
2615    /// Whether the cardholder provided a CVC and if it matched Stripe’s record.
2616    #[serde(skip_serializing_if = "Option::is_none")]
2617    pub cvc_check: Option<CreateIssuingAuthorizationVerificationDataCvcCheck>,
2618    /// Whether the cardholder provided an expiry date and if it matched Stripe’s record.
2619    #[serde(skip_serializing_if = "Option::is_none")]
2620    pub expiry_check: Option<CreateIssuingAuthorizationVerificationDataExpiryCheck>,
2621    /// 3D Secure details.
2622    #[serde(skip_serializing_if = "Option::is_none")]
2623    pub three_d_secure: Option<CreateIssuingAuthorizationVerificationDataThreeDSecure>,
2624}
2625#[cfg(feature = "redact-generated-debug")]
2626impl std::fmt::Debug for CreateIssuingAuthorizationVerificationData {
2627    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2628        f.debug_struct("CreateIssuingAuthorizationVerificationData").finish_non_exhaustive()
2629    }
2630}
2631impl CreateIssuingAuthorizationVerificationData {
2632    pub fn new() -> Self {
2633        Self {
2634            address_line1_check: None,
2635            address_postal_code_check: None,
2636            authentication_exemption: None,
2637            cvc_check: None,
2638            expiry_check: None,
2639            three_d_secure: None,
2640        }
2641    }
2642}
2643impl Default for CreateIssuingAuthorizationVerificationData {
2644    fn default() -> Self {
2645        Self::new()
2646    }
2647}
2648/// Whether the cardholder provided an address first line and if it matched the cardholder’s `billing.address.line1`.
2649#[derive(Clone, Eq, PartialEq)]
2650#[non_exhaustive]
2651pub enum CreateIssuingAuthorizationVerificationDataAddressLine1Check {
2652    Match,
2653    Mismatch,
2654    NotProvided,
2655    /// An unrecognized value from Stripe. Should not be used as a request parameter.
2656    Unknown(String),
2657}
2658impl CreateIssuingAuthorizationVerificationDataAddressLine1Check {
2659    pub fn as_str(&self) -> &str {
2660        use CreateIssuingAuthorizationVerificationDataAddressLine1Check::*;
2661        match self {
2662            Match => "match",
2663            Mismatch => "mismatch",
2664            NotProvided => "not_provided",
2665            Unknown(v) => v,
2666        }
2667    }
2668}
2669
2670impl std::str::FromStr for CreateIssuingAuthorizationVerificationDataAddressLine1Check {
2671    type Err = std::convert::Infallible;
2672    fn from_str(s: &str) -> Result<Self, Self::Err> {
2673        use CreateIssuingAuthorizationVerificationDataAddressLine1Check::*;
2674        match s {
2675            "match" => Ok(Match),
2676            "mismatch" => Ok(Mismatch),
2677            "not_provided" => Ok(NotProvided),
2678            v => {
2679                tracing::warn!(
2680                    "Unknown value '{}' for enum '{}'",
2681                    v,
2682                    "CreateIssuingAuthorizationVerificationDataAddressLine1Check"
2683                );
2684                Ok(Unknown(v.to_owned()))
2685            }
2686        }
2687    }
2688}
2689impl std::fmt::Display for CreateIssuingAuthorizationVerificationDataAddressLine1Check {
2690    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2691        f.write_str(self.as_str())
2692    }
2693}
2694
2695#[cfg(not(feature = "redact-generated-debug"))]
2696impl std::fmt::Debug for CreateIssuingAuthorizationVerificationDataAddressLine1Check {
2697    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2698        f.write_str(self.as_str())
2699    }
2700}
2701#[cfg(feature = "redact-generated-debug")]
2702impl std::fmt::Debug for CreateIssuingAuthorizationVerificationDataAddressLine1Check {
2703    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2704        f.debug_struct(stringify!(CreateIssuingAuthorizationVerificationDataAddressLine1Check))
2705            .finish_non_exhaustive()
2706    }
2707}
2708impl serde::Serialize for CreateIssuingAuthorizationVerificationDataAddressLine1Check {
2709    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2710    where
2711        S: serde::Serializer,
2712    {
2713        serializer.serialize_str(self.as_str())
2714    }
2715}
2716#[cfg(feature = "deserialize")]
2717impl<'de> serde::Deserialize<'de> for CreateIssuingAuthorizationVerificationDataAddressLine1Check {
2718    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2719        use std::str::FromStr;
2720        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2721        Ok(Self::from_str(&s).expect("infallible"))
2722    }
2723}
2724/// Whether the cardholder provided a postal code and if it matched the cardholder’s `billing.address.postal_code`.
2725#[derive(Clone, Eq, PartialEq)]
2726#[non_exhaustive]
2727pub enum CreateIssuingAuthorizationVerificationDataAddressPostalCodeCheck {
2728    Match,
2729    Mismatch,
2730    NotProvided,
2731    /// An unrecognized value from Stripe. Should not be used as a request parameter.
2732    Unknown(String),
2733}
2734impl CreateIssuingAuthorizationVerificationDataAddressPostalCodeCheck {
2735    pub fn as_str(&self) -> &str {
2736        use CreateIssuingAuthorizationVerificationDataAddressPostalCodeCheck::*;
2737        match self {
2738            Match => "match",
2739            Mismatch => "mismatch",
2740            NotProvided => "not_provided",
2741            Unknown(v) => v,
2742        }
2743    }
2744}
2745
2746impl std::str::FromStr for CreateIssuingAuthorizationVerificationDataAddressPostalCodeCheck {
2747    type Err = std::convert::Infallible;
2748    fn from_str(s: &str) -> Result<Self, Self::Err> {
2749        use CreateIssuingAuthorizationVerificationDataAddressPostalCodeCheck::*;
2750        match s {
2751            "match" => Ok(Match),
2752            "mismatch" => Ok(Mismatch),
2753            "not_provided" => Ok(NotProvided),
2754            v => {
2755                tracing::warn!(
2756                    "Unknown value '{}' for enum '{}'",
2757                    v,
2758                    "CreateIssuingAuthorizationVerificationDataAddressPostalCodeCheck"
2759                );
2760                Ok(Unknown(v.to_owned()))
2761            }
2762        }
2763    }
2764}
2765impl std::fmt::Display for CreateIssuingAuthorizationVerificationDataAddressPostalCodeCheck {
2766    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2767        f.write_str(self.as_str())
2768    }
2769}
2770
2771#[cfg(not(feature = "redact-generated-debug"))]
2772impl std::fmt::Debug for CreateIssuingAuthorizationVerificationDataAddressPostalCodeCheck {
2773    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2774        f.write_str(self.as_str())
2775    }
2776}
2777#[cfg(feature = "redact-generated-debug")]
2778impl std::fmt::Debug for CreateIssuingAuthorizationVerificationDataAddressPostalCodeCheck {
2779    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2780        f.debug_struct(stringify!(CreateIssuingAuthorizationVerificationDataAddressPostalCodeCheck))
2781            .finish_non_exhaustive()
2782    }
2783}
2784impl serde::Serialize for CreateIssuingAuthorizationVerificationDataAddressPostalCodeCheck {
2785    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2786    where
2787        S: serde::Serializer,
2788    {
2789        serializer.serialize_str(self.as_str())
2790    }
2791}
2792#[cfg(feature = "deserialize")]
2793impl<'de> serde::Deserialize<'de>
2794    for CreateIssuingAuthorizationVerificationDataAddressPostalCodeCheck
2795{
2796    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2797        use std::str::FromStr;
2798        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2799        Ok(Self::from_str(&s).expect("infallible"))
2800    }
2801}
2802/// The exemption applied to this authorization.
2803#[derive(Clone, Eq, PartialEq)]
2804#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
2805#[derive(serde::Serialize)]
2806pub struct CreateIssuingAuthorizationVerificationDataAuthenticationExemption {
2807    /// The entity that requested the exemption, either the acquiring merchant or the Issuing user.
2808    pub claimed_by: CreateIssuingAuthorizationVerificationDataAuthenticationExemptionClaimedBy,
2809    /// The specific exemption claimed for this authorization.
2810    #[serde(rename = "type")]
2811    pub type_: CreateIssuingAuthorizationVerificationDataAuthenticationExemptionType,
2812}
2813#[cfg(feature = "redact-generated-debug")]
2814impl std::fmt::Debug for CreateIssuingAuthorizationVerificationDataAuthenticationExemption {
2815    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2816        f.debug_struct("CreateIssuingAuthorizationVerificationDataAuthenticationExemption")
2817            .finish_non_exhaustive()
2818    }
2819}
2820impl CreateIssuingAuthorizationVerificationDataAuthenticationExemption {
2821    pub fn new(
2822        claimed_by: impl Into<
2823            CreateIssuingAuthorizationVerificationDataAuthenticationExemptionClaimedBy,
2824        >,
2825        type_: impl Into<CreateIssuingAuthorizationVerificationDataAuthenticationExemptionType>,
2826    ) -> Self {
2827        Self { claimed_by: claimed_by.into(), type_: type_.into() }
2828    }
2829}
2830/// The entity that requested the exemption, either the acquiring merchant or the Issuing user.
2831#[derive(Clone, Eq, PartialEq)]
2832#[non_exhaustive]
2833pub enum CreateIssuingAuthorizationVerificationDataAuthenticationExemptionClaimedBy {
2834    Acquirer,
2835    Issuer,
2836    /// An unrecognized value from Stripe. Should not be used as a request parameter.
2837    Unknown(String),
2838}
2839impl CreateIssuingAuthorizationVerificationDataAuthenticationExemptionClaimedBy {
2840    pub fn as_str(&self) -> &str {
2841        use CreateIssuingAuthorizationVerificationDataAuthenticationExemptionClaimedBy::*;
2842        match self {
2843            Acquirer => "acquirer",
2844            Issuer => "issuer",
2845            Unknown(v) => v,
2846        }
2847    }
2848}
2849
2850impl std::str::FromStr
2851    for CreateIssuingAuthorizationVerificationDataAuthenticationExemptionClaimedBy
2852{
2853    type Err = std::convert::Infallible;
2854    fn from_str(s: &str) -> Result<Self, Self::Err> {
2855        use CreateIssuingAuthorizationVerificationDataAuthenticationExemptionClaimedBy::*;
2856        match s {
2857            "acquirer" => Ok(Acquirer),
2858            "issuer" => Ok(Issuer),
2859            v => {
2860                tracing::warn!(
2861                    "Unknown value '{}' for enum '{}'",
2862                    v,
2863                    "CreateIssuingAuthorizationVerificationDataAuthenticationExemptionClaimedBy"
2864                );
2865                Ok(Unknown(v.to_owned()))
2866            }
2867        }
2868    }
2869}
2870impl std::fmt::Display
2871    for CreateIssuingAuthorizationVerificationDataAuthenticationExemptionClaimedBy
2872{
2873    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2874        f.write_str(self.as_str())
2875    }
2876}
2877
2878#[cfg(not(feature = "redact-generated-debug"))]
2879impl std::fmt::Debug
2880    for CreateIssuingAuthorizationVerificationDataAuthenticationExemptionClaimedBy
2881{
2882    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2883        f.write_str(self.as_str())
2884    }
2885}
2886#[cfg(feature = "redact-generated-debug")]
2887impl std::fmt::Debug
2888    for CreateIssuingAuthorizationVerificationDataAuthenticationExemptionClaimedBy
2889{
2890    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2891        f.debug_struct(stringify!(
2892            CreateIssuingAuthorizationVerificationDataAuthenticationExemptionClaimedBy
2893        ))
2894        .finish_non_exhaustive()
2895    }
2896}
2897impl serde::Serialize
2898    for CreateIssuingAuthorizationVerificationDataAuthenticationExemptionClaimedBy
2899{
2900    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2901    where
2902        S: serde::Serializer,
2903    {
2904        serializer.serialize_str(self.as_str())
2905    }
2906}
2907#[cfg(feature = "deserialize")]
2908impl<'de> serde::Deserialize<'de>
2909    for CreateIssuingAuthorizationVerificationDataAuthenticationExemptionClaimedBy
2910{
2911    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2912        use std::str::FromStr;
2913        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2914        Ok(Self::from_str(&s).expect("infallible"))
2915    }
2916}
2917/// The specific exemption claimed for this authorization.
2918#[derive(Clone, Eq, PartialEq)]
2919#[non_exhaustive]
2920pub enum CreateIssuingAuthorizationVerificationDataAuthenticationExemptionType {
2921    LowValueTransaction,
2922    TransactionRiskAnalysis,
2923    Unknown,
2924    /// An unrecognized value from Stripe. Should not be used as a request parameter.
2925    /// This variant is prefixed with an underscore to avoid conflicts with Stripe's 'Unknown' variant.
2926    _Unknown(String),
2927}
2928impl CreateIssuingAuthorizationVerificationDataAuthenticationExemptionType {
2929    pub fn as_str(&self) -> &str {
2930        use CreateIssuingAuthorizationVerificationDataAuthenticationExemptionType::*;
2931        match self {
2932            LowValueTransaction => "low_value_transaction",
2933            TransactionRiskAnalysis => "transaction_risk_analysis",
2934            Unknown => "unknown",
2935            _Unknown(v) => v,
2936        }
2937    }
2938}
2939
2940impl std::str::FromStr for CreateIssuingAuthorizationVerificationDataAuthenticationExemptionType {
2941    type Err = std::convert::Infallible;
2942    fn from_str(s: &str) -> Result<Self, Self::Err> {
2943        use CreateIssuingAuthorizationVerificationDataAuthenticationExemptionType::*;
2944        match s {
2945            "low_value_transaction" => Ok(LowValueTransaction),
2946            "transaction_risk_analysis" => Ok(TransactionRiskAnalysis),
2947            "unknown" => Ok(Unknown),
2948            v => {
2949                tracing::warn!(
2950                    "Unknown value '{}' for enum '{}'",
2951                    v,
2952                    "CreateIssuingAuthorizationVerificationDataAuthenticationExemptionType"
2953                );
2954                Ok(_Unknown(v.to_owned()))
2955            }
2956        }
2957    }
2958}
2959impl std::fmt::Display for CreateIssuingAuthorizationVerificationDataAuthenticationExemptionType {
2960    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2961        f.write_str(self.as_str())
2962    }
2963}
2964
2965#[cfg(not(feature = "redact-generated-debug"))]
2966impl std::fmt::Debug for CreateIssuingAuthorizationVerificationDataAuthenticationExemptionType {
2967    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2968        f.write_str(self.as_str())
2969    }
2970}
2971#[cfg(feature = "redact-generated-debug")]
2972impl std::fmt::Debug for CreateIssuingAuthorizationVerificationDataAuthenticationExemptionType {
2973    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2974        f.debug_struct(stringify!(
2975            CreateIssuingAuthorizationVerificationDataAuthenticationExemptionType
2976        ))
2977        .finish_non_exhaustive()
2978    }
2979}
2980impl serde::Serialize for CreateIssuingAuthorizationVerificationDataAuthenticationExemptionType {
2981    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2982    where
2983        S: serde::Serializer,
2984    {
2985        serializer.serialize_str(self.as_str())
2986    }
2987}
2988#[cfg(feature = "deserialize")]
2989impl<'de> serde::Deserialize<'de>
2990    for CreateIssuingAuthorizationVerificationDataAuthenticationExemptionType
2991{
2992    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2993        use std::str::FromStr;
2994        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2995        Ok(Self::from_str(&s).expect("infallible"))
2996    }
2997}
2998/// Whether the cardholder provided a CVC and if it matched Stripe’s record.
2999#[derive(Clone, Eq, PartialEq)]
3000#[non_exhaustive]
3001pub enum CreateIssuingAuthorizationVerificationDataCvcCheck {
3002    Match,
3003    Mismatch,
3004    NotProvided,
3005    /// An unrecognized value from Stripe. Should not be used as a request parameter.
3006    Unknown(String),
3007}
3008impl CreateIssuingAuthorizationVerificationDataCvcCheck {
3009    pub fn as_str(&self) -> &str {
3010        use CreateIssuingAuthorizationVerificationDataCvcCheck::*;
3011        match self {
3012            Match => "match",
3013            Mismatch => "mismatch",
3014            NotProvided => "not_provided",
3015            Unknown(v) => v,
3016        }
3017    }
3018}
3019
3020impl std::str::FromStr for CreateIssuingAuthorizationVerificationDataCvcCheck {
3021    type Err = std::convert::Infallible;
3022    fn from_str(s: &str) -> Result<Self, Self::Err> {
3023        use CreateIssuingAuthorizationVerificationDataCvcCheck::*;
3024        match s {
3025            "match" => Ok(Match),
3026            "mismatch" => Ok(Mismatch),
3027            "not_provided" => Ok(NotProvided),
3028            v => {
3029                tracing::warn!(
3030                    "Unknown value '{}' for enum '{}'",
3031                    v,
3032                    "CreateIssuingAuthorizationVerificationDataCvcCheck"
3033                );
3034                Ok(Unknown(v.to_owned()))
3035            }
3036        }
3037    }
3038}
3039impl std::fmt::Display for CreateIssuingAuthorizationVerificationDataCvcCheck {
3040    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3041        f.write_str(self.as_str())
3042    }
3043}
3044
3045#[cfg(not(feature = "redact-generated-debug"))]
3046impl std::fmt::Debug for CreateIssuingAuthorizationVerificationDataCvcCheck {
3047    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3048        f.write_str(self.as_str())
3049    }
3050}
3051#[cfg(feature = "redact-generated-debug")]
3052impl std::fmt::Debug for CreateIssuingAuthorizationVerificationDataCvcCheck {
3053    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3054        f.debug_struct(stringify!(CreateIssuingAuthorizationVerificationDataCvcCheck))
3055            .finish_non_exhaustive()
3056    }
3057}
3058impl serde::Serialize for CreateIssuingAuthorizationVerificationDataCvcCheck {
3059    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3060    where
3061        S: serde::Serializer,
3062    {
3063        serializer.serialize_str(self.as_str())
3064    }
3065}
3066#[cfg(feature = "deserialize")]
3067impl<'de> serde::Deserialize<'de> for CreateIssuingAuthorizationVerificationDataCvcCheck {
3068    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3069        use std::str::FromStr;
3070        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3071        Ok(Self::from_str(&s).expect("infallible"))
3072    }
3073}
3074/// Whether the cardholder provided an expiry date and if it matched Stripe’s record.
3075#[derive(Clone, Eq, PartialEq)]
3076#[non_exhaustive]
3077pub enum CreateIssuingAuthorizationVerificationDataExpiryCheck {
3078    Match,
3079    Mismatch,
3080    NotProvided,
3081    /// An unrecognized value from Stripe. Should not be used as a request parameter.
3082    Unknown(String),
3083}
3084impl CreateIssuingAuthorizationVerificationDataExpiryCheck {
3085    pub fn as_str(&self) -> &str {
3086        use CreateIssuingAuthorizationVerificationDataExpiryCheck::*;
3087        match self {
3088            Match => "match",
3089            Mismatch => "mismatch",
3090            NotProvided => "not_provided",
3091            Unknown(v) => v,
3092        }
3093    }
3094}
3095
3096impl std::str::FromStr for CreateIssuingAuthorizationVerificationDataExpiryCheck {
3097    type Err = std::convert::Infallible;
3098    fn from_str(s: &str) -> Result<Self, Self::Err> {
3099        use CreateIssuingAuthorizationVerificationDataExpiryCheck::*;
3100        match s {
3101            "match" => Ok(Match),
3102            "mismatch" => Ok(Mismatch),
3103            "not_provided" => Ok(NotProvided),
3104            v => {
3105                tracing::warn!(
3106                    "Unknown value '{}' for enum '{}'",
3107                    v,
3108                    "CreateIssuingAuthorizationVerificationDataExpiryCheck"
3109                );
3110                Ok(Unknown(v.to_owned()))
3111            }
3112        }
3113    }
3114}
3115impl std::fmt::Display for CreateIssuingAuthorizationVerificationDataExpiryCheck {
3116    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3117        f.write_str(self.as_str())
3118    }
3119}
3120
3121#[cfg(not(feature = "redact-generated-debug"))]
3122impl std::fmt::Debug for CreateIssuingAuthorizationVerificationDataExpiryCheck {
3123    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3124        f.write_str(self.as_str())
3125    }
3126}
3127#[cfg(feature = "redact-generated-debug")]
3128impl std::fmt::Debug for CreateIssuingAuthorizationVerificationDataExpiryCheck {
3129    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3130        f.debug_struct(stringify!(CreateIssuingAuthorizationVerificationDataExpiryCheck))
3131            .finish_non_exhaustive()
3132    }
3133}
3134impl serde::Serialize for CreateIssuingAuthorizationVerificationDataExpiryCheck {
3135    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3136    where
3137        S: serde::Serializer,
3138    {
3139        serializer.serialize_str(self.as_str())
3140    }
3141}
3142#[cfg(feature = "deserialize")]
3143impl<'de> serde::Deserialize<'de> for CreateIssuingAuthorizationVerificationDataExpiryCheck {
3144    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3145        use std::str::FromStr;
3146        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3147        Ok(Self::from_str(&s).expect("infallible"))
3148    }
3149}
3150/// 3D Secure details.
3151#[derive(Clone, Eq, PartialEq)]
3152#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
3153#[derive(serde::Serialize)]
3154pub struct CreateIssuingAuthorizationVerificationDataThreeDSecure {
3155    /// The outcome of the 3D Secure authentication request.
3156    pub result: CreateIssuingAuthorizationVerificationDataThreeDSecureResult,
3157}
3158#[cfg(feature = "redact-generated-debug")]
3159impl std::fmt::Debug for CreateIssuingAuthorizationVerificationDataThreeDSecure {
3160    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3161        f.debug_struct("CreateIssuingAuthorizationVerificationDataThreeDSecure")
3162            .finish_non_exhaustive()
3163    }
3164}
3165impl CreateIssuingAuthorizationVerificationDataThreeDSecure {
3166    pub fn new(
3167        result: impl Into<CreateIssuingAuthorizationVerificationDataThreeDSecureResult>,
3168    ) -> Self {
3169        Self { result: result.into() }
3170    }
3171}
3172/// The outcome of the 3D Secure authentication request.
3173#[derive(Clone, Eq, PartialEq)]
3174#[non_exhaustive]
3175pub enum CreateIssuingAuthorizationVerificationDataThreeDSecureResult {
3176    AttemptAcknowledged,
3177    Authenticated,
3178    Failed,
3179    Required,
3180    /// An unrecognized value from Stripe. Should not be used as a request parameter.
3181    Unknown(String),
3182}
3183impl CreateIssuingAuthorizationVerificationDataThreeDSecureResult {
3184    pub fn as_str(&self) -> &str {
3185        use CreateIssuingAuthorizationVerificationDataThreeDSecureResult::*;
3186        match self {
3187            AttemptAcknowledged => "attempt_acknowledged",
3188            Authenticated => "authenticated",
3189            Failed => "failed",
3190            Required => "required",
3191            Unknown(v) => v,
3192        }
3193    }
3194}
3195
3196impl std::str::FromStr for CreateIssuingAuthorizationVerificationDataThreeDSecureResult {
3197    type Err = std::convert::Infallible;
3198    fn from_str(s: &str) -> Result<Self, Self::Err> {
3199        use CreateIssuingAuthorizationVerificationDataThreeDSecureResult::*;
3200        match s {
3201            "attempt_acknowledged" => Ok(AttemptAcknowledged),
3202            "authenticated" => Ok(Authenticated),
3203            "failed" => Ok(Failed),
3204            "required" => Ok(Required),
3205            v => {
3206                tracing::warn!(
3207                    "Unknown value '{}' for enum '{}'",
3208                    v,
3209                    "CreateIssuingAuthorizationVerificationDataThreeDSecureResult"
3210                );
3211                Ok(Unknown(v.to_owned()))
3212            }
3213        }
3214    }
3215}
3216impl std::fmt::Display for CreateIssuingAuthorizationVerificationDataThreeDSecureResult {
3217    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3218        f.write_str(self.as_str())
3219    }
3220}
3221
3222#[cfg(not(feature = "redact-generated-debug"))]
3223impl std::fmt::Debug for CreateIssuingAuthorizationVerificationDataThreeDSecureResult {
3224    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3225        f.write_str(self.as_str())
3226    }
3227}
3228#[cfg(feature = "redact-generated-debug")]
3229impl std::fmt::Debug for CreateIssuingAuthorizationVerificationDataThreeDSecureResult {
3230    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3231        f.debug_struct(stringify!(CreateIssuingAuthorizationVerificationDataThreeDSecureResult))
3232            .finish_non_exhaustive()
3233    }
3234}
3235impl serde::Serialize for CreateIssuingAuthorizationVerificationDataThreeDSecureResult {
3236    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3237    where
3238        S: serde::Serializer,
3239    {
3240        serializer.serialize_str(self.as_str())
3241    }
3242}
3243#[cfg(feature = "deserialize")]
3244impl<'de> serde::Deserialize<'de> for CreateIssuingAuthorizationVerificationDataThreeDSecureResult {
3245    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3246        use std::str::FromStr;
3247        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3248        Ok(Self::from_str(&s).expect("infallible"))
3249    }
3250}
3251/// The digital wallet used for this transaction.
3252/// One of `apple_pay`, `google_pay`, or `samsung_pay`.
3253/// Will populate as `null` when no digital wallet was utilized.
3254#[derive(Clone, Eq, PartialEq)]
3255#[non_exhaustive]
3256pub enum CreateIssuingAuthorizationWallet {
3257    ApplePay,
3258    GooglePay,
3259    SamsungPay,
3260    /// An unrecognized value from Stripe. Should not be used as a request parameter.
3261    Unknown(String),
3262}
3263impl CreateIssuingAuthorizationWallet {
3264    pub fn as_str(&self) -> &str {
3265        use CreateIssuingAuthorizationWallet::*;
3266        match self {
3267            ApplePay => "apple_pay",
3268            GooglePay => "google_pay",
3269            SamsungPay => "samsung_pay",
3270            Unknown(v) => v,
3271        }
3272    }
3273}
3274
3275impl std::str::FromStr for CreateIssuingAuthorizationWallet {
3276    type Err = std::convert::Infallible;
3277    fn from_str(s: &str) -> Result<Self, Self::Err> {
3278        use CreateIssuingAuthorizationWallet::*;
3279        match s {
3280            "apple_pay" => Ok(ApplePay),
3281            "google_pay" => Ok(GooglePay),
3282            "samsung_pay" => Ok(SamsungPay),
3283            v => {
3284                tracing::warn!(
3285                    "Unknown value '{}' for enum '{}'",
3286                    v,
3287                    "CreateIssuingAuthorizationWallet"
3288                );
3289                Ok(Unknown(v.to_owned()))
3290            }
3291        }
3292    }
3293}
3294impl std::fmt::Display for CreateIssuingAuthorizationWallet {
3295    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3296        f.write_str(self.as_str())
3297    }
3298}
3299
3300#[cfg(not(feature = "redact-generated-debug"))]
3301impl std::fmt::Debug for CreateIssuingAuthorizationWallet {
3302    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3303        f.write_str(self.as_str())
3304    }
3305}
3306#[cfg(feature = "redact-generated-debug")]
3307impl std::fmt::Debug for CreateIssuingAuthorizationWallet {
3308    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3309        f.debug_struct(stringify!(CreateIssuingAuthorizationWallet)).finish_non_exhaustive()
3310    }
3311}
3312impl serde::Serialize for CreateIssuingAuthorizationWallet {
3313    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3314    where
3315        S: serde::Serializer,
3316    {
3317        serializer.serialize_str(self.as_str())
3318    }
3319}
3320#[cfg(feature = "deserialize")]
3321impl<'de> serde::Deserialize<'de> for CreateIssuingAuthorizationWallet {
3322    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3323        use std::str::FromStr;
3324        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3325        Ok(Self::from_str(&s).expect("infallible"))
3326    }
3327}
3328/// Create a test-mode authorization.
3329#[derive(Clone)]
3330#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
3331#[derive(serde::Serialize)]
3332pub struct CreateIssuingAuthorization {
3333    inner: CreateIssuingAuthorizationBuilder,
3334}
3335#[cfg(feature = "redact-generated-debug")]
3336impl std::fmt::Debug for CreateIssuingAuthorization {
3337    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3338        f.debug_struct("CreateIssuingAuthorization").finish_non_exhaustive()
3339    }
3340}
3341impl CreateIssuingAuthorization {
3342    /// Construct a new `CreateIssuingAuthorization`.
3343    pub fn new(card: impl Into<String>) -> Self {
3344        Self { inner: CreateIssuingAuthorizationBuilder::new(card.into()) }
3345    }
3346    /// The total amount to attempt to authorize.
3347    /// This amount is in the provided currency, or defaults to the card's currency, and in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal).
3348    pub fn amount(mut self, amount: impl Into<i64>) -> Self {
3349        self.inner.amount = Some(amount.into());
3350        self
3351    }
3352    /// Detailed breakdown of amount components.
3353    /// These amounts are denominated in `currency` and in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal).
3354    pub fn amount_details(
3355        mut self,
3356        amount_details: impl Into<CreateIssuingAuthorizationAmountDetails>,
3357    ) -> Self {
3358        self.inner.amount_details = Some(amount_details.into());
3359        self
3360    }
3361    /// How the card details were provided. Defaults to online.
3362    pub fn authorization_method(
3363        mut self,
3364        authorization_method: impl Into<stripe_shared::IssuingAuthorizationAuthorizationMethod>,
3365    ) -> Self {
3366        self.inner.authorization_method = Some(authorization_method.into());
3367        self
3368    }
3369    /// The currency of the authorization.
3370    /// If not provided, defaults to the currency of the card.
3371    /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
3372    /// Must be a [supported currency](https://stripe.com/docs/currencies).
3373    pub fn currency(mut self, currency: impl Into<stripe_types::Currency>) -> Self {
3374        self.inner.currency = Some(currency.into());
3375        self
3376    }
3377    /// Specifies which fields in the response should be expanded.
3378    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
3379        self.inner.expand = Some(expand.into());
3380        self
3381    }
3382    /// Fleet-specific information for authorizations using Fleet cards.
3383    pub fn fleet(mut self, fleet: impl Into<CreateIssuingAuthorizationFleet>) -> Self {
3384        self.inner.fleet = Some(fleet.into());
3385        self
3386    }
3387    /// Probability that this transaction can be disputed in the event of fraud.
3388    /// Assessed by comparing the characteristics of the authorization to card network rules.
3389    pub fn fraud_disputability_likelihood(
3390        mut self,
3391        fraud_disputability_likelihood: impl Into<
3392            CreateIssuingAuthorizationFraudDisputabilityLikelihood,
3393        >,
3394    ) -> Self {
3395        self.inner.fraud_disputability_likelihood = Some(fraud_disputability_likelihood.into());
3396        self
3397    }
3398    /// Information about fuel that was purchased with this transaction.
3399    pub fn fuel(mut self, fuel: impl Into<CreateIssuingAuthorizationFuel>) -> Self {
3400        self.inner.fuel = Some(fuel.into());
3401        self
3402    }
3403    /// If set `true`, you may provide [amount](https://docs.stripe.com/api/issuing/authorizations/approve#approve_issuing_authorization-amount) to control how much to hold for the authorization.
3404    pub fn is_amount_controllable(mut self, is_amount_controllable: impl Into<bool>) -> Self {
3405        self.inner.is_amount_controllable = Some(is_amount_controllable.into());
3406        self
3407    }
3408    /// The total amount to attempt to authorize.
3409    /// This amount is in the provided merchant currency, and in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal).
3410    pub fn merchant_amount(mut self, merchant_amount: impl Into<i64>) -> Self {
3411        self.inner.merchant_amount = Some(merchant_amount.into());
3412        self
3413    }
3414    /// The currency of the authorization.
3415    /// If not provided, defaults to the currency of the card.
3416    /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
3417    /// Must be a [supported currency](https://stripe.com/docs/currencies).
3418    pub fn merchant_currency(
3419        mut self,
3420        merchant_currency: impl Into<stripe_types::Currency>,
3421    ) -> Self {
3422        self.inner.merchant_currency = Some(merchant_currency.into());
3423        self
3424    }
3425    /// Details about the seller (grocery store, e-commerce website, etc.) where the card authorization happened.
3426    pub fn merchant_data(
3427        mut self,
3428        merchant_data: impl Into<CreateIssuingAuthorizationMerchantData>,
3429    ) -> Self {
3430        self.inner.merchant_data = Some(merchant_data.into());
3431        self
3432    }
3433    /// Details about the authorization, such as identifiers, set by the card network.
3434    pub fn network_data(
3435        mut self,
3436        network_data: impl Into<CreateIssuingAuthorizationNetworkData>,
3437    ) -> Self {
3438        self.inner.network_data = Some(network_data.into());
3439        self
3440    }
3441    /// Stripe’s assessment of the fraud risk for this authorization.
3442    pub fn risk_assessment(
3443        mut self,
3444        risk_assessment: impl Into<CreateIssuingAuthorizationRiskAssessment>,
3445    ) -> Self {
3446        self.inner.risk_assessment = Some(risk_assessment.into());
3447        self
3448    }
3449    /// Verifications that Stripe performed on information that the cardholder provided to the merchant.
3450    pub fn verification_data(
3451        mut self,
3452        verification_data: impl Into<CreateIssuingAuthorizationVerificationData>,
3453    ) -> Self {
3454        self.inner.verification_data = Some(verification_data.into());
3455        self
3456    }
3457    /// The digital wallet used for this transaction.
3458    /// One of `apple_pay`, `google_pay`, or `samsung_pay`.
3459    /// Will populate as `null` when no digital wallet was utilized.
3460    pub fn wallet(mut self, wallet: impl Into<CreateIssuingAuthorizationWallet>) -> Self {
3461        self.inner.wallet = Some(wallet.into());
3462        self
3463    }
3464}
3465impl CreateIssuingAuthorization {
3466    /// Send the request and return the deserialized response.
3467    pub async fn send<C: StripeClient>(
3468        &self,
3469        client: &C,
3470    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
3471        self.customize().send(client).await
3472    }
3473
3474    /// Send the request and return the deserialized response, blocking until completion.
3475    pub fn send_blocking<C: StripeBlockingClient>(
3476        &self,
3477        client: &C,
3478    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
3479        self.customize().send_blocking(client)
3480    }
3481}
3482
3483impl StripeRequest for CreateIssuingAuthorization {
3484    type Output = stripe_shared::IssuingAuthorization;
3485
3486    fn build(&self) -> RequestBuilder {
3487        RequestBuilder::new(StripeMethod::Post, "/test_helpers/issuing/authorizations")
3488            .form(&self.inner)
3489    }
3490}
3491#[derive(Clone, Eq, PartialEq)]
3492#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
3493#[derive(serde::Serialize)]
3494struct CaptureIssuingAuthorizationBuilder {
3495    #[serde(skip_serializing_if = "Option::is_none")]
3496    capture_amount: Option<i64>,
3497    #[serde(skip_serializing_if = "Option::is_none")]
3498    close_authorization: Option<bool>,
3499    #[serde(skip_serializing_if = "Option::is_none")]
3500    expand: Option<Vec<String>>,
3501    #[serde(skip_serializing_if = "Option::is_none")]
3502    purchase_details: Option<CaptureIssuingAuthorizationPurchaseDetails>,
3503}
3504#[cfg(feature = "redact-generated-debug")]
3505impl std::fmt::Debug for CaptureIssuingAuthorizationBuilder {
3506    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3507        f.debug_struct("CaptureIssuingAuthorizationBuilder").finish_non_exhaustive()
3508    }
3509}
3510impl CaptureIssuingAuthorizationBuilder {
3511    fn new() -> Self {
3512        Self {
3513            capture_amount: None,
3514            close_authorization: None,
3515            expand: None,
3516            purchase_details: None,
3517        }
3518    }
3519}
3520/// Additional purchase information that is optionally provided by the merchant.
3521#[derive(Clone, Eq, PartialEq)]
3522#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
3523#[derive(serde::Serialize)]
3524pub struct CaptureIssuingAuthorizationPurchaseDetails {
3525    /// Fleet-specific information for transactions using Fleet cards.
3526    #[serde(skip_serializing_if = "Option::is_none")]
3527    pub fleet: Option<CaptureIssuingAuthorizationPurchaseDetailsFleet>,
3528    /// Information about the flight that was purchased with this transaction.
3529    #[serde(skip_serializing_if = "Option::is_none")]
3530    pub flight: Option<CaptureIssuingAuthorizationPurchaseDetailsFlight>,
3531    /// Information about fuel that was purchased with this transaction.
3532    #[serde(skip_serializing_if = "Option::is_none")]
3533    pub fuel: Option<CaptureIssuingAuthorizationPurchaseDetailsFuel>,
3534    /// Information about lodging that was purchased with this transaction.
3535    #[serde(skip_serializing_if = "Option::is_none")]
3536    pub lodging: Option<CaptureIssuingAuthorizationPurchaseDetailsLodging>,
3537    /// The line items in the purchase.
3538    #[serde(skip_serializing_if = "Option::is_none")]
3539    pub receipt: Option<Vec<CaptureIssuingAuthorizationPurchaseDetailsReceipt>>,
3540    /// A merchant-specific order number.
3541    #[serde(skip_serializing_if = "Option::is_none")]
3542    pub reference: Option<String>,
3543}
3544#[cfg(feature = "redact-generated-debug")]
3545impl std::fmt::Debug for CaptureIssuingAuthorizationPurchaseDetails {
3546    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3547        f.debug_struct("CaptureIssuingAuthorizationPurchaseDetails").finish_non_exhaustive()
3548    }
3549}
3550impl CaptureIssuingAuthorizationPurchaseDetails {
3551    pub fn new() -> Self {
3552        Self {
3553            fleet: None,
3554            flight: None,
3555            fuel: None,
3556            lodging: None,
3557            receipt: None,
3558            reference: None,
3559        }
3560    }
3561}
3562impl Default for CaptureIssuingAuthorizationPurchaseDetails {
3563    fn default() -> Self {
3564        Self::new()
3565    }
3566}
3567/// Fleet-specific information for transactions using Fleet cards.
3568#[derive(Clone, Eq, PartialEq)]
3569#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
3570#[derive(serde::Serialize)]
3571pub struct CaptureIssuingAuthorizationPurchaseDetailsFleet {
3572    /// Answers to prompts presented to the cardholder at the point of sale.
3573    /// Prompted fields vary depending on the configuration of your physical fleet cards.
3574    /// Typical points of sale support only numeric entry.
3575    #[serde(skip_serializing_if = "Option::is_none")]
3576    pub cardholder_prompt_data: Option<FleetCardholderPromptDataSpecs>,
3577    /// The type of purchase. One of `fuel_purchase`, `non_fuel_purchase`, or `fuel_and_non_fuel_purchase`.
3578    #[serde(skip_serializing_if = "Option::is_none")]
3579    pub purchase_type: Option<CaptureIssuingAuthorizationPurchaseDetailsFleetPurchaseType>,
3580    /// More information about the total amount.
3581    /// This information is not guaranteed to be accurate as some merchants may provide unreliable data.
3582    #[serde(skip_serializing_if = "Option::is_none")]
3583    pub reported_breakdown: Option<FleetReportedBreakdownSpecs>,
3584    /// The type of fuel service. One of `non_fuel_transaction`, `full_service`, or `self_service`.
3585    #[serde(skip_serializing_if = "Option::is_none")]
3586    pub service_type: Option<CaptureIssuingAuthorizationPurchaseDetailsFleetServiceType>,
3587}
3588#[cfg(feature = "redact-generated-debug")]
3589impl std::fmt::Debug for CaptureIssuingAuthorizationPurchaseDetailsFleet {
3590    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3591        f.debug_struct("CaptureIssuingAuthorizationPurchaseDetailsFleet").finish_non_exhaustive()
3592    }
3593}
3594impl CaptureIssuingAuthorizationPurchaseDetailsFleet {
3595    pub fn new() -> Self {
3596        Self {
3597            cardholder_prompt_data: None,
3598            purchase_type: None,
3599            reported_breakdown: None,
3600            service_type: None,
3601        }
3602    }
3603}
3604impl Default for CaptureIssuingAuthorizationPurchaseDetailsFleet {
3605    fn default() -> Self {
3606        Self::new()
3607    }
3608}
3609/// The type of purchase. One of `fuel_purchase`, `non_fuel_purchase`, or `fuel_and_non_fuel_purchase`.
3610#[derive(Clone, Eq, PartialEq)]
3611#[non_exhaustive]
3612pub enum CaptureIssuingAuthorizationPurchaseDetailsFleetPurchaseType {
3613    FuelAndNonFuelPurchase,
3614    FuelPurchase,
3615    NonFuelPurchase,
3616    /// An unrecognized value from Stripe. Should not be used as a request parameter.
3617    Unknown(String),
3618}
3619impl CaptureIssuingAuthorizationPurchaseDetailsFleetPurchaseType {
3620    pub fn as_str(&self) -> &str {
3621        use CaptureIssuingAuthorizationPurchaseDetailsFleetPurchaseType::*;
3622        match self {
3623            FuelAndNonFuelPurchase => "fuel_and_non_fuel_purchase",
3624            FuelPurchase => "fuel_purchase",
3625            NonFuelPurchase => "non_fuel_purchase",
3626            Unknown(v) => v,
3627        }
3628    }
3629}
3630
3631impl std::str::FromStr for CaptureIssuingAuthorizationPurchaseDetailsFleetPurchaseType {
3632    type Err = std::convert::Infallible;
3633    fn from_str(s: &str) -> Result<Self, Self::Err> {
3634        use CaptureIssuingAuthorizationPurchaseDetailsFleetPurchaseType::*;
3635        match s {
3636            "fuel_and_non_fuel_purchase" => Ok(FuelAndNonFuelPurchase),
3637            "fuel_purchase" => Ok(FuelPurchase),
3638            "non_fuel_purchase" => Ok(NonFuelPurchase),
3639            v => {
3640                tracing::warn!(
3641                    "Unknown value '{}' for enum '{}'",
3642                    v,
3643                    "CaptureIssuingAuthorizationPurchaseDetailsFleetPurchaseType"
3644                );
3645                Ok(Unknown(v.to_owned()))
3646            }
3647        }
3648    }
3649}
3650impl std::fmt::Display for CaptureIssuingAuthorizationPurchaseDetailsFleetPurchaseType {
3651    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3652        f.write_str(self.as_str())
3653    }
3654}
3655
3656#[cfg(not(feature = "redact-generated-debug"))]
3657impl std::fmt::Debug for CaptureIssuingAuthorizationPurchaseDetailsFleetPurchaseType {
3658    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3659        f.write_str(self.as_str())
3660    }
3661}
3662#[cfg(feature = "redact-generated-debug")]
3663impl std::fmt::Debug for CaptureIssuingAuthorizationPurchaseDetailsFleetPurchaseType {
3664    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3665        f.debug_struct(stringify!(CaptureIssuingAuthorizationPurchaseDetailsFleetPurchaseType))
3666            .finish_non_exhaustive()
3667    }
3668}
3669impl serde::Serialize for CaptureIssuingAuthorizationPurchaseDetailsFleetPurchaseType {
3670    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3671    where
3672        S: serde::Serializer,
3673    {
3674        serializer.serialize_str(self.as_str())
3675    }
3676}
3677#[cfg(feature = "deserialize")]
3678impl<'de> serde::Deserialize<'de> for CaptureIssuingAuthorizationPurchaseDetailsFleetPurchaseType {
3679    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3680        use std::str::FromStr;
3681        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3682        Ok(Self::from_str(&s).expect("infallible"))
3683    }
3684}
3685/// The type of fuel service. One of `non_fuel_transaction`, `full_service`, or `self_service`.
3686#[derive(Clone, Eq, PartialEq)]
3687#[non_exhaustive]
3688pub enum CaptureIssuingAuthorizationPurchaseDetailsFleetServiceType {
3689    FullService,
3690    NonFuelTransaction,
3691    SelfService,
3692    /// An unrecognized value from Stripe. Should not be used as a request parameter.
3693    Unknown(String),
3694}
3695impl CaptureIssuingAuthorizationPurchaseDetailsFleetServiceType {
3696    pub fn as_str(&self) -> &str {
3697        use CaptureIssuingAuthorizationPurchaseDetailsFleetServiceType::*;
3698        match self {
3699            FullService => "full_service",
3700            NonFuelTransaction => "non_fuel_transaction",
3701            SelfService => "self_service",
3702            Unknown(v) => v,
3703        }
3704    }
3705}
3706
3707impl std::str::FromStr for CaptureIssuingAuthorizationPurchaseDetailsFleetServiceType {
3708    type Err = std::convert::Infallible;
3709    fn from_str(s: &str) -> Result<Self, Self::Err> {
3710        use CaptureIssuingAuthorizationPurchaseDetailsFleetServiceType::*;
3711        match s {
3712            "full_service" => Ok(FullService),
3713            "non_fuel_transaction" => Ok(NonFuelTransaction),
3714            "self_service" => Ok(SelfService),
3715            v => {
3716                tracing::warn!(
3717                    "Unknown value '{}' for enum '{}'",
3718                    v,
3719                    "CaptureIssuingAuthorizationPurchaseDetailsFleetServiceType"
3720                );
3721                Ok(Unknown(v.to_owned()))
3722            }
3723        }
3724    }
3725}
3726impl std::fmt::Display for CaptureIssuingAuthorizationPurchaseDetailsFleetServiceType {
3727    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3728        f.write_str(self.as_str())
3729    }
3730}
3731
3732#[cfg(not(feature = "redact-generated-debug"))]
3733impl std::fmt::Debug for CaptureIssuingAuthorizationPurchaseDetailsFleetServiceType {
3734    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3735        f.write_str(self.as_str())
3736    }
3737}
3738#[cfg(feature = "redact-generated-debug")]
3739impl std::fmt::Debug for CaptureIssuingAuthorizationPurchaseDetailsFleetServiceType {
3740    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3741        f.debug_struct(stringify!(CaptureIssuingAuthorizationPurchaseDetailsFleetServiceType))
3742            .finish_non_exhaustive()
3743    }
3744}
3745impl serde::Serialize for CaptureIssuingAuthorizationPurchaseDetailsFleetServiceType {
3746    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3747    where
3748        S: serde::Serializer,
3749    {
3750        serializer.serialize_str(self.as_str())
3751    }
3752}
3753#[cfg(feature = "deserialize")]
3754impl<'de> serde::Deserialize<'de> for CaptureIssuingAuthorizationPurchaseDetailsFleetServiceType {
3755    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3756        use std::str::FromStr;
3757        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3758        Ok(Self::from_str(&s).expect("infallible"))
3759    }
3760}
3761/// Information about the flight that was purchased with this transaction.
3762#[derive(Clone, Eq, PartialEq)]
3763#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
3764#[derive(serde::Serialize)]
3765pub struct CaptureIssuingAuthorizationPurchaseDetailsFlight {
3766    /// The time that the flight departed.
3767    #[serde(skip_serializing_if = "Option::is_none")]
3768    pub departure_at: Option<stripe_types::Timestamp>,
3769    /// The name of the passenger.
3770    #[serde(skip_serializing_if = "Option::is_none")]
3771    pub passenger_name: Option<String>,
3772    /// Whether the ticket is refundable.
3773    #[serde(skip_serializing_if = "Option::is_none")]
3774    pub refundable: Option<bool>,
3775    /// The legs of the trip.
3776    #[serde(skip_serializing_if = "Option::is_none")]
3777    pub segments: Option<Vec<CaptureIssuingAuthorizationPurchaseDetailsFlightSegments>>,
3778    /// The travel agency that issued the ticket.
3779    #[serde(skip_serializing_if = "Option::is_none")]
3780    pub travel_agency: Option<String>,
3781}
3782#[cfg(feature = "redact-generated-debug")]
3783impl std::fmt::Debug for CaptureIssuingAuthorizationPurchaseDetailsFlight {
3784    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3785        f.debug_struct("CaptureIssuingAuthorizationPurchaseDetailsFlight").finish_non_exhaustive()
3786    }
3787}
3788impl CaptureIssuingAuthorizationPurchaseDetailsFlight {
3789    pub fn new() -> Self {
3790        Self {
3791            departure_at: None,
3792            passenger_name: None,
3793            refundable: None,
3794            segments: None,
3795            travel_agency: None,
3796        }
3797    }
3798}
3799impl Default for CaptureIssuingAuthorizationPurchaseDetailsFlight {
3800    fn default() -> Self {
3801        Self::new()
3802    }
3803}
3804/// The legs of the trip.
3805#[derive(Clone, Eq, PartialEq)]
3806#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
3807#[derive(serde::Serialize)]
3808pub struct CaptureIssuingAuthorizationPurchaseDetailsFlightSegments {
3809    /// The three-letter IATA airport code of the flight's destination.
3810    #[serde(skip_serializing_if = "Option::is_none")]
3811    pub arrival_airport_code: Option<String>,
3812    /// The airline carrier code.
3813    #[serde(skip_serializing_if = "Option::is_none")]
3814    pub carrier: Option<String>,
3815    /// The three-letter IATA airport code that the flight departed from.
3816    #[serde(skip_serializing_if = "Option::is_none")]
3817    pub departure_airport_code: Option<String>,
3818    /// The flight number.
3819    #[serde(skip_serializing_if = "Option::is_none")]
3820    pub flight_number: Option<String>,
3821    /// The flight's service class.
3822    #[serde(skip_serializing_if = "Option::is_none")]
3823    pub service_class: Option<String>,
3824    /// Whether a stopover is allowed on this flight.
3825    #[serde(skip_serializing_if = "Option::is_none")]
3826    pub stopover_allowed: Option<bool>,
3827}
3828#[cfg(feature = "redact-generated-debug")]
3829impl std::fmt::Debug for CaptureIssuingAuthorizationPurchaseDetailsFlightSegments {
3830    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3831        f.debug_struct("CaptureIssuingAuthorizationPurchaseDetailsFlightSegments")
3832            .finish_non_exhaustive()
3833    }
3834}
3835impl CaptureIssuingAuthorizationPurchaseDetailsFlightSegments {
3836    pub fn new() -> Self {
3837        Self {
3838            arrival_airport_code: None,
3839            carrier: None,
3840            departure_airport_code: None,
3841            flight_number: None,
3842            service_class: None,
3843            stopover_allowed: None,
3844        }
3845    }
3846}
3847impl Default for CaptureIssuingAuthorizationPurchaseDetailsFlightSegments {
3848    fn default() -> Self {
3849        Self::new()
3850    }
3851}
3852/// Information about fuel that was purchased with this transaction.
3853#[derive(Clone, Eq, PartialEq)]
3854#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
3855#[derive(serde::Serialize)]
3856pub struct CaptureIssuingAuthorizationPurchaseDetailsFuel {
3857    /// [Conexxus Payment System Product Code](https://www.conexxus.org/conexxus-payment-system-product-codes) identifying the primary fuel product purchased.
3858    #[serde(skip_serializing_if = "Option::is_none")]
3859    pub industry_product_code: Option<String>,
3860    /// The quantity of `unit`s of fuel that was dispensed, represented as a decimal string with at most 12 decimal places.
3861    #[serde(skip_serializing_if = "Option::is_none")]
3862    pub quantity_decimal: Option<String>,
3863    /// The type of fuel that was purchased.
3864    /// One of `diesel`, `unleaded_plus`, `unleaded_regular`, `unleaded_super`, or `other`.
3865    #[serde(rename = "type")]
3866    #[serde(skip_serializing_if = "Option::is_none")]
3867    pub type_: Option<CaptureIssuingAuthorizationPurchaseDetailsFuelType>,
3868    /// The units for `quantity_decimal`.
3869    /// One of `charging_minute`, `imperial_gallon`, `kilogram`, `kilowatt_hour`, `liter`, `pound`, `us_gallon`, or `other`.
3870    #[serde(skip_serializing_if = "Option::is_none")]
3871    pub unit: Option<CaptureIssuingAuthorizationPurchaseDetailsFuelUnit>,
3872    /// The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places.
3873    #[serde(skip_serializing_if = "Option::is_none")]
3874    pub unit_cost_decimal: Option<String>,
3875}
3876#[cfg(feature = "redact-generated-debug")]
3877impl std::fmt::Debug for CaptureIssuingAuthorizationPurchaseDetailsFuel {
3878    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3879        f.debug_struct("CaptureIssuingAuthorizationPurchaseDetailsFuel").finish_non_exhaustive()
3880    }
3881}
3882impl CaptureIssuingAuthorizationPurchaseDetailsFuel {
3883    pub fn new() -> Self {
3884        Self {
3885            industry_product_code: None,
3886            quantity_decimal: None,
3887            type_: None,
3888            unit: None,
3889            unit_cost_decimal: None,
3890        }
3891    }
3892}
3893impl Default for CaptureIssuingAuthorizationPurchaseDetailsFuel {
3894    fn default() -> Self {
3895        Self::new()
3896    }
3897}
3898/// The type of fuel that was purchased.
3899/// One of `diesel`, `unleaded_plus`, `unleaded_regular`, `unleaded_super`, or `other`.
3900#[derive(Clone, Eq, PartialEq)]
3901#[non_exhaustive]
3902pub enum CaptureIssuingAuthorizationPurchaseDetailsFuelType {
3903    Diesel,
3904    Other,
3905    UnleadedPlus,
3906    UnleadedRegular,
3907    UnleadedSuper,
3908    /// An unrecognized value from Stripe. Should not be used as a request parameter.
3909    Unknown(String),
3910}
3911impl CaptureIssuingAuthorizationPurchaseDetailsFuelType {
3912    pub fn as_str(&self) -> &str {
3913        use CaptureIssuingAuthorizationPurchaseDetailsFuelType::*;
3914        match self {
3915            Diesel => "diesel",
3916            Other => "other",
3917            UnleadedPlus => "unleaded_plus",
3918            UnleadedRegular => "unleaded_regular",
3919            UnleadedSuper => "unleaded_super",
3920            Unknown(v) => v,
3921        }
3922    }
3923}
3924
3925impl std::str::FromStr for CaptureIssuingAuthorizationPurchaseDetailsFuelType {
3926    type Err = std::convert::Infallible;
3927    fn from_str(s: &str) -> Result<Self, Self::Err> {
3928        use CaptureIssuingAuthorizationPurchaseDetailsFuelType::*;
3929        match s {
3930            "diesel" => Ok(Diesel),
3931            "other" => Ok(Other),
3932            "unleaded_plus" => Ok(UnleadedPlus),
3933            "unleaded_regular" => Ok(UnleadedRegular),
3934            "unleaded_super" => Ok(UnleadedSuper),
3935            v => {
3936                tracing::warn!(
3937                    "Unknown value '{}' for enum '{}'",
3938                    v,
3939                    "CaptureIssuingAuthorizationPurchaseDetailsFuelType"
3940                );
3941                Ok(Unknown(v.to_owned()))
3942            }
3943        }
3944    }
3945}
3946impl std::fmt::Display for CaptureIssuingAuthorizationPurchaseDetailsFuelType {
3947    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3948        f.write_str(self.as_str())
3949    }
3950}
3951
3952#[cfg(not(feature = "redact-generated-debug"))]
3953impl std::fmt::Debug for CaptureIssuingAuthorizationPurchaseDetailsFuelType {
3954    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3955        f.write_str(self.as_str())
3956    }
3957}
3958#[cfg(feature = "redact-generated-debug")]
3959impl std::fmt::Debug for CaptureIssuingAuthorizationPurchaseDetailsFuelType {
3960    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3961        f.debug_struct(stringify!(CaptureIssuingAuthorizationPurchaseDetailsFuelType))
3962            .finish_non_exhaustive()
3963    }
3964}
3965impl serde::Serialize for CaptureIssuingAuthorizationPurchaseDetailsFuelType {
3966    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3967    where
3968        S: serde::Serializer,
3969    {
3970        serializer.serialize_str(self.as_str())
3971    }
3972}
3973#[cfg(feature = "deserialize")]
3974impl<'de> serde::Deserialize<'de> for CaptureIssuingAuthorizationPurchaseDetailsFuelType {
3975    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3976        use std::str::FromStr;
3977        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3978        Ok(Self::from_str(&s).expect("infallible"))
3979    }
3980}
3981/// The units for `quantity_decimal`.
3982/// One of `charging_minute`, `imperial_gallon`, `kilogram`, `kilowatt_hour`, `liter`, `pound`, `us_gallon`, or `other`.
3983#[derive(Clone, Eq, PartialEq)]
3984#[non_exhaustive]
3985pub enum CaptureIssuingAuthorizationPurchaseDetailsFuelUnit {
3986    ChargingMinute,
3987    ImperialGallon,
3988    Kilogram,
3989    KilowattHour,
3990    Liter,
3991    Other,
3992    Pound,
3993    UsGallon,
3994    /// An unrecognized value from Stripe. Should not be used as a request parameter.
3995    Unknown(String),
3996}
3997impl CaptureIssuingAuthorizationPurchaseDetailsFuelUnit {
3998    pub fn as_str(&self) -> &str {
3999        use CaptureIssuingAuthorizationPurchaseDetailsFuelUnit::*;
4000        match self {
4001            ChargingMinute => "charging_minute",
4002            ImperialGallon => "imperial_gallon",
4003            Kilogram => "kilogram",
4004            KilowattHour => "kilowatt_hour",
4005            Liter => "liter",
4006            Other => "other",
4007            Pound => "pound",
4008            UsGallon => "us_gallon",
4009            Unknown(v) => v,
4010        }
4011    }
4012}
4013
4014impl std::str::FromStr for CaptureIssuingAuthorizationPurchaseDetailsFuelUnit {
4015    type Err = std::convert::Infallible;
4016    fn from_str(s: &str) -> Result<Self, Self::Err> {
4017        use CaptureIssuingAuthorizationPurchaseDetailsFuelUnit::*;
4018        match s {
4019            "charging_minute" => Ok(ChargingMinute),
4020            "imperial_gallon" => Ok(ImperialGallon),
4021            "kilogram" => Ok(Kilogram),
4022            "kilowatt_hour" => Ok(KilowattHour),
4023            "liter" => Ok(Liter),
4024            "other" => Ok(Other),
4025            "pound" => Ok(Pound),
4026            "us_gallon" => Ok(UsGallon),
4027            v => {
4028                tracing::warn!(
4029                    "Unknown value '{}' for enum '{}'",
4030                    v,
4031                    "CaptureIssuingAuthorizationPurchaseDetailsFuelUnit"
4032                );
4033                Ok(Unknown(v.to_owned()))
4034            }
4035        }
4036    }
4037}
4038impl std::fmt::Display for CaptureIssuingAuthorizationPurchaseDetailsFuelUnit {
4039    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4040        f.write_str(self.as_str())
4041    }
4042}
4043
4044#[cfg(not(feature = "redact-generated-debug"))]
4045impl std::fmt::Debug for CaptureIssuingAuthorizationPurchaseDetailsFuelUnit {
4046    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4047        f.write_str(self.as_str())
4048    }
4049}
4050#[cfg(feature = "redact-generated-debug")]
4051impl std::fmt::Debug for CaptureIssuingAuthorizationPurchaseDetailsFuelUnit {
4052    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4053        f.debug_struct(stringify!(CaptureIssuingAuthorizationPurchaseDetailsFuelUnit))
4054            .finish_non_exhaustive()
4055    }
4056}
4057impl serde::Serialize for CaptureIssuingAuthorizationPurchaseDetailsFuelUnit {
4058    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4059    where
4060        S: serde::Serializer,
4061    {
4062        serializer.serialize_str(self.as_str())
4063    }
4064}
4065#[cfg(feature = "deserialize")]
4066impl<'de> serde::Deserialize<'de> for CaptureIssuingAuthorizationPurchaseDetailsFuelUnit {
4067    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4068        use std::str::FromStr;
4069        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4070        Ok(Self::from_str(&s).expect("infallible"))
4071    }
4072}
4073/// Information about lodging that was purchased with this transaction.
4074#[derive(Copy, Clone, Eq, PartialEq)]
4075#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
4076#[derive(serde::Serialize)]
4077pub struct CaptureIssuingAuthorizationPurchaseDetailsLodging {
4078    /// The time of checking into the lodging.
4079    #[serde(skip_serializing_if = "Option::is_none")]
4080    pub check_in_at: Option<stripe_types::Timestamp>,
4081    /// The number of nights stayed at the lodging.
4082    #[serde(skip_serializing_if = "Option::is_none")]
4083    pub nights: Option<i64>,
4084}
4085#[cfg(feature = "redact-generated-debug")]
4086impl std::fmt::Debug for CaptureIssuingAuthorizationPurchaseDetailsLodging {
4087    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4088        f.debug_struct("CaptureIssuingAuthorizationPurchaseDetailsLodging").finish_non_exhaustive()
4089    }
4090}
4091impl CaptureIssuingAuthorizationPurchaseDetailsLodging {
4092    pub fn new() -> Self {
4093        Self { check_in_at: None, nights: None }
4094    }
4095}
4096impl Default for CaptureIssuingAuthorizationPurchaseDetailsLodging {
4097    fn default() -> Self {
4098        Self::new()
4099    }
4100}
4101/// The line items in the purchase.
4102#[derive(Clone, Eq, PartialEq)]
4103#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
4104#[derive(serde::Serialize)]
4105pub struct CaptureIssuingAuthorizationPurchaseDetailsReceipt {
4106    #[serde(skip_serializing_if = "Option::is_none")]
4107    pub description: Option<String>,
4108    #[serde(skip_serializing_if = "Option::is_none")]
4109    pub quantity: Option<String>,
4110    #[serde(skip_serializing_if = "Option::is_none")]
4111    pub total: Option<i64>,
4112    #[serde(skip_serializing_if = "Option::is_none")]
4113    pub unit_cost: Option<i64>,
4114}
4115#[cfg(feature = "redact-generated-debug")]
4116impl std::fmt::Debug for CaptureIssuingAuthorizationPurchaseDetailsReceipt {
4117    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4118        f.debug_struct("CaptureIssuingAuthorizationPurchaseDetailsReceipt").finish_non_exhaustive()
4119    }
4120}
4121impl CaptureIssuingAuthorizationPurchaseDetailsReceipt {
4122    pub fn new() -> Self {
4123        Self { description: None, quantity: None, total: None, unit_cost: None }
4124    }
4125}
4126impl Default for CaptureIssuingAuthorizationPurchaseDetailsReceipt {
4127    fn default() -> Self {
4128        Self::new()
4129    }
4130}
4131/// Capture a test-mode authorization.
4132#[derive(Clone)]
4133#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
4134#[derive(serde::Serialize)]
4135pub struct CaptureIssuingAuthorization {
4136    inner: CaptureIssuingAuthorizationBuilder,
4137    authorization: String,
4138}
4139#[cfg(feature = "redact-generated-debug")]
4140impl std::fmt::Debug for CaptureIssuingAuthorization {
4141    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4142        f.debug_struct("CaptureIssuingAuthorization").finish_non_exhaustive()
4143    }
4144}
4145impl CaptureIssuingAuthorization {
4146    /// Construct a new `CaptureIssuingAuthorization`.
4147    pub fn new(authorization: impl Into<String>) -> Self {
4148        Self {
4149            authorization: authorization.into(),
4150            inner: CaptureIssuingAuthorizationBuilder::new(),
4151        }
4152    }
4153    /// The amount to capture from the authorization.
4154    /// If not provided, the full amount of the authorization will be captured.
4155    /// This amount is in the authorization currency and in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal).
4156    pub fn capture_amount(mut self, capture_amount: impl Into<i64>) -> Self {
4157        self.inner.capture_amount = Some(capture_amount.into());
4158        self
4159    }
4160    /// Whether to close the authorization after capture.
4161    /// Defaults to true.
4162    /// Set to false to enable multi-capture flows.
4163    pub fn close_authorization(mut self, close_authorization: impl Into<bool>) -> Self {
4164        self.inner.close_authorization = Some(close_authorization.into());
4165        self
4166    }
4167    /// Specifies which fields in the response should be expanded.
4168    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
4169        self.inner.expand = Some(expand.into());
4170        self
4171    }
4172    /// Additional purchase information that is optionally provided by the merchant.
4173    pub fn purchase_details(
4174        mut self,
4175        purchase_details: impl Into<CaptureIssuingAuthorizationPurchaseDetails>,
4176    ) -> Self {
4177        self.inner.purchase_details = Some(purchase_details.into());
4178        self
4179    }
4180}
4181impl CaptureIssuingAuthorization {
4182    /// Send the request and return the deserialized response.
4183    pub async fn send<C: StripeClient>(
4184        &self,
4185        client: &C,
4186    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
4187        self.customize().send(client).await
4188    }
4189
4190    /// Send the request and return the deserialized response, blocking until completion.
4191    pub fn send_blocking<C: StripeBlockingClient>(
4192        &self,
4193        client: &C,
4194    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
4195        self.customize().send_blocking(client)
4196    }
4197}
4198
4199impl StripeRequest for CaptureIssuingAuthorization {
4200    type Output = stripe_shared::IssuingAuthorization;
4201
4202    fn build(&self) -> RequestBuilder {
4203        let authorization = &self.authorization;
4204        RequestBuilder::new(
4205            StripeMethod::Post,
4206            format!("/test_helpers/issuing/authorizations/{authorization}/capture"),
4207        )
4208        .form(&self.inner)
4209    }
4210}
4211#[derive(Clone, Eq, PartialEq)]
4212#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
4213#[derive(serde::Serialize)]
4214struct ExpireIssuingAuthorizationBuilder {
4215    #[serde(skip_serializing_if = "Option::is_none")]
4216    expand: Option<Vec<String>>,
4217}
4218#[cfg(feature = "redact-generated-debug")]
4219impl std::fmt::Debug for ExpireIssuingAuthorizationBuilder {
4220    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4221        f.debug_struct("ExpireIssuingAuthorizationBuilder").finish_non_exhaustive()
4222    }
4223}
4224impl ExpireIssuingAuthorizationBuilder {
4225    fn new() -> Self {
4226        Self { expand: None }
4227    }
4228}
4229/// Expire a test-mode Authorization.
4230#[derive(Clone)]
4231#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
4232#[derive(serde::Serialize)]
4233pub struct ExpireIssuingAuthorization {
4234    inner: ExpireIssuingAuthorizationBuilder,
4235    authorization: String,
4236}
4237#[cfg(feature = "redact-generated-debug")]
4238impl std::fmt::Debug for ExpireIssuingAuthorization {
4239    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4240        f.debug_struct("ExpireIssuingAuthorization").finish_non_exhaustive()
4241    }
4242}
4243impl ExpireIssuingAuthorization {
4244    /// Construct a new `ExpireIssuingAuthorization`.
4245    pub fn new(authorization: impl Into<String>) -> Self {
4246        Self {
4247            authorization: authorization.into(),
4248            inner: ExpireIssuingAuthorizationBuilder::new(),
4249        }
4250    }
4251    /// Specifies which fields in the response should be expanded.
4252    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
4253        self.inner.expand = Some(expand.into());
4254        self
4255    }
4256}
4257impl ExpireIssuingAuthorization {
4258    /// Send the request and return the deserialized response.
4259    pub async fn send<C: StripeClient>(
4260        &self,
4261        client: &C,
4262    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
4263        self.customize().send(client).await
4264    }
4265
4266    /// Send the request and return the deserialized response, blocking until completion.
4267    pub fn send_blocking<C: StripeBlockingClient>(
4268        &self,
4269        client: &C,
4270    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
4271        self.customize().send_blocking(client)
4272    }
4273}
4274
4275impl StripeRequest for ExpireIssuingAuthorization {
4276    type Output = stripe_shared::IssuingAuthorization;
4277
4278    fn build(&self) -> RequestBuilder {
4279        let authorization = &self.authorization;
4280        RequestBuilder::new(
4281            StripeMethod::Post,
4282            format!("/test_helpers/issuing/authorizations/{authorization}/expire"),
4283        )
4284        .form(&self.inner)
4285    }
4286}
4287#[derive(Clone, Eq, PartialEq)]
4288#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
4289#[derive(serde::Serialize)]
4290struct FinalizeAmountIssuingAuthorizationBuilder {
4291    #[serde(skip_serializing_if = "Option::is_none")]
4292    expand: Option<Vec<String>>,
4293    final_amount: i64,
4294    #[serde(skip_serializing_if = "Option::is_none")]
4295    fleet: Option<FinalizeAmountIssuingAuthorizationFleet>,
4296    #[serde(skip_serializing_if = "Option::is_none")]
4297    fuel: Option<FinalizeAmountIssuingAuthorizationFuel>,
4298}
4299#[cfg(feature = "redact-generated-debug")]
4300impl std::fmt::Debug for FinalizeAmountIssuingAuthorizationBuilder {
4301    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4302        f.debug_struct("FinalizeAmountIssuingAuthorizationBuilder").finish_non_exhaustive()
4303    }
4304}
4305impl FinalizeAmountIssuingAuthorizationBuilder {
4306    fn new(final_amount: impl Into<i64>) -> Self {
4307        Self { expand: None, final_amount: final_amount.into(), fleet: None, fuel: None }
4308    }
4309}
4310/// Fleet-specific information for authorizations using Fleet cards.
4311#[derive(Clone, Eq, PartialEq)]
4312#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
4313#[derive(serde::Serialize)]
4314pub struct FinalizeAmountIssuingAuthorizationFleet {
4315    /// Answers to prompts presented to the cardholder at the point of sale.
4316    /// Prompted fields vary depending on the configuration of your physical fleet cards.
4317    /// Typical points of sale support only numeric entry.
4318    #[serde(skip_serializing_if = "Option::is_none")]
4319    pub cardholder_prompt_data: Option<FleetCardholderPromptDataSpecs>,
4320    /// The type of purchase. One of `fuel_purchase`, `non_fuel_purchase`, or `fuel_and_non_fuel_purchase`.
4321    #[serde(skip_serializing_if = "Option::is_none")]
4322    pub purchase_type: Option<FinalizeAmountIssuingAuthorizationFleetPurchaseType>,
4323    /// More information about the total amount.
4324    /// This information is not guaranteed to be accurate as some merchants may provide unreliable data.
4325    #[serde(skip_serializing_if = "Option::is_none")]
4326    pub reported_breakdown: Option<FleetReportedBreakdownSpecs>,
4327    /// The type of fuel service. One of `non_fuel_transaction`, `full_service`, or `self_service`.
4328    #[serde(skip_serializing_if = "Option::is_none")]
4329    pub service_type: Option<FinalizeAmountIssuingAuthorizationFleetServiceType>,
4330}
4331#[cfg(feature = "redact-generated-debug")]
4332impl std::fmt::Debug for FinalizeAmountIssuingAuthorizationFleet {
4333    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4334        f.debug_struct("FinalizeAmountIssuingAuthorizationFleet").finish_non_exhaustive()
4335    }
4336}
4337impl FinalizeAmountIssuingAuthorizationFleet {
4338    pub fn new() -> Self {
4339        Self {
4340            cardholder_prompt_data: None,
4341            purchase_type: None,
4342            reported_breakdown: None,
4343            service_type: None,
4344        }
4345    }
4346}
4347impl Default for FinalizeAmountIssuingAuthorizationFleet {
4348    fn default() -> Self {
4349        Self::new()
4350    }
4351}
4352/// The type of purchase. One of `fuel_purchase`, `non_fuel_purchase`, or `fuel_and_non_fuel_purchase`.
4353#[derive(Clone, Eq, PartialEq)]
4354#[non_exhaustive]
4355pub enum FinalizeAmountIssuingAuthorizationFleetPurchaseType {
4356    FuelAndNonFuelPurchase,
4357    FuelPurchase,
4358    NonFuelPurchase,
4359    /// An unrecognized value from Stripe. Should not be used as a request parameter.
4360    Unknown(String),
4361}
4362impl FinalizeAmountIssuingAuthorizationFleetPurchaseType {
4363    pub fn as_str(&self) -> &str {
4364        use FinalizeAmountIssuingAuthorizationFleetPurchaseType::*;
4365        match self {
4366            FuelAndNonFuelPurchase => "fuel_and_non_fuel_purchase",
4367            FuelPurchase => "fuel_purchase",
4368            NonFuelPurchase => "non_fuel_purchase",
4369            Unknown(v) => v,
4370        }
4371    }
4372}
4373
4374impl std::str::FromStr for FinalizeAmountIssuingAuthorizationFleetPurchaseType {
4375    type Err = std::convert::Infallible;
4376    fn from_str(s: &str) -> Result<Self, Self::Err> {
4377        use FinalizeAmountIssuingAuthorizationFleetPurchaseType::*;
4378        match s {
4379            "fuel_and_non_fuel_purchase" => Ok(FuelAndNonFuelPurchase),
4380            "fuel_purchase" => Ok(FuelPurchase),
4381            "non_fuel_purchase" => Ok(NonFuelPurchase),
4382            v => {
4383                tracing::warn!(
4384                    "Unknown value '{}' for enum '{}'",
4385                    v,
4386                    "FinalizeAmountIssuingAuthorizationFleetPurchaseType"
4387                );
4388                Ok(Unknown(v.to_owned()))
4389            }
4390        }
4391    }
4392}
4393impl std::fmt::Display for FinalizeAmountIssuingAuthorizationFleetPurchaseType {
4394    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4395        f.write_str(self.as_str())
4396    }
4397}
4398
4399#[cfg(not(feature = "redact-generated-debug"))]
4400impl std::fmt::Debug for FinalizeAmountIssuingAuthorizationFleetPurchaseType {
4401    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4402        f.write_str(self.as_str())
4403    }
4404}
4405#[cfg(feature = "redact-generated-debug")]
4406impl std::fmt::Debug for FinalizeAmountIssuingAuthorizationFleetPurchaseType {
4407    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4408        f.debug_struct(stringify!(FinalizeAmountIssuingAuthorizationFleetPurchaseType))
4409            .finish_non_exhaustive()
4410    }
4411}
4412impl serde::Serialize for FinalizeAmountIssuingAuthorizationFleetPurchaseType {
4413    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4414    where
4415        S: serde::Serializer,
4416    {
4417        serializer.serialize_str(self.as_str())
4418    }
4419}
4420#[cfg(feature = "deserialize")]
4421impl<'de> serde::Deserialize<'de> for FinalizeAmountIssuingAuthorizationFleetPurchaseType {
4422    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4423        use std::str::FromStr;
4424        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4425        Ok(Self::from_str(&s).expect("infallible"))
4426    }
4427}
4428/// The type of fuel service. One of `non_fuel_transaction`, `full_service`, or `self_service`.
4429#[derive(Clone, Eq, PartialEq)]
4430#[non_exhaustive]
4431pub enum FinalizeAmountIssuingAuthorizationFleetServiceType {
4432    FullService,
4433    NonFuelTransaction,
4434    SelfService,
4435    /// An unrecognized value from Stripe. Should not be used as a request parameter.
4436    Unknown(String),
4437}
4438impl FinalizeAmountIssuingAuthorizationFleetServiceType {
4439    pub fn as_str(&self) -> &str {
4440        use FinalizeAmountIssuingAuthorizationFleetServiceType::*;
4441        match self {
4442            FullService => "full_service",
4443            NonFuelTransaction => "non_fuel_transaction",
4444            SelfService => "self_service",
4445            Unknown(v) => v,
4446        }
4447    }
4448}
4449
4450impl std::str::FromStr for FinalizeAmountIssuingAuthorizationFleetServiceType {
4451    type Err = std::convert::Infallible;
4452    fn from_str(s: &str) -> Result<Self, Self::Err> {
4453        use FinalizeAmountIssuingAuthorizationFleetServiceType::*;
4454        match s {
4455            "full_service" => Ok(FullService),
4456            "non_fuel_transaction" => Ok(NonFuelTransaction),
4457            "self_service" => Ok(SelfService),
4458            v => {
4459                tracing::warn!(
4460                    "Unknown value '{}' for enum '{}'",
4461                    v,
4462                    "FinalizeAmountIssuingAuthorizationFleetServiceType"
4463                );
4464                Ok(Unknown(v.to_owned()))
4465            }
4466        }
4467    }
4468}
4469impl std::fmt::Display for FinalizeAmountIssuingAuthorizationFleetServiceType {
4470    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4471        f.write_str(self.as_str())
4472    }
4473}
4474
4475#[cfg(not(feature = "redact-generated-debug"))]
4476impl std::fmt::Debug for FinalizeAmountIssuingAuthorizationFleetServiceType {
4477    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4478        f.write_str(self.as_str())
4479    }
4480}
4481#[cfg(feature = "redact-generated-debug")]
4482impl std::fmt::Debug for FinalizeAmountIssuingAuthorizationFleetServiceType {
4483    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4484        f.debug_struct(stringify!(FinalizeAmountIssuingAuthorizationFleetServiceType))
4485            .finish_non_exhaustive()
4486    }
4487}
4488impl serde::Serialize for FinalizeAmountIssuingAuthorizationFleetServiceType {
4489    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4490    where
4491        S: serde::Serializer,
4492    {
4493        serializer.serialize_str(self.as_str())
4494    }
4495}
4496#[cfg(feature = "deserialize")]
4497impl<'de> serde::Deserialize<'de> for FinalizeAmountIssuingAuthorizationFleetServiceType {
4498    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4499        use std::str::FromStr;
4500        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4501        Ok(Self::from_str(&s).expect("infallible"))
4502    }
4503}
4504/// Information about fuel that was purchased with this transaction.
4505#[derive(Clone, Eq, PartialEq)]
4506#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
4507#[derive(serde::Serialize)]
4508pub struct FinalizeAmountIssuingAuthorizationFuel {
4509    /// [Conexxus Payment System Product Code](https://www.conexxus.org/conexxus-payment-system-product-codes) identifying the primary fuel product purchased.
4510    #[serde(skip_serializing_if = "Option::is_none")]
4511    pub industry_product_code: Option<String>,
4512    /// The quantity of `unit`s of fuel that was dispensed, represented as a decimal string with at most 12 decimal places.
4513    #[serde(skip_serializing_if = "Option::is_none")]
4514    pub quantity_decimal: Option<String>,
4515    /// The type of fuel that was purchased.
4516    /// One of `diesel`, `unleaded_plus`, `unleaded_regular`, `unleaded_super`, or `other`.
4517    #[serde(rename = "type")]
4518    #[serde(skip_serializing_if = "Option::is_none")]
4519    pub type_: Option<FinalizeAmountIssuingAuthorizationFuelType>,
4520    /// The units for `quantity_decimal`.
4521    /// One of `charging_minute`, `imperial_gallon`, `kilogram`, `kilowatt_hour`, `liter`, `pound`, `us_gallon`, or `other`.
4522    #[serde(skip_serializing_if = "Option::is_none")]
4523    pub unit: Option<FinalizeAmountIssuingAuthorizationFuelUnit>,
4524    /// The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places.
4525    #[serde(skip_serializing_if = "Option::is_none")]
4526    pub unit_cost_decimal: Option<String>,
4527}
4528#[cfg(feature = "redact-generated-debug")]
4529impl std::fmt::Debug for FinalizeAmountIssuingAuthorizationFuel {
4530    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4531        f.debug_struct("FinalizeAmountIssuingAuthorizationFuel").finish_non_exhaustive()
4532    }
4533}
4534impl FinalizeAmountIssuingAuthorizationFuel {
4535    pub fn new() -> Self {
4536        Self {
4537            industry_product_code: None,
4538            quantity_decimal: None,
4539            type_: None,
4540            unit: None,
4541            unit_cost_decimal: None,
4542        }
4543    }
4544}
4545impl Default for FinalizeAmountIssuingAuthorizationFuel {
4546    fn default() -> Self {
4547        Self::new()
4548    }
4549}
4550/// The type of fuel that was purchased.
4551/// One of `diesel`, `unleaded_plus`, `unleaded_regular`, `unleaded_super`, or `other`.
4552#[derive(Clone, Eq, PartialEq)]
4553#[non_exhaustive]
4554pub enum FinalizeAmountIssuingAuthorizationFuelType {
4555    Diesel,
4556    Other,
4557    UnleadedPlus,
4558    UnleadedRegular,
4559    UnleadedSuper,
4560    /// An unrecognized value from Stripe. Should not be used as a request parameter.
4561    Unknown(String),
4562}
4563impl FinalizeAmountIssuingAuthorizationFuelType {
4564    pub fn as_str(&self) -> &str {
4565        use FinalizeAmountIssuingAuthorizationFuelType::*;
4566        match self {
4567            Diesel => "diesel",
4568            Other => "other",
4569            UnleadedPlus => "unleaded_plus",
4570            UnleadedRegular => "unleaded_regular",
4571            UnleadedSuper => "unleaded_super",
4572            Unknown(v) => v,
4573        }
4574    }
4575}
4576
4577impl std::str::FromStr for FinalizeAmountIssuingAuthorizationFuelType {
4578    type Err = std::convert::Infallible;
4579    fn from_str(s: &str) -> Result<Self, Self::Err> {
4580        use FinalizeAmountIssuingAuthorizationFuelType::*;
4581        match s {
4582            "diesel" => Ok(Diesel),
4583            "other" => Ok(Other),
4584            "unleaded_plus" => Ok(UnleadedPlus),
4585            "unleaded_regular" => Ok(UnleadedRegular),
4586            "unleaded_super" => Ok(UnleadedSuper),
4587            v => {
4588                tracing::warn!(
4589                    "Unknown value '{}' for enum '{}'",
4590                    v,
4591                    "FinalizeAmountIssuingAuthorizationFuelType"
4592                );
4593                Ok(Unknown(v.to_owned()))
4594            }
4595        }
4596    }
4597}
4598impl std::fmt::Display for FinalizeAmountIssuingAuthorizationFuelType {
4599    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4600        f.write_str(self.as_str())
4601    }
4602}
4603
4604#[cfg(not(feature = "redact-generated-debug"))]
4605impl std::fmt::Debug for FinalizeAmountIssuingAuthorizationFuelType {
4606    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4607        f.write_str(self.as_str())
4608    }
4609}
4610#[cfg(feature = "redact-generated-debug")]
4611impl std::fmt::Debug for FinalizeAmountIssuingAuthorizationFuelType {
4612    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4613        f.debug_struct(stringify!(FinalizeAmountIssuingAuthorizationFuelType))
4614            .finish_non_exhaustive()
4615    }
4616}
4617impl serde::Serialize for FinalizeAmountIssuingAuthorizationFuelType {
4618    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4619    where
4620        S: serde::Serializer,
4621    {
4622        serializer.serialize_str(self.as_str())
4623    }
4624}
4625#[cfg(feature = "deserialize")]
4626impl<'de> serde::Deserialize<'de> for FinalizeAmountIssuingAuthorizationFuelType {
4627    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4628        use std::str::FromStr;
4629        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4630        Ok(Self::from_str(&s).expect("infallible"))
4631    }
4632}
4633/// The units for `quantity_decimal`.
4634/// One of `charging_minute`, `imperial_gallon`, `kilogram`, `kilowatt_hour`, `liter`, `pound`, `us_gallon`, or `other`.
4635#[derive(Clone, Eq, PartialEq)]
4636#[non_exhaustive]
4637pub enum FinalizeAmountIssuingAuthorizationFuelUnit {
4638    ChargingMinute,
4639    ImperialGallon,
4640    Kilogram,
4641    KilowattHour,
4642    Liter,
4643    Other,
4644    Pound,
4645    UsGallon,
4646    /// An unrecognized value from Stripe. Should not be used as a request parameter.
4647    Unknown(String),
4648}
4649impl FinalizeAmountIssuingAuthorizationFuelUnit {
4650    pub fn as_str(&self) -> &str {
4651        use FinalizeAmountIssuingAuthorizationFuelUnit::*;
4652        match self {
4653            ChargingMinute => "charging_minute",
4654            ImperialGallon => "imperial_gallon",
4655            Kilogram => "kilogram",
4656            KilowattHour => "kilowatt_hour",
4657            Liter => "liter",
4658            Other => "other",
4659            Pound => "pound",
4660            UsGallon => "us_gallon",
4661            Unknown(v) => v,
4662        }
4663    }
4664}
4665
4666impl std::str::FromStr for FinalizeAmountIssuingAuthorizationFuelUnit {
4667    type Err = std::convert::Infallible;
4668    fn from_str(s: &str) -> Result<Self, Self::Err> {
4669        use FinalizeAmountIssuingAuthorizationFuelUnit::*;
4670        match s {
4671            "charging_minute" => Ok(ChargingMinute),
4672            "imperial_gallon" => Ok(ImperialGallon),
4673            "kilogram" => Ok(Kilogram),
4674            "kilowatt_hour" => Ok(KilowattHour),
4675            "liter" => Ok(Liter),
4676            "other" => Ok(Other),
4677            "pound" => Ok(Pound),
4678            "us_gallon" => Ok(UsGallon),
4679            v => {
4680                tracing::warn!(
4681                    "Unknown value '{}' for enum '{}'",
4682                    v,
4683                    "FinalizeAmountIssuingAuthorizationFuelUnit"
4684                );
4685                Ok(Unknown(v.to_owned()))
4686            }
4687        }
4688    }
4689}
4690impl std::fmt::Display for FinalizeAmountIssuingAuthorizationFuelUnit {
4691    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4692        f.write_str(self.as_str())
4693    }
4694}
4695
4696#[cfg(not(feature = "redact-generated-debug"))]
4697impl std::fmt::Debug for FinalizeAmountIssuingAuthorizationFuelUnit {
4698    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4699        f.write_str(self.as_str())
4700    }
4701}
4702#[cfg(feature = "redact-generated-debug")]
4703impl std::fmt::Debug for FinalizeAmountIssuingAuthorizationFuelUnit {
4704    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4705        f.debug_struct(stringify!(FinalizeAmountIssuingAuthorizationFuelUnit))
4706            .finish_non_exhaustive()
4707    }
4708}
4709impl serde::Serialize for FinalizeAmountIssuingAuthorizationFuelUnit {
4710    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4711    where
4712        S: serde::Serializer,
4713    {
4714        serializer.serialize_str(self.as_str())
4715    }
4716}
4717#[cfg(feature = "deserialize")]
4718impl<'de> serde::Deserialize<'de> for FinalizeAmountIssuingAuthorizationFuelUnit {
4719    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4720        use std::str::FromStr;
4721        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4722        Ok(Self::from_str(&s).expect("infallible"))
4723    }
4724}
4725/// Finalize the amount on an Authorization prior to capture, when the initial authorization was for an estimated amount.
4726#[derive(Clone)]
4727#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
4728#[derive(serde::Serialize)]
4729pub struct FinalizeAmountIssuingAuthorization {
4730    inner: FinalizeAmountIssuingAuthorizationBuilder,
4731    authorization: String,
4732}
4733#[cfg(feature = "redact-generated-debug")]
4734impl std::fmt::Debug for FinalizeAmountIssuingAuthorization {
4735    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4736        f.debug_struct("FinalizeAmountIssuingAuthorization").finish_non_exhaustive()
4737    }
4738}
4739impl FinalizeAmountIssuingAuthorization {
4740    /// Construct a new `FinalizeAmountIssuingAuthorization`.
4741    pub fn new(authorization: impl Into<String>, final_amount: impl Into<i64>) -> Self {
4742        Self {
4743            authorization: authorization.into(),
4744            inner: FinalizeAmountIssuingAuthorizationBuilder::new(final_amount.into()),
4745        }
4746    }
4747    /// Specifies which fields in the response should be expanded.
4748    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
4749        self.inner.expand = Some(expand.into());
4750        self
4751    }
4752    /// Fleet-specific information for authorizations using Fleet cards.
4753    pub fn fleet(mut self, fleet: impl Into<FinalizeAmountIssuingAuthorizationFleet>) -> Self {
4754        self.inner.fleet = Some(fleet.into());
4755        self
4756    }
4757    /// Information about fuel that was purchased with this transaction.
4758    pub fn fuel(mut self, fuel: impl Into<FinalizeAmountIssuingAuthorizationFuel>) -> Self {
4759        self.inner.fuel = Some(fuel.into());
4760        self
4761    }
4762}
4763impl FinalizeAmountIssuingAuthorization {
4764    /// Send the request and return the deserialized response.
4765    pub async fn send<C: StripeClient>(
4766        &self,
4767        client: &C,
4768    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
4769        self.customize().send(client).await
4770    }
4771
4772    /// Send the request and return the deserialized response, blocking until completion.
4773    pub fn send_blocking<C: StripeBlockingClient>(
4774        &self,
4775        client: &C,
4776    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
4777        self.customize().send_blocking(client)
4778    }
4779}
4780
4781impl StripeRequest for FinalizeAmountIssuingAuthorization {
4782    type Output = stripe_shared::IssuingAuthorization;
4783
4784    fn build(&self) -> RequestBuilder {
4785        let authorization = &self.authorization;
4786        RequestBuilder::new(
4787            StripeMethod::Post,
4788            format!("/test_helpers/issuing/authorizations/{authorization}/finalize_amount"),
4789        )
4790        .form(&self.inner)
4791    }
4792}
4793#[derive(Clone, Eq, PartialEq)]
4794#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
4795#[derive(serde::Serialize)]
4796struct RespondIssuingAuthorizationBuilder {
4797    confirmed: bool,
4798    #[serde(skip_serializing_if = "Option::is_none")]
4799    expand: Option<Vec<String>>,
4800}
4801#[cfg(feature = "redact-generated-debug")]
4802impl std::fmt::Debug for RespondIssuingAuthorizationBuilder {
4803    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4804        f.debug_struct("RespondIssuingAuthorizationBuilder").finish_non_exhaustive()
4805    }
4806}
4807impl RespondIssuingAuthorizationBuilder {
4808    fn new(confirmed: impl Into<bool>) -> Self {
4809        Self { confirmed: confirmed.into(), expand: None }
4810    }
4811}
4812/// Respond to a fraud challenge on a testmode Issuing authorization, simulating either a confirmation of fraud or a correction of legitimacy.
4813#[derive(Clone)]
4814#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
4815#[derive(serde::Serialize)]
4816pub struct RespondIssuingAuthorization {
4817    inner: RespondIssuingAuthorizationBuilder,
4818    authorization: String,
4819}
4820#[cfg(feature = "redact-generated-debug")]
4821impl std::fmt::Debug for RespondIssuingAuthorization {
4822    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4823        f.debug_struct("RespondIssuingAuthorization").finish_non_exhaustive()
4824    }
4825}
4826impl RespondIssuingAuthorization {
4827    /// Construct a new `RespondIssuingAuthorization`.
4828    pub fn new(authorization: impl Into<String>, confirmed: impl Into<bool>) -> Self {
4829        Self {
4830            authorization: authorization.into(),
4831            inner: RespondIssuingAuthorizationBuilder::new(confirmed.into()),
4832        }
4833    }
4834    /// Specifies which fields in the response should be expanded.
4835    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
4836        self.inner.expand = Some(expand.into());
4837        self
4838    }
4839}
4840impl RespondIssuingAuthorization {
4841    /// Send the request and return the deserialized response.
4842    pub async fn send<C: StripeClient>(
4843        &self,
4844        client: &C,
4845    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
4846        self.customize().send(client).await
4847    }
4848
4849    /// Send the request and return the deserialized response, blocking until completion.
4850    pub fn send_blocking<C: StripeBlockingClient>(
4851        &self,
4852        client: &C,
4853    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
4854        self.customize().send_blocking(client)
4855    }
4856}
4857
4858impl StripeRequest for RespondIssuingAuthorization {
4859    type Output = stripe_shared::IssuingAuthorization;
4860
4861    fn build(&self) -> RequestBuilder {
4862        let authorization = &self.authorization;
4863        RequestBuilder::new(
4864            StripeMethod::Post,
4865            format!(
4866                "/test_helpers/issuing/authorizations/{authorization}/fraud_challenges/respond"
4867            ),
4868        )
4869        .form(&self.inner)
4870    }
4871}
4872#[derive(Clone, Eq, PartialEq)]
4873#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
4874#[derive(serde::Serialize)]
4875struct IncrementIssuingAuthorizationBuilder {
4876    #[serde(skip_serializing_if = "Option::is_none")]
4877    expand: Option<Vec<String>>,
4878    increment_amount: i64,
4879    #[serde(skip_serializing_if = "Option::is_none")]
4880    is_amount_controllable: Option<bool>,
4881}
4882#[cfg(feature = "redact-generated-debug")]
4883impl std::fmt::Debug for IncrementIssuingAuthorizationBuilder {
4884    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4885        f.debug_struct("IncrementIssuingAuthorizationBuilder").finish_non_exhaustive()
4886    }
4887}
4888impl IncrementIssuingAuthorizationBuilder {
4889    fn new(increment_amount: impl Into<i64>) -> Self {
4890        Self {
4891            expand: None,
4892            increment_amount: increment_amount.into(),
4893            is_amount_controllable: None,
4894        }
4895    }
4896}
4897/// Increment a test-mode Authorization.
4898#[derive(Clone)]
4899#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
4900#[derive(serde::Serialize)]
4901pub struct IncrementIssuingAuthorization {
4902    inner: IncrementIssuingAuthorizationBuilder,
4903    authorization: String,
4904}
4905#[cfg(feature = "redact-generated-debug")]
4906impl std::fmt::Debug for IncrementIssuingAuthorization {
4907    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4908        f.debug_struct("IncrementIssuingAuthorization").finish_non_exhaustive()
4909    }
4910}
4911impl IncrementIssuingAuthorization {
4912    /// Construct a new `IncrementIssuingAuthorization`.
4913    pub fn new(authorization: impl Into<String>, increment_amount: impl Into<i64>) -> Self {
4914        Self {
4915            authorization: authorization.into(),
4916            inner: IncrementIssuingAuthorizationBuilder::new(increment_amount.into()),
4917        }
4918    }
4919    /// Specifies which fields in the response should be expanded.
4920    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
4921        self.inner.expand = Some(expand.into());
4922        self
4923    }
4924    /// If set `true`, you may provide [amount](https://docs.stripe.com/api/issuing/authorizations/approve#approve_issuing_authorization-amount) to control how much to hold for the authorization.
4925    pub fn is_amount_controllable(mut self, is_amount_controllable: impl Into<bool>) -> Self {
4926        self.inner.is_amount_controllable = Some(is_amount_controllable.into());
4927        self
4928    }
4929}
4930impl IncrementIssuingAuthorization {
4931    /// Send the request and return the deserialized response.
4932    pub async fn send<C: StripeClient>(
4933        &self,
4934        client: &C,
4935    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
4936        self.customize().send(client).await
4937    }
4938
4939    /// Send the request and return the deserialized response, blocking until completion.
4940    pub fn send_blocking<C: StripeBlockingClient>(
4941        &self,
4942        client: &C,
4943    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
4944        self.customize().send_blocking(client)
4945    }
4946}
4947
4948impl StripeRequest for IncrementIssuingAuthorization {
4949    type Output = stripe_shared::IssuingAuthorization;
4950
4951    fn build(&self) -> RequestBuilder {
4952        let authorization = &self.authorization;
4953        RequestBuilder::new(
4954            StripeMethod::Post,
4955            format!("/test_helpers/issuing/authorizations/{authorization}/increment"),
4956        )
4957        .form(&self.inner)
4958    }
4959}
4960#[derive(Clone, Eq, PartialEq)]
4961#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
4962#[derive(serde::Serialize)]
4963struct ReverseIssuingAuthorizationBuilder {
4964    #[serde(skip_serializing_if = "Option::is_none")]
4965    expand: Option<Vec<String>>,
4966    #[serde(skip_serializing_if = "Option::is_none")]
4967    reverse_amount: Option<i64>,
4968}
4969#[cfg(feature = "redact-generated-debug")]
4970impl std::fmt::Debug for ReverseIssuingAuthorizationBuilder {
4971    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4972        f.debug_struct("ReverseIssuingAuthorizationBuilder").finish_non_exhaustive()
4973    }
4974}
4975impl ReverseIssuingAuthorizationBuilder {
4976    fn new() -> Self {
4977        Self { expand: None, reverse_amount: None }
4978    }
4979}
4980/// Reverse a test-mode Authorization.
4981#[derive(Clone)]
4982#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
4983#[derive(serde::Serialize)]
4984pub struct ReverseIssuingAuthorization {
4985    inner: ReverseIssuingAuthorizationBuilder,
4986    authorization: String,
4987}
4988#[cfg(feature = "redact-generated-debug")]
4989impl std::fmt::Debug for ReverseIssuingAuthorization {
4990    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4991        f.debug_struct("ReverseIssuingAuthorization").finish_non_exhaustive()
4992    }
4993}
4994impl ReverseIssuingAuthorization {
4995    /// Construct a new `ReverseIssuingAuthorization`.
4996    pub fn new(authorization: impl Into<String>) -> Self {
4997        Self {
4998            authorization: authorization.into(),
4999            inner: ReverseIssuingAuthorizationBuilder::new(),
5000        }
5001    }
5002    /// Specifies which fields in the response should be expanded.
5003    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
5004        self.inner.expand = Some(expand.into());
5005        self
5006    }
5007    /// The amount to reverse from the authorization.
5008    /// If not provided, the full amount of the authorization will be reversed.
5009    /// This amount is in the authorization currency and in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal).
5010    pub fn reverse_amount(mut self, reverse_amount: impl Into<i64>) -> Self {
5011        self.inner.reverse_amount = Some(reverse_amount.into());
5012        self
5013    }
5014}
5015impl ReverseIssuingAuthorization {
5016    /// Send the request and return the deserialized response.
5017    pub async fn send<C: StripeClient>(
5018        &self,
5019        client: &C,
5020    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
5021        self.customize().send(client).await
5022    }
5023
5024    /// Send the request and return the deserialized response, blocking until completion.
5025    pub fn send_blocking<C: StripeBlockingClient>(
5026        &self,
5027        client: &C,
5028    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
5029        self.customize().send_blocking(client)
5030    }
5031}
5032
5033impl StripeRequest for ReverseIssuingAuthorization {
5034    type Output = stripe_shared::IssuingAuthorization;
5035
5036    fn build(&self) -> RequestBuilder {
5037        let authorization = &self.authorization;
5038        RequestBuilder::new(
5039            StripeMethod::Post,
5040            format!("/test_helpers/issuing/authorizations/{authorization}/reverse"),
5041        )
5042        .form(&self.inner)
5043    }
5044}
5045
5046#[derive(Clone, Eq, PartialEq)]
5047#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
5048#[derive(serde::Serialize)]
5049pub struct FleetCardholderPromptDataSpecs {
5050    /// Driver ID.
5051    #[serde(skip_serializing_if = "Option::is_none")]
5052    pub driver_id: Option<String>,
5053    /// Odometer reading.
5054    #[serde(skip_serializing_if = "Option::is_none")]
5055    pub odometer: Option<i64>,
5056    /// An alphanumeric ID.
5057    /// This field is used when a vehicle ID, driver ID, or generic ID is entered by the cardholder, but the merchant or card network did not specify the prompt type.
5058    #[serde(skip_serializing_if = "Option::is_none")]
5059    pub unspecified_id: Option<String>,
5060    /// User ID.
5061    #[serde(skip_serializing_if = "Option::is_none")]
5062    pub user_id: Option<String>,
5063    /// Vehicle number.
5064    #[serde(skip_serializing_if = "Option::is_none")]
5065    pub vehicle_number: Option<String>,
5066}
5067#[cfg(feature = "redact-generated-debug")]
5068impl std::fmt::Debug for FleetCardholderPromptDataSpecs {
5069    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5070        f.debug_struct("FleetCardholderPromptDataSpecs").finish_non_exhaustive()
5071    }
5072}
5073impl FleetCardholderPromptDataSpecs {
5074    pub fn new() -> Self {
5075        Self {
5076            driver_id: None,
5077            odometer: None,
5078            unspecified_id: None,
5079            user_id: None,
5080            vehicle_number: None,
5081        }
5082    }
5083}
5084impl Default for FleetCardholderPromptDataSpecs {
5085    fn default() -> Self {
5086        Self::new()
5087    }
5088}
5089#[derive(Clone, Eq, PartialEq)]
5090#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
5091#[derive(serde::Serialize)]
5092pub struct FleetReportedBreakdownFuelSpecs {
5093    /// Gross fuel amount that should equal Fuel Volume multipled by Fuel Unit Cost, inclusive of taxes.
5094    #[serde(skip_serializing_if = "Option::is_none")]
5095    pub gross_amount_decimal: Option<String>,
5096}
5097#[cfg(feature = "redact-generated-debug")]
5098impl std::fmt::Debug for FleetReportedBreakdownFuelSpecs {
5099    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5100        f.debug_struct("FleetReportedBreakdownFuelSpecs").finish_non_exhaustive()
5101    }
5102}
5103impl FleetReportedBreakdownFuelSpecs {
5104    pub fn new() -> Self {
5105        Self { gross_amount_decimal: None }
5106    }
5107}
5108impl Default for FleetReportedBreakdownFuelSpecs {
5109    fn default() -> Self {
5110        Self::new()
5111    }
5112}
5113#[derive(Clone, Eq, PartialEq)]
5114#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
5115#[derive(serde::Serialize)]
5116pub struct FleetReportedBreakdownNonFuelSpecs {
5117    /// Gross non-fuel amount that should equal the sum of the line items, inclusive of taxes.
5118    #[serde(skip_serializing_if = "Option::is_none")]
5119    pub gross_amount_decimal: Option<String>,
5120}
5121#[cfg(feature = "redact-generated-debug")]
5122impl std::fmt::Debug for FleetReportedBreakdownNonFuelSpecs {
5123    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5124        f.debug_struct("FleetReportedBreakdownNonFuelSpecs").finish_non_exhaustive()
5125    }
5126}
5127impl FleetReportedBreakdownNonFuelSpecs {
5128    pub fn new() -> Self {
5129        Self { gross_amount_decimal: None }
5130    }
5131}
5132impl Default for FleetReportedBreakdownNonFuelSpecs {
5133    fn default() -> Self {
5134        Self::new()
5135    }
5136}
5137#[derive(Clone, Eq, PartialEq)]
5138#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
5139#[derive(serde::Serialize)]
5140pub struct FleetReportedBreakdownTaxSpecs {
5141    /// Amount of state or provincial Sales Tax included in the transaction amount.
5142    /// Null if not reported by merchant or not subject to tax.
5143    #[serde(skip_serializing_if = "Option::is_none")]
5144    pub local_amount_decimal: Option<String>,
5145    /// Amount of national Sales Tax or VAT included in the transaction amount.
5146    /// Null if not reported by merchant or not subject to tax.
5147    #[serde(skip_serializing_if = "Option::is_none")]
5148    pub national_amount_decimal: Option<String>,
5149}
5150#[cfg(feature = "redact-generated-debug")]
5151impl std::fmt::Debug for FleetReportedBreakdownTaxSpecs {
5152    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5153        f.debug_struct("FleetReportedBreakdownTaxSpecs").finish_non_exhaustive()
5154    }
5155}
5156impl FleetReportedBreakdownTaxSpecs {
5157    pub fn new() -> Self {
5158        Self { local_amount_decimal: None, national_amount_decimal: None }
5159    }
5160}
5161impl Default for FleetReportedBreakdownTaxSpecs {
5162    fn default() -> Self {
5163        Self::new()
5164    }
5165}
5166#[derive(Clone, Eq, PartialEq)]
5167#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
5168#[derive(serde::Serialize)]
5169pub struct FleetReportedBreakdownSpecs {
5170    /// Breakdown of fuel portion of the purchase.
5171    #[serde(skip_serializing_if = "Option::is_none")]
5172    pub fuel: Option<FleetReportedBreakdownFuelSpecs>,
5173    /// Breakdown of non-fuel portion of the purchase.
5174    #[serde(skip_serializing_if = "Option::is_none")]
5175    pub non_fuel: Option<FleetReportedBreakdownNonFuelSpecs>,
5176    /// Information about tax included in this transaction.
5177    #[serde(skip_serializing_if = "Option::is_none")]
5178    pub tax: Option<FleetReportedBreakdownTaxSpecs>,
5179}
5180#[cfg(feature = "redact-generated-debug")]
5181impl std::fmt::Debug for FleetReportedBreakdownSpecs {
5182    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5183        f.debug_struct("FleetReportedBreakdownSpecs").finish_non_exhaustive()
5184    }
5185}
5186impl FleetReportedBreakdownSpecs {
5187    pub fn new() -> Self {
5188        Self { fuel: None, non_fuel: None, tax: None }
5189    }
5190}
5191impl Default for FleetReportedBreakdownSpecs {
5192    fn default() -> Self {
5193        Self::new()
5194    }
5195}