clerk_rs/models/
o_auth_application_with_secret.rs

1/*
2 * Clerk Backend API
3 *
4 * The Clerk REST Backend API, meant to be accessed by backend servers. Please see https://clerk.com/docs for more information.
5 *
6 * The version of the OpenAPI document: v1
7 * Contact: support@clerk.com
8 * Generated by: https://openapi-generator.tech
9 */
10
11#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
12pub struct OAuthApplicationWithSecret {
13	#[serde(rename = "object")]
14	pub object: Object,
15	#[serde(rename = "id")]
16	pub id: String,
17	#[serde(rename = "instance_id")]
18	pub instance_id: String,
19	#[serde(rename = "name")]
20	pub name: String,
21	#[serde(rename = "client_id")]
22	pub client_id: String,
23	#[serde(rename = "public")]
24	pub public: bool,
25	#[serde(rename = "scopes")]
26	pub scopes: String,
27	#[serde(rename = "callback_url")]
28	pub callback_url: String,
29	#[serde(rename = "authorize_url")]
30	pub authorize_url: String,
31	#[serde(rename = "token_fetch_url")]
32	pub token_fetch_url: String,
33	#[serde(rename = "user_info_url")]
34	pub user_info_url: String,
35	/// Unix timestamp of creation.
36	#[serde(rename = "created_at")]
37	pub created_at: i64,
38	/// Unix timestamp of last update.
39	#[serde(rename = "updated_at")]
40	pub updated_at: i64,
41	/// Empty if public client.
42	#[serde(rename = "client_secret", skip_serializing_if = "Option::is_none")]
43	pub client_secret: Option<String>,
44}
45
46impl OAuthApplicationWithSecret {
47	pub fn new(
48		object: Object,
49		id: String,
50		instance_id: String,
51		name: String,
52		client_id: String,
53		public: bool,
54		scopes: String,
55		callback_url: String,
56		authorize_url: String,
57		token_fetch_url: String,
58		user_info_url: String,
59		created_at: i64,
60		updated_at: i64,
61	) -> OAuthApplicationWithSecret {
62		OAuthApplicationWithSecret {
63			object,
64			id,
65			instance_id,
66			name,
67			client_id,
68			public,
69			scopes,
70			callback_url,
71			authorize_url,
72			token_fetch_url,
73			user_info_url,
74			created_at,
75			updated_at,
76			client_secret: None,
77		}
78	}
79}
80
81///
82#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
83pub enum Object {
84	#[serde(rename = "oauth_application")]
85	OauthApplication,
86}
87
88impl Default for Object {
89	fn default() -> Object {
90		Self::OauthApplication
91	}
92}