Skip to main content

bitwarden_api_api/models/
claimable_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/// ClaimableRotationJobResponseModel : A single claimable rotation job, as an access connector's
16/// poll (`GET access-connectors/rotation/jobs`) sees it -- the candidate set spec `ClaimRotation`
17/// claims from.
18/// Bit.Services.Pam.AccessConnector.Rotation.Api.Models.Response.ClaimableRotationJobResponseModel.
19/// TargetSystemId comes from the config the poll query already joins for its eligibility check,
20/// since the job row itself carries only `RotationConfigId`.
21#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
22pub struct ClaimableRotationJobResponseModel {
23    #[serde(
24        rename = "object",
25        alias = "Object",
26        skip_serializing_if = "Option::is_none"
27    )]
28    pub object: Option<String>,
29    /// The rotation job's unique identifier -- the id a claim is placed against.
30    #[serde(
31        rename = "jobId",
32        alias = "JobId",
33        skip_serializing_if = "Option::is_none"
34    )]
35    pub job_id: Option<uuid::Uuid>,
36    #[serde(
37        rename = "source",
38        alias = "Source",
39        skip_serializing_if = "Option::is_none"
40    )]
41    pub source: Option<models::PamRotationSource>,
42    /// The earliest time the job can be claimed (UTC). Pushed out on retry (backoff) or release.
43    #[serde(
44        rename = "nextClaimableAt",
45        alias = "NextClaimableAt",
46        skip_serializing_if = "Option::is_none"
47    )]
48    pub next_claimable_at: Option<String>,
49    /// When the job times out if no attempt has succeeded by then (UTC).
50    #[serde(
51        rename = "expiresAt",
52        alias = "ExpiresAt",
53        skip_serializing_if = "Option::is_none"
54    )]
55    pub expires_at: Option<String>,
56    /// The target system the job's rotation runs against.
57    #[serde(
58        rename = "targetSystemId",
59        alias = "TargetSystemId",
60        skip_serializing_if = "Option::is_none"
61    )]
62    pub target_system_id: Option<uuid::Uuid>,
63}
64
65impl ClaimableRotationJobResponseModel {
66    /// A single claimable rotation job, as an access connector's poll (`GET
67    /// access-connectors/rotation/jobs`) sees it -- the candidate set spec `ClaimRotation` claims
68    /// from. Bit.Services.Pam.AccessConnector.Rotation.Api.Models.Response.
69    /// ClaimableRotationJobResponseModel.TargetSystemId comes from the config the poll query
70    /// already joins for its eligibility check, since the job row itself carries only
71    /// `RotationConfigId`.
72    pub fn new() -> ClaimableRotationJobResponseModel {
73        ClaimableRotationJobResponseModel {
74            object: None,
75            job_id: None,
76            source: None,
77            next_claimable_at: None,
78            expires_at: None,
79            target_system_id: None,
80        }
81    }
82}