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 ¶
- func Create(ctx context.Context, params *CreateParams) (*clerk.Organization, error)
- func Delete(ctx context.Context, id string) (*clerk.DeletedResource, error)
- func DeleteLogo(ctx context.Context, id string) (*clerk.Organization, error)
- func Get(ctx context.Context, idOrSlug string) (*clerk.Organization, error)
- func List(ctx context.Context, params *ListParams) (*clerk.OrganizationList, error)
- func Update(ctx context.Context, id string, params *UpdateParams) (*clerk.Organization, error)
- func UpdateLogo(ctx context.Context, id string, params *UpdateLogoParams) (*clerk.Organization, error)
- func UpdateMetadata(ctx context.Context, id string, params *UpdateMetadataParams) (*clerk.Organization, error)
- type Client
- func (c *Client) Create(ctx context.Context, params *CreateParams) (*clerk.Organization, error)
- func (c *Client) Delete(ctx context.Context, id string) (*clerk.DeletedResource, error)
- func (c *Client) DeleteLogo(ctx context.Context, id string) (*clerk.Organization, error)
- func (c *Client) Get(ctx context.Context, idOrSlug string) (*clerk.Organization, error)
- func (c *Client) List(ctx context.Context, params *ListParams) (*clerk.OrganizationList, error)
- func (c *Client) Update(ctx context.Context, id string, params *UpdateParams) (*clerk.Organization, error)
- func (c *Client) UpdateLogo(ctx context.Context, id string, params *UpdateLogoParams) (*clerk.Organization, error)
- func (c *Client) UpdateMetadata(ctx context.Context, id string, params *UpdateMetadataParams) (*clerk.Organization, error)
- type CreateParams
- type ListParams
- type UpdateLogoParams
- type UpdateMetadataParams
- type UpdateParams
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 DeleteLogo ¶
DeleteLogo removes the organization's logo.
func Get ¶
Get 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 ¶
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 (*Client) Create ¶
func (c *Client) Create(ctx context.Context, params *CreateParams) (*clerk.Organization, error)
Create creates a new organization.
func (*Client) DeleteLogo ¶
DeleteLogo removes the organization's logo.
func (*Client) Get ¶
Get 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 (*Client) UpdateLogo ¶
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 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"` }