bitwarden_api_api/models/rotation_cipher_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/// RotationCipherResponseModel : The response to `GET
16/// access-connectors/rotation/attempts/{id}/cipher` -- purpose-built for the access connector's
17/// narrow read (only this access connector's claimed, executing attempt; see
18/// `GetRotationCipherQuery`), deliberately not the general `CipherResponseModel` (which is
19/// user-principal-bound).
20/// Bit.Services.Pam.AccessConnector.Rotation.Api.Models.Response.RotationCipherResponseModel.Data
21/// is the cipher's encrypted JSON blob exactly as stored -- opaque ciphertext the server never
22/// decrypts.
23#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
24pub struct RotationCipherResponseModel {
25 /// The cipher's unique identifier.
26 #[serde(
27 rename = "cipherId",
28 alias = "CipherId",
29 skip_serializing_if = "Option::is_none"
30 )]
31 pub cipher_id: Option<uuid::Uuid>,
32 /// The organization owning the cipher.
33 #[serde(
34 rename = "organizationId",
35 alias = "OrganizationId",
36 skip_serializing_if = "Option::is_none"
37 )]
38 pub organization_id: Option<uuid::Uuid>,
39 #[serde(
40 rename = "type",
41 alias = "R#type",
42 skip_serializing_if = "Option::is_none"
43 )]
44 pub r#type: Option<models::CipherType>,
45 /// The cipher's encrypted JSON blob, verbatim -- opaque ciphertext.
46 #[serde(
47 rename = "data",
48 alias = "Data",
49 skip_serializing_if = "Option::is_none"
50 )]
51 pub data: Option<String>,
52 /// The cipher's own wrapped encryption key, when it has one -- opaque ciphertext. Null when
53 /// the cipher is encrypted under the organization key directly.
54 #[serde(rename = "key", alias = "Key", skip_serializing_if = "Option::is_none")]
55 pub key: Option<String>,
56 /// The cipher's current revision date (UTC) -- what the access connector sends back as its
57 /// last-known revision when writing the rotated secret.
58 #[serde(
59 rename = "revisionDate",
60 alias = "RevisionDate",
61 skip_serializing_if = "Option::is_none"
62 )]
63 pub revision_date: Option<String>,
64}
65
66impl RotationCipherResponseModel {
67 /// The response to `GET access-connectors/rotation/attempts/{id}/cipher` -- purpose-built for
68 /// the access connector's narrow read (only this access connector's claimed, executing attempt;
69 /// see `GetRotationCipherQuery`), deliberately not the general `CipherResponseModel` (which is
70 /// user-principal-bound).
71 /// Bit.Services.Pam.AccessConnector.Rotation.Api.Models.Response.RotationCipherResponseModel.
72 /// Data is the cipher's encrypted JSON blob exactly as stored -- opaque ciphertext the server
73 /// never decrypts.
74 pub fn new() -> RotationCipherResponseModel {
75 RotationCipherResponseModel {
76 cipher_id: None,
77 organization_id: None,
78 r#type: None,
79 data: None,
80 key: None,
81 revision_date: None,
82 }
83 }
84}