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