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.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 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 #[serde(rename = "hosts")]
26 pub hosts: Vec<String>,
27 /// The project's ID.
28 #[serde(rename = "id")]
29 pub id: String,
30 /// The project's name if set
31 #[serde(rename = "name")]
32 pub name: 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", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
49 pub workspace_id: Option<Option<String>>,
50}
51
52impl ProjectMetadata {
53 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 {
54 ProjectMetadata {
55 created_at,
56 environment,
57 home_region,
58 hosts,
59 id,
60 name,
61 slug,
62 state,
63 subscription_id: None,
64 subscription_plan: None,
65 updated_at,
66 workspace: None,
67 workspace_id: None,
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 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 = "us")]
99 Us,
100 #[serde(rename = "global")]
101 Global,
102}
103
104impl Default for HomeRegionEnum {
105 fn default() -> HomeRegionEnum {
106 Self::EuCentral
107 }
108}
109/// The state of the project. running Running halted Halted deleted Deleted
110#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
111pub enum StateEnum {
112 #[serde(rename = "running")]
113 Running,
114 #[serde(rename = "halted")]
115 Halted,
116 #[serde(rename = "deleted")]
117 Deleted,
118}
119
120impl Default for StateEnum {
121 fn default() -> StateEnum {
122 Self::Running
123 }
124}
125