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