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. The lease's end is pushed out by
17/// Bit.Services.Pam.Api.Models.Request.AccessLeaseExtensionRequestModel.DurationSeconds; a
18/// justifying Bit.Services.Pam.Api.Models.Request.AccessLeaseExtensionRequestModel.Reason is
19/// required. Extensions are always auto-approved, subject to the governing rule allowing extensions
20/// and the per-lease maximum not being reached.
21#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
22pub struct AccessLeaseExtensionRequestModel {
23    /// How far the lease's end is pushed out, in seconds. Must be positive and no longer than the
24    /// governing rule's maximum extension duration.
25    #[serde(
26        rename = "durationSeconds",
27        alias = "DurationSeconds",
28        skip_serializing_if = "Option::is_none"
29    )]
30    pub duration_seconds: Option<i32>,
31    /// The justification recorded with the extension. Required to be non-empty.
32    #[serde(rename = "reason", alias = "Reason")]
33    pub reason: String,
34}
35
36impl AccessLeaseExtensionRequestModel {
37    /// A request to extend an active lease, identified by the route's lease id. The lease's end is
38    /// pushed out by
39    /// Bit.Services.Pam.Api.Models.Request.AccessLeaseExtensionRequestModel.DurationSeconds; a
40    /// justifying Bit.Services.Pam.Api.Models.Request.AccessLeaseExtensionRequestModel.Reason is
41    /// required. Extensions are always auto-approved, subject to the governing rule allowing
42    /// extensions and the per-lease maximum not being reached.
43    pub fn new(reason: String) -> AccessLeaseExtensionRequestModel {
44        AccessLeaseExtensionRequestModel {
45            duration_seconds: None,
46            reason,
47        }
48    }
49}