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