Skip to main content

ory_client/models/
project_metadata.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.43
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 ProjectMetadata {
16    /// The Project's Creation Date
17    #[serde(rename = "created_at")]
18    pub created_at: String,
19    /// The environment of the project. prod Production stage Staging dev Development
20    #[serde(rename = "environment")]
21    pub environment: EnvironmentEnum,
22    /// The project's data home region eu-central EUCentral asia-northeast AsiaNorthEast us-east USEast us-west USWest eu EU asia Asia us US global Global
23    #[serde(rename = "home_region")]
24    pub home_region: HomeRegionEnum,
25    /// The FQDN hostnames this project listens on
26    #[serde(rename = "hosts")]
27    pub hosts: Vec<String>,
28    /// The project's ID.
29    #[serde(rename = "id")]
30    pub id: String,
31    /// The project's name if set
32    #[serde(rename = "name")]
33    pub name: String,
34    /// The project's slug
35    #[serde(rename = "slug")]
36    pub slug: String,
37    /// The state of the project. running Running halted Halted deleted Deleted
38    #[serde(rename = "state")]
39    pub state: StateEnum,
40    #[serde(rename = "subscription_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
41    pub subscription_id: Option<Option<String>>,
42    #[serde(rename = "subscription_plan", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
43    pub subscription_plan: Option<Option<String>>,
44    /// Last Time Project was Updated
45    #[serde(rename = "updated_at")]
46    pub updated_at: String,
47    #[serde(rename = "workspace", skip_serializing_if = "Option::is_none")]
48    pub workspace: Option<Box<models::Workspace>>,
49    #[serde(rename = "workspace_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
50    pub workspace_id: Option<Option<String>>,
51}
52
53impl ProjectMetadata {
54    pub fn new(created_at: String, environment: EnvironmentEnum, home_region: HomeRegionEnum, hosts: Vec<String>, id: String, name: String, slug: String, state: StateEnum, updated_at: String) -> ProjectMetadata {
55        ProjectMetadata {
56            created_at,
57            environment,
58            home_region,
59            hosts,
60            id,
61            name,
62            slug,
63            state,
64            subscription_id: None,
65            subscription_plan: None,
66            updated_at,
67            workspace: None,
68            workspace_id: None,
69        }
70    }
71}
72/// The environment of the project. prod Production stage Staging dev Development
73#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
74pub enum EnvironmentEnum {
75    #[serde(rename = "prod")]
76    Prod,
77    #[serde(rename = "stage")]
78    Stage,
79    #[serde(rename = "dev")]
80    Dev,
81}
82
83impl Default for EnvironmentEnum {
84    fn default() -> EnvironmentEnum {
85        Self::Prod
86    }
87}
88/// The project's data home region eu-central EUCentral asia-northeast AsiaNorthEast us-east USEast us-west USWest eu EU asia Asia us US global Global
89#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
90pub enum HomeRegionEnum {
91    #[serde(rename = "eu-central")]
92    EuCentral,
93    #[serde(rename = "asia-northeast")]
94    AsiaNortheast,
95    #[serde(rename = "us-east")]
96    UsEast,
97    #[serde(rename = "us-west")]
98    UsWest,
99    #[serde(rename = "eu")]
100    Eu,
101    #[serde(rename = "asia")]
102    Asia,
103    #[serde(rename = "us")]
104    Us,
105    #[serde(rename = "global")]
106    Global,
107}
108
109impl Default for HomeRegionEnum {
110    fn default() -> HomeRegionEnum {
111        Self::EuCentral
112    }
113}
114/// The state of the project. running Running halted Halted deleted Deleted
115#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
116pub enum StateEnum {
117    #[serde(rename = "running")]
118    Running,
119    #[serde(rename = "halted")]
120    Halted,
121    #[serde(rename = "deleted")]
122    Deleted,
123}
124
125impl Default for StateEnum {
126    fn default() -> StateEnum {
127        Self::Running
128    }
129}
130