Skip to main content

bitwarden_api_api/models/
access_lease_extension_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/// AccessLeaseExtensionRequestModel : A request to extend an active lease, identified by the
16/// route's lease id. Extensions are always auto-approved, subject to the governing rule allowing
17/// extensions and the per-lease maximum not being reached.
18#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
19pub struct AccessLeaseExtensionRequestModel {
20    /// How far the lease's end is pushed out, in seconds, bounded by the governing rule's maximum
21    /// extension duration.
22    #[serde(
23        rename = "durationSeconds",
24        alias = "DurationSeconds",
25        skip_serializing_if = "Option::is_none"
26    )]
27    pub duration_seconds: Option<i32>,
28    /// The justification recorded with the extension.
29    #[serde(rename = "reason", alias = "Reason")]
30    pub reason: String,
31}
32
33impl AccessLeaseExtensionRequestModel {
34    /// A request to extend an active lease, identified by the route's lease id. Extensions are
35    /// always auto-approved, subject to the governing rule allowing extensions and the per-lease
36    /// maximum not being reached.
37    pub fn new(reason: String) -> AccessLeaseExtensionRequestModel {
38        AccessLeaseExtensionRequestModel {
39            duration_seconds: None,
40            reason,
41        }
42    }
43}