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

import (
	"github.com/meshery/schemas/models/core"
	"github.com/gofrs/uuid"
)

// Environment Environments allow you to logically group related Connections and their associated Credentials. Learn more at https://docs.meshery.io/concepts/logical/environments
type Environment 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"`

	// SchemaVersion API version of the object, optionally prefixed with an API group (e.g. "group.example.io/v1beta1" or bare "v1beta1").
	SchemaVersion core.VersionString `gorm:"-" db:"-" json:"schemaVersion" yaml:"schemaVersion"`

	// Name Environment name
	Name string `db:"name" json:"name" yaml:"name"`

	// Description Environment description
	Description string `db:"description" json:"description" yaml:"description"`

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

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

	// CreatedAt Timestamp when the resource was created.
	CreatedAt core.CreatedAt `db:"created_at" json:"createdAt" yaml:"createdAt,omitempty"`

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

	// UpdatedAt Timestamp when the resource was updated.
	UpdatedAt core.UpdatedAt `db:"updated_at" json:"updatedAt" yaml:"updatedAt,omitempty"`

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

// EnvironmentConnectionMapping Junction record linking an environment to a connection.
type EnvironmentConnectionMapping struct {
	// ConnectionId A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
	ConnectionID *core.Uuid `db:"connection_id" json:"connectionId" yaml:"connectionId,omitempty"`
	CreatedAt    core.Time  `db:"created_at" json:"createdAt" yaml:"createdAt,omitempty"`

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

	// EnvironmentId A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
	EnvironmentID *core.Uuid     `db:"environment_id" json:"environmentId" yaml:"environmentId,omitempty"`
	ID            core.GeneralId `db:"id" json:"id" yaml:"id"`
	UpdatedAt     core.Time      `db:"updated_at" json:"updatedAt" yaml:"updatedAt,omitempty"`
}

// EnvironmentConnectionMappingPage Paginated list of environment-to-connection mapping records, returned when a connection is assigned to or unassigned from an environment. Distinct from EnvironmentConnectionsPage, which lists the connections themselves rather than the junction records.
type EnvironmentConnectionMappingPage struct {
	// EnvironmentConnectionMapping Environment-to-connection mapping records in this page.
	EnvironmentConnectionMapping []EnvironmentConnectionMapping `json:"environmentConnectionMapping" yaml:"environmentConnectionMapping"`

	// Page Zero-based page index returned in this response.
	Page int `json:"page" yaml:"page"`

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

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

// EnvironmentConnectionsPage Paginated list of connections associated with an environment.
type EnvironmentConnectionsPage struct {
	// Connections The connections of the environmentconnectionspage.
	Connections *[]map[string]interface{} `json:"connections,omitempty" yaml:"connections,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"`
}

// EnvironmentPage Paginated list of environments.
type EnvironmentPage struct {
	// Environments Environments associated with this resource.
	Environments []Environment       `json:"environments,omitempty" yaml:"environments,omitempty"`
	Page         core.Number `json:"page,omitempty" yaml:"page,omitempty"`
	PageSize     core.Number `json:"pageSize" yaml:"pageSize,omitempty"`
	TotalCount   core.Number `json:"totalCount" yaml:"totalCount,omitempty"`
}

// EnvironmentPayload Payload for creating or updating an environment.
type EnvironmentPayload struct {
	Description core.Text `json:"description,omitempty" yaml:"description,omitempty"`
	Name        core.Text `json:"name" yaml:"name"`

	// OrgID Select an organization in which you want to create this new environment. Keep in mind that the organization cannot be changed after creation.
	OrgID uuid.UUID `json:"organizationId" yaml:"organizationId"`
}

// EnvironmentId defines model for environmentId.
type EnvironmentId = core.Id

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

// OrgIdQuery defines model for orgIdQuery.
type OrgIdQuery = uuid.UUID

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