// Package user 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 user

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 UserStatus.
const (
	Active    UserStatus = "active"
	Anonymous UserStatus = "anonymous"
	Inactive  UserStatus = "inactive"
	Pending   UserStatus = "pending"
)

// Defines values for UserEmailAddressSource.
const (
	Backfill      UserEmailAddressSource = "backfill"
	Consolidation UserEmailAddressSource = "consolidation"
	Manual        UserEmailAddressSource = "manual"
	Signup        UserEmailAddressSource = "signup"
)

// Adapter Placeholder for Adapter struct definition.
type Adapter = map[string]interface{}

// Grafana defines model for Grafana.
type Grafana struct {
	// GrafanaApiKey Grafana API key for the user configuration.
	GrafanaApiKey *string `json:"grafanaApiKey,omitempty" yaml:"grafanaApiKey,omitempty"`

	// GrafanaUrl Grafana URL for the user configuration.
	GrafanaUrl *string `json:"grafanaUrl,omitempty" yaml:"grafanaUrl,omitempty"`

	// SelectedBoardsConfigs Selected Grafana board configurations for the user.
	SelectedBoardsConfigs *[]SelectedGrafanaConfig `json:"selectedBoardsConfigs,omitempty" yaml:"selectedBoardsConfigs,omitempty"`
}

// GrafanaBoard Placeholder for GrafanaBoard definition (define fields as needed)
type GrafanaBoard = map[string]interface{}

// LoadTestPreferences defines model for LoadTestPreferences.
type LoadTestPreferences struct {
	// C Concurrent requests
	C *int `json:"c,omitempty" yaml:"c,omitempty"`

	// Gen Load generator
	Gen *string `json:"gen,omitempty" yaml:"gen,omitempty"`

	// Qps Queries per second
	Qps *int `json:"qps,omitempty" yaml:"qps,omitempty"`

	// T Duration
	T *string `json:"t,omitempty" yaml:"t,omitempty"`
}

// OrganizationWithRoles An organization the user is a member of, together with the names of the roles assigned to that user within the organization. Returned as an item of User.organizations.organizationsWithRoles. The role names are dynamic, user-generated values (no fixed enumeration).
type OrganizationWithRoles struct {
	// 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"`

	// Name Name of the organization.
	Name string `db:"name" json:"name,omitempty" yaml:"name,omitempty"`

	// Description Human readable description of the organization.
	Description *string `db:"description" json:"description,omitempty" yaml:"description,omitempty"`

	// Country Country associated with the organization.
	Country *string `db:"country" json:"country,omitempty" yaml:"country,omitempty"`

	// Region Region associated with the organization.
	Region *string `db:"region" json:"region,omitempty" yaml:"region,omitempty"`

	// 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"`
	CreatedAt core.Time  `db:"created_at" json:"createdAt,omitempty" yaml:"createdAt,omitempty"`
	UpdatedAt core.Time  `db:"updated_at" json:"updatedAt,omitempty" yaml:"updatedAt,omitempty"`

	// DeletedAt Timestamp when the organization was soft-deleted (null if not deleted).
	DeletedAt *core.NullTime `db:"deleted_at" json:"deletedAt,omitempty" yaml:"deletedAt,omitempty"`

	// RoleNames Names of the roles assigned to the user within this organization. Free-form, user-generated role names; not a fixed enumeration.
	RoleNames pq.StringArray `db:"role_names" json:"roleNames" yaml:"roleNames"`
}

// Panel Grafana panel structure imported from github.com/grafana-tools/sdk
type Panel = map[string]interface{}

// Preference defines model for Preference.
type Preference struct {
	// AnonymousPerfResults The anonymous perf results of the preference.
	AnonymousPerfResults bool `json:"anonymousPerfResults" yaml:"anonymousPerfResults"`

	// AnonymousUsageStats The anonymous usage stats of the preference.
	AnonymousUsageStats bool `json:"anonymousUsageStats" yaml:"anonymousUsageStats"`

	// DashboardPreferences The dashboard preferences of the preference.
	DashboardPreferences map[string]interface{} `json:"dashboardPreferences" yaml:"dashboardPreferences"`
	Grafana              *Grafana               `json:"grafana,omitempty" yaml:"grafana,omitempty"`
	LoadTestPrefs        *LoadTestPreferences   `json:"loadTestPrefs,omitempty" yaml:"loadTestPrefs,omitempty"`

	// MeshAdapters The mesh adapters of the preference.
	MeshAdapters *[]Adapter  `json:"meshAdapters,omitempty" yaml:"meshAdapters,omitempty"`
	Prometheus   *Prometheus `json:"prometheus,omitempty" yaml:"prometheus,omitempty"`

	// RemoteProviderPreferences The remote provider preferences of the preference.
	RemoteProviderPreferences map[string]interface{} `json:"remoteProviderPreferences" yaml:"remoteProviderPreferences"`

	// SelectedOrganizationId ID of the associated selectedOrganization.
	SelectedOrganizationId uuid.UUID `json:"selectedOrganizationId" yaml:"selectedOrganizationId"`

	// SelectedWorkspaceForOrganizations The selected workspace for organizations of the preference.
	SelectedWorkspaceForOrganizations map[string]string `json:"selectedWorkspaceForOrganizations" yaml:"selectedWorkspaceForOrganizations"`

	// UpdatedAt Timestamp of when the resource was last updated.
	UpdatedAt time.Time `json:"updatedAt" yaml:"updatedAt"`

	// UsersExtensionPreferences The users extension preferences of the preference.
	UsersExtensionPreferences map[string]interface{} `json:"usersExtensionPreferences" yaml:"usersExtensionPreferences"`
}

// Prometheus defines model for Prometheus.
type Prometheus struct {
	// PrometheusUrl The prometheus URL of the prometheus.
	PrometheusUrl *string `json:"prometheusUrl,omitempty" yaml:"prometheusUrl,omitempty"`

	// SelectedPrometheusBoardsConfigs The selected prometheus boards configs of the prometheus.
	SelectedPrometheusBoardsConfigs *[]SelectedGrafanaConfig `json:"selectedPrometheusBoardsConfigs,omitempty" yaml:"selectedPrometheusBoardsConfigs,omitempty"`
}

// PublicUser Publicly viewable projection of User served by the unauthenticated public users directory. Deliberately excludes email, real names, and every other personally identifying or account-internal field.
type PublicUser struct {
	// AvatarUrl URL to user's avatar image
	AvatarUrl string `db:"avatar_url" json:"avatarUrl,omitempty" yaml:"avatarUrl,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" yaml:"id"`

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

	// Username Public username of the user
	Username string `db:"username" json:"username,omitempty" yaml:"username,omitempty"`
}

// PublicUsersPage Paginated list of publicly viewable user records
type PublicUsersPage struct {
	// Data Public user records for the requested page.
	Data []PublicUser `json:"data" yaml:"data"`

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

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

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

// SearchableUser Minimal collaboration projection of User served by the authenticated user-search endpoints (people-picker flows such as sharing a design). Carries just enough to identify and display a person - name, username, email, avatar - and deliberately excludes roles, organization and team membership, preferences, and login metadata.
type SearchableUser struct {
	// AvatarUrl URL to user's avatar image
	AvatarUrl string `db:"avatar_url" json:"avatarUrl,omitempty" yaml:"avatarUrl,omitempty"`

	// DeletedAt SQL null Timestamp to handle null values of time.
	DeletedAt core.NullTime `db:"deleted_at" json:"deletedAt,omitempty" yaml:"deletedAt"`

	// Email User's email address
	Email openapi_types.Email `db:"email" json:"email,omitempty" yaml:"email,omitempty"`

	// FirstName User's first name
	FirstName string `db:"first_name" json:"firstName,omitempty" yaml:"firstName,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" yaml:"id"`

	// LastName User's last name
	LastName string `db:"last_name" json:"lastName,omitempty" yaml:"lastName,omitempty"`

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

	// Username Public username of the user
	Username string `db:"username" json:"username,omitempty" yaml:"username,omitempty"`
}

// SearchableUsersPage Paginated list of users in the searchable collaboration projection
type SearchableUsersPage struct {
	// Data Matching user records for the requested page.
	Data []SearchableUser `json:"data" yaml:"data"`

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

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

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

// SelectedGrafanaConfig defines model for SelectedGrafanaConfig.
type SelectedGrafanaConfig struct {
	// Board Placeholder for GrafanaBoard definition (define fields as needed)
	Board *GrafanaBoard `json:"board,omitempty" yaml:"board,omitempty"`

	// Panels Panels selected for the Grafana board configuration.
	Panels *[]Panel `json:"panels,omitempty" yaml:"panels,omitempty"`

	// TemplateVars Template variables applied to the selected Grafana board configuration.
	TemplateVars *[]string `json:"templateVars,omitempty" yaml:"templateVars,omitempty"`
}

// Social Various online profiles associated with the user account, like GitHub, LinkedIn, X, and so on.
type Social struct {
	// Link The link of the social.
	Link string `json:"link" yaml:"link"`

	// Site The site of the social.
	Site string `json:"site" yaml:"site"`
}

// TeamWithRoles A team the user is a member of, together with the names of the roles assigned to that user within the team. Returned as an item of User.teams.teamsWithRoles. The role names are dynamic, user-generated values (no fixed enumeration).
type TeamWithRoles struct {
	// 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"`

	// Name Name of the team.
	Name string `db:"name" json:"name,omitempty" yaml:"name,omitempty"`

	// Description Human readable description of the team.
	Description *string `db:"description" json:"description,omitempty" yaml:"description,omitempty"`

	// 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"`

	// Metadata Free-form metadata associated with the team.
	Metadata  core.Map          `db:"metadata" json:"metadata,omitempty" yaml:"metadata,omitempty"`
	CreatedAt core.Time `db:"created_at" json:"createdAt,omitempty" yaml:"createdAt,omitempty"`
	UpdatedAt core.Time `db:"updated_at" json:"updatedAt,omitempty" yaml:"updatedAt,omitempty"`

	// DeletedAt Timestamp when the team was soft-deleted (null if not deleted).
	DeletedAt *core.NullTime `db:"deleted_at" json:"deletedAt,omitempty" yaml:"deletedAt,omitempty"`

	// RoleNames Names of the roles assigned to the user within this team. Free-form, user-generated role names; not a fixed enumeration.
	RoleNames pq.StringArray `db:"role_names" json:"roleNames" yaml:"roleNames"`
}

// User Represents a user
type User struct {
	AcceptedTermsAt core.Time `db:"accepted_terms_at" json:"acceptedTermsAt" yaml:"acceptedTermsAt,omitempty"`

	// AvatarUrl URL to user's avatar image
	AvatarUrl *string `db:"avatar_url" json:"avatarUrl" yaml:"avatarUrl"`

	// Bio User's biography or description
	Bio *string `db:"bio" json:"bio" yaml:"bio"`

	// Country User's country information stored as JSONB
	Country   core.Map          `db:"country" json:"country" yaml:"country"`
	CreatedAt core.Time `db:"created_at" json:"createdAt" yaml:"createdAt"`

	// DeletedAt Timestamp when the user record was soft-deleted (null if not deleted)
	DeletedAt *core.NullTime `db:"deleted_at" json:"deletedAt" yaml:"deletedAt"`

	// Email User's email address
	Email          openapi_types.Email `db:"email" json:"email" yaml:"email"`
	FirstLoginTime core.Time   `db:"first_login_time" json:"firstLoginTime" yaml:"firstLoginTime,omitempty"`

	// FirstName User's first name
	FirstName string `db:"first_name" json:"firstName" yaml:"firstName"`

	// 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"`
	LastLoginTime core.Time `db:"last_login_time" json:"lastLoginTime" yaml:"lastLoginTime"`

	// LastName User's last name
	LastName string `db:"last_name" json:"lastName" yaml:"lastName"`

	// Organizations Organizations the user belongs to with role information
	Organizations *struct {
		// OrganizationsWithRoles Organization memberships for the user with their assigned roles.
		OrganizationsWithRoles *[]OrganizationWithRoles `db:"organizations_with_roles" json:"organizationsWithRoles" yaml:"organizationsWithRoles"`

		// TotalCount Total number of organization memberships returned for the user.
		TotalCount *int `db:"total_count" json:"totalCount" yaml:"totalCount"`
	} `db:"organizations" json:"organizations" yaml:"organizations"`
	Preferences *Preference `db:"preferences" json:"preferences" yaml:"preferences,omitempty"`

	// Provider Authentication provider (e.g., Google, Github)
	Provider string `db:"provider" json:"provider" yaml:"provider"`

	// Region User's region information stored as JSONB
	Region core.Map `db:"region" json:"region" yaml:"region"`

	// RoleNames Names of the global roles assigned to the user. Free-form, user-generated values sourced from the roles table (role_name is a varchar, not a fixed enumeration); the seeded system roles such as "admin", "organization admin" and "user" are a subset, not the whole set.
	RoleNames pq.StringArray `db:"role_names" json:"roleNames" yaml:"roleNames"`

	// Socials Various online profiles associated with the user account
	Socials *UserSocials `db:"socials" json:"socials" yaml:"socials"`

	// Status User account status
	Status UserStatus `db:"status" json:"status" yaml:"status"`

	// Teams Teams the user belongs to with role information
	Teams *struct {
		// TeamsWithRoles Team memberships for the user with their assigned roles.
		TeamsWithRoles *[]TeamWithRoles `db:"teams_with_roles" json:"teamsWithRoles" yaml:"teamsWithRoles"`

		// TotalCount Total number of team memberships returned for the user.
		TotalCount *int `db:"total_count" json:"totalCount" yaml:"totalCount"`
	} `db:"teams" json:"teams" yaml:"teams"`
	UpdatedAt core.Time `db:"updated_at" json:"updatedAt" yaml:"updatedAt"`
}

// UserStatus User account status
type UserStatus string

// UserEmailAddress One email address associated with a user account. A user has exactly one primary address (mirrored in users.email) and any number of secondary addresses accumulated from account consolidation or explicit addition. Uniqueness across live addresses is enforced case-insensitively.
type UserEmailAddress struct {
	CreatedAt core.Time `db:"created_at" json:"createdAt" yaml:"createdAt"`

	// DeletedAt SQL null Timestamp to handle null values of time.
	DeletedAt core.NullTime `db:"deleted_at" json:"deletedAt" yaml:"deletedAt"`

	// Email The email address
	Email openapi_types.Email `db:"email" json:"email" yaml:"email"`

	// 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"`

	// IsPrimary Exactly one live primary address per user; mirrors users.email
	IsPrimary bool `db:"is_primary" json:"isPrimary" yaml:"isPrimary"`

	// Source How this address became associated with the account
	Source    UserEmailAddressSource `db:"source" json:"source" yaml:"source"`
	UpdatedAt core.Time      `db:"updated_at" json:"updatedAt" yaml:"updatedAt"`

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

	// Verified Whether the address was verified (per Kratos verifiable addresses) at record time
	Verified bool `db:"verified" json:"verified" yaml:"verified"`
}

// UserEmailAddressSource How this address became associated with the account
type UserEmailAddressSource string

// Filter defines model for filter.
type Filter = string

// Order defines model for order.
type Order = string

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

// Page defines model for page.
type Page = int

// PageSize defines model for pageSize.
type PageSize = int

// Search defines model for search.
type Search = string
