bitwarden_api_api/models/submit_cipher_update_request_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/// SubmitCipherUpdateRequestModel : The body of `PUT
16/// access-connectors/rotation/attempts/{id}/cipher` (spec `AcceptCipherUpdate`).
17#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
18pub struct SubmitCipherUpdateRequestModel {
19 /// The rotated cipher's encrypted JSON blob, written back verbatim -- opaque ciphertext to the
20 /// server.
21 #[serde(rename = "data", alias = "Data")]
22 pub data: String,
23 /// The cipher revision date the access connector read before rotating. A mismatch at write
24 /// time means a user edited the cipher concurrently, and the write is rejected rather than
25 /// overwriting their change.
26 #[serde(rename = "lastKnownRevisionDate", alias = "LastKnownRevisionDate")]
27 pub last_known_revision_date: String,
28}
29
30impl SubmitCipherUpdateRequestModel {
31 /// The body of `PUT access-connectors/rotation/attempts/{id}/cipher` (spec
32 /// `AcceptCipherUpdate`).
33 pub fn new(data: String, last_known_revision_date: String) -> SubmitCipherUpdateRequestModel {
34 SubmitCipherUpdateRequestModel {
35 data,
36 last_known_revision_date,
37 }
38 }
39}