Skip to main content

bitwarden_api_api/models/
cipher_access_state_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/// CipherAccessStateResponseModel : A single-snapshot read of the caller's access state for one
16/// cipher, powering the cipher-view banner and the vault-row badge. At most one of the three
17/// branches is meaningfully \"next\": an active lease authorizes access, a pending request awaits a
18/// decision, and an approved request awaits activation by the caller.
19#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
20pub struct CipherAccessStateResponseModel {
21    #[serde(
22        rename = "object",
23        alias = "Object",
24        skip_serializing_if = "Option::is_none"
25    )]
26    pub object: Option<String>,
27    #[serde(
28        rename = "cipherId",
29        alias = "CipherId",
30        skip_serializing_if = "Option::is_none"
31    )]
32    pub cipher_id: Option<uuid::Uuid>,
33    #[serde(
34        rename = "activeLease",
35        alias = "ActiveLease",
36        skip_serializing_if = "Option::is_none"
37    )]
38    pub active_lease: Option<Box<models::AccessLeaseResponseModel>>,
39    #[serde(
40        rename = "pendingRequest",
41        alias = "PendingRequest",
42        skip_serializing_if = "Option::is_none"
43    )]
44    pub pending_request: Option<Box<models::AccessRequestDetailsResponseModel>>,
45    #[serde(
46        rename = "approvedRequest",
47        alias = "ApprovedRequest",
48        skip_serializing_if = "Option::is_none"
49    )]
50    pub approved_request: Option<Box<models::AccessRequestDetailsResponseModel>>,
51    /// Whether the active lease can still be extended (the rule opts in and it has not been
52    /// extended yet).
53    #[serde(
54        rename = "extensionsAllowed",
55        alias = "ExtensionsAllowed",
56        skip_serializing_if = "Option::is_none"
57    )]
58    pub extensions_allowed: Option<bool>,
59    /// The longest a single extension of the active lease may run, in seconds; null when there is
60    /// no cap or no active lease.
61    #[serde(
62        rename = "maxExtensionDurationSeconds",
63        alias = "MaxExtensionDurationSeconds",
64        skip_serializing_if = "Option::is_none"
65    )]
66    pub max_extension_duration_seconds: Option<i32>,
67}
68
69impl CipherAccessStateResponseModel {
70    /// A single-snapshot read of the caller's access state for one cipher, powering the cipher-view
71    /// banner and the vault-row badge. At most one of the three branches is meaningfully \"next\":
72    /// an active lease authorizes access, a pending request awaits a decision, and an approved
73    /// request awaits activation by the caller.
74    pub fn new() -> CipherAccessStateResponseModel {
75        CipherAccessStateResponseModel {
76            object: None,
77            cipher_id: None,
78            active_lease: None,
79            pending_request: None,
80            approved_request: None,
81            extensions_allowed: None,
82            max_extension_duration_seconds: None,
83        }
84    }
85}