clerk_sdk_rust_community/models/create_actor_token_request.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.dev
8 * Generated by: https://openapi-generator.tech
9 */
10
11
12
13
14#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
15pub struct CreateActorTokenRequest {
16 /// The ID of the user that can use the newly created sign in token.
17 #[serde(rename = "user_id")]
18 pub user_id: String,
19 /// The actor payload. It needs to include a sub property which should contain the ID of the actor. This whole payload will be also included in the JWT session token.
20 #[serde(rename = "actor")]
21 pub actor: serde_json::Value,
22 /// Optional parameter to specify the life duration of the actor token in seconds. By default, the duration is 1 hour.
23 #[serde(rename = "expires_in_seconds", skip_serializing_if = "Option::is_none")]
24 pub expires_in_seconds: Option<i32>,
25 /// The maximum duration that the session which will be created by the generated actor token should last. By default, the duration of a session created via an actor token, lasts 30 minutes.
26 #[serde(rename = "session_max_duration_in_seconds", skip_serializing_if = "Option::is_none")]
27 pub session_max_duration_in_seconds: Option<i32>,
28}
29
30impl CreateActorTokenRequest {
31 pub fn new(user_id: String, actor: serde_json::Value) -> CreateActorTokenRequest {
32 CreateActorTokenRequest {
33 user_id,
34 actor,
35 expires_in_seconds: None,
36 session_max_duration_in_seconds: None,
37 }
38 }
39}
40
41