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.22.4
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 organizations of the project.  Organizations are used to group users and enforce certain restrictions like usage of SSO.
33    #[serde(rename = "organizations")]
34    pub organizations: Vec<models::BasicOrganization>,
35    /// The configuration revision ID.
36    #[serde(rename = "revision_id")]
37    pub revision_id: String,
38    #[serde(rename = "services")]
39    pub services: Box<models::ProjectServices>,
40    /// The project's slug
41    #[serde(rename = "slug")]
42    pub slug: String,
43    /// The state of the project. running Running halted Halted deleted Deleted
44    #[serde(rename = "state")]
45    pub state: StateEnum,
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 Project {
51    pub fn new(environment: EnvironmentEnum, home_region: HomeRegionEnum, id: String, name: String, organizations: Vec<models::BasicOrganization>, revision_id: String, services: models::ProjectServices, slug: String, state: StateEnum) -> Project {
52        Project {
53            cors_admin: None,
54            cors_public: None,
55            environment,
56            home_region,
57            id,
58            name,
59            organizations,
60            revision_id,
61            services: Box::new(services),
62            slug,
63            state,
64            workspace_id: None,
65        }
66    }
67}
68/// The environment of the project. prod Production stage Staging dev Development
69#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
70pub enum EnvironmentEnum {
71    #[serde(rename = "prod")]
72    Prod,
73    #[serde(rename = "stage")]
74    Stage,
75    #[serde(rename = "dev")]
76    Dev,
77}
78
79impl Default for EnvironmentEnum {
80    fn default() -> EnvironmentEnum {
81        Self::Prod
82    }
83}
84/// 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
85#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
86pub enum HomeRegionEnum {
87    #[serde(rename = "eu-central")]
88    EuCentral,
89    #[serde(rename = "asia-northeast")]
90    AsiaNortheast,
91    #[serde(rename = "us-east")]
92    UsEast,
93    #[serde(rename = "us-west")]
94    UsWest,
95    #[serde(rename = "us")]
96    Us,
97    #[serde(rename = "global")]
98    Global,
99}
100
101impl Default for HomeRegionEnum {
102    fn default() -> HomeRegionEnum {
103        Self::EuCentral
104    }
105}
106/// The state of the project. running Running halted Halted deleted Deleted
107#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
108pub enum StateEnum {
109    #[serde(rename = "running")]
110    Running,
111    #[serde(rename = "halted")]
112    Halted,
113    #[serde(rename = "deleted")]
114    Deleted,
115}
116
117impl Default for StateEnum {
118    fn default() -> StateEnum {
119        Self::Running
120    }
121}
122