bitwarden_api_api/models/register_access_connector_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/// RegisterAccessConnectorRequestModel : Registers a new access connector (spec
16/// `ConnectorRegistration`). The organization key arrives wrapped client-side in
17/// Bit.Services.Pam.AccessConnector.Api.Models.Request.RegisterAccessConnectorRequestModel.
18/// EncryptedPayload and
19/// Bit.Services.Pam.AccessConnector.Api.Models.Request.RegisterAccessConnectorRequestModel.Key, so
20/// the server never sees it in plaintext.
21#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
22pub struct RegisterAccessConnectorRequestModel {
23 /// The access connector's display label, sent in plaintext.
24 #[serde(rename = "name", alias = "Name")]
25 pub name: String,
26 /// The organization key, wrapped client-side with the encryption-key half of the access
27 /// connector's credential. Returned on every token response so the access connector can unwrap
28 /// it locally.
29 #[serde(rename = "encryptedPayload", alias = "EncryptedPayload")]
30 pub encrypted_payload: String,
31 /// The key protecting
32 /// Bit.Services.Pam.AccessConnector.Api.Models.Request.RegisterAccessConnectorRequestModel.
33 /// EncryptedPayload, wrapped with the organization key.
34 #[serde(rename = "key", alias = "Key")]
35 pub key: String,
36}
37
38impl RegisterAccessConnectorRequestModel {
39 /// Registers a new access connector (spec `ConnectorRegistration`). The organization key
40 /// arrives wrapped client-side in
41 /// Bit.Services.Pam.AccessConnector.Api.Models.Request.RegisterAccessConnectorRequestModel.
42 /// EncryptedPayload and
43 /// Bit.Services.Pam.AccessConnector.Api.Models.Request.RegisterAccessConnectorRequestModel.Key,
44 /// so the server never sees it in plaintext.
45 pub fn new(
46 name: String,
47 encrypted_payload: String,
48 key: String,
49 ) -> RegisterAccessConnectorRequestModel {
50 RegisterAccessConnectorRequestModel {
51 name,
52 encrypted_payload,
53 key,
54 }
55 }
56}