types

package
v1.20.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AcceptOrganizationInvitationQuery added in v1.16.0

type AcceptOrganizationInvitationQuery struct {
	OrganizationID string `path:"organization_id"`
	InvitationID   string `path:"invitation_id"`
	RedirectURL    string `query:"redirect_url" json:"redirect_url,omitempty" nullable:"true"`
}

type AcceptOrganizationInvitationRequest

type AcceptOrganizationInvitationRequest struct {
	RedirectURL *string `json:"redirect_url,omitempty" nullable:"true"`
}

func (*AcceptOrganizationInvitationRequest) Validate added in v1.5.0

type AddOrganizationMemberRequest

type AddOrganizationMemberRequest struct {
	UserID string `json:"user_id" required:"true" nullable:"false"`
	Role   string `json:"role" required:"true" nullable:"false"`
}

func (*AddOrganizationMemberRequest) Validate added in v1.5.0

func (r *AddOrganizationMemberRequest) Validate() error

type AddOrganizationTeamMemberRequest

type AddOrganizationTeamMemberRequest struct {
	MemberID string `json:"member_id" required:"true" nullable:"false"`
}

func (*AddOrganizationTeamMemberRequest) Validate added in v1.5.0

type CreateOrganizationInvitationRequest

type CreateOrganizationInvitationRequest struct {
	Email       string `json:"email" required:"true" nullable:"false"`
	Role        string `json:"role" required:"true" nullable:"false"`
	RedirectURL string `json:"redirect_url,omitempty" nullable:"true"`
}

func (*CreateOrganizationInvitationRequest) Validate added in v1.5.0

type CreateOrganizationRequest

type CreateOrganizationRequest struct {
	Name     string         `json:"name" required:"true" nullable:"false"`
	Role     string         `json:"role" required:"true" nullable:"false"`
	Slug     *string        `json:"slug,omitempty" nullable:"true"`
	Metadata map[string]any `json:"metadata,omitempty" nullable:"true"`
}

func (*CreateOrganizationRequest) Validate added in v1.5.0

func (r *CreateOrganizationRequest) Validate() error

type CreateOrganizationTeamRequest

type CreateOrganizationTeamRequest struct {
	Name        string         `json:"name" required:"true" nullable:"false"`
	Slug        *string        `json:"slug,omitempty" nullable:"true"`
	Description *string        `json:"description,omitempty" nullable:"true"`
	Metadata    map[string]any `json:"metadata,omitempty" nullable:"true"`
}

func (*CreateOrganizationTeamRequest) Validate added in v1.5.0

func (r *CreateOrganizationTeamRequest) Validate() error

type DeleteOrganizationMemberResponse

type DeleteOrganizationMemberResponse struct {
	Message string `json:"message" required:"true" nullable:"false"`
}

type DeleteOrganizationResponse

type DeleteOrganizationResponse struct {
	Message string `json:"message" required:"true" nullable:"false"`
}

type DeleteOrganizationTeamMemberResponse

type DeleteOrganizationTeamMemberResponse struct {
	Message string `json:"message" required:"true" nullable:"false"`
}

type DeleteOrganizationTeamResponse

type DeleteOrganizationTeamResponse struct {
	Message string `json:"message" required:"true" nullable:"false"`
}

type InvitationID added in v1.16.0

type InvitationID struct {
	OrganizationID string `path:"organization_id"`
	InvitationID   string `path:"invitation_id"`
}

type ListOrganizationMembersRequest added in v1.16.0

type ListOrganizationMembersRequest struct {
	OrganizationID string `path:"organization_id"`
	Page           int    `query:"page" json:"page,omitempty" nullable:"false"`
	Limit          int    `query:"limit" json:"limit,omitempty" nullable:"false"`
}

type ListOrganizationTeamMembersRequest added in v1.16.0

type ListOrganizationTeamMembersRequest struct {
	OrganizationID string `path:"organization_id"`
	TeamID         string `path:"team_id"`
	Page           int    `query:"page" json:"page,omitempty" nullable:"false"`
	Limit          int    `query:"limit" json:"limit,omitempty" nullable:"false"`
}

type MemberID added in v1.16.0

type MemberID struct {
	OrganizationID string `path:"organization_id"`
	MemberID       string `path:"member_id"`
}

type Organization

type Organization struct {
	bun.BaseModel `bun:"table:organizations"`

	ID        string         `json:"id" required:"true" nullable:"false" bun:"column:id,pk"`
	OwnerID   string         `json:"owner_id" required:"true" nullable:"false" bun:"column:owner_id"`
	Name      string         `json:"name" required:"true" nullable:"false" bun:"column:name"`
	Slug      string         `json:"slug" required:"true" nullable:"false" bun:"column:slug"`
	Metadata  map[string]any `json:"metadata" nullable:"true" bun:"column:metadata"`
	CreatedAt time.Time      `json:"created_at" required:"true" nullable:"false" bun:"column:created_at,default:current_timestamp"`
	UpdatedAt time.Time      `json:"updated_at" required:"true" nullable:"false" bun:"column:updated_at,default:current_timestamp"`
}

type OrganizationID added in v1.16.0

type OrganizationID struct {
	OrganizationID string `path:"organization_id"`
}

type OrganizationInvitation

type OrganizationInvitation struct {
	bun.BaseModel `bun:"table:organization_invitations"`

	ID             string                       `json:"id" required:"true" nullable:"false" bun:"column:id,pk"`
	Email          string                       `json:"email" required:"true" nullable:"false" bun:"column:email"`
	InviterID      string                       `json:"inviter_id" required:"true" nullable:"false" bun:"column:inviter_id"`
	OrganizationID string                       `json:"organization_id" required:"true" nullable:"false" bun:"column:organization_id"`
	Role           string                       `json:"role" required:"true" nullable:"false" bun:"column:role"`
	Status         OrganizationInvitationStatus `json:"status" required:"true" nullable:"false" bun:"column:status"`
	ExpiresAt      time.Time                    `json:"expires_at" required:"true" nullable:"false" bun:"column:expires_at"`
	CreatedAt      time.Time                    `json:"created_at" required:"true" nullable:"false" bun:"column:created_at,default:current_timestamp"`
}

type OrganizationInvitationContext added in v1.15.0

type OrganizationInvitationContext struct {
	emailtmpl.CommonContext
	InvitationEmail  string
	OrganizationName string
	Role             string
	AcceptLink       string
	Expiry           time.Duration
}

type OrganizationInvitationServiceHooksConfig added in v1.18.0

type OrganizationInvitationServiceHooksConfig struct {
	BeforeCreate func(ctx context.Context, actor *models.Actor, invitation *OrganizationInvitation) error
	AfterCreate  func(ctx context.Context, actor *models.Actor, invitation *OrganizationInvitation) error
	BeforeUpdate func(ctx context.Context, actor *models.Actor, invitation *OrganizationInvitation) error
	AfterUpdate  func(ctx context.Context, actor *models.Actor, invitation *OrganizationInvitation) error
}

type OrganizationInvitationStatus

type OrganizationInvitationStatus string
const (
	OrganizationInvitationStatusPending  OrganizationInvitationStatus = "pending"
	OrganizationInvitationStatusAccepted OrganizationInvitationStatus = "accepted"
	OrganizationInvitationStatusRejected OrganizationInvitationStatus = "rejected"
	OrganizationInvitationStatusRevoked  OrganizationInvitationStatus = "revoked"
	OrganizationInvitationStatusExpired  OrganizationInvitationStatus = "expired"
)

func (OrganizationInvitationStatus) PrepareJSONSchema added in v1.16.0

func (OrganizationInvitationStatus) PrepareJSONSchema(schema *jsonschema.Schema) error

type OrganizationMember

type OrganizationMember struct {
	bun.BaseModel `bun:"table:organization_members"`

	ID             string    `json:"id" required:"true" nullable:"false" bun:"column:id,pk"`
	OrganizationID string    `json:"organization_id" required:"true" nullable:"false" bun:"column:organization_id"`
	UserID         string    `json:"user_id" required:"true" nullable:"false" bun:"column:user_id"`
	Role           string    `json:"role" required:"true" nullable:"false" bun:"column:role"`
	CreatedAt      time.Time `json:"created_at" required:"true" nullable:"false" bun:"column:created_at,default:current_timestamp"`
	UpdatedAt      time.Time `json:"updated_at" required:"true" nullable:"false" bun:"column:updated_at,default:current_timestamp"`
}

type OrganizationMemberServiceHooksConfig added in v1.18.0

type OrganizationMemberServiceHooksConfig struct {
	BeforeCreate func(ctx context.Context, actor *models.Actor, member *OrganizationMember) error
	AfterCreate  func(ctx context.Context, actor *models.Actor, member *OrganizationMember) error
	BeforeUpdate func(ctx context.Context, actor *models.Actor, member *OrganizationMember) error
	AfterUpdate  func(ctx context.Context, actor *models.Actor, member *OrganizationMember) error
	BeforeDelete func(ctx context.Context, actor *models.Actor, member *OrganizationMember) error
	AfterDelete  func(ctx context.Context, actor *models.Actor, member *OrganizationMember) error
}

type OrganizationServiceHooksConfig added in v1.18.0

type OrganizationServiceHooksConfig struct {
	BeforeCreate func(ctx context.Context, actor *models.Actor, organization *Organization) error
	AfterCreate  func(ctx context.Context, actor *models.Actor, organization *Organization) error
	BeforeUpdate func(ctx context.Context, actor *models.Actor, organization *Organization) error
	AfterUpdate  func(ctx context.Context, actor *models.Actor, organization *Organization) error
	BeforeDelete func(ctx context.Context, actor *models.Actor, organization *Organization) error
	AfterDelete  func(ctx context.Context, actor *models.Actor, organization *Organization) error
}

type OrganizationTeam

type OrganizationTeam struct {
	bun.BaseModel `bun:"table:organization_teams"`

	ID             string         `json:"id" required:"true" nullable:"false" bun:"column:id,pk"`
	OrganizationID string         `json:"organization_id" required:"true" nullable:"false" bun:"column:organization_id"`
	Name           string         `json:"name" required:"true" nullable:"false" bun:"column:name"`
	Slug           string         `json:"slug" required:"true" nullable:"false" bun:"column:slug"`
	Description    *string        `json:"description" nullable:"true" bun:"column:description"`
	Metadata       map[string]any `json:"metadata" nullable:"true" bun:"column:metadata"`
	CreatedAt      time.Time      `json:"created_at" required:"true" nullable:"false" bun:"column:created_at,default:current_timestamp"`
	UpdatedAt      time.Time      `json:"updated_at" required:"true" nullable:"false" bun:"column:updated_at,default:current_timestamp"`
}

type OrganizationTeamMember

type OrganizationTeamMember struct {
	bun.BaseModel `bun:"table:organization_team_members"`

	ID        string    `json:"id" required:"true" nullable:"false" bun:"column:id,pk"`
	TeamID    string    `json:"team_id" required:"true" nullable:"false" bun:"column:team_id"`
	MemberID  string    `json:"member_id" required:"true" nullable:"false" bun:"column:member_id"`
	CreatedAt time.Time `json:"created_at" required:"true" nullable:"false" bun:"column:created_at,default:current_timestamp"`
}

type OrganizationTeamMemberServiceHooksConfig added in v1.18.0

type OrganizationTeamMemberServiceHooksConfig struct {
	BeforeCreate func(ctx context.Context, actor *models.Actor, member *OrganizationTeamMember) error
	AfterCreate  func(ctx context.Context, actor *models.Actor, member *OrganizationTeamMember) error
	BeforeDelete func(ctx context.Context, actor *models.Actor, member *OrganizationTeamMember) error
	AfterDelete  func(ctx context.Context, actor *models.Actor, member *OrganizationTeamMember) error
}

type OrganizationTeamServiceHooksConfig added in v1.18.0

type OrganizationTeamServiceHooksConfig struct {
	BeforeCreate func(ctx context.Context, actor *models.Actor, team *OrganizationTeam) error
	AfterCreate  func(ctx context.Context, actor *models.Actor, team *OrganizationTeam) error
	BeforeUpdate func(ctx context.Context, actor *models.Actor, team *OrganizationTeam) error
	AfterUpdate  func(ctx context.Context, actor *models.Actor, team *OrganizationTeam) error
	BeforeDelete func(ctx context.Context, actor *models.Actor, team *OrganizationTeam) error
	AfterDelete  func(ctx context.Context, actor *models.Actor, team *OrganizationTeam) error
}

type OrganizationsPluginConfig

type OrganizationsPluginConfig struct {
	Enabled                          bool          `json:"enabled" toml:"enabled"`
	OrganizationsLimit               *int          `json:"organizations_limit" toml:"organizations_limit"`
	MembersLimit                     *int          `json:"members_limit" toml:"members_limit"`
	InvitationsLimit                 *int          `json:"invitations_limit" toml:"invitations_limit"`
	InvitationExpiresIn              time.Duration `json:"invitation_expires_in" toml:"invitation_expires_in"`
	RequireEmailVerifiedOnInvitation bool          `json:"require_email_verified_on_invitation" toml:"require_email_verified_on_invitation"`

	ServiceHooks                    *OrganizationsServiceHooksConfig                                                        `json:"-" toml:"-"`
	SendOrganizationInvitationEmail func(params SendOrganizationInvitationEmailParams, reqCtx *models.RequestContext) error `json:"-" toml:"-"`
}

func (*OrganizationsPluginConfig) ApplyDefaults

func (config *OrganizationsPluginConfig) ApplyDefaults()

type SendOrganizationInvitationEmailParams added in v1.5.0

type SendOrganizationInvitationEmailParams struct {
	Organization *Organization
	Invitation   *OrganizationInvitation
	Inviter      *models.User
	AcceptURL    string
}

type TeamID added in v1.16.0

type TeamID struct {
	OrganizationID string `path:"organization_id"`
	TeamID         string `path:"team_id"`
}

type TeamMemberID added in v1.16.0

type TeamMemberID struct {
	OrganizationID string `path:"organization_id"`
	TeamID         string `path:"team_id"`
	MemberID       string `path:"member_id"`
}

type UpdateOrganizationMemberRequest

type UpdateOrganizationMemberRequest struct {
	Role string `json:"role" required:"true" nullable:"false"`
}

func (*UpdateOrganizationMemberRequest) Validate added in v1.5.0

func (r *UpdateOrganizationMemberRequest) Validate() error

type UpdateOrganizationRequest

type UpdateOrganizationRequest struct {
	Name     *string        `json:"name,omitempty" nullable:"true"`
	Slug     *string        `json:"slug,omitempty" nullable:"true"`
	Metadata map[string]any `json:"metadata,omitempty" nullable:"true"`
}

func (*UpdateOrganizationRequest) Validate added in v1.5.0

func (r *UpdateOrganizationRequest) Validate() error

type UpdateOrganizationTeamRequest

type UpdateOrganizationTeamRequest struct {
	Name        string         `json:"name" required:"true" nullable:"false"`
	Slug        *string        `json:"slug,omitempty" nullable:"true"`
	Description *string        `json:"description,omitempty" nullable:"true"`
	Metadata    map[string]any `json:"metadata,omitempty" nullable:"true"`
}

func (*UpdateOrganizationTeamRequest) Validate added in v1.5.0

func (r *UpdateOrganizationTeamRequest) Validate() error

Jump to

Keyboard shortcuts

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