// Code generated by sqlc. DO NOT EDIT.
// versions:
//   sqlc v1.29.0

package configdb

import (
	"time"

	"github.com/google/uuid"
	"github.com/jackc/pgx/v5/pgtype"
)

type AdminApiKey struct {
	ID          uuid.UUID  `json:"id"`
	KeyHash     string     `json:"key_hash"`
	Name        string     `json:"name"`
	Description *string    `json:"description"`
	CreatedAt   *time.Time `json:"created_at"`
}

type BucketConfiguration struct {
	ID            uuid.UUID `json:"id"`
	BucketName    string    `json:"bucket_name"`
	CloudProvider string    `json:"cloud_provider"`
	Region        string    `json:"region"`
	Endpoint      *string   `json:"endpoint"`
	Role          *string   `json:"role"`
	UsePathStyle  bool      `json:"use_path_style"`
	InsecureTls   bool      `json:"insecure_tls"`
}

type BucketPrefixMapping struct {
	ID             uuid.UUID `json:"id"`
	BucketID       uuid.UUID `json:"bucket_id"`
	OrganizationID uuid.UUID `json:"organization_id"`
	PathPrefix     string    `json:"path_prefix"`
	Signal         string    `json:"signal"`
}

type CCollector struct {
	ID               uuid.UUID        `json:"id"`
	CreatedAt        pgtype.Timestamp `json:"created_at"`
	UpdatedAt        pgtype.Timestamp `json:"updated_at"`
	CreatedBy        *string          `json:"created_by"`
	UpdatedBy        *string          `json:"updated_by"`
	OrganizationID   pgtype.UUID      `json:"organization_id"`
	StorageProfileID pgtype.UUID      `json:"storage_profile_id"`
	InstanceNum      int16            `json:"instance_num"`
	ExternalID       string           `json:"external_id"`
	DeletedAt        pgtype.Timestamp `json:"deleted_at"`
	DeletedBy        *string          `json:"deleted_by"`
	Type             int32            `json:"type"`
	Trusted          pgtype.Bool      `json:"trusted"`
	Version          *string          `json:"version"`
	Saas             pgtype.Bool      `json:"saas"`
	Style            *string          `json:"style"`
	DagHashSeed      pgtype.Int4      `json:"dag_hash_seed"`
	ConfigHashSeed   pgtype.Int4      `json:"config_hash_seed"`
	CollectorGroup   string           `json:"collector_group"`
	Flags            map[string]any   `json:"flags"`
}

type COrganization struct {
	ID                           uuid.UUID        `json:"id"`
	CreatedAt                    pgtype.Timestamp `json:"created_at"`
	UpdatedAt                    pgtype.Timestamp `json:"updated_at"`
	CreatedBy                    *string          `json:"created_by"`
	UpdatedBy                    *string          `json:"updated_by"`
	Name                         *string          `json:"name"`
	Enabled                      pgtype.Bool      `json:"enabled"`
	NotificationSlack            *string          `json:"notification_slack"`
	NotificationEmail            *string          `json:"notification_email"`
	NotificationPagerDutyService *string          `json:"notification_pager_duty_service"`
	Features                     map[string]any   `json:"features"`
}

type COrganizationApiKey struct {
	ID             uuid.UUID        `json:"id"`
	CreatedAt      pgtype.Timestamp `json:"created_at"`
	UpdatedAt      pgtype.Timestamp `json:"updated_at"`
	CreatedBy      *string          `json:"created_by"`
	UpdatedBy      *string          `json:"updated_by"`
	OrganizationID pgtype.UUID      `json:"organization_id"`
	Name           *string          `json:"name"`
	ApiKey         *string          `json:"api_key"`
	Enabled        pgtype.Bool      `json:"enabled"`
}

type CStorageProfile struct {
	ID             uuid.UUID `json:"id"`
	OrganizationID uuid.UUID `json:"organization_id"`
	CloudProvider  string    `json:"cloud_provider"`
	Bucket         string    `json:"bucket"`
	Region         string    `json:"region"`
	Role           *string   `json:"role"`
}

// Tracks when expiry cleanup was last run for each organization and signal type. Separate from policy to avoid creating policy records just for tracking.
type ExpiryRunTracking struct {
	OrganizationID uuid.UUID        `json:"organization_id"`
	SignalType     string           `json:"signal_type"`
	LastRunAt      pgtype.Timestamp `json:"last_run_at"`
	CreatedAt      pgtype.Timestamp `json:"created_at"`
	UpdatedAt      pgtype.Timestamp `json:"updated_at"`
}

type Organization struct {
	ID        uuid.UUID  `json:"id"`
	Name      string     `json:"name"`
	Enabled   bool       `json:"enabled"`
	CreatedAt time.Time  `json:"created_at"`
	SyncedAt  *time.Time `json:"synced_at"`
}

type OrganizationApiKey struct {
	ID          uuid.UUID  `json:"id"`
	KeyHash     string     `json:"key_hash"`
	Name        string     `json:"name"`
	Description *string    `json:"description"`
	CreatedAt   *time.Time `json:"created_at"`
}

type OrganizationApiKeyMapping struct {
	ID             uuid.UUID `json:"id"`
	ApiKeyID       uuid.UUID `json:"api_key_id"`
	OrganizationID uuid.UUID `json:"organization_id"`
}

type OrganizationBucket struct {
	ID             uuid.UUID `json:"id"`
	OrganizationID uuid.UUID `json:"organization_id"`
	BucketID       uuid.UUID `json:"bucket_id"`
	InstanceNum    int16     `json:"instance_num"`
	CollectorName  string    `json:"collector_name"`
}

// Stores data retention policies for each organization and signal type. A value of -1 means use system default, 0 means never expire, >0 means specific retention days.
type OrganizationSignalExpiry struct {
	OrganizationID uuid.UUID `json:"organization_id"`
	SignalType     string    `json:"signal_type"`
	MaxAgeDays     int32     `json:"max_age_days"`
	CreatedAt      time.Time `json:"created_at"`
	UpdatedAt      time.Time `json:"updated_at"`
}
