ory_client/models/member_invite.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 MemberInvite {
16 /// The Project's Revision Creation Date
17 #[serde(rename = "created_at")]
18 pub created_at: String,
19 /// The invite's ID.
20 #[serde(rename = "id")]
21 pub id: String,
22 /// The invitee's email
23 #[serde(rename = "invitee_email")]
24 pub invitee_email: String,
25 #[serde(rename = "invitee_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
26 pub invitee_id: Option<Option<String>>,
27 /// The invite owner's email Usually the project's owner email
28 #[serde(rename = "owner_email")]
29 pub owner_email: String,
30 /// The invite owner's ID Usually the project's owner
31 #[serde(rename = "owner_id")]
32 pub owner_id: String,
33 #[serde(rename = "project_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
34 pub project_id: Option<Option<String>>,
35 #[serde(rename = "role", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
36 pub role: Option<Option<String>>,
37 /// The invite's status Keeps track of the invites status such as pending, accepted, declined, expired pending PENDING accepted ACCEPTED declined DECLINED expired EXPIRED cancelled CANCELLED removed REMOVED
38 #[serde(rename = "status")]
39 pub status: StatusEnum,
40 /// Last Time Project's Revision was Updated
41 #[serde(rename = "updated_at")]
42 pub updated_at: String,
43 #[serde(rename = "workspace_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
44 pub workspace_id: Option<Option<String>>,
45}
46
47impl MemberInvite {
48 pub fn new(created_at: String, id: String, invitee_email: String, owner_email: String, owner_id: String, status: StatusEnum, updated_at: String) -> MemberInvite {
49 MemberInvite {
50 created_at,
51 id,
52 invitee_email,
53 invitee_id: None,
54 owner_email,
55 owner_id,
56 project_id: None,
57 role: None,
58 status,
59 updated_at,
60 workspace_id: None,
61 }
62 }
63}
64/// The invite's status Keeps track of the invites status such as pending, accepted, declined, expired pending PENDING accepted ACCEPTED declined DECLINED expired EXPIRED cancelled CANCELLED removed REMOVED
65#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
66pub enum StatusEnum {
67 #[serde(rename = "pending")]
68 Pending,
69 #[serde(rename = "accepted")]
70 Accepted,
71 #[serde(rename = "declined")]
72 Declined,
73 #[serde(rename = "expired")]
74 Expired,
75 #[serde(rename = "cancelled")]
76 Cancelled,
77 #[serde(rename = "removed")]
78 Removed,
79}
80
81impl Default for StatusEnum {
82 fn default() -> StatusEnum {
83 Self::Pending
84 }
85}
86