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

import (
	"time"

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

// Defines values for ContentSharePayloadContentType.
const (
	View ContentSharePayloadContentType = "view"
)

// ContentSharePayload Payload for sharing a view with one or more recipients by email. The
// wire format matches the canonical design share payload
// (`design.ContentSharePayload` in `v1beta2/design`), restricted to the
// `view` content type since that is all this endpoint accepts.
type ContentSharePayload struct {
	// ContentId A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
	ContentId core.Uuid `json:"contentId" yaml:"contentId"`

	// ContentType The kind of content being shared. Only `view` is accepted on this
	// endpoint.
	ContentType ContentSharePayloadContentType `json:"contentType" yaml:"contentType"`

	// Emails Email addresses of the recipients to share this view with.
	Emails []openapi_types.Email `json:"emails" yaml:"emails"`

	// Share When true, flip the view's visibility to public and send invitation
	// emails to the recipients. When false, revert visibility to private.
	Share bool `json:"share" yaml:"share"`
}

// ContentSharePayloadContentType The kind of content being shared. Only `view` is accepted on this
// endpoint.
type ContentSharePayloadContentType string

// MesheryView A saved view with filters and metadata that defines a customized perspective of Meshery resources. Learn more at https://docs.meshery.io/concepts/logical/views
type MesheryView 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" yaml:"id"`

	// Name Display name of the view.
	Name string `db:"name" json:"name" yaml:"name"`

	// Visibility Visibility level of the view.
	Visibility string `db:"visibility" json:"visibility" yaml:"visibility"`

	// Filters Filter configuration that defines which resources this view displays.
	Filters core.Map `db:"filters" json:"filters" yaml:"filters"`

	// Metadata Additional metadata associated with the view.
	Metadata core.Map `db:"metadata" json:"metadata" yaml:"metadata"`

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

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

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

	// DeletedAt Timestamp when the view was soft deleted. Null while the view remains active.
	DeletedAt *core.NullTime `db:"deleted_at" json:"deletedAt,omitempty" yaml:"deletedAt,omitempty"`
}

// MesheryViewPage Paginated list of views with location enrichment.
type MesheryViewPage struct {
	// Page Zero-based page index returned in this response.
	Page int `json:"page,omitempty" yaml:"page,omitempty"`

	// PageSize Maximum number of items returned on each page.
	PageSize int `json:"pageSize,omitempty" yaml:"pageSize,omitempty"`

	// TotalCount Total number of items across all pages.
	TotalCount int `json:"totalCount,omitempty" yaml:"totalCount,omitempty"`

	// Views Views in this page, enriched with workspace and organization context.
	Views []MesheryViewWithLocation `json:"views,omitempty" yaml:"views,omitempty"`
}

// MesheryViewWithLocation A view enriched with the workspace and organization it belongs to.
type MesheryViewWithLocation struct {
	// CreatedAt Timestamp when the view was created.
	CreatedAt time.Time `db:"created_at" json:"createdAt" yaml:"createdAt"`

	// DeletedAt Timestamp when the view was soft deleted. Null while the view remains active.
	DeletedAt *core.NullTime `db:"deleted_at" json:"deletedAt,omitempty" yaml:"deletedAt,omitempty"`

	// Filters Filter configuration for this view.
	Filters core.Map               `db:"filters" json:"filters,omitempty" yaml:"filters,omitempty"`
	ID      core.GeneralId `db:"id" json:"id" yaml:"id"`

	// Metadata Metadata associated with the view.
	Metadata core.Map `db:"metadata" json:"metadata,omitempty" yaml:"metadata,omitempty"`

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

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

	// OrganizationName Name of the organization this view belongs to.
	OrganizationName string `db:"organization_name" json:"organizationName,omitempty" yaml:"organizationName,omitempty"`

	// UpdatedAt Timestamp when the view was last updated.
	UpdatedAt time.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,omitempty" yaml:"userId,omitempty"`

	// Visibility Visibility level of the view.
	Visibility string `db:"visibility" json:"visibility,omitempty" yaml:"visibility,omitempty"`

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

	// WorkspaceName Name of the workspace this view belongs to.
	WorkspaceName string `db:"workspace_name" json:"workspaceName,omitempty" yaml:"workspaceName,omitempty"`
}

// ViewPayload Payload for creating or updating a view.
type ViewPayload struct {
	// Filters Filter configuration for this view.
	Filters core.Map `json:"filters,omitempty" yaml:"filters,omitempty"`

	// Metadata Metadata associated with the view.
	Metadata core.Map `json:"metadata,omitempty" yaml:"metadata,omitempty"`

	// Name Display name of the view.
	Name string `json:"name,omitempty" yaml:"name,omitempty"`

	// Visibility Visibility level of the view.
	Visibility *string `json:"visibility,omitempty" yaml:"visibility,omitempty"`
}

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

// OrgIdQuery defines model for orgIdQuery.
type OrgIdQuery = string

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

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

// Pagesize defines model for pagesize.
type Pagesize = int

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

// UserIdQuery defines model for userIdQuery.
type UserIdQuery = string

// ViewId defines model for viewId.
type ViewId = core.ViewId
