Skip to main content

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    /// Encrypted string containing secret Send data
73    #[serde(
74        rename = "data",
75        alias = "Data",
76        skip_serializing_if = "Option::is_none"
77    )]
78    pub data: Option<String>,
79    /// A base64-encoded byte array containing the Send's encryption key. It's also provided to
80    /// send recipients in the Send's URL.
81    #[serde(rename = "key", alias = "Key", skip_serializing_if = "Option::is_none")]
82    pub key: Option<String>,
83    /// The maximum number of times a send can be accessed before it expires. When this value is
84    /// null, there is no limit.
85    #[serde(
86        rename = "maxAccessCount",
87        alias = "MaxAccessCount",
88        skip_serializing_if = "Option::is_none"
89    )]
90    pub max_access_count: Option<i32>,
91    /// The number of times a send has been accessed since it was created.
92    #[serde(
93        rename = "accessCount",
94        alias = "AccessCount",
95        skip_serializing_if = "Option::is_none"
96    )]
97    pub access_count: Option<i32>,
98    /// Base64-encoded byte array of a password hash that grants access to the send. Mutually
99    /// exclusive with Bit.Api.Tools.Models.Response.SendResponseModel.Emails.
100    #[serde(
101        rename = "password",
102        alias = "Password",
103        skip_serializing_if = "Option::is_none"
104    )]
105    pub password: Option<String>,
106    /// Comma-separated list of emails that may access the send using OTP authentication. Mutually
107    /// exclusive with Bit.Api.Tools.Models.Response.SendResponseModel.Password.
108    #[serde(
109        rename = "emails",
110        alias = "Emails",
111        skip_serializing_if = "Option::is_none"
112    )]
113    pub emails: Option<String>,
114    /// When true, send access is disabled.
115    #[serde(
116        rename = "disabled",
117        alias = "Disabled",
118        skip_serializing_if = "Option::is_none"
119    )]
120    pub disabled: Option<bool>,
121    /// The last time this send's data changed.
122    #[serde(
123        rename = "revisionDate",
124        alias = "RevisionDate",
125        skip_serializing_if = "Option::is_none"
126    )]
127    pub revision_date: Option<String>,
128    /// The date after which a send cannot be accessed. When this value is null, there is no
129    /// expiration date.
130    #[serde(
131        rename = "expirationDate",
132        alias = "ExpirationDate",
133        skip_serializing_if = "Option::is_none"
134    )]
135    pub expiration_date: Option<String>,
136    /// The date after which a send may be automatically deleted from the server.
137    #[serde(
138        rename = "deletionDate",
139        alias = "DeletionDate",
140        skip_serializing_if = "Option::is_none"
141    )]
142    pub deletion_date: Option<String>,
143    /// When true send access hides the user's email address and displays a confirmation message
144    /// instead.
145    #[serde(
146        rename = "hideEmail",
147        alias = "HideEmail",
148        skip_serializing_if = "Option::is_none"
149    )]
150    pub hide_email: Option<bool>,
151}
152
153impl SendResponseModel {
154    /// A response issued to a Bitwarden client in response to ownership operations.
155    pub fn new() -> SendResponseModel {
156        SendResponseModel {
157            object: None,
158            id: None,
159            access_id: None,
160            r#type: None,
161            auth_type: None,
162            name: None,
163            notes: None,
164            file: None,
165            text: None,
166            data: None,
167            key: None,
168            max_access_count: None,
169            access_count: None,
170            password: None,
171            emails: None,
172            disabled: None,
173            revision_date: None,
174            expiration_date: None,
175            deletion_date: None,
176            hide_email: None,
177        }
178    }
179}