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.97
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 /// Set in the response to accepting an invite when the workspace allows access only to members of its organization and the invitee is not one. The invite is accepted, but the invitee cannot access the workspace or project until they sign in through this organization's single sign-on.
36 #[serde(rename = "required_organization_id", skip_serializing_if = "Option::is_none")]
37 pub required_organization_id: Option<String>,
38 #[serde(rename = "role", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
39 pub role: Option<Option<String>>,
40 /// 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
41 #[serde(rename = "status")]
42 pub status: StatusEnum,
43 /// Last Time Project's Revision was Updated
44 #[serde(rename = "updated_at")]
45 pub updated_at: String,
46 #[serde(rename = "workspace_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
47 pub workspace_id: Option<Option<String>>,
48}
49
50impl MemberInvite {
51 pub fn new(created_at: String, id: String, invitee_email: String, owner_email: String, owner_id: String, status: StatusEnum, updated_at: String) -> MemberInvite {
52 MemberInvite {
53 created_at,
54 id,
55 invitee_email,
56 invitee_id: None,
57 owner_email,
58 owner_id,
59 project_id: None,
60 required_organization_id: None,
61 role: None,
62 status,
63 updated_at,
64 workspace_id: None,
65 }
66 }
67}
68/// 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
69#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
70pub enum StatusEnum {
71 #[serde(rename = "pending")]
72 Pending,
73 #[serde(rename = "accepted")]
74 Accepted,
75 #[serde(rename = "declined")]
76 Declined,
77 #[serde(rename = "expired")]
78 Expired,
79 #[serde(rename = "cancelled")]
80 Cancelled,
81 #[serde(rename = "removed")]
82 Removed,
83}
84
85impl Default for StatusEnum {
86 fn default() -> StatusEnum {
87 Self::Pending
88 }
89}
90