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

import (
	"time"

	"github.com/meshery/schemas/models/core"
)

// Credential Meshery Credentials store sensitive information such as API keys, tokens, and passwords used by connections to external systems.
type Credential 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 Human-readable name for the credential.
	Name string `db:"name" json:"name" yaml:"name"`

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

	// Type Credential type (e.g. token, basic, AWS).
	Type string `db:"type" json:"type" yaml:"type"`

	// Secret Key-value pairs containing the sensitive credential data.
	Secret core.Map `db:"secret" json:"secret,omitempty" yaml:"secret,omitempty"`

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

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

	// DeletedAt Timestamp when the credential was soft-deleted.
	DeletedAt core.NullTime `db:"deleted_at" json:"deletedAt,omitempty" yaml:"deletedAt,omitempty"`
}

// CredentialPage A paginated list of credentials.
type CredentialPage struct {
	// Credentials The credentials returned on the current page.
	Credentials []Credential `json:"credentials" yaml:"credentials"`

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

	// Page Current page number (zero-based).
	Page int `json:"page" yaml:"page"`

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

// CredentialPayload Payload for creating or updating a credential.
type CredentialPayload 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 `json:"id,omitempty" yaml:"id,omitempty"`

	// Name Human-readable name for the credential.
	Name string `json:"name" yaml:"name"`

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

	// Type Credential type (e.g. token, basic, AWS).
	Type string `json:"type" yaml:"type"`

	// Secret Key-value pairs containing the sensitive credential data.
	Secret core.Map `json:"secret,omitempty" yaml:"secret,omitempty"`
}

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

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

// Order defines model for order.
type Order = 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
