remove inline sum types
This commit is contained in:
@@ -11,7 +11,7 @@ import json
|
|||||||
@[params]
|
@[params]
|
||||||
pub struct AccessTokenOptions {
|
pub struct AccessTokenOptions {
|
||||||
pub mut:
|
pub mut:
|
||||||
ttl int | string // TTL in seconds or a time span (e.g., '2d', '5h')
|
ttl int = 21600// TTL in seconds
|
||||||
name string // Display name for the participant
|
name string // Display name for the participant
|
||||||
identity string // Identity of the user
|
identity string // Identity of the user
|
||||||
metadata string // Custom metadata to be passed to participants
|
metadata string // Custom metadata to be passed to participants
|
||||||
@@ -19,8 +19,6 @@ pub struct AccessTokenOptions {
|
|||||||
|
|
||||||
// Constructor for AccessToken
|
// Constructor for AccessToken
|
||||||
pub fn (client Client) new_access_token(options AccessTokenOptions) !AccessToken {
|
pub fn (client Client) new_access_token(options AccessTokenOptions) !AccessToken {
|
||||||
ttl := if options.ttl is int { options.ttl } else { 21600 } // Default TTL of 6 hours (21600 seconds)
|
|
||||||
|
|
||||||
return AccessToken{
|
return AccessToken{
|
||||||
api_key: client.api_key
|
api_key: client.api_key
|
||||||
api_secret: client.api_secret
|
api_secret: client.api_secret
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ pub struct AccessToken {
|
|||||||
api_secret string
|
api_secret string
|
||||||
grants ClaimGrants
|
grants ClaimGrants
|
||||||
identity string
|
identity string
|
||||||
ttl int | string
|
ttl int
|
||||||
}
|
}
|
||||||
|
|
||||||
// Method to add a video grant to the token
|
// Method to add a video grant to the token
|
||||||
|
|||||||
Reference in New Issue
Block a user