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