ory_client/models/
message.rs

1/*
2 * Ory APIs
3 *
4 * # Introduction Documentation for all public and administrative Ory APIs. Administrative APIs can only be accessed with a valid Personal Access Token. Public APIs are mostly used in browsers.  ## SDKs This document describes the APIs available in the Ory Network. The APIs are available as SDKs for the following languages:  | Language       | Download SDK                                                     | Documentation                                                                        | | -------------- | ---------------------------------------------------------------- | ------------------------------------------------------------------------------------ | | Dart           | [pub.dev](https://pub.dev/packages/ory_client)                   | [README](https://github.com/ory/sdk/blob/master/clients/client/dart/README.md)       | | .NET           | [nuget.org](https://www.nuget.org/packages/Ory.Client/)          | [README](https://github.com/ory/sdk/blob/master/clients/client/dotnet/README.md)     | | Elixir         | [hex.pm](https://hex.pm/packages/ory_client)                     | [README](https://github.com/ory/sdk/blob/master/clients/client/elixir/README.md)     | | Go             | [github.com](https://github.com/ory/client-go)                   | [README](https://github.com/ory/sdk/blob/master/clients/client/go/README.md)         | | Java           | [maven.org](https://search.maven.org/artifact/sh.ory/ory-client) | [README](https://github.com/ory/sdk/blob/master/clients/client/java/README.md)       | | JavaScript     | [npmjs.com](https://www.npmjs.com/package/@ory/client)           | [README](https://github.com/ory/sdk/blob/master/clients/client/typescript/README.md) | | JavaScript (With fetch) | [npmjs.com](https://www.npmjs.com/package/@ory/client-fetch)           | [README](https://github.com/ory/sdk/blob/master/clients/client/typescript-fetch/README.md) |  | PHP            | [packagist.org](https://packagist.org/packages/ory/client)       | [README](https://github.com/ory/sdk/blob/master/clients/client/php/README.md)        | | Python         | [pypi.org](https://pypi.org/project/ory-client/)                 | [README](https://github.com/ory/sdk/blob/master/clients/client/python/README.md)     | | Ruby           | [rubygems.org](https://rubygems.org/gems/ory-client)             | [README](https://github.com/ory/sdk/blob/master/clients/client/ruby/README.md)       | | Rust           | [crates.io](https://crates.io/crates/ory-client)                 | [README](https://github.com/ory/sdk/blob/master/clients/client/rust/README.md)       | 
5 *
6 * The version of the OpenAPI document: v1.22.2
7 * Contact: support@ory.sh
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct Message {
16    #[serde(rename = "body")]
17    pub body: String,
18    #[serde(rename = "channel", skip_serializing_if = "Option::is_none")]
19    pub channel: Option<String>,
20    /// CreatedAt is a helper struct field for gobuffalo.pop.
21    #[serde(rename = "created_at")]
22    pub created_at: String,
23    /// Dispatches store information about the attempts of delivering a message May contain an error if any happened, or just the `success` state.
24    #[serde(rename = "dispatches", skip_serializing_if = "Option::is_none")]
25    pub dispatches: Option<Vec<models::MessageDispatch>>,
26    #[serde(rename = "id")]
27    pub id: String,
28    #[serde(rename = "recipient")]
29    pub recipient: String,
30    #[serde(rename = "send_count")]
31    pub send_count: i64,
32    #[serde(rename = "status")]
33    pub status: models::CourierMessageStatus,
34    #[serde(rename = "subject")]
35    pub subject: String,
36    ///  recovery_invalid TypeRecoveryInvalid recovery_valid TypeRecoveryValid recovery_code_invalid TypeRecoveryCodeInvalid recovery_code_valid TypeRecoveryCodeValid verification_invalid TypeVerificationInvalid verification_valid TypeVerificationValid verification_code_invalid TypeVerificationCodeInvalid verification_code_valid TypeVerificationCodeValid stub TypeTestStub login_code_valid TypeLoginCodeValid registration_code_valid TypeRegistrationCodeValid
37    #[serde(rename = "template_type")]
38    pub template_type: TemplateTypeEnum,
39    #[serde(rename = "type")]
40    pub r#type: models::CourierMessageType,
41    /// UpdatedAt is a helper struct field for gobuffalo.pop.
42    #[serde(rename = "updated_at")]
43    pub updated_at: String,
44}
45
46impl Message {
47    pub fn new(body: String, created_at: String, id: String, recipient: String, send_count: i64, status: models::CourierMessageStatus, subject: String, template_type: TemplateTypeEnum, r#type: models::CourierMessageType, updated_at: String) -> Message {
48        Message {
49            body,
50            channel: None,
51            created_at,
52            dispatches: None,
53            id,
54            recipient,
55            send_count,
56            status,
57            subject,
58            template_type,
59            r#type,
60            updated_at,
61        }
62    }
63}
64///  recovery_invalid TypeRecoveryInvalid recovery_valid TypeRecoveryValid recovery_code_invalid TypeRecoveryCodeInvalid recovery_code_valid TypeRecoveryCodeValid verification_invalid TypeVerificationInvalid verification_valid TypeVerificationValid verification_code_invalid TypeVerificationCodeInvalid verification_code_valid TypeVerificationCodeValid stub TypeTestStub login_code_valid TypeLoginCodeValid registration_code_valid TypeRegistrationCodeValid
65#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
66pub enum TemplateTypeEnum {
67    #[serde(rename = "recovery_invalid")]
68    RecoveryInvalid,
69    #[serde(rename = "recovery_valid")]
70    RecoveryValid,
71    #[serde(rename = "recovery_code_invalid")]
72    RecoveryCodeInvalid,
73    #[serde(rename = "recovery_code_valid")]
74    RecoveryCodeValid,
75    #[serde(rename = "verification_invalid")]
76    VerificationInvalid,
77    #[serde(rename = "verification_valid")]
78    VerificationValid,
79    #[serde(rename = "verification_code_invalid")]
80    VerificationCodeInvalid,
81    #[serde(rename = "verification_code_valid")]
82    VerificationCodeValid,
83    #[serde(rename = "stub")]
84    Stub,
85    #[serde(rename = "login_code_valid")]
86    LoginCodeValid,
87    #[serde(rename = "registration_code_valid")]
88    RegistrationCodeValid,
89}
90
91impl Default for TemplateTypeEnum {
92    fn default() -> TemplateTypeEnum {
93        Self::RecoveryInvalid
94    }
95}
96