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 approval outcome a request for this cipher would get, so the
16/// client can offer the right form before submitting.
17#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
18pub struct AccessPreCheckResponseModel {
19    #[serde(
20        rename = "object",
21        alias = "Object",
22        skip_serializing_if = "Option::is_none"
23    )]
24    pub object: Option<String>,
25    #[serde(
26        rename = "cipherId",
27        alias = "CipherId",
28        skip_serializing_if = "Option::is_none"
29    )]
30    pub cipher_id: Option<uuid::Uuid>,
31    #[serde(
32        rename = "approvalMode",
33        alias = "ApprovalMode",
34        skip_serializing_if = "Option::is_none"
35    )]
36    pub approval_mode: Option<models::AccessApprovalMode>,
37    /// True when the caller already holds an active lease, so no request is needed.
38    #[serde(
39        rename = "hasActiveLease",
40        alias = "HasActiveLease",
41        skip_serializing_if = "Option::is_none"
42    )]
43    pub has_active_lease: Option<bool>,
44    /// The duration to pre-select, from the rule's default or the global one, clamped to
45    /// Bit.Services.Pam.Api.Models.Response.AccessPreCheckResponseModel.MaxDurationSeconds.
46    #[serde(
47        rename = "defaultDurationSeconds",
48        alias = "DefaultDurationSeconds",
49        skip_serializing_if = "Option::is_none"
50    )]
51    pub default_duration_seconds: Option<i32>,
52    /// The longest duration (automatic path) or window (human path) a request may ask for, which
53    /// is the rule's cap narrowed by the global ceiling. Submit enforces the same limit.
54    #[serde(
55        rename = "maxDurationSeconds",
56        alias = "MaxDurationSeconds",
57        skip_serializing_if = "Option::is_none"
58    )]
59    pub max_duration_seconds: Option<i32>,
60    /// False only when the single-active-lease constraint binds and another member holds the slot.
61    /// A hint, re-checked at start; absent means true.
62    #[serde(
63        rename = "canStartLease",
64        alias = "CanStartLease",
65        skip_serializing_if = "Option::is_none"
66    )]
67    pub can_start_lease: Option<bool>,
68    /// When the lease holding the slot ends. Null when
69    /// Bit.Services.Pam.Api.Models.Response.AccessPreCheckResponseModel.CanStartLease is true.
70    #[serde(
71        rename = "slotFreesAt",
72        alias = "SlotFreesAt",
73        skip_serializing_if = "Option::is_none"
74    )]
75    pub slot_frees_at: Option<String>,
76}
77
78impl AccessPreCheckResponseModel {
79    /// The approval outcome a request for this cipher would get, so the client can offer the right
80    /// form before submitting.
81    pub fn new() -> AccessPreCheckResponseModel {
82        AccessPreCheckResponseModel {
83            object: None,
84            cipher_id: None,
85            approval_mode: None,
86            has_active_lease: None,
87            default_duration_seconds: None,
88            max_duration_seconds: None,
89            can_start_lease: None,
90            slot_frees_at: None,
91        }
92    }
93}