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 a won claim returns (spec `ClaimRotation`), with
16/// everything needed to execute the rotation. A lost or ineligible claim gets an error response
17/// instead, so every field is populated.
18#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
19pub struct RotationClaimResponseModel {
20    /// The attempt this claim opened, which the outcome is reported against.
21    #[serde(
22        rename = "attemptId",
23        alias = "AttemptId",
24        skip_serializing_if = "Option::is_none"
25    )]
26    pub attempt_id: Option<uuid::Uuid>,
27    #[serde(
28        rename = "jobId",
29        alias = "JobId",
30        skip_serializing_if = "Option::is_none"
31    )]
32    pub job_id: Option<uuid::Uuid>,
33    #[serde(
34        rename = "source",
35        alias = "Source",
36        skip_serializing_if = "Option::is_none"
37    )]
38    pub source: Option<models::PamRotationSource>,
39    #[serde(
40        rename = "targetSystemId",
41        alias = "TargetSystemId",
42        skip_serializing_if = "Option::is_none"
43    )]
44    pub target_system_id: Option<uuid::Uuid>,
45    #[serde(
46        rename = "targetSystemName",
47        alias = "TargetSystemName",
48        skip_serializing_if = "Option::is_none"
49    )]
50    pub target_system_name: Option<String>,
51    /// The target system's sealed blob.
52    #[serde(
53        rename = "targetSystemSealedData",
54        alias = "TargetSystemSealedData",
55        skip_serializing_if = "Option::is_none"
56    )]
57    pub target_system_sealed_data: Option<String>,
58    /// The content key of the target system's sealed blob, wrapped by the organization key.
59    #[serde(
60        rename = "targetSystemWrappedKey",
61        alias = "TargetSystemWrappedKey",
62        skip_serializing_if = "Option::is_none"
63    )]
64    pub target_system_wrapped_key: Option<String>,
65    #[serde(
66        rename = "cipherId",
67        alias = "CipherId",
68        skip_serializing_if = "Option::is_none"
69    )]
70    pub cipher_id: Option<uuid::Uuid>,
71    /// The rotation config's sealed blob.
72    #[serde(
73        rename = "rotationConfigSealedData",
74        alias = "RotationConfigSealedData",
75        skip_serializing_if = "Option::is_none"
76    )]
77    pub rotation_config_sealed_data: Option<String>,
78    /// The content key of the rotation config's sealed blob, wrapped by the organization key.
79    #[serde(
80        rename = "rotationConfigWrappedKey",
81        alias = "RotationConfigWrappedKey",
82        skip_serializing_if = "Option::is_none"
83    )]
84    pub rotation_config_wrapped_key: Option<String>,
85    /// The claim's lease deadline. Past it, the release sweep may reclaim the job if the access
86    /// connector's heartbeat has also gone stale.
87    #[serde(
88        rename = "executeBy",
89        alias = "ExecuteBy",
90        skip_serializing_if = "Option::is_none"
91    )]
92    pub execute_by: Option<String>,
93}
94
95impl RotationClaimResponseModel {
96    /// The work snapshot a won claim returns (spec `ClaimRotation`), with everything needed to
97    /// execute the rotation. A lost or ineligible claim gets an error response instead, so every
98    /// field is populated.
99    pub fn new() -> RotationClaimResponseModel {
100        RotationClaimResponseModel {
101            attempt_id: None,
102            job_id: None,
103            source: None,
104            target_system_id: None,
105            target_system_name: None,
106            target_system_sealed_data: None,
107            target_system_wrapped_key: None,
108            cipher_id: None,
109            rotation_config_sealed_data: None,
110            rotation_config_wrapped_key: None,
111            execute_by: None,
112        }
113    }
114}