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.36
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 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 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 = "us")]
100 Us,
101 #[serde(rename = "global")]
102 Global,
103}
104
105impl Default for HomeRegionEnum {
106 fn default() -> HomeRegionEnum {
107 Self::EuCentral
108 }
109}
110/// The state of the project. running Running halted Halted deleted Deleted
111#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
112pub enum StateEnum {
113 #[serde(rename = "running")]
114 Running,
115 #[serde(rename = "halted")]
116 Halted,
117 #[serde(rename = "deleted")]
118 Deleted,
119}
120
121impl Default for StateEnum {
122 fn default() -> StateEnum {
123 Self::Running
124 }
125}
126