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