bitwarden_api_api/models/
push_registration_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 PushRegistrationRequestModel {
17    #[serde(rename = "deviceId", alias = "DeviceId")]
18    pub device_id: String,
19    #[serde(rename = "pushToken", alias = "PushToken")]
20    pub push_token: String,
21    #[serde(rename = "userId", alias = "UserId")]
22    pub user_id: String,
23    #[serde(rename = "type", alias = "R#type")]
24    pub r#type: models::DeviceType,
25    #[serde(rename = "identifier", alias = "Identifier")]
26    pub identifier: String,
27    #[serde(
28        rename = "organizationIds",
29        alias = "OrganizationIds",
30        skip_serializing_if = "Option::is_none"
31    )]
32    pub organization_ids: Option<Vec<String>>,
33    #[serde(
34        rename = "installationId",
35        alias = "InstallationId",
36        skip_serializing_if = "Option::is_none"
37    )]
38    pub installation_id: Option<uuid::Uuid>,
39}
40
41impl PushRegistrationRequestModel {
42    pub fn new(
43        device_id: String,
44        push_token: String,
45        user_id: String,
46        r#type: models::DeviceType,
47        identifier: String,
48    ) -> PushRegistrationRequestModel {
49        PushRegistrationRequestModel {
50            device_id,
51            push_token,
52            user_id,
53            r#type,
54            identifier,
55            organization_ids: None,
56            installation_id: None,
57        }
58    }
59}