Avnology ID
SDKsGo SDKType Reference

Type Reference

Go struct definitions for User, Session, Organization, TokenSet, and all SDK types.

Type Reference

All types are defined in the github.com/avnology/sdk-go package.

User

type User struct {
    ID              string            `json:"id"`
    Email           string            `json:"email"`
    EmailVerified   bool              `json:"email_verified"`
    Phone           string            `json:"phone,omitempty"`
    PhoneVerified   bool              `json:"phone_verified"`
    Name            *UserName         `json:"name,omitempty"`
    AvatarURL       string            `json:"avatar_url,omitempty"`
    Status          string            `json:"status"` // "active", "disabled", "pending_deletion"
    OrganizationID  string            `json:"organization_id,omitempty"`
    Locale          string            `json:"locale,omitempty"`
    Timezone        string            `json:"timezone,omitempty"`
    MfaEnabled      bool              `json:"mfa_enabled"`
    MfaMethods      []string          `json:"mfa_methods"`
    Metadata        UserMetadata      `json:"metadata"`
    CreatedAt       time.Time         `json:"created_at"`
    UpdatedAt       time.Time         `json:"updated_at"`
    LastLoginAt     *time.Time        `json:"last_login_at,omitempty"`
    VerifiedAt      *time.Time        `json:"verified_at,omitempty"`
}

type UserName struct {
    First string `json:"first"`
    Last  string `json:"last"`
}

type UserTraits struct {
    Name      *UserName `json:"name,omitempty"`
    Phone     string    `json:"phone,omitempty"`
    Locale    string    `json:"locale,omitempty"`
    Timezone  string    `json:"timezone,omitempty"`
    AvatarURL string    `json:"avatar_url,omitempty"`
}

type UserMetadata struct {
    Public map[string]any `json:"public"`
    Admin  map[string]any `json:"admin"`
}

Session

type Session struct {
    ID                          string       `json:"id"`
    Active                      bool         `json:"active"`
    ExpiresAt                   time.Time    `json:"expires_at"`
    AuthenticatedAt             time.Time    `json:"authenticated_at"`
    IssuedAt                    time.Time    `json:"issued_at"`
    AuthenticatorAssuranceLevel string       `json:"authenticator_assurance_level"` // "aal1", "aal2"
    Identity                    Identity     `json:"identity"`
    Devices                     []DeviceInfo `json:"devices"`
    AuthenticationMethods       []AuthMethod `json:"authentication_methods"`
}

type Identity struct {
    ID             string         `json:"id"`
    Email          string         `json:"email"`
    EmailVerified  bool           `json:"email_verified"`
    Phone          string         `json:"phone,omitempty"`
    Name           *UserName      `json:"name,omitempty"`
    OrganizationID string         `json:"organization_id,omitempty"`
    Metadata       PublicMetadata `json:"metadata"`
    CreatedAt      time.Time      `json:"created_at"`
    UpdatedAt      time.Time      `json:"updated_at"`
}

type DeviceInfo struct {
    ID           string    `json:"id"`
    UserAgent    string    `json:"user_agent"`
    IPAddress    string    `json:"ip_address"`
    Location     string    `json:"location,omitempty"`
    LastActiveAt time.Time `json:"last_active_at"`
}

type AuthMethod struct {
    Method      string    `json:"method"` // "password", "webauthn", "totp", "oidc", "code"
    AAL         string    `json:"aal"`
    CompletedAt time.Time `json:"completed_at"`
    Provider    string    `json:"provider,omitempty"`
}

Organization

type Organization struct {
    ID               string              `json:"id"`
    Name             string              `json:"name"`
    Slug             string              `json:"slug"`
    Domains          []string            `json:"domains"`
    RegistrationMode string              `json:"registration_mode"`
    MemberCount      int                 `json:"member_count"`
    SSOEnabled       bool                `json:"sso_enabled"`
    SCIMEnabled      bool                `json:"scim_enabled"`
    Metadata         map[string]any      `json:"metadata"`
    CreatedAt        time.Time           `json:"created_at"`
    UpdatedAt        time.Time           `json:"updated_at"`
}

type Member struct {
    UserID       string    `json:"user_id"`
    Email        string    `json:"email"`
    Name         *UserName `json:"name,omitempty"`
    Role         string    `json:"role"`
    JoinedAt     time.Time `json:"joined_at"`
    LastActiveAt *time.Time `json:"last_active_at,omitempty"`
}

TokenSet

type TokenSet struct {
    AccessToken  string    `json:"access_token"`
    RefreshToken string    `json:"refresh_token,omitempty"`
    IDToken      string    `json:"id_token,omitempty"`
    TokenType    string    `json:"token_type"`
    ExpiresIn    int       `json:"expires_in"`
    ExpiresAt    time.Time `json:"expires_at"`
    Scope        string    `json:"scope"`
}

Paginated lists

type UserList struct {
    Users         []User `json:"users"`
    NextPageToken string `json:"next_page_token,omitempty"`
    TotalSize     int    `json:"total_size"`
}

type SessionList struct {
    Sessions      []Session `json:"sessions"`
    NextPageToken string    `json:"next_page_token,omitempty"`
    TotalSize     int       `json:"total_size"`
}

type OrganizationList struct {
    Organizations []Organization `json:"organizations"`
    NextPageToken string         `json:"next_page_token,omitempty"`
    TotalSize     int            `json:"total_size"`
}

See also

On this page