Skip to content
Merged
Show file tree
Hide file tree
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
18 changes: 12 additions & 6 deletions email_address.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,27 @@ import "encoding/json"

type EmailAddress struct {
APIResource
ID string `json:"id"`
Object string `json:"object"`
EmailAddress string `json:"email_address"`
Reserved bool `json:"reserved"`
Verification *Verification `json:"verification"`
LinkedTo []*LinkedIdentification `json:"linked_to"`
ID string `json:"id"`
Object string `json:"object"`
EmailAddress string `json:"email_address"`
Reserved bool `json:"reserved"`
Verification *Verification `json:"verification"`
LinkedTo []*LinkedIdentification `json:"linked_to"`
MatchesSSOConnection bool `json:"matches_sso_connection"`
CreatedAt int64 `json:"created_at"`
UpdatedAt int64 `json:"updated_at"`
}

type Verification struct {
Object string `json:"object"`
Status string `json:"status"`
Strategy string `json:"strategy"`
Channel *string `json:"channel,omitempty"`
Attempts *int64 `json:"attempts"`
ExpireAt *int64 `json:"expire_at"`
VerifiedAtClient string `json:"verified_at_client,omitempty"`
Nonce *string `json:"nonce,omitempty"`
Message *string `json:"message,omitempty"`
ExternalVerificationRedirectURL *string `json:"external_verification_redirect_url,omitempty"`
Error json.RawMessage `json:"error,omitempty"`
}
Expand Down
42 changes: 42 additions & 0 deletions enterprise_account.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package clerk

import "encoding/json"

type EnterpriseAccount struct {
ID string `json:"id"`
Object string `json:"object"`
Protocol string `json:"protocol"`
Provider string `json:"provider"`
Active bool `json:"active"`
EmailAddress string `json:"email_address"`
FirstName *string `json:"first_name"`
LastName *string `json:"last_name"`
ProviderUserID *string `json:"provider_user_id"`
LastAuthenticatedAt *int64 `json:"last_authenticated_at"`
PublicMetadata json.RawMessage `json:"public_metadata" logger:"omit"`
Verification *Verification `json:"verification"`
EnterpriseConnection *EnterpriseAccountConnection `json:"enterprise_connection"`
EnterpriseConnectionID string `json:"enterprise_connection_id"`
}

type EnterpriseAccountConnection struct {
// ID belongs to the underlying connection, either SAML Connection or the OAuth config
ID string `json:"id"`
EnterpriseConnectionID string `json:"enterprise_connection_id"`
Protocol string `json:"protocol"`
Provider string `json:"provider"`

// Name is the name of this enterprise connection that we will display directly to end-users
Name string `json:"name"`
LogoPublicURL *string `json:"logo_public_url"`
Domains []string `json:"domains,omitempty"`
Active bool `json:"active"`
SyncUserAttributes bool `json:"sync_user_attributes"`
DisableAdditionalIdentifications bool `json:"disable_additional_identifications"`
CreatedAt int64 `json:"created_at"`
UpdatedAt int64 `json:"updated_at"`

// SAML Connection specific fields
AllowSubdomains bool `json:"allow_subdomains"`
AllowIDPInitiated bool `json:"allow_idp_initiated"`
}
1 change: 1 addition & 0 deletions organization_membership.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ type OrganizationMembershipPublicUserData struct {
ImageURL *string `json:"image_url"`
HasImage bool `json:"has_image"`
Identifier string `json:"identifier"`
Username *string `json:"username"`
}
2 changes: 2 additions & 0 deletions phone_number.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ type PhoneNumber struct {
Verification *Verification `json:"verification"`
LinkedTo []*LinkedIdentification `json:"linked_to"`
BackupCodes []string `json:"backup_codes"`
CreatedAt int64 `json:"created_at"`
UpdatedAt int64 `json:"updated_at"`
}
120 changes: 73 additions & 47 deletions user.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,43 +4,47 @@ import "encoding/json"

type User struct {
APIResource
Object string `json:"object"`
ID string `json:"id"`
Username *string `json:"username"`
FirstName *string `json:"first_name"`
LastName *string `json:"last_name"`
ImageURL *string `json:"image_url,omitempty"`
HasImage bool `json:"has_image"`
PrimaryEmailAddressID *string `json:"primary_email_address_id"`
PrimaryPhoneNumberID *string `json:"primary_phone_number_id"`
PrimaryWeb3WalletID *string `json:"primary_web3_wallet_id"`
PasswordEnabled bool `json:"password_enabled"`
TwoFactorEnabled bool `json:"two_factor_enabled"`
TOTPEnabled bool `json:"totp_enabled"`
BackupCodeEnabled bool `json:"backup_code_enabled"`
EmailAddresses []*EmailAddress `json:"email_addresses"`
PhoneNumbers []*PhoneNumber `json:"phone_numbers"`
Web3Wallets []*Web3Wallet `json:"web3_wallets"`
Passkeys []*Passkey `json:"passkeys"`
ExternalAccounts []*ExternalAccount `json:"external_accounts"`
SAMLAccounts []*SAMLAccount `json:"saml_accounts"`
PasswordLastUpdatedAt *int64 `json:"password_last_updated_at,omitempty"`
PublicMetadata json.RawMessage `json:"public_metadata"`
PrivateMetadata json.RawMessage `json:"private_metadata,omitempty"`
UnsafeMetadata json.RawMessage `json:"unsafe_metadata,omitempty"`
ExternalID *string `json:"external_id"`
LastSignInAt *int64 `json:"last_sign_in_at"`
Banned bool `json:"banned"`
Locked bool `json:"locked"`
LockoutExpiresInSeconds *int64 `json:"lockout_expires_in_seconds"`
VerificationAttemptsRemaining *int64 `json:"verification_attempts_remaining"`
DeleteSelfEnabled bool `json:"delete_self_enabled"`
CreateOrganizationEnabled bool `json:"create_organization_enabled"`
CreateOrganizationsLimit *int `json:"create_organizations_limit,omitempty"`
LastActiveAt *int64 `json:"last_active_at"`
LegalAcceptedAt *int64 `json:"legal_accepted_at"`
CreatedAt int64 `json:"created_at"`
UpdatedAt int64 `json:"updated_at"`
Object string `json:"object"`
ID string `json:"id"`
Username *string `json:"username"`
FirstName *string `json:"first_name"`
LastName *string `json:"last_name"`
ImageURL *string `json:"image_url,omitempty"`
HasImage bool `json:"has_image"`
PrimaryEmailAddressID *string `json:"primary_email_address_id"`
PrimaryPhoneNumberID *string `json:"primary_phone_number_id"`
PrimaryWeb3WalletID *string `json:"primary_web3_wallet_id"`
PasswordEnabled bool `json:"password_enabled"`
TwoFactorEnabled bool `json:"two_factor_enabled"`
TOTPEnabled bool `json:"totp_enabled"`
BackupCodeEnabled bool `json:"backup_code_enabled"`
EmailAddresses []*EmailAddress `json:"email_addresses"`
PhoneNumbers []*PhoneNumber `json:"phone_numbers"`
Web3Wallets []*Web3Wallet `json:"web3_wallets"`
Passkeys []*Passkey `json:"passkeys"`
OrganizationMemberships []*OrganizationMembership `json:"organization_memberships,omitempty"`
ExternalAccounts []*ExternalAccount `json:"external_accounts"`
SAMLAccounts []*SAMLAccount `json:"saml_accounts"`
EnterpriseAccounts []*EnterpriseAccount `json:"enterprise_accounts"`
PasswordLastUpdatedAt *int64 `json:"password_last_updated_at,omitempty"`
PublicMetadata json.RawMessage `json:"public_metadata"`
PrivateMetadata json.RawMessage `json:"private_metadata,omitempty"`
UnsafeMetadata json.RawMessage `json:"unsafe_metadata,omitempty"`
ExternalID *string `json:"external_id"`
LastSignInAt *int64 `json:"last_sign_in_at"`
Banned bool `json:"banned"`
Locked bool `json:"locked"`
LockoutExpiresInSeconds *int64 `json:"lockout_expires_in_seconds"`
VerificationAttemptsRemaining *int64 `json:"verification_attempts_remaining"`
CreatedAt int64 `json:"created_at"`
UpdatedAt int64 `json:"updated_at"`
DeleteSelfEnabled bool `json:"delete_self_enabled"`
CreateOrganizationEnabled bool `json:"create_organization_enabled"`
CreateOrganizationsLimit *int `json:"create_organizations_limit,omitempty"`
LastActiveAt *int64 `json:"last_active_at"`
MFAEnabledAt *int64 `json:"mfa_enabled_at"`
MFADisabledAt *int64 `json:"mfa_disabled_at"`
LegalAcceptedAt *int64 `json:"legal_accepted_at"`
}

type ExternalAccount struct {
Expand All @@ -56,8 +60,11 @@ type ExternalAccount struct {
AvatarURL string `json:"avatar_url"`
ImageURL *string `json:"image_url,omitempty"`
Username *string `json:"username"`
PhoneNumber *string `json:"phone_number"`
PublicMetadata json.RawMessage `json:"public_metadata"`
Label *string `json:"label"`
CreatedAt int64 `json:"created_at"`
UpdatedAt int64 `json:"updated_at"`
Verification *Verification `json:"verification"`
}

Expand All @@ -66,23 +73,42 @@ type Web3Wallet struct {
ID string `json:"id"`
Web3Wallet string `json:"web3_wallet"`
Verification *Verification `json:"verification"`
CreatedAt int64 `json:"created_at"`
UpdatedAt int64 `json:"updated_at"`
}

type SAMLAccount struct {
Object string `json:"object"`
ID string `json:"id"`
Provider string `json:"provider"`
Active bool `json:"active"`
EmailAddress string `json:"email_address"`
FirstName *string `json:"first_name"`
LastName *string `json:"last_name"`
ProviderUserID *string `json:"provider_user_id"`
PublicMetadata json.RawMessage `json:"public_metadata"`
Verification *Verification `json:"verification"`
Object string `json:"object"`
ID string `json:"id"`
Provider string `json:"provider"`
Active bool `json:"active"`
EmailAddress string `json:"email_address"`
FirstName *string `json:"first_name"`
LastName *string `json:"last_name"`
ProviderUserID *string `json:"provider_user_id"`
LastAuthenticatedAt *int64 `json:"last_authenticated_at"`
PublicMetadata json.RawMessage `json:"public_metadata"`
SAMLConnection *SAMLAccountConnection `json:"saml_connection"`
EnterpriseConnectionID string `json:"enterprise_connection_id"`
Verification *Verification `json:"verification"`
}

type UserList struct {
APIResource
Users []*User `json:"data"`
TotalCount int64 `json:"total_count"`
}

type SAMLAccountConnection struct {
ID string `json:"id"`
Name string `json:"name"`
Domains []string `json:"domains"`
Active bool `json:"active"`
Provider string `json:"provider"`
SyncUserAttributes bool `json:"sync_user_attributes"`
AllowSubdomains bool `json:"allow_subdomains"`
AllowIDPInitiated bool `json:"allow_idp_initiated"`
DisableAdditionalIdentifications bool `json:"disable_additional_identifications"`
CreatedAt int64 `json:"created_at"`
UpdatedAt int64 `json:"updated_at"`
}
Loading