// Package invitation provides primitives to interact with the openapi HTTP API.
//
// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.5.1 DO NOT EDIT.
package invitation

import (
	"time"

	"github.com/lib/pq"
	"github.com/meshery/schemas/models/core"
	openapi_types "github.com/oapi-codegen/runtime/types"
	"github.com/gofrs/uuid"
)

// Defines values for InvitationStatus.
const (
	Disabled InvitationStatus = "disabled"
	Enabled  InvitationStatus = "enabled"
)

// Invitation Invitation entity schema.
type Invitation struct {
	// AcceptedBy List of user ids that have already accepted the invitation. Empty means the invitation has not been used yet.
	AcceptedBy pq.StringArray `db:"accepted_by" json:"acceptedBy" yaml:"acceptedBy"`

	// CreatedAt Timestamp when the invitation was created.
	CreatedAt time.Time `db:"created_at" json:"createdAt" yaml:"createdAt"`

	// DeletedAt Timestamp when the invitation was deleted, if applicable.
	DeletedAt core.NullTime `db:"deleted_at" json:"deletedAt" yaml:"deletedAt"`

	// Description Description of the invitation, which can be used to provide additional context. Null or empty string means the invitation does not have a description.
	Description string `json:"description" yaml:"description"`

	// Emails Email addresses or patterns for which the invitation is valid. Null means the invitation is valid for any email address.
	Emails pq.StringArray `json:"emails" yaml:"emails"`

	// ExpiresAt Timestamp when the invitation expires, if applicable. Null or empty means the invitation does not expire.
	ExpiresAt *time.Time `db:"expires_at" json:"expiresAt" yaml:"expiresAt"`

	// Id A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
	ID core.Uuid `db:"id" json:"id" yaml:"id"`

	// IsDefault Indicates whether the invitation is a default invitation (open invite), which can be used to assign users when signing up from fqdn or custom domain. An organization can only have one default invitation.
	IsDefault *bool `db:"is_default" json:"isDefault" yaml:"isDefault"`

	// Name Name of the invitation, which can be used to identify it. Required; cannot be an empty string.
	Name string `json:"name" yaml:"name"`

	// OrgId A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
	OrgID core.Uuid `db:"org_id" json:"orgId" yaml:"orgId"`

	// Owner A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
	Owner core.Uuid `db:"owner" json:"owner" yaml:"owner"`

	// Quota Quota for the invitation; limits the number of users that can accept it. Null or empty means the invitation is unlimited.
	Quota *int `json:"quota,omitempty" yaml:"quota,omitempty"`

	// Roles Roles that the user will have when accepting the invitation. Empty means the invitation does not specify any roles.
	Roles pq.StringArray `json:"roles" yaml:"roles"`

	// Status Status of the invitation, where enabled means the invitation is active and can be used, disabled means the invitation is no longer valid and is temporarily inactive. Disabled invitations can be re-enabled later.
	Status InvitationStatus `json:"status" yaml:"status"`

	// Teams Teams that the user will be added to when accepting the invitation. Empty means the invitation does not specify any teams.
	Teams pq.StringArray `json:"teams" yaml:"teams"`

	// UpdatedAt Timestamp when the invitation was last updated.
	UpdatedAt time.Time `db:"updated_at" json:"updatedAt" yaml:"updatedAt"`
}

// InvitationPayload Payload for creating or updating an invitation.
type InvitationPayload struct {
	// Description Description of the invitation.
	Description string `json:"description" yaml:"description"`

	// Emails Email addresses or patterns this invitation is valid for.
	Emails pq.StringArray `json:"emails" yaml:"emails"`

	// ExpiresAt Timestamp when the invitation expires, if applicable.
	ExpiresAt *time.Time `db:"expires_at" json:"expiresAt,omitempty" yaml:"expiresAt,omitempty"`

	// Id A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
	ID *core.Uuid `json:"id,omitempty" yaml:"id,omitempty"`

	// IsDefault Indicates whether the invitation is a default invitation (open invite).
	IsDefault *bool `db:"is_default" json:"isDefault,omitempty" yaml:"isDefault,omitempty"`

	// Name Name of the invitation.
	Name string `json:"name" yaml:"name"`

	// OrgID ID of the organization to which the user is invited.
	OrgID uuid.UUID `db:"org_id" json:"orgId" yaml:"orgId"`

	// Owner A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
	Owner *core.Uuid `db:"owner" json:"owner,omitempty" yaml:"owner,omitempty"`

	// Quota Quota for the invitation; limits the number of users that can accept it.
	Quota *int `json:"quota,omitempty" yaml:"quota,omitempty"`

	// Roles Roles that the user will have when accepting the invitation.
	Roles pq.StringArray `json:"roles" yaml:"roles"`

	// Status Status of the invitation, where enabled means the invitation is active and can be used, disabled means the invitation is no longer valid and is temporarily inactive. Disabled invitations can be re-enabled later.
	Status InvitationStatus `json:"status" yaml:"status"`

	// Teams Teams that the user will be added to when accepting the invitation.
	Teams pq.StringArray `json:"teams" yaml:"teams"`
}

// InvitationStatus Status of the invitation, where enabled means the invitation is active and can be used, disabled means the invitation is no longer valid and is temporarily inactive. Disabled invitations can be re-enabled later.
type InvitationStatus string

// InvitationsPage Paginated list of invitations for an organization.
type InvitationsPage struct {
	// Data Invitations returned on the current page.
	Data *[]Invitation `json:"data" yaml:"data"`

	// Page Current page number of the result set.
	Page int `json:"page,omitempty" yaml:"page,omitempty"`

	// PageSize Number of items per page.
	PageSize int `json:"pageSize" yaml:"pageSize"`

	// TotalCount Total number of items available.
	TotalCount int `json:"totalCount" yaml:"totalCount"`
}

// SignupData A signup request record as persisted in the signup_data table. Captures the requester's identity, the product form the request originated from (for example playground, meshmap, docker-extension), the moderation status, and the tracking task created for the request. Also embedded in signup webhook and notification payloads, where only a subset of fields may be populated.
type SignupData struct {
	CreatedAt core.Time `db:"created_at" json:"createdAt,omitempty" yaml:"createdAt,omitempty"`

	// Email Email address of the requester.
	Email *openapi_types.Email `db:"email" json:"email,omitempty" yaml:"email,omitempty"`

	// FirstName First name of the requester.
	FirstName *string `db:"first_name" json:"firstName,omitempty" yaml:"firstName,omitempty"`

	// FormType Product form the signup request originated from. Known values include playground, meshmap, docker-extension, epsma-book, content, contact and event; the set is open-ended.
	FormType *string `db:"form_type" json:"formType,omitempty" yaml:"formType,omitempty"`

	// Id A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
	ID *core.Uuid `db:"id" json:"id,omitempty" yaml:"id,omitempty"`

	// LastName Last name of the requester.
	LastName *string `db:"last_name" json:"lastName,omitempty" yaml:"lastName,omitempty"`

	// Occupation Occupation stated by the requester.
	Occupation *string `db:"occupation" json:"occupation,omitempty" yaml:"occupation,omitempty"`

	// Organization Organization stated by the requester.
	Organization *string `db:"organization" json:"organization,omitempty" yaml:"organization,omitempty"`

	// Role Role stated by the requester within their organization.
	Role *string `db:"role" json:"role,omitempty" yaml:"role,omitempty"`

	// Status Moderation status of the signup request.
	Status *string `db:"status" json:"status,omitempty" yaml:"status,omitempty"`

	// TaskID Identifier of the tracking task created for this request in the external task system.
	TaskID *string `db:"task_id" json:"taskId,omitempty" yaml:"taskId,omitempty"`

	// TaskLink Link to the tracking task created for this request.
	TaskLink  *string           `db:"task_link" json:"taskLink,omitempty" yaml:"taskLink,omitempty"`
	UpdatedAt core.Time `db:"updated_at" json:"updatedAt,omitempty" yaml:"updatedAt,omitempty"`
}

// SignupRequest A signup request submitted for organization access.
type SignupRequest map[string]interface{}

// SignupRequestNotification Notification about the most recent signup request awaiting moderator action, served by getSignupRequestNotification.
type SignupRequestNotification struct {
	// PreProcessed Whether the signup request was automatically processed before moderator review.
	PreProcessed bool `json:"preProcessed" yaml:"preProcessed"`

	// SignupData A signup request record as persisted in the signup_data table. Captures the requester's identity, the product form the request originated from (for example playground, meshmap, docker-extension), the moderation status, and the tracking task created for the request. Also embedded in signup webhook and notification payloads, where only a subset of fields may be populated.
	SignupData SignupData `json:"signupData" yaml:"signupData"`
}

// SignupRequestsPage Paginated list of signup requests.
type SignupRequestsPage struct {
	// Data Signup requests returned on the current page.
	Data *[]SignupRequest `json:"data,omitempty" yaml:"data,omitempty"`

	// Page Current page number of the result set.
	Page int `json:"page,omitempty" yaml:"page,omitempty"`

	// PageSize Number of items per page.
	PageSize int `json:"pageSize" yaml:"pageSize"`

	// TotalCount Total number of items available.
	TotalCount int `json:"totalCount" yaml:"totalCount"`
}

// SignupWebhookPayload Outbound webhook body that Cloud POSTs to the configured signup and entitlement webhooks (WEBHOOK_SIGNUP_REQUEST, WEBHOOK_KANVAS_ENTITLEMENT) when a signup request is processed. Emitted by Cloud; not served by any Cloud endpoint.
type SignupWebhookPayload struct {
	// NewUser Whether the requester is a newly created user.
	NewUser bool `json:"newUser" yaml:"newUser"`

	// SignupData A signup request record as persisted in the signup_data table. Captures the requester's identity, the product form the request originated from (for example playground, meshmap, docker-extension), the moderation status, and the tracking task created for the request. Also embedded in signup webhook and notification payloads, where only a subset of fields may be populated.
	SignupData SignupData `json:"signupData" yaml:"signupData"`
}

// Uuid A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
type Uuid = core.Uuid

// InvitationId defines model for invitationId.
type InvitationId = uuid.UUID

// OrgId defines model for orgId.
type OrgId = uuid.UUID

// SignupEmail defines model for signupEmail.
type SignupEmail = openapi_types.Email

// SignupFirstName defines model for signupFirstName.
type SignupFirstName = string

// SignupFormType defines model for signupFormType.
type SignupFormType = string

// SignupLastName defines model for signupLastName.
type SignupLastName = string

// SignupOccupation defines model for signupOccupation.
type SignupOccupation = string

// SignupOrganization defines model for signupOrganization.
type SignupOrganization = string

// SignupRequestId A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
type SignupRequestId = Uuid

// SignupRole defines model for signupRole.
type SignupRole = string

// SignupStatus defines model for signupStatus.
type SignupStatus = string

// SignupTaskId defines model for signupTaskId.
type SignupTaskId = string

// SignupTaskLink defines model for signupTaskLink.
type SignupTaskLink = string
