user

package
v2.0.4 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: MIT Imports: 7 Imported by: 0

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 Delete

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

Delete deletes a user.

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 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.

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) Delete

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

Delete deletes a user.

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) 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) 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.

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
	CreatedAt *string `json:"created_at,omitempty"`
}

type DeleteMFAParams

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

type ListOAuthAccessTokensParams

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

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"`
	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"`
	LastActiveAtSince *int64   `json:"last_active_at_since,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 DeleteMFA

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

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"`
	// Specified in RFC3339 format
	CreatedAt *string `json:"created_at,omitempty"`
}

Jump to

Keyboard shortcuts

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