Skip to content

Commit

Permalink
fix(customer-ext,PM query): type field is optional
Browse files Browse the repository at this point in the history
Signed-off-by: Sean Pianka <pianka@eml.cc>
  • Loading branch information
seanpianka committed Apr 26, 2024
1 parent 15b3663 commit 362659e
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/resources/customer_ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,39 +9,40 @@ use crate::resources::{

#[derive(Clone, Debug, Serialize, Eq, PartialEq)]
pub struct CustomerPaymentMethodRetrieval<'a> {
///A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list.
/// A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list.
///For instance, if you make a list request and receive 100 objects, starting with `obj_bar`,
///your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.
#[serde(skip_serializing_if = "Option::is_none")]
pub ending_before: Option<String>,

///Specifies which fields in the response should be expanded.
/// Specifies which fields in the response should be expanded.
#[serde(skip_serializing_if = "Expand::is_empty")]
pub expand: &'a [&'a str],

///A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
/// A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
#[serde(skip_serializing_if = "Option::is_none")]
pub limit: Option<i32>,

///A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list.
/// A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list.
///For instance, if you make a list request and receive 100 objects, ending with `obj_foo`,
///your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.
#[serde(skip_serializing_if = "Option::is_none")]
pub starting_after: Option<String>,

///A required filter on the list, based on the object `type` field.
/// An optional filter on the list, based on the object type field. Without the filter, the list includes all current and future payment method types. If your integration expects only one type of payment method in the response, make sure to provide a type value in the request.
#[serde(rename = "type")]
pub type_: CustomerPaymentMethodRetrievalType,
#[serde(skip_serializing_if = "Option::is_none")]
pub type_: Option<CustomerPaymentMethodRetrievalType>,
}

impl<'a> CustomerPaymentMethodRetrieval<'a> {
pub fn new(the_type: CustomerPaymentMethodRetrievalType) -> Self {
pub fn new() -> Self {
CustomerPaymentMethodRetrieval {
ending_before: None,
expand: &[],
limit: None,
starting_after: None,
type_: the_type,
type_: None,
}
}
}
Expand Down

0 comments on commit 362659e

Please sign in to comment.