bitwarden_api_api/models/
send_response_model.rs

1/*
2 * Bitwarden Internal API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: latest
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use serde::{Deserialize, Serialize};
12
13use crate::models;
14
15/// SendResponseModel : A response issued to a Bitwarden client in response to ownership operations.
16#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
17pub struct SendResponseModel {
18    #[serde(
19        rename = "object",
20        alias = "Object",
21        skip_serializing_if = "Option::is_none"
22    )]
23    pub object: Option<String>,
24    /// Identifies the send to its owner
25    #[serde(rename = "id", alias = "Id", skip_serializing_if = "Option::is_none")]
26    pub id: Option<uuid::Uuid>,
27    /// Identifies the send in a send URL
28    #[serde(
29        rename = "accessId",
30        alias = "AccessId",
31        skip_serializing_if = "Option::is_none"
32    )]
33    pub access_id: Option<String>,
34    #[serde(
35        rename = "type",
36        alias = "R#type",
37        skip_serializing_if = "Option::is_none"
38    )]
39    pub r#type: Option<models::SendType>,
40    #[serde(
41        rename = "authType",
42        alias = "AuthType",
43        skip_serializing_if = "Option::is_none"
44    )]
45    pub auth_type: Option<models::AuthType>,
46    /// Label for the send.
47    #[serde(
48        rename = "name",
49        alias = "Name",
50        skip_serializing_if = "Option::is_none"
51    )]
52    pub name: Option<String>,
53    /// Notes for the send. This is only visible to the owner of the send. This field is encrypted.
54    #[serde(
55        rename = "notes",
56        alias = "Notes",
57        skip_serializing_if = "Option::is_none"
58    )]
59    pub notes: Option<String>,
60    #[serde(
61        rename = "file",
62        alias = "File",
63        skip_serializing_if = "Option::is_none"
64    )]
65    pub file: Option<Box<models::SendFileModel>>,
66    #[serde(
67        rename = "text",
68        alias = "Text",
69        skip_serializing_if = "Option::is_none"
70    )]
71    pub text: Option<Box<models::SendTextModel>>,
72    /// A base64-encoded byte array containing the Send's encryption key. It's also provided to
73    /// send recipients in the Send's URL.
74    #[serde(rename = "key", alias = "Key", skip_serializing_if = "Option::is_none")]
75    pub key: Option<String>,
76    /// The maximum number of times a send can be accessed before it expires. When this value is
77    /// null, there is no limit.
78    #[serde(
79        rename = "maxAccessCount",
80        alias = "MaxAccessCount",
81        skip_serializing_if = "Option::is_none"
82    )]
83    pub max_access_count: Option<i32>,
84    /// The number of times a send has been accessed since it was created.
85    #[serde(
86        rename = "accessCount",
87        alias = "AccessCount",
88        skip_serializing_if = "Option::is_none"
89    )]
90    pub access_count: Option<i32>,
91    /// Base64-encoded byte array of a password hash that grants access to the send. Mutually
92    /// exclusive with Bit.Api.Tools.Models.Response.SendResponseModel.Emails.
93    #[serde(
94        rename = "password",
95        alias = "Password",
96        skip_serializing_if = "Option::is_none"
97    )]
98    pub password: Option<String>,
99    /// Comma-separated list of emails that may access the send using OTP authentication. Mutually
100    /// exclusive with Bit.Api.Tools.Models.Response.SendResponseModel.Password.
101    #[serde(
102        rename = "emails",
103        alias = "Emails",
104        skip_serializing_if = "Option::is_none"
105    )]
106    pub emails: Option<String>,
107    /// When true, send access is disabled.
108    #[serde(
109        rename = "disabled",
110        alias = "Disabled",
111        skip_serializing_if = "Option::is_none"
112    )]
113    pub disabled: Option<bool>,
114    /// The last time this send's data changed.
115    #[serde(
116        rename = "revisionDate",
117        alias = "RevisionDate",
118        skip_serializing_if = "Option::is_none"
119    )]
120    pub revision_date: Option<String>,
121    /// The date after which a send cannot be accessed. When this value is null, there is no
122    /// expiration date.
123    #[serde(
124        rename = "expirationDate",
125        alias = "ExpirationDate",
126        skip_serializing_if = "Option::is_none"
127    )]
128    pub expiration_date: Option<String>,
129    /// The date after which a send may be automatically deleted from the server.
130    #[serde(
131        rename = "deletionDate",
132        alias = "DeletionDate",
133        skip_serializing_if = "Option::is_none"
134    )]
135    pub deletion_date: Option<String>,
136    /// When true send access hides the user's email address and displays a confirmation message
137    /// instead.
138    #[serde(
139        rename = "hideEmail",
140        alias = "HideEmail",
141        skip_serializing_if = "Option::is_none"
142    )]
143    pub hide_email: Option<bool>,
144}
145
146impl SendResponseModel {
147    /// A response issued to a Bitwarden client in response to ownership operations.
148    pub fn new() -> SendResponseModel {
149        SendResponseModel {
150            object: None,
151            id: None,
152            access_id: None,
153            r#type: None,
154            auth_type: None,
155            name: None,
156            notes: None,
157            file: None,
158            text: None,
159            key: None,
160            max_access_count: None,
161            access_count: None,
162            password: None,
163            emails: None,
164            disabled: None,
165            revision_date: None,
166            expiration_date: None,
167            deletion_date: None,
168            hide_email: None,
169        }
170    }
171}