ory_client/models/invoice_data_v1.rs
1/*
2 * Ory APIs
3 *
4 * # Introduction Documentation for all public and administrative Ory APIs. Administrative APIs can only be accessed with a valid Personal Access Token. Public APIs are mostly used in browsers. ## SDKs This document describes the APIs available in the Ory Network. The APIs are available as SDKs for the following languages: | Language | Download SDK | Documentation | | -------------- | ---------------------------------------------------------------- | ------------------------------------------------------------------------------------ | | Dart | [pub.dev](https://pub.dev/packages/ory_client) | [README](https://github.com/ory/sdk/blob/master/clients/client/dart/README.md) | | .NET | [nuget.org](https://www.nuget.org/packages/Ory.Client/) | [README](https://github.com/ory/sdk/blob/master/clients/client/dotnet/README.md) | | Elixir | [hex.pm](https://hex.pm/packages/ory_client) | [README](https://github.com/ory/sdk/blob/master/clients/client/elixir/README.md) | | Go | [github.com](https://github.com/ory/client-go) | [README](https://github.com/ory/sdk/blob/master/clients/client/go/README.md) | | Java | [maven.org](https://search.maven.org/artifact/sh.ory/ory-client) | [README](https://github.com/ory/sdk/blob/master/clients/client/java/README.md) | | JavaScript | [npmjs.com](https://www.npmjs.com/package/@ory/client) | [README](https://github.com/ory/sdk/blob/master/clients/client/typescript/README.md) | | JavaScript (With fetch) | [npmjs.com](https://www.npmjs.com/package/@ory/client-fetch) | [README](https://github.com/ory/sdk/blob/master/clients/client/typescript-fetch/README.md) | | PHP | [packagist.org](https://packagist.org/packages/ory/client) | [README](https://github.com/ory/sdk/blob/master/clients/client/php/README.md) | | Python | [pypi.org](https://pypi.org/project/ory-client/) | [README](https://github.com/ory/sdk/blob/master/clients/client/python/README.md) | | Ruby | [rubygems.org](https://rubygems.org/gems/ory-client) | [README](https://github.com/ory/sdk/blob/master/clients/client/ruby/README.md) | | Rust | [crates.io](https://crates.io/crates/ory-client) | [README](https://github.com/ory/sdk/blob/master/clients/client/rust/README.md) |
5 *
6 * The version of the OpenAPI document: v1.22.26
7 * Contact: support@ory.sh
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct InvoiceDataV1 {
16 #[serde(rename = "billing_period")]
17 pub billing_period: Box<models::TimeInterval>,
18 /// The currency of the invoice.
19 #[serde(rename = "currency")]
20 pub currency: String,
21 /// Deleted is true if the invoice has been soft-deleted.
22 #[serde(rename = "deleted", skip_serializing_if = "Option::is_none")]
23 pub deleted: Option<bool>,
24 /// The items that are part of this invoice.
25 #[serde(rename = "items")]
26 pub items: Vec<models::LineItemV1>,
27 /// The plan that this invoice is based on, in the format \"Name@version\".
28 #[serde(rename = "plan", skip_serializing_if = "Option::is_none")]
29 pub plan: Option<String>,
30 #[serde(rename = "stripe_invoice_item", skip_serializing_if = "Option::is_none")]
31 pub stripe_invoice_item: Option<String>,
32 /// The status of the invoice, one of `draft`, `open`, `paid`, `uncollectible`, or `void`. [Learn more](https://stripe.com/docs/billing/invoices/workflow#workflow-overview)
33 #[serde(rename = "stripe_invoice_status", skip_serializing_if = "Option::is_none")]
34 pub stripe_invoice_status: Option<String>,
35 /// An optional link to the invoice on Stripe.
36 #[serde(rename = "stripe_link", skip_serializing_if = "Option::is_none")]
37 pub stripe_link: Option<String>,
38 /// The subtitle of the invoice.
39 #[serde(rename = "subtitle", skip_serializing_if = "Option::is_none")]
40 pub subtitle: Option<String>,
41 #[serde(rename = "tax", skip_serializing_if = "Option::is_none")]
42 pub tax: Option<Box<models::TaxLineItem>>,
43 /// The title of the invoice.
44 #[serde(rename = "title")]
45 pub title: String,
46 #[serde(rename = "total_in_cent")]
47 pub total_in_cent: i64,
48}
49
50impl InvoiceDataV1 {
51 pub fn new(billing_period: models::TimeInterval, currency: String, items: Vec<models::LineItemV1>, title: String, total_in_cent: i64) -> InvoiceDataV1 {
52 InvoiceDataV1 {
53 billing_period: Box::new(billing_period),
54 currency,
55 deleted: None,
56 items,
57 plan: None,
58 stripe_invoice_item: None,
59 stripe_invoice_status: None,
60 stripe_link: None,
61 subtitle: None,
62 tax: None,
63 title,
64 total_in_cent,
65 }
66 }
67}
68