user

package
v2.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 12, 2024 License: MIT Imports: 10 Imported by: 9

Documentation

Overview

Code generated by "gen"; DO NOT EDIT. This file is meant to be re-generated in place and/or deleted at any time.

Package user provides the Users API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Ban

func Ban(ctx context.Context, id string) (*clerk.User, error)

Ban marks the user as banned.

func Create

func Create(ctx context.Context, params *CreateParams) (*clerk.User, error)

Create creates a new user.

func CreateTOTP added in v2.0.9

func CreateTOTP(ctx context.Context, userID string) (*clerk.TOTP, error)

CreateTOTP creates a TOTP (Time-based One-Time Password) for the user.

func Delete

func Delete(ctx context.Context, id string) (*clerk.DeletedResource, error)

Delete deletes a user.

func DeleteExternalAccount added in v2.1.0

func DeleteExternalAccount(ctx context.Context, params *DeleteExternalAccountParams) (*clerk.DeletedResource, error)

DeleteExternalAccount deletes an external account by its ID.

func DeletePasskey added in v2.0.8

func DeletePasskey(ctx context.Context, userID, identificationID string) (*clerk.DeletedResource, error)

DeletePasskey deletes a passkey by its identification ID.

func DeleteProfileImage added in v2.0.6

func DeleteProfileImage(ctx context.Context, id string) (*clerk.User, error)

DeleteProfileImage deletes the user's profile image.

func DeleteWeb3Wallet added in v2.0.9

func DeleteWeb3Wallet(ctx context.Context, userID, identificationID string) (*clerk.DeletedResource, error)

DeleteWeb3Wallet deletes a web3 wallet by its identification ID.

func Get

func Get(ctx context.Context, id string) (*clerk.User, error)

Get retrieves details about the user.

func List

func List(ctx context.Context, params *ListParams) (*clerk.UserList, error)

List returns a list of users.

func ListOAuthAccessTokens

func ListOAuthAccessTokens(ctx context.Context, params *ListOAuthAccessTokensParams) (*clerk.OAuthAccessTokenList, error)

ListOAuthAccessTokens retrieves a list of the user's access tokens for a specific OAuth provider.

func ListOrganizationInvitations added in v2.1.0

func ListOrganizationInvitations(ctx context.Context, params *ListOrganizationInvitationsParams) (*clerk.OrganizationInvitationList, error)

ListOrganizationInvitations lists all the user's organization invitations.

func ListOrganizationMemberships

func ListOrganizationMemberships(ctx context.Context, id string, params *ListOrganizationMembershipsParams) (*clerk.OrganizationMembershipList, error)

ListOrganizationMemberships lists all the user's organization memberships.

func Lock

func Lock(ctx context.Context, id string) (*clerk.User, error)

Lock marks the user as locked.

func Unban

func Unban(ctx context.Context, id string) (*clerk.User, error)

Unban removes the ban for a user.

func Unlock

func Unlock(ctx context.Context, id string) (*clerk.User, error)

Unlock removes the lock for a user.

func Update

func Update(ctx context.Context, id string, params *UpdateParams) (*clerk.User, error)

Update updates a user.

func UpdateMetadata

func UpdateMetadata(ctx context.Context, id string, params *UpdateMetadataParams) (*clerk.User, error)

UpdateMetadata updates the user's metadata by merging the provided values with the existing ones.

func UpdateProfileImage added in v2.0.5

func UpdateProfileImage(ctx context.Context, id string, params *UpdateProfileImageParams) (*clerk.User, error)

UpdateProfileImage sets or replaces the user's profile image.

Types

type Client

type Client struct {
	Backend clerk.Backend
}

Client is used to invoke the Users API.

func NewClient

func NewClient(config *clerk.ClientConfig) *Client

func (*Client) Ban

func (c *Client) Ban(ctx context.Context, id string) (*clerk.User, error)

Ban marks the user as banned.

func (*Client) Count

func (c *Client) Count(ctx context.Context, params *ListParams) (*TotalCount, error)

Count returns the total count of users satisfying the parameters.

func (*Client) Create

func (c *Client) Create(ctx context.Context, params *CreateParams) (*clerk.User, error)

Create creates a new user.

func (*Client) CreateTOTP added in v2.0.9

func (c *Client) CreateTOTP(ctx context.Context, userID string) (*clerk.TOTP, error)

CreateTOTP creates a TOTP (Time-based One-Time Password) for the user.

func (*Client) Delete

func (c *Client) Delete(ctx context.Context, id string) (*clerk.DeletedResource, error)

Delete deletes a user.

func (*Client) DeleteBackupCode added in v2.0.9

func (c *Client) DeleteBackupCode(ctx context.Context, userID string) (*MultifactorAuthentication, error)

DeleteBackupCode deletes all the backup codes from a given user.

func (*Client) DeleteExternalAccount added in v2.1.0

func (c *Client) DeleteExternalAccount(ctx context.Context, params *DeleteExternalAccountParams) (*clerk.DeletedResource, error)

DeleteExternalAccount deletes an external account by its ID.

func (*Client) DeleteMFA

func (c *Client) DeleteMFA(ctx context.Context, params *DeleteMFAParams) (*MultifactorAuthentication, error)

DeleteMFA disables a user's multi-factor authentication methods.

func (*Client) DeletePasskey added in v2.0.8

func (c *Client) DeletePasskey(ctx context.Context, userID, identificationID string) (*clerk.DeletedResource, error)

DeletePasskey deletes a passkey by its identification ID.

func (*Client) DeleteProfileImage added in v2.0.6

func (c *Client) DeleteProfileImage(ctx context.Context, id string) (*clerk.User, error)

DeleteProfileImage deletes the user's profile image.

func (*Client) DeleteTOTP added in v2.0.9

func (c *Client) DeleteTOTP(ctx context.Context, userID string) (*MultifactorAuthentication, error)

DeleteTOTP deletes all the TOTPs from a given user.

func (*Client) DeleteWeb3Wallet added in v2.0.9

func (c *Client) DeleteWeb3Wallet(ctx context.Context, userID, identificationID string) (*clerk.DeletedResource, error)

DeleteWeb3Wallet deletes a web3 wallet by its identification ID.

func (*Client) Get

func (c *Client) Get(ctx context.Context, id string) (*clerk.User, error)

Get retrieves details about the user.

func (*Client) List

func (c *Client) List(ctx context.Context, params *ListParams) (*clerk.UserList, error)

List returns a list of users.

func (*Client) ListOAuthAccessTokens

func (c *Client) ListOAuthAccessTokens(ctx context.Context, params *ListOAuthAccessTokensParams) (*clerk.OAuthAccessTokenList, error)

ListOAuthAccessTokens retrieves a list of the user's access tokens for a specific OAuth provider.

func (*Client) ListOrganizationInvitations added in v2.1.0

func (c *Client) ListOrganizationInvitations(ctx context.Context, params *ListOrganizationInvitationsParams) (*clerk.OrganizationInvitationList, error)

ListOrganizationInvitations lists all the user's organization invitations.

func (*Client) ListOrganizationMemberships

func (c *Client) ListOrganizationMemberships(ctx context.Context, id string, params *ListOrganizationMembershipsParams) (*clerk.OrganizationMembershipList, error)

ListOrganizationMemberships lists all the user's organization memberships.

func (*Client) Lock

func (c *Client) Lock(ctx context.Context, id string) (*clerk.User, error)

Lock marks the user as locked.

func (*Client) Unban

func (c *Client) Unban(ctx context.Context, id string) (*clerk.User, error)

Unban removes the ban for a user.

func (*Client) Unlock

func (c *Client) Unlock(ctx context.Context, id string) (*clerk.User, error)

Unlock removes the lock for a user.

func (*Client) Update

func (c *Client) Update(ctx context.Context, id string, params *UpdateParams) (*clerk.User, error)

Update updates a user.

func (*Client) UpdateMetadata

func (c *Client) UpdateMetadata(ctx context.Context, id string, params *UpdateMetadataParams) (*clerk.User, error)

UpdateMetadata updates the user's metadata by merging the provided values with the existing ones.

func (*Client) UpdateProfileImage added in v2.0.5

func (c *Client) UpdateProfileImage(ctx context.Context, id string, params *UpdateProfileImageParams) (*clerk.User, error)

UpdateProfileImage sets or replaces the user's profile image.

type CreateParams

type CreateParams struct {
	clerk.APIParams
	EmailAddresses          *[]string        `json:"email_address,omitempty"`
	PhoneNumbers            *[]string        `json:"phone_number,omitempty"`
	Web3Wallets             *[]string        `json:"web3_wallet,omitempty"`
	Username                *string          `json:"username,omitempty"`
	Password                *string          `json:"password,omitempty"`
	FirstName               *string          `json:"first_name,omitempty"`
	LastName                *string          `json:"last_name,omitempty"`
	ExternalID              *string          `json:"external_id,omitempty"`
	UnsafeMetadata          *json.RawMessage `json:"unsafe_metadata,omitempty"`
	PublicMetadata          *json.RawMessage `json:"public_metadata,omitempty"`
	PrivateMetadata         *json.RawMessage `json:"private_metadata,omitempty"`
	PasswordDigest          *string          `json:"password_digest,omitempty"`
	PasswordHasher          *string          `json:"password_hasher,omitempty"`
	SkipPasswordRequirement *bool            `json:"skip_password_requirement,omitempty"`
	SkipPasswordChecks      *bool            `json:"skip_password_checks,omitempty"`
	TOTPSecret              *string          `json:"totp_secret,omitempty"`
	BackupCodes             *[]string        `json:"backup_codes,omitempty"`
	// Specified in RFC3339 format
	LegalAcceptedAt *string `json:"legal_accepted_at,omitempty"`
	SkipLegalChecks *bool   `json:"skip_legal_checks,omitempty"`
	// Specified in RFC3339 format
	CreatedAt *string `json:"created_at,omitempty"`
}

type DeleteExternalAccountParams added in v2.1.0

type DeleteExternalAccountParams struct {
	clerk.APIParams
	UserID string `json:"-"`
	ID     string `json:"-"`
}

type DeleteMFAParams

type DeleteMFAParams struct {
	clerk.APIParams
	ID string `json:"-"`
}

type ListOAuthAccessTokensParams

type ListOAuthAccessTokensParams struct {
	clerk.APIParams
	ID       string `json:"-"`
	Provider string `json:"-"`
}

type ListOrganizationInvitationsParams added in v2.1.0

type ListOrganizationInvitationsParams struct {
	clerk.APIParams
	clerk.ListParams
	UserID   string    `json:"-"`
	Statuses *[]string `json:"statuses,omitempty"`
}

func (*ListOrganizationInvitationsParams) ToQuery added in v2.1.0

func (params *ListOrganizationInvitationsParams) ToQuery() url.Values

ToQuery returns url.Values from the params.

type ListOrganizationMembershipsParams

type ListOrganizationMembershipsParams struct {
	clerk.APIParams
	clerk.ListParams
}

func (*ListOrganizationMembershipsParams) ToQuery

func (params *ListOrganizationMembershipsParams) ToQuery() url.Values

ToQuery returns url.Values from the params.

type ListParams

type ListParams struct {
	clerk.APIParams
	clerk.ListParams
	OrderBy           *string  `json:"order_by,omitempty"`
	Query             *string  `json:"query,omitempty"`
	EmailAddressQuery *string  `json:"email_address_query,omitempty"`
	PhoneNumberQuery  *string  `json:"phone_number_query,omitempty"`
	UsernameQuery     *string  `json:"username_query,omitempty"`
	NameQuery         *string  `json:"name_query,omitempty"`
	EmailAddresses    []string `json:"email_address,omitempty"`
	ExternalIDs       []string `json:"external_id,omitempty"`
	PhoneNumbers      []string `json:"phone_number,omitempty"`
	Web3Wallets       []string `json:"web3_wallet,omitempty"`
	Usernames         []string `json:"username,omitempty"`
	UserIDs           []string `json:"user_id,omitempty"`
	// OrganizationIDs filters users that have memberships to the given organizations. For each organization ID, the
	// + and - can be prepended to the ID, which denote whether the respective organization should be included or
	// excluded from the result set. Accepts up to 100 organization IDs.
	OrganizationIDs []string `json:"organization_id,omitempty"`
	// Deprecated: Prefer using the LastActiveAtAfter parameter, which has
	// identical functionality. This parameter is just being renamed.
	LastActiveAtSince  *int64 `json:"last_active_at_since,omitempty"`
	CreatedAtBefore    *int64 `json:"created_at_before,omitempty"`
	CreatedAtAfter     *int64 `json:"created_at_after,omitempty"`
	LastActiveAtBefore *int64 `json:"last_active_at_before,omitempty"`
	LastActiveAtAfter  *int64 `json:"last_active_at_after,omitempty"`
}

func (*ListParams) ToQuery

func (params *ListParams) ToQuery() url.Values

ToQuery returns url.Values from the params.

type MultifactorAuthentication

type MultifactorAuthentication struct {
	clerk.APIResource
	UserID string `json:"user_id"`
}

func DeleteBackupCode added in v2.0.9

func DeleteBackupCode(ctx context.Context, userID string) (*MultifactorAuthentication, error)

DeleteBackupCode deletes all the backup codes from a given user.

func DeleteMFA

DeleteMFA disables a user's multi-factor authentication methods.

func DeleteTOTP added in v2.0.9

func DeleteTOTP(ctx context.Context, userID string) (*MultifactorAuthentication, error)

DeleteTOTP deletes all the TOTPs from a given user.

type TotalCount

type TotalCount struct {
	clerk.APIResource
	Object     string `json:"object"`
	TotalCount int64  `json:"total_count"`
}

Response schema for GET /v1/users/count

func Count

func Count(ctx context.Context, params *ListParams) (*TotalCount, error)

Count returns the total count of users satisfying the parameters.

type UpdateMetadataParams

type UpdateMetadataParams struct {
	clerk.APIParams
	PublicMetadata  *json.RawMessage `json:"public_metadata,omitempty"`
	PrivateMetadata *json.RawMessage `json:"private_metadata,omitempty"`
	UnsafeMetadata  *json.RawMessage `json:"unsafe_metadata,omitempty"`
}

type UpdateParams

type UpdateParams struct {
	clerk.APIParams
	FirstName                        *string          `json:"first_name,omitempty"`
	LastName                         *string          `json:"last_name,omitempty"`
	PrimaryEmailAddressID            *string          `json:"primary_email_address_id,omitempty"`
	NotifyPrimaryEmailAddressChanged *bool            `json:"notify_primary_email_address_changed,omitempty"`
	PrimaryPhoneNumberID             *string          `json:"primary_phone_number_id,omitempty"`
	PrimaryWeb3WalletID              *string          `json:"primary_web3_wallet_id,omitempty"`
	Username                         *string          `json:"username,omitempty"`
	ProfileImageID                   *string          `json:"profile_image_id,omitempty"`
	ProfileImage                     *string          `json:"profile_image,omitempty"`
	Password                         *string          `json:"password,omitempty"`
	PasswordDigest                   *string          `json:"password_digest,omitempty"`
	PasswordHasher                   *string          `json:"password_hasher,omitempty"`
	SkipPasswordChecks               *bool            `json:"skip_password_checks,omitempty"`
	SignOutOfOtherSessions           *bool            `json:"sign_out_of_other_sessions,omitempty"`
	ExternalID                       *string          `json:"external_id,omitempty"`
	PublicMetadata                   *json.RawMessage `json:"public_metadata,omitempty"`
	PrivateMetadata                  *json.RawMessage `json:"private_metadata,omitempty"`
	UnsafeMetadata                   *json.RawMessage `json:"unsafe_metadata,omitempty"`
	TOTPSecret                       *string          `json:"totp_secret,omitempty"`
	BackupCodes                      *[]string        `json:"backup_codes,omitempty"`
	DeleteSelfEnabled                *bool            `json:"delete_self_enabled,omitempty"`
	CreateOrganizationEnabled        *bool            `json:"create_organization_enabled,omitempty"`
	CreateOrganizationsLimit         *int             `json:"create_organizations_limit,omitempty"`
	// Specified in RFC3339 format
	LegalAcceptedAt *string `json:"legal_accepted_at,omitempty"`
	SkipLegalChecks *bool   `json:"skip_legal_checks,omitempty"`
	// Specified in RFC3339 format
	CreatedAt *string `json:"created_at,omitempty"`
}

type UpdateProfileImageParams added in v2.0.5

type UpdateProfileImageParams struct {
	clerk.APIParams
	File multipart.File `json:"-"`
}

func (*UpdateProfileImageParams) ToMultipart added in v2.0.5

func (params *UpdateProfileImageParams) ToMultipart() ([]byte, string, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL