organization

package
v3.0.0-...-369eb33 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: MIT Imports: 9 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 organization provides the Organizations API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

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

Create creates a new organization.

func Delete

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

Delete deletes an organization.

func DeleteLogo(ctx context.Context, id string) (*clerk.Organization, error)

DeleteLogo removes the organization's logo.

func Get

func Get(ctx context.Context, idOrSlug string) (*clerk.Organization, error)

Get retrieves details for an organization. The organization can be fetched by either the ID or its slug.

func GetWithParams

func GetWithParams(ctx context.Context, idOrSlug string, params *GetParams) (*clerk.Organization, error)

GetWithParams retrieves details for an organization. The organization can be fetched by either the ID or its slug.

func List

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

List returns a list of organizations.

func Update

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

Update updates an organization.

func UpdateLogo(ctx context.Context, id string, params *UpdateLogoParams) (*clerk.Organization, error)

UpdateLogo sets or replaces the organization's logo.

func UpdateMetadata

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

UpdateMetadata updates the organization'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 Organizations API.

func NewClient

func NewClient(config *clerk.ClientConfig) *Client

func (*Client) Create

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

Create creates a new organization.

func (*Client) Delete

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

Delete deletes an organization.

func (c *Client) DeleteLogo(ctx context.Context, id string) (*clerk.Organization, error)

DeleteLogo removes the organization's logo.

func (*Client) Get

func (c *Client) Get(ctx context.Context, idOrSlug string) (*clerk.Organization, error)

Get retrieves details for an organization. The organization can be fetched by either the ID or its slug.

func (*Client) GetWithParams

func (c *Client) GetWithParams(ctx context.Context, idOrSlug string, params *GetParams) (*clerk.Organization, error)

GetWithParams retrieves details for an organization. The organization can be fetched by either the ID or its slug.

func (*Client) List

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

List returns a list of organizations.

func (*Client) Update

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

Update updates an organization.

func (c *Client) UpdateLogo(ctx context.Context, id string, params *UpdateLogoParams) (*clerk.Organization, error)

UpdateLogo sets or replaces the organization's logo.

func (*Client) UpdateMetadata

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

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

type CreateParams

type CreateParams struct {
	clerk.APIParams
	Name                  *string          `json:"name,omitempty"`
	Slug                  *string          `json:"slug,omitempty"`
	CreatedBy             *string          `json:"created_by,omitempty"`
	MaxAllowedMemberships *int64           `json:"max_allowed_memberships,omitempty"`
	PublicMetadata        *json.RawMessage `json:"public_metadata,omitempty"`
	PrivateMetadata       *json.RawMessage `json:"private_metadata,omitempty"`
}

type GetParams

type GetParams struct {
	clerk.APIParams
	IncludeMembersCount *bool `json:"include_members_count,omitempty"`
}

func (*GetParams) ToQuery

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

type ListParams

type ListParams struct {
	clerk.APIParams
	clerk.ListParams
	IncludeMembersCount                         *bool    `json:"include_members_count,omitempty"`
	IncludeMissingMemberWithElevatedPermissions *bool    `json:"include_missing_member_with_elevated_permissions,omitempty"`
	OrderBy                                     *string  `json:"order_by,omitempty"`
	Query                                       *string  `json:"query,omitempty"`
	UserIDs                                     []string `json:"user_id,omitempty"`
	FilterBy                                    []string `json:"filter_by,omitempty"`
}

func (*ListParams) ToQuery

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

ToQuery returns query string values from the params.

type UpdateLogoParams

type UpdateLogoParams struct {
	clerk.APIParams
	File           multipart.File `json:"-"`
	UploaderUserID *string        `json:"-"`
}

func (*UpdateLogoParams) ToMultipart

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

ToMultipart transforms the UpdateLogoParams to a multipart message that can be used as the request body. For multipart/form-data requests the Content-Type header needs to include each part's boundaries. ToMultipart returns the Content-Type after all parameters are added to the multipart.Writer.

type UpdateMetadataParams

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

type UpdateParams

type UpdateParams struct {
	clerk.APIParams
	Name                  *string          `json:"name,omitempty"`
	Slug                  *string          `json:"slug,omitempty"`
	MaxAllowedMemberships *int64           `json:"max_allowed_memberships,omitempty"`
	PublicMetadata        *json.RawMessage `json:"public_metadata,omitempty"`
	PrivateMetadata       *json.RawMessage `json:"private_metadata,omitempty"`
	AdminDeleteEnabled    *bool            `json:"admin_delete_enabled,omitempty"`
}

Jump to

Keyboard shortcuts

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