clerk_fapi_rs/models/token.rs
1/*
2 * Clerk Frontend API
3 *
4 * The Clerk REST Frontend API, meant to be accessed from a browser or native environment. This is a Form Based API and all the data must be sent and formatted according to the `application/x-www-form-urlencoded` content type. ### Versions When the API changes in a way that isn't compatible with older versions, a new version is released. Each version is identified by its release date, e.g. `2021-02-05`. For more information, please see [Clerk API Versions](https://clerk.com/docs/backend-requests/versioning/overview). ### Using the Try It Console The `Try It` feature of the docs only works for **Development Instances** when using the `DevBrowser` security scheme. To use it, first generate a dev instance token from the `/v1/dev_browser` endpoint. 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
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct Token {
16 /// String representing the object's type. Objects of the same type share the same value.
17 #[serde(rename = "object")]
18 pub object: Object,
19 /// String representing the encoded jwt value.
20 #[serde(rename = "jwt")]
21 pub jwt: String,
22}
23
24impl Token {
25 pub fn new(object: Object, jwt: String) -> Token {
26 Token { object, jwt }
27 }
28}
29/// String representing the object's type. Objects of the same type share the same value.
30#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
31pub enum Object {
32 #[serde(rename = "token")]
33 Token,
34}
35
36impl Default for Object {
37 fn default() -> Object {
38 Self::Token
39 }
40}