ory_client/models/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.17.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 Project {
16 #[serde(rename = "cors_admin", skip_serializing_if = "Option::is_none")]
17 pub cors_admin: Option<Box<models::ProjectCors>>,
18 #[serde(rename = "cors_public", skip_serializing_if = "Option::is_none")]
19 pub cors_public: Option<Box<models::ProjectCors>>,
20 /// The environment of the project. prod Production stage Staging dev Development
21 #[serde(rename = "environment")]
22 pub environment: EnvironmentEnum,
23 /// The project home region. This is used to set where the project data is stored and where the project's endpoints are located. eu-central EUCentral asia-northeast AsiaNorthEast us-east USEast us-west USWest us US global Global
24 #[serde(rename = "home_region")]
25 pub home_region: HomeRegionEnum,
26 /// The project's ID.
27 #[serde(rename = "id")]
28 pub id: String,
29 /// The name of the project.
30 #[serde(rename = "name")]
31 pub name: String,
32 /// The configuration revision ID.
33 #[serde(rename = "revision_id")]
34 pub revision_id: String,
35 #[serde(rename = "services")]
36 pub services: Box<models::ProjectServices>,
37 /// The project's slug
38 #[serde(rename = "slug")]
39 pub slug: String,
40 /// The state of the project. running Running halted Halted deleted Deleted
41 #[serde(rename = "state")]
42 pub state: StateEnum,
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 Project {
48 pub fn new(environment: EnvironmentEnum, home_region: HomeRegionEnum, id: String, name: String, revision_id: String, services: models::ProjectServices, slug: String, state: StateEnum) -> Project {
49 Project {
50 cors_admin: None,
51 cors_public: None,
52 environment,
53 home_region,
54 id,
55 name,
56 revision_id,
57 services: Box::new(services),
58 slug,
59 state,
60 workspace_id: None,
61 }
62 }
63}
64/// The environment of the project. prod Production stage Staging dev Development
65#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
66pub enum EnvironmentEnum {
67 #[serde(rename = "prod")]
68 Prod,
69 #[serde(rename = "stage")]
70 Stage,
71 #[serde(rename = "dev")]
72 Dev,
73}
74
75impl Default for EnvironmentEnum {
76 fn default() -> EnvironmentEnum {
77 Self::Prod
78 }
79}
80/// The project home region. This is used to set where the project data is stored and where the project's endpoints are located. eu-central EUCentral asia-northeast AsiaNorthEast us-east USEast us-west USWest us US global Global
81#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
82pub enum HomeRegionEnum {
83 #[serde(rename = "eu-central")]
84 EuCentral,
85 #[serde(rename = "asia-northeast")]
86 AsiaNortheast,
87 #[serde(rename = "us-east")]
88 UsEast,
89 #[serde(rename = "us-west")]
90 UsWest,
91 #[serde(rename = "us")]
92 Us,
93 #[serde(rename = "global")]
94 Global,
95}
96
97impl Default for HomeRegionEnum {
98 fn default() -> HomeRegionEnum {
99 Self::EuCentral
100 }
101}
102/// The state of the project. running Running halted Halted deleted Deleted
103#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
104pub enum StateEnum {
105 #[serde(rename = "running")]
106 Running,
107 #[serde(rename = "halted")]
108 Halted,
109 #[serde(rename = "deleted")]
110 Deleted,
111}
112
113impl Default for StateEnum {
114 fn default() -> StateEnum {
115 Self::Running
116 }
117}
118