Skip to content

Commit

Permalink
feat: generate latest changes from OpenApi spec
Browse files Browse the repository at this point in the history
  • Loading branch information
arlyon authored Sep 22, 2023
1 parent 18296e3 commit 652a360
Show file tree
Hide file tree
Showing 9 changed files with 75 additions and 38 deletions.
2 changes: 1 addition & 1 deletion openapi/version.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "v532"
"version": "v545"
}
4 changes: 2 additions & 2 deletions src/resources/generated/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1463,14 +1463,14 @@ pub struct PersonParams {
/// The government-issued ID number of the individual, as appropriate for the representative's country.
///
/// (Examples are a Social Security Number in the U.S., or a Social Insurance Number in Canada).
/// Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii).
/// Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii).
#[serde(skip_serializing_if = "Option::is_none")]
pub id_number: Option<String>,

/// The government-issued secondary ID number of the individual, as appropriate for the representative's country, will be used for enhanced verification checks.
///
/// In Thailand, this would be the laser code found on the back of an ID card.
/// Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii).
/// Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii).
#[serde(skip_serializing_if = "Option::is_none")]
pub id_number_secondary: Option<String>,

Expand Down
20 changes: 17 additions & 3 deletions src/resources/generated/checkout_session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -874,11 +874,14 @@ pub struct PaymentPagesCheckoutSessionCustomText {

/// Custom text that should be displayed alongside the payment confirmation button.
pub submit: Option<PaymentPagesCheckoutSessionCustomTextPosition>,

/// Custom text that should be displayed in place of the default terms of service agreement text.
pub terms_of_service_acceptance: Option<PaymentPagesCheckoutSessionCustomTextPosition>,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct PaymentPagesCheckoutSessionCustomTextPosition {
/// Text may be up to 1000 characters in length.
/// Text may be up to 1200 characters in length.
pub message: String,
}

Expand Down Expand Up @@ -1450,6 +1453,11 @@ pub struct CreateCheckoutSessionCustomText {
/// Custom text that should be displayed alongside the payment confirmation button.
#[serde(skip_serializing_if = "Option::is_none")]
pub submit: Option<CreateCheckoutSessionCustomTextSubmit>,

/// Custom text that should be displayed in place of the default terms of service agreement text.
#[serde(skip_serializing_if = "Option::is_none")]
pub terms_of_service_acceptance:
Option<CreateCheckoutSessionCustomTextTermsOfServiceAcceptance>,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
Expand Down Expand Up @@ -1920,13 +1928,19 @@ pub struct CreateCheckoutSessionCustomFieldsText {

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct CreateCheckoutSessionCustomTextShippingAddress {
/// Text may be up to 1000 characters in length.
/// Text may be up to 1200 characters in length.
pub message: String,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct CreateCheckoutSessionCustomTextSubmit {
/// Text may be up to 1000 characters in length.
/// Text may be up to 1200 characters in length.
pub message: String,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct CreateCheckoutSessionCustomTextTermsOfServiceAcceptance {
/// Text may be up to 1200 characters in length.
pub message: String,
}

Expand Down
22 changes: 11 additions & 11 deletions src/resources/generated/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ pub struct File {
/// Measured in seconds since the Unix epoch.
pub created: Timestamp,

/// The time at which the file expires and is no longer available in epoch seconds.
/// The file expires and isn't available at this time in epoch seconds.
pub expires_at: Option<Timestamp>,

/// A filename for the file, suitable for saving to a filesystem.
/// The suitable name for saving the file to a filesystem.
pub filename: Option<String>,

/// A list of [file links](https://stripe.com/docs/api#file_links) that point at this file.
Expand All @@ -35,32 +35,32 @@ pub struct File {
/// The [purpose](https://stripe.com/docs/file-upload#uploading-a-file) of the uploaded file.
pub purpose: FilePurpose,

/// The size in bytes of the file object.
/// The size of the file object in bytes.
pub size: u64,

/// A user friendly title for the document.
/// A suitable title for the document.
pub title: Option<String>,

/// The type of the file returned (e.g., `csv`, `pdf`, `jpg`, or `png`).
/// The returned file type (for example, `csv`, `pdf`, `jpg`, or `png`).
#[serde(rename = "type")]
pub type_: Option<String>,

/// The URL from which the file can be downloaded using your live secret API key.
/// Use your live secret API key to download the file from this URL.
pub url: Option<String>,
}

impl File {
/// Returns a list of the files that your account has access to.
///
/// The files are returned sorted by creation date, with the most recently created files appearing first.
/// Stripe sorts and returns the files by their creation dates, placing the most recently created files at the top.
pub fn list(client: &Client, params: &ListFiles<'_>) -> Response<List<File>> {
client.get_query("/files", &params)
}

/// Retrieves the details of an existing file object.
///
/// Supply the unique file ID from a file, and Stripe will return the corresponding file object.
/// To access file contents, see the [File Upload Guide](https://stripe.com/docs/file-upload#download-file-contents).
/// After you supply a unique file ID, Stripe returns the corresponding file object.
/// Learn how to [access file contents](https://stripe.com/docs/file-upload#download-file-contents).
pub fn retrieve(client: &Client, id: &FileId, expand: &[&str]) -> Response<File> {
client.get_query(&format!("/files/{}", id), &Expand { expand })
}
Expand Down Expand Up @@ -99,9 +99,9 @@ pub struct ListFiles<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
pub limit: Option<u64>,

/// The file purpose to filter queries by.
/// Filter queries by the file purpose.
///
/// If none is provided, files will not be filtered by purpose.
/// If you don't provide a purpose, the queries return unfiltered files.
#[serde(skip_serializing_if = "Option::is_none")]
pub purpose: Option<FilePurpose>,

Expand Down
8 changes: 4 additions & 4 deletions src/resources/generated/file_link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ pub struct FileLink {
/// Measured in seconds since the Unix epoch.
pub created: Timestamp,

/// Whether this link is already expired.
/// Returns if the link is already expired.
pub expired: bool,

/// Time at which the link expires.
/// Time that the link expires.
pub expires_at: Option<Timestamp>,

/// The file object this link points to.
Expand Down Expand Up @@ -88,7 +88,7 @@ pub struct CreateFileLink<'a> {
#[serde(skip_serializing_if = "Expand::is_empty")]
pub expand: &'a [&'a str],

/// A future timestamp after which the link will no longer be usable.
/// The link isn't usable after this future timestamp.
#[serde(skip_serializing_if = "Option::is_none")]
pub expires_at: Option<Timestamp>,

Expand Down Expand Up @@ -136,7 +136,7 @@ pub struct ListFileLinks<'a> {

/// Filter links by their expiration status.
///
/// By default, all links are returned.
/// By default, Stripe returns all links.
#[serde(skip_serializing_if = "Option::is_none")]
pub expired: Option<bool>,

Expand Down
19 changes: 9 additions & 10 deletions src/resources/generated/payment_intent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,11 +227,11 @@ impl PaymentIntent {

/// Updates properties on a PaymentIntent object without confirming.
///
/// Depending on which properties you update, you may need to confirm the
/// Depending on which properties you update, you might need to confirm the
/// PaymentIntent again.
///
/// For example, updating the `payment_method` will always require you to confirm the PaymentIntent again.
/// If you prefer to update and confirm at the same time, we recommend updating properties via the [confirm API](https://stripe.com/docs/api/payment_intents/confirm) instead.
/// For example, updating the `payment_method` always requires you to confirm the PaymentIntent again.
/// If you prefer to update and confirm at the same time, we recommend updating properties through the [confirm API](https://stripe.com/docs/api/payment_intents/confirm) instead.
pub fn update(
client: &Client,
id: &PaymentIntentId,
Expand Down Expand Up @@ -1812,10 +1812,9 @@ pub struct UpdatePaymentIntent<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
pub payment_method_options: Option<UpdatePaymentIntentPaymentMethodOptions>,

/// The list of payment method types (e.g.
/// The list of payment method types (for example, card) that this PaymentIntent can use.
///
/// card) that this PaymentIntent is allowed to use.
/// Use automatic_payment_methods to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods).
/// Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods).
#[serde(skip_serializing_if = "Option::is_none")]
pub payment_method_types: Option<Vec<String>>,

Expand Down Expand Up @@ -1850,16 +1849,16 @@ pub struct UpdatePaymentIntent<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
pub statement_descriptor_suffix: Option<&'a str>,

/// The parameters used to automatically create a Transfer when the payment succeeds.
/// Use this parameter to automatically create a Transfer when the payment succeeds.
///
/// For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
/// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
#[serde(skip_serializing_if = "Option::is_none")]
pub transfer_data: Option<UpdatePaymentIntentTransferData>,

/// A string that identifies the resulting payment as part of a group.
///
/// `transfer_group` may only be provided if it has not been set.
/// See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts) for details.
/// You can only provide `transfer_group` if it hasn't been set.
/// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
#[serde(skip_serializing_if = "Option::is_none")]
pub transfer_group: Option<&'a str>,
}
Expand Down
33 changes: 28 additions & 5 deletions src/resources/generated/payment_link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,11 +282,14 @@ pub struct PaymentLinksResourceCustomText {

/// Custom text that should be displayed alongside the payment confirmation button.
pub submit: Option<PaymentLinksResourceCustomTextPosition>,

/// Custom text that should be displayed in place of the default terms of service agreement text.
pub terms_of_service_acceptance: Option<PaymentLinksResourceCustomTextPosition>,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct PaymentLinksResourceCustomTextPosition {
/// Text may be up to 1000 characters in length.
/// Text may be up to 1200 characters in length.
pub message: String,
}

Expand Down Expand Up @@ -793,6 +796,10 @@ pub struct CreatePaymentLinkCustomText {
/// Custom text that should be displayed alongside the payment confirmation button.
#[serde(skip_serializing_if = "Option::is_none")]
pub submit: Option<CreatePaymentLinkCustomTextSubmit>,

/// Custom text that should be displayed in place of the default terms of service agreement text.
#[serde(skip_serializing_if = "Option::is_none")]
pub terms_of_service_acceptance: Option<CreatePaymentLinkCustomTextTermsOfServiceAcceptance>,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
Expand Down Expand Up @@ -961,6 +968,10 @@ pub struct UpdatePaymentLinkCustomText {
/// Custom text that should be displayed alongside the payment confirmation button.
#[serde(skip_serializing_if = "Option::is_none")]
pub submit: Option<UpdatePaymentLinkCustomTextSubmit>,

/// Custom text that should be displayed in place of the default terms of service agreement text.
#[serde(skip_serializing_if = "Option::is_none")]
pub terms_of_service_acceptance: Option<UpdatePaymentLinkCustomTextTermsOfServiceAcceptance>,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
Expand Down Expand Up @@ -1055,13 +1066,19 @@ pub struct CreatePaymentLinkCustomFieldsText {

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct CreatePaymentLinkCustomTextShippingAddress {
/// Text may be up to 1000 characters in length.
/// Text may be up to 1200 characters in length.
pub message: String,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct CreatePaymentLinkCustomTextSubmit {
/// Text may be up to 1000 characters in length.
/// Text may be up to 1200 characters in length.
pub message: String,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct CreatePaymentLinkCustomTextTermsOfServiceAcceptance {
/// Text may be up to 1200 characters in length.
pub message: String,
}

Expand Down Expand Up @@ -1177,13 +1194,19 @@ pub struct UpdatePaymentLinkCustomFieldsText {

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct UpdatePaymentLinkCustomTextShippingAddress {
/// Text may be up to 1000 characters in length.
/// Text may be up to 1200 characters in length.
pub message: String,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct UpdatePaymentLinkCustomTextSubmit {
/// Text may be up to 1000 characters in length.
/// Text may be up to 1200 characters in length.
pub message: String,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct UpdatePaymentLinkCustomTextTermsOfServiceAcceptance {
/// Text may be up to 1200 characters in length.
pub message: String,
}

Expand Down
1 change: 1 addition & 0 deletions src/resources/generated/payment_method.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2818,6 +2818,7 @@ pub struct CardDetailsParams {

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct TokenParams {
/// For backwards compatibility, you can alternatively provide a Stripe token (e.g., for Apple Pay, Amex Express Checkout, or legacy Checkout) into the card hash with format card: {token: "tok_visa"}.
pub token: String,
}

Expand Down
4 changes: 2 additions & 2 deletions src/resources/generated/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,14 +195,14 @@ pub struct CreateTokenPerson {
/// The person's ID number, as appropriate for their country.
///
/// For example, a social security number in the U.S., social insurance number in Canada, etc.
/// Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii).
/// Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii).
#[serde(skip_serializing_if = "Option::is_none")]
pub id_number: Option<String>,

/// The person's secondary ID number, as appropriate for their country, will be used for enhanced verification checks.
///
/// In Thailand, this would be the laser code found on the back of an ID card.
/// Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii).
/// Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii).
#[serde(skip_serializing_if = "Option::is_none")]
pub id_number_secondary: Option<String>,

Expand Down

0 comments on commit 652a360

Please sign in to comment.