remove inline sum types

This commit is contained in:
timurgordon
2025-01-23 00:52:19 +00:00
parent 12db34ddb0
commit 885c4d9b32
2 changed files with 2 additions and 4 deletions

View File

@@ -11,7 +11,7 @@ import json
@[params]
pub struct AccessTokenOptions {
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
identity string // Identity of the user
metadata string // Custom metadata to be passed to participants
@@ -19,8 +19,6 @@ pub struct AccessTokenOptions {
// Constructor for 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{
api_key: client.api_key
api_secret: client.api_secret

View File

@@ -39,7 +39,7 @@ pub struct AccessToken {
api_secret string
grants ClaimGrants
identity string
ttl int | string
ttl int
}
// Method to add a video grant to the token