amazon_spapi/models/data_kiosk_2023_11_15/
query.rs

1/*
2 * Selling Partner API for Data Kiosk
3 *
4 * The Selling Partner API for Data Kiosk lets you submit GraphQL queries from a variety of schemas to help selling partners manage their businesses.
5 *
6 * The version of the OpenAPI document: 2023-11-15
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// Query : Detailed information about the query.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Query {
17    /// The query identifier. This identifier is unique only in combination with a selling partner account ID.
18    #[serde(rename = "queryId")]
19    pub query_id: String,
20    /// The submitted query.
21    #[serde(rename = "query")]
22    pub query: String,
23    /// The date and time when the query was created, in ISO 8601 date time format.
24    #[serde(rename = "createdTime")]
25    pub created_time: String,
26    /// The processing status of the query.
27    #[serde(rename = "processingStatus")]
28    pub processing_status: ProcessingStatus,
29    /// The date and time when the query processing started, in ISO 8601 date time format.
30    #[serde(rename = "processingStartTime", skip_serializing_if = "Option::is_none")]
31    pub processing_start_time: Option<String>,
32    /// The date and time when the query processing completed, in ISO 8601 date time format.
33    #[serde(rename = "processingEndTime", skip_serializing_if = "Option::is_none")]
34    pub processing_end_time: Option<String>,
35    /// The data document identifier. This identifier is only present when there is data available as a result of the query. This identifier is unique only in combination with a selling partner account ID. Pass this identifier into the `getDocument` operation to get the information required to retrieve the data document's contents.
36    #[serde(rename = "dataDocumentId", skip_serializing_if = "Option::is_none")]
37    pub data_document_id: Option<String>,
38    /// The error document identifier. This identifier is only present when an error occurs during query processing. This identifier is unique only in combination with a selling partner account ID. Pass this identifier into the `getDocument` operation to get the information required to retrieve the error document's contents.
39    #[serde(rename = "errorDocumentId", skip_serializing_if = "Option::is_none")]
40    pub error_document_id: Option<String>,
41    #[serde(rename = "pagination", skip_serializing_if = "Option::is_none")]
42    pub pagination: Option<Box<models::data_kiosk_2023_11_15::QueryPagination>>,
43}
44
45impl Query {
46    /// Detailed information about the query.
47    pub fn new(query_id: String, query: String, created_time: String, processing_status: ProcessingStatus) -> Query {
48        Query {
49            query_id,
50            query,
51            created_time,
52            processing_status,
53            processing_start_time: None,
54            processing_end_time: None,
55            data_document_id: None,
56            error_document_id: None,
57            pagination: None,
58        }
59    }
60}
61/// The processing status of the query.
62#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
63pub enum ProcessingStatus {
64    #[serde(rename = "CANCELLED")]
65    Cancelled,
66    #[serde(rename = "DONE")]
67    Done,
68    #[serde(rename = "FATAL")]
69    Fatal,
70    #[serde(rename = "IN_PROGRESS")]
71    InProgress,
72    #[serde(rename = "IN_QUEUE")]
73    InQueue,
74}
75
76impl Default for ProcessingStatus {
77    fn default() -> ProcessingStatus {
78        Self::Cancelled
79    }
80}
81