amazon_spapi/models/orders_v0/regulated_information_field.rs
1/*
2 * Selling Partner API for Orders
3 *
4 * Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools. _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response).
5 *
6 * The version of the OpenAPI document: v0
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// RegulatedInformationField : A field collected from the regulatory form.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct RegulatedInformationField {
17 /// The unique identifier of the field.
18 #[serde(rename = "FieldId")]
19 pub field_id: String,
20 /// The name of the field.
21 #[serde(rename = "FieldLabel")]
22 pub field_label: String,
23 /// The type of field.
24 #[serde(rename = "FieldType")]
25 pub field_type: FieldType,
26 /// The content of the field as collected in regulatory form. Note that `FileAttachment` type fields contain a URL where you can download the attachment.
27 #[serde(rename = "FieldValue")]
28 pub field_value: String,
29}
30
31impl RegulatedInformationField {
32 /// A field collected from the regulatory form.
33 pub fn new(field_id: String, field_label: String, field_type: FieldType, field_value: String) -> RegulatedInformationField {
34 RegulatedInformationField {
35 field_id,
36 field_label,
37 field_type,
38 field_value,
39 }
40 }
41}
42/// The type of field.
43#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
44pub enum FieldType {
45 #[serde(rename = "Text")]
46 Text,
47 #[serde(rename = "FileAttachment")]
48 FileAttachment,
49}
50
51impl Default for FieldType {
52 fn default() -> FieldType {
53 Self::Text
54 }
55}
56