bitwarden_api_api/models/
json_element_push_send_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#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct JsonElementPushSendRequestModel {
17    #[serde(
18        rename = "userId",
19        alias = "UserId",
20        skip_serializing_if = "Option::is_none"
21    )]
22    pub user_id: Option<uuid::Uuid>,
23    #[serde(
24        rename = "organizationId",
25        alias = "OrganizationId",
26        skip_serializing_if = "Option::is_none"
27    )]
28    pub organization_id: Option<uuid::Uuid>,
29    #[serde(
30        rename = "deviceId",
31        alias = "DeviceId",
32        skip_serializing_if = "Option::is_none"
33    )]
34    pub device_id: Option<uuid::Uuid>,
35    #[serde(
36        rename = "identifier",
37        alias = "Identifier",
38        skip_serializing_if = "Option::is_none"
39    )]
40    pub identifier: Option<String>,
41    #[serde(rename = "type", alias = "R#type")]
42    pub r#type: models::PushType,
43    #[serde(rename = "payload", alias = "Payload")]
44    pub payload: Option<serde_json::Value>,
45    #[serde(
46        rename = "clientType",
47        alias = "ClientType",
48        skip_serializing_if = "Option::is_none"
49    )]
50    pub client_type: Option<models::ClientType>,
51    #[serde(
52        rename = "installationId",
53        alias = "InstallationId",
54        skip_serializing_if = "Option::is_none"
55    )]
56    pub installation_id: Option<uuid::Uuid>,
57}
58
59impl JsonElementPushSendRequestModel {
60    pub fn new(
61        r#type: models::PushType,
62        payload: Option<serde_json::Value>,
63    ) -> JsonElementPushSendRequestModel {
64        JsonElementPushSendRequestModel {
65            user_id: None,
66            organization_id: None,
67            device_id: None,
68            identifier: None,
69            r#type,
70            payload,
71            client_type: None,
72            installation_id: None,
73        }
74    }
75}