bitwarden_api_api/models/report_rotation_failed_request_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/// ReportRotationFailedRequestModel : A failed rotation report (spec `RecordRotationFailed`). Raw
16/// target-system output can echo credentials, so the access connector sends an
17/// Bit.Services.Pam.AccessConnector.Rotation.Api.Models.Request.ReportRotationFailedRequestModel.
18/// ErrorCode and optional
19/// Bit.Services.Pam.AccessConnector.Rotation.Api.Models.Request.ReportRotationFailedRequestModel.
20/// Detail instead, whose combination is truncated rather than rejected.
21#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
22pub struct ReportRotationFailedRequestModel {
23 #[serde(rename = "syncState", alias = "SyncState")]
24 pub sync_state: models::PamRotationSyncState,
25 /// A connector-defined token classifying the failure, never raw target-system output.
26 #[serde(rename = "errorCode", alias = "ErrorCode")]
27 pub error_code: String,
28 /// Human-readable context, under the same no-raw-output contract as
29 /// Bit.Services.Pam.AccessConnector.Rotation.Api.Models.Request.
30 /// ReportRotationFailedRequestModel.ErrorCode.
31 #[serde(
32 rename = "detail",
33 alias = "Detail",
34 skip_serializing_if = "Option::is_none"
35 )]
36 pub detail: Option<String>,
37}
38
39impl ReportRotationFailedRequestModel {
40 /// A failed rotation report (spec `RecordRotationFailed`). Raw target-system output can echo
41 /// credentials, so the access connector sends an
42 /// Bit.Services.Pam.AccessConnector.Rotation.Api.Models.Request.
43 /// ReportRotationFailedRequestModel.ErrorCode and optional
44 /// Bit.Services.Pam.AccessConnector.Rotation.Api.Models.Request.
45 /// ReportRotationFailedRequestModel.Detail instead, whose combination is truncated rather than
46 /// rejected.
47 pub fn new(
48 sync_state: models::PamRotationSyncState,
49 error_code: String,
50 ) -> ReportRotationFailedRequestModel {
51 ReportRotationFailedRequestModel {
52 sync_state,
53 error_code,
54 detail: None,
55 }
56 }
57}