Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DASH-416: Include the latest activity on session response #333

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 25 additions & 12 deletions session.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,33 @@ package clerk

import "encoding/json"

type SessionActivity struct {
Object string `json:"object"`
ID string `json:"id"`
DeviceType *string `json:"device_type,omitempty"`
IsMobile bool `json:"is_mobile"`
BrowserName *string `json:"browser_name,omitempty"`
BrowserVersion *string `json:"browser_version,omitempty"`
IPAddress *string `json:"ip_address,omitempty"`
City *string `json:"city,omitempty"`
Country *string `json:"country,omitempty"`
}

type Session struct {
APIResource
Object string `json:"object"`
ID string `json:"id"`
ClientID string `json:"client_id"`
UserID string `json:"user_id"`
Status string `json:"status"`
LastActiveOrganizationID string `json:"last_active_organization_id,omitempty"`
Actor json.RawMessage `json:"actor,omitempty"`
LastActiveAt int64 `json:"last_active_at"`
ExpireAt int64 `json:"expire_at"`
AbandonAt int64 `json:"abandon_at"`
CreatedAt int64 `json:"created_at"`
UpdatedAt int64 `json:"updated_at"`
Object string `json:"object"`
ID string `json:"id"`
ClientID string `json:"client_id"`
UserID string `json:"user_id"`
Status string `json:"status"`
LastActiveOrganizationID string `json:"last_active_organization_id,omitempty"`
LatestActivity *SessionActivity `json:"latest_activity,omitempty"`
Actor json.RawMessage `json:"actor,omitempty"`
LastActiveAt int64 `json:"last_active_at"`
ExpireAt int64 `json:"expire_at"`
AbandonAt int64 `json:"abandon_at"`
CreatedAt int64 `json:"created_at"`
UpdatedAt int64 `json:"updated_at"`
}

type SessionList struct {
Expand Down
Loading