Skip to main content

bitwarden_api_api/models/
pam_rotation_job_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/// PamRotationJobResponseModel : One offer of rotation work for a config, together with every
16/// attempt recorded against it -- an element of
17/// Bit.Services.Pam.AccessConnector.Rotation.Api.Models.Response.
18/// PamRotationConfigDetailResponseModel.Jobs (the config detail page's attempt history).
19#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
20pub struct PamRotationJobResponseModel {
21    /// The job's unique identifier.
22    #[serde(rename = "id", alias = "Id", skip_serializing_if = "Option::is_none")]
23    pub id: Option<uuid::Uuid>,
24    /// The rotation config this job was offered for.
25    #[serde(
26        rename = "rotationConfigId",
27        alias = "RotationConfigId",
28        skip_serializing_if = "Option::is_none"
29    )]
30    pub rotation_config_id: Option<uuid::Uuid>,
31    #[serde(
32        rename = "source",
33        alias = "Source",
34        skip_serializing_if = "Option::is_none"
35    )]
36    pub source: Option<models::PamRotationSource>,
37    #[serde(
38        rename = "status",
39        alias = "Status",
40        skip_serializing_if = "Option::is_none"
41    )]
42    pub status: Option<models::PamRotationJobStatus>,
43    /// The access connector currently holding the job's claim. Null unless
44    /// Bit.Services.Pam.AccessConnector.Rotation.Api.Models.Response.PamRotationJobResponseModel.
45    /// Status is Bit.Pam.Enums.PamRotationJobStatus.Claimed.
46    #[serde(
47        rename = "claimedByAccessConnectorId",
48        alias = "ClaimedByAccessConnectorId",
49        skip_serializing_if = "Option::is_none"
50    )]
51    pub claimed_by_access_connector_id: Option<uuid::Uuid>,
52    /// When the current claim was taken (UTC). Null unless
53    /// Bit.Services.Pam.AccessConnector.Rotation.Api.Models.Response.PamRotationJobResponseModel.
54    /// Status is Bit.Pam.Enums.PamRotationJobStatus.Claimed.
55    #[serde(
56        rename = "claimedAt",
57        alias = "ClaimedAt",
58        skip_serializing_if = "Option::is_none"
59    )]
60    pub claimed_at: Option<String>,
61    /// When the job was offered (UTC).
62    #[serde(
63        rename = "creationDate",
64        alias = "CreationDate",
65        skip_serializing_if = "Option::is_none"
66    )]
67    pub creation_date: Option<String>,
68    /// The earliest time the job can be claimed (UTC). Pushed out on retry (backoff) or release.
69    #[serde(
70        rename = "nextClaimableAt",
71        alias = "NextClaimableAt",
72        skip_serializing_if = "Option::is_none"
73    )]
74    pub next_claimable_at: Option<String>,
75    /// When the job times out if no attempt has succeeded by then (UTC).
76    #[serde(
77        rename = "expiresAt",
78        alias = "ExpiresAt",
79        skip_serializing_if = "Option::is_none"
80    )]
81    pub expires_at: Option<String>,
82    /// Every attempt recorded against this job, oldest first.
83    #[serde(
84        rename = "attempts",
85        alias = "Attempts",
86        skip_serializing_if = "Option::is_none"
87    )]
88    pub attempts: Option<Vec<models::PamRotationAttemptResponseModel>>,
89}
90
91impl PamRotationJobResponseModel {
92    /// One offer of rotation work for a config, together with every attempt recorded against it --
93    /// an element of
94    /// Bit.Services.Pam.AccessConnector.Rotation.Api.Models.Response.
95    /// PamRotationConfigDetailResponseModel.Jobs (the config detail page's attempt history).
96    pub fn new() -> PamRotationJobResponseModel {
97        PamRotationJobResponseModel {
98            id: None,
99            rotation_config_id: None,
100            source: None,
101            status: None,
102            claimed_by_access_connector_id: None,
103            claimed_at: None,
104            creation_date: None,
105            next_claimable_at: None,
106            expires_at: None,
107            attempts: None,
108        }
109    }
110}