Skip to main content

bitwarden_api_api/models/
access_pre_check_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/// AccessPreCheckResponseModel : The resolved approval outcome for a cipher, without submitting a
16/// request — lets the client present the right workflow (pick a duration vs. pick a window and
17/// justify) before the requester commits.
18#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
19pub struct AccessPreCheckResponseModel {
20    #[serde(
21        rename = "object",
22        alias = "Object",
23        skip_serializing_if = "Option::is_none"
24    )]
25    pub object: Option<String>,
26    #[serde(
27        rename = "cipherId",
28        alias = "CipherId",
29        skip_serializing_if = "Option::is_none"
30    )]
31    pub cipher_id: Option<uuid::Uuid>,
32    #[serde(
33        rename = "approvalMode",
34        alias = "ApprovalMode",
35        skip_serializing_if = "Option::is_none"
36    )]
37    pub approval_mode: Option<models::AccessApprovalMode>,
38    /// True when the caller already holds an active lease: reveal the credential, no request
39    /// needed.
40    #[serde(
41        rename = "hasActiveLease",
42        alias = "HasActiveLease",
43        skip_serializing_if = "Option::is_none"
44    )]
45    pub has_active_lease: Option<bool>,
46}
47
48impl AccessPreCheckResponseModel {
49    /// The resolved approval outcome for a cipher, without submitting a request — lets the client
50    /// present the right workflow (pick a duration vs. pick a window and justify) before the
51    /// requester commits.
52    pub fn new() -> AccessPreCheckResponseModel {
53        AccessPreCheckResponseModel {
54            object: None,
55            cipher_id: None,
56            approval_mode: None,
57            has_active_lease: None,
58        }
59    }
60}