// Code generated by SQLBoiler 4.19.5 (https://github.com/aarondl/sqlboiler). DO NOT EDIT.
// This file is meant to be re-generated in place and/or deleted at any time.

package models

import (
	"strconv"

	"github.com/aarondl/sqlboiler/v4/boil"
	"github.com/aarondl/strmangle"
	"github.com/friendsofgo/errors"
)

// M type is for providing columns and column values to UpdateAll.
type M map[string]interface{}

// ErrSyncFail occurs during insert when the record could not be retrieved in
// order to populate default value information. This usually happens when LastInsertId
// fails or there was a primary key configuration that was not resolvable.
var ErrSyncFail = errors.New("models: failed to synchronize data after insert")

type insertCache struct {
	query        string
	retQuery     string
	valueMapping []uint64
	retMapping   []uint64
}

type updateCache struct {
	query        string
	valueMapping []uint64
}

func makeCacheKey(cols boil.Columns, nzDefaults []string) string {
	buf := strmangle.GetBuffer()

	buf.WriteString(strconv.Itoa(cols.Kind))
	for _, w := range cols.Cols {
		buf.WriteString(w)
	}

	if len(nzDefaults) != 0 {
		buf.WriteByte('.')
	}
	for _, nz := range nzDefaults {
		buf.WriteString(nz)
	}

	str := buf.String()
	strmangle.PutBuffer(buf)
	return str
}

// Enum values for Cmdtype
const (
	CmdtypeTYPE_RUN_SCENARIO_UNSPECIFIED string = "TYPE_RUN_SCENARIO_UNSPECIFIED"
	CmdtypeTYPE_STOP_SCENARIO            string = "TYPE_STOP_SCENARIO"
	CmdtypeTYPE_RUN_SCRIPT               string = "TYPE_RUN_SCRIPT"
	CmdtypeTYPE_STOP_SCRIPT              string = "TYPE_STOP_SCRIPT"
	CmdtypeTYPE_UPDATE                   string = "TYPE_UPDATE"
	CmdtypeTYPE_ADJUSTMENT               string = "TYPE_ADJUSTMENT"
	CmdtypeTYPE_INCREASE                 string = "TYPE_INCREASE"
	CmdtypeTYPE_RUN_SIMPLE_SCRIPT        string = "TYPE_RUN_SIMPLE_SCRIPT"
)

func AllCmdtype() []string {
	return []string{
		CmdtypeTYPE_RUN_SCENARIO_UNSPECIFIED,
		CmdtypeTYPE_STOP_SCENARIO,
		CmdtypeTYPE_RUN_SCRIPT,
		CmdtypeTYPE_STOP_SCRIPT,
		CmdtypeTYPE_UPDATE,
		CmdtypeTYPE_ADJUSTMENT,
		CmdtypeTYPE_INCREASE,
		CmdtypeTYPE_RUN_SIMPLE_SCRIPT,
	}
}

// Enum values for Cmdscope
const (
	CmdscopeSCOPE_ALL_UNSPECIFIED string = "SCOPE_ALL_UNSPECIFIED"
	CmdscopeSCOPE_ID              string = "SCOPE_ID"
)

func AllCmdscope() []string {
	return []string{
		CmdscopeSCOPE_ALL_UNSPECIFIED,
		CmdscopeSCOPE_ID,
	}
}

// Enum values for Cmdstatus
const (
	CmdstatusSTATUS_CREATED_UNSPECIFIED string = "STATUS_CREATED_UNSPECIFIED"
	CmdstatusSTATUS_PROCESSED           string = "STATUS_PROCESSED"
	CmdstatusSTATUS_FAILED              string = "STATUS_FAILED"
	CmdstatusSTATUS_COMPLETED           string = "STATUS_COMPLETED"
)

func AllCmdstatus() []string {
	return []string{
		CmdstatusSTATUS_CREATED_UNSPECIFIED,
		CmdstatusSTATUS_PROCESSED,
		CmdstatusSTATUS_FAILED,
		CmdstatusSTATUS_COMPLETED,
	}
}

// Enum values for RunReportStatus
const (
	RunReportStatusSTATUS_UNSPECIFIED string = "STATUS_UNSPECIFIED"
	RunReportStatusSTATUS_COMPLETE    string = "STATUS_COMPLETE"
	RunReportStatusSTATUS_PROCESSING  string = "STATUS_PROCESSING"
	RunReportStatusSTATUS_NOT_APPLIED string = "STATUS_NOT_APPLIED"
	RunReportStatusSTATUS_FAILED      string = "STATUS_FAILED"
)

func AllRunReportStatus() []string {
	return []string{
		RunReportStatusSTATUS_UNSPECIFIED,
		RunReportStatusSTATUS_COMPLETE,
		RunReportStatusSTATUS_PROCESSING,
		RunReportStatusSTATUS_NOT_APPLIED,
		RunReportStatusSTATUS_FAILED,
	}
}

// Enum values for Estatus
const (
	EstatusSTATUS_STOPPED_UNSPECIFIED string = "STATUS_STOPPED_UNSPECIFIED"
	EstatusSTATUS_PREPARED            string = "STATUS_PREPARED"
	EstatusSTATUS_RUNNING             string = "STATUS_RUNNING"
	EstatusSTATUS_SCHEDULED           string = "STATUS_SCHEDULED"
	EstatusSTATUS_STOPPING            string = "STATUS_STOPPING"
)

func AllEstatus() []string {
	return []string{
		EstatusSTATUS_STOPPED_UNSPECIFIED,
		EstatusSTATUS_PREPARED,
		EstatusSTATUS_RUNNING,
		EstatusSTATUS_SCHEDULED,
		EstatusSTATUS_STOPPING,
	}
}

// Enum values for Escheme
const (
	EschemeHTTP  string = "http"
	EschemeHTTPS string = "https"
	Escheme      string = ""
)

func AllEscheme() []string {
	return []string{
		EschemeHTTP,
		EschemeHTTPS,
		Escheme,
	}
}

// Enum values for EhttpMethod
const (
	EhttpMethodGet   string = "get"
	EhttpMethodPost  string = "post"
	EhttpMethodHead  string = "head"
	EhttpMethodPut   string = "put"
	EhttpMethodPatch string = "patch"
	EhttpMethodDel   string = "del"
)

func AllEhttpMethod() []string {
	return []string{
		EhttpMethodGet,
		EhttpMethodPost,
		EhttpMethodHead,
		EhttpMethodPut,
		EhttpMethodPatch,
		EhttpMethodDel,
	}
}
