stripe/resources/generated/
scheduled_query_run.rs

1// ======================================
2// This file was automatically generated.
3// ======================================
4
5use crate::ids::ScheduledQueryRunId;
6use crate::params::{Object, Timestamp};
7use crate::resources::File;
8use serde::{Deserialize, Serialize};
9
10/// The resource representing a Stripe "ScheduledQueryRun".
11///
12/// For more details see <https://stripe.com/docs/api/sigma/scheduled_queries/object>
13#[derive(Clone, Debug, Default, Deserialize, Serialize)]
14pub struct ScheduledQueryRun {
15    /// Unique identifier for the object.
16    pub id: ScheduledQueryRunId,
17
18    /// Time at which the object was created.
19    ///
20    /// Measured in seconds since the Unix epoch.
21    pub created: Timestamp,
22
23    /// When the query was run, Sigma contained a snapshot of your Stripe data at this time.
24    pub data_load_time: Timestamp,
25
26    #[serde(skip_serializing_if = "Option::is_none")]
27    pub error: Option<SigmaScheduledQueryRunError>,
28
29    /// The file object representing the results of the query.
30    pub file: Option<File>,
31
32    /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
33    pub livemode: bool,
34
35    /// Time at which the result expires and is no longer available for download.
36    pub result_available_until: Timestamp,
37
38    /// SQL for the query.
39    pub sql: String,
40
41    /// The query's execution status, which will be `completed` for successful runs, and `canceled`, `failed`, or `timed_out` otherwise.
42    pub status: String,
43
44    /// Title of the query.
45    pub title: String,
46}
47
48impl Object for ScheduledQueryRun {
49    type Id = ScheduledQueryRunId;
50    fn id(&self) -> Self::Id {
51        self.id.clone()
52    }
53    fn object(&self) -> &'static str {
54        "scheduled_query_run"
55    }
56}
57
58#[derive(Clone, Debug, Default, Deserialize, Serialize)]
59pub struct SigmaScheduledQueryRunError {
60    /// Information about the run failure.
61    pub message: String,
62}