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