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 : The body of `POST
16/// access-connectors/rotation/attempts/{id}/failure` (spec `RecordRotationFailed`). The contract
17/// forbids forwarding raw target-system error output -- it can echo credentials -- so the access
18/// connector reports an
19/// Bit.Services.Pam.AccessConnector.Rotation.Api.Models.Request.ReportRotationFailedRequestModel.
20/// ErrorCode token it defines plus an optional
21/// Bit.Services.Pam.AccessConnector.Rotation.Api.Models.Request.ReportRotationFailedRequestModel.
22/// Detail. The combined reason the two produce is truncated rather than rejected, since it can
23/// exceed the length the server records.
24#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
25pub struct ReportRotationFailedRequestModel {
26 #[serde(rename = "syncState", alias = "SyncState")]
27 pub sync_state: models::PamRotationSyncState,
28 /// A connector-defined token classifying the failure -- never raw target-system output.
29 #[serde(rename = "errorCode", alias = "ErrorCode")]
30 pub error_code: String,
31 /// Additional human-readable context for the failure, subject to the same no-raw-target-output
32 /// contract as
33 /// Bit.Services.Pam.AccessConnector.Rotation.Api.Models.Request.
34 /// ReportRotationFailedRequestModel.ErrorCode.
35 #[serde(
36 rename = "detail",
37 alias = "Detail",
38 skip_serializing_if = "Option::is_none"
39 )]
40 pub detail: Option<String>,
41}
42
43impl ReportRotationFailedRequestModel {
44 /// The body of `POST access-connectors/rotation/attempts/{id}/failure` (spec
45 /// `RecordRotationFailed`). The contract forbids forwarding raw target-system error output --
46 /// it can echo credentials -- so the access connector reports an
47 /// Bit.Services.Pam.AccessConnector.Rotation.Api.Models.Request.
48 /// ReportRotationFailedRequestModel.ErrorCode token it defines plus an optional
49 /// Bit.Services.Pam.AccessConnector.Rotation.Api.Models.Request.
50 /// ReportRotationFailedRequestModel.Detail. The combined reason the two produce is truncated
51 /// rather than rejected, since it can exceed the length the server records.
52 pub fn new(
53 sync_state: models::PamRotationSyncState,
54 error_code: String,
55 ) -> ReportRotationFailedRequestModel {
56 ReportRotationFailedRequestModel {
57 sync_state,
58 error_code,
59 detail: None,
60 }
61 }
62}