Skip to main content

bitwarden_api_api/models/
rotation_claim_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/// RotationClaimResponseModel : The work snapshot handed back on a successful claim (spec
16/// `ClaimRotation`) -- everything the access connector needs to execute the rotation without
17/// another round trip. Returned only when the claim was actually won; a lost or ineligible claim is
18/// an error response instead, so every field here is populated.
19#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
20pub struct RotationClaimResponseModel {
21    /// The attempt opened by this claim -- the id the access connector reports its outcome
22    /// against.
23    #[serde(
24        rename = "attemptId",
25        alias = "AttemptId",
26        skip_serializing_if = "Option::is_none"
27    )]
28    pub attempt_id: Option<uuid::Uuid>,
29    /// The rotation job the claim was taken on.
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 target system the rotation runs against.
43    #[serde(
44        rename = "targetSystemId",
45        alias = "TargetSystemId",
46        skip_serializing_if = "Option::is_none"
47    )]
48    pub target_system_id: Option<uuid::Uuid>,
49    /// The target system's display name.
50    #[serde(
51        rename = "targetSystemName",
52        alias = "TargetSystemName",
53        skip_serializing_if = "Option::is_none"
54    )]
55    pub target_system_name: Option<String>,
56    #[serde(
57        rename = "kind",
58        alias = "Kind",
59        skip_serializing_if = "Option::is_none"
60    )]
61    pub kind: Option<models::PamTargetSystemKind>,
62    #[serde(
63        rename = "passwordPolicy",
64        alias = "PasswordPolicy",
65        skip_serializing_if = "Option::is_none"
66    )]
67    pub password_policy: Option<Box<models::PamPasswordPolicyResponseModel>>,
68    /// The organization cipher holding the credential to rotate.
69    #[serde(
70        rename = "cipherId",
71        alias = "CipherId",
72        skip_serializing_if = "Option::is_none"
73    )]
74    pub cipher_id: Option<uuid::Uuid>,
75    /// The account to rotate on the target system. Opaque to the server -- never parsed; only the
76    /// access connector interprets it.
77    #[serde(
78        rename = "accountIdentity",
79        alias = "AccountIdentity",
80        skip_serializing_if = "Option::is_none"
81    )]
82    pub account_identity: Option<String>,
83    /// When true, the access connector terminates the account's live sessions after rotating.
84    #[serde(
85        rename = "terminateSessions",
86        alias = "TerminateSessions",
87        skip_serializing_if = "Option::is_none"
88    )]
89    pub terminate_sessions: Option<bool>,
90    /// The claim's lease deadline. The access connector must finish -- or at least keep
91    /// heartbeating -- before this, or the release sweep may reclaim the job out from under it
92    /// once its heartbeat also goes stale.
93    #[serde(
94        rename = "executeBy",
95        alias = "ExecuteBy",
96        skip_serializing_if = "Option::is_none"
97    )]
98    pub execute_by: Option<String>,
99}
100
101impl RotationClaimResponseModel {
102    /// The work snapshot handed back on a successful claim (spec `ClaimRotation`) -- everything the
103    /// access connector needs to execute the rotation without another round trip. Returned only
104    /// when the claim was actually won; a lost or ineligible claim is an error response instead, so
105    /// every field here is populated.
106    pub fn new() -> RotationClaimResponseModel {
107        RotationClaimResponseModel {
108            attempt_id: None,
109            job_id: None,
110            source: None,
111            target_system_id: None,
112            target_system_name: None,
113            kind: None,
114            password_policy: None,
115            cipher_id: None,
116            account_identity: None,
117            terminate_sessions: None,
118            execute_by: None,
119        }
120    }
121}